From patchwork Thu Jul 25 00:49:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ValdikSS X-Patchwork-Id: 13741482 X-Patchwork-Delegate: jikos@jikos.cz Received: from mail.valdk.tel (mail.valdk.tel [185.177.150.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 188544690 for ; Thu, 25 Jul 2024 00:49:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.177.150.13 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721868601; cv=none; b=ZA7hTTdIoUZ9TkBvaOynKwR7wZq37Sg/mZjwqEObV1Ke2J7AfM+CPU15OiV7F+Jx/N3vMM1dCDL4rCQoHyzT+xshWs3x4mrep6az10eZ/FNJzAZkieyl5Jnj54H9zZCT0e5tkEMsbBzzb5tMGzdy+Cfzd9zjNJEs5fuJXuekGz0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721868601; c=relaxed/simple; bh=Liw2mfkz+66XFldKXxhBkp7Op7WL6zjALQ1yObA1WkQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=DQCwJJ8CxVbl7gA7IegYlQr1/BTcOaNA2ARH2yZpZZWNG8hGjwXcSt5L+ARcGuq1WfcSe9ccPgbpkCg7P5Wts7ETR9rHN9zUvwJ4n3W6otvoBSCWvxGKM38k/T1oDFYAwe9lHdyWwtqrAWdLdRDegB8UIwAwtvbGu7w9ncin750= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=valdikss.org.ru; spf=pass smtp.mailfrom=valdikss.org.ru; dkim=pass (2048-bit key) header.d=valdikss.org.ru header.i=@valdikss.org.ru header.b=kGJcWtPc; arc=none smtp.client-ip=185.177.150.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=valdikss.org.ru Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=valdikss.org.ru Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=valdikss.org.ru header.i=@valdikss.org.ru header.b="kGJcWtPc" Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id 49DE614597AD; Thu, 25 Jul 2024 03:49:47 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=valdikss.org.ru; s=msrv; t=1721868590; h=from:subject:date:message-id:to:cc:mime-version: content-transfer-encoding; bh=lxnt5s7WEuNwWqj56J65qR6nzb/GOPTX+fiBoBTcCpk=; b=kGJcWtPcBKdfzegMFd2cL9FHNsTxx1fcS1Sq/8L/vsr/3yR0AHrUe9A2y2cEyH71a5mXQO FTlrombp24IB2VbTxCXBdE8upWRgFtHp4kT0n0tHaft4ITnqMbXwNOqYnyjAg2DfhUHezm GtGdNC4Q+nee0idJ35LXweZaasvLXyRnVjFT3olpetq3HzR/xyN2KGAtulDra4k6DBoMkC WNqvP5bVREOliwpoTNbuQSI57QKPm0f2YTBi4gcPvNoTBj1Y5kwK4kIvwkIiobOBFM79qi qNXFZfU0A5FJ4X/7qo+liXpxvrHuNKxqPe700D06ZHZq5F1fxfyZeH1srm6YBw== From: ValdikSS To: linux-input@vger.kernel.org Cc: Jiri Kosina , Benjamin Tissoires , Rodrigo Aguilera Subject: [PATCH RESEND] HID: lenovo: fix Fn-Lock on Lenovo TrackPoint Keyboard II in USB mode Date: Thu, 25 Jul 2024 03:49:17 +0300 Message-ID: <20240725004934.301342-1-iam@valdikss.org.ru> X-Mailer: git-send-email 2.45.2 Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 When Fn-Lock is pressed on Lenovo TrackPoint Keyboard II in USB mode, the keyboard only sends the scancode to the host and does not toggle the mode by itself, contrary to Bluetooth mode. This results in non-working Fn-Lock switching. Fix this issue by sending switching command upon receiving Fn-Lock scancode. Signed-off-by: ValdikSS Reported-by: Rodrigo Aguilera Tested-by: Rodrigo Aguilera Cc: stable@vger.kernel.org # 6.x --- drivers/hid/hid-lenovo.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/hid/hid-lenovo.c b/drivers/hid/hid-lenovo.c index e5e72aa52..6b315310a 100644 --- a/drivers/hid/hid-lenovo.c +++ b/drivers/hid/hid-lenovo.c @@ -757,6 +757,13 @@ static int lenovo_event_cptkbd(struct hid_device *hdev, * ensure things are in sync (the syncing should be a no-op). */ cptkbd_data->fn_lock = !cptkbd_data->fn_lock; + if (hdev->product == USB_DEVICE_ID_LENOVO_TPIIUSBKBD) { + /* + * ThinkPad TrackPoint keyboard II in USB mode needs + * host to toggle Fn-lock + */ + lenovo_send_cmd_cptkbd(hdev, 0x05, cptkbd_data->fn_lock); + } } return 0;