[PATCH] HID: lenovo: fix Fn-Lock on Lenovo TrackPoint Keyboard II in USB mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <iam@xxxxxxxxxxxxxxx>
Reported-by: Rodrigo Aguilera <rodrigoaguileraparraga@xxxxxxxxx>
Tested-by: Rodrigo Aguilera <rodrigoaguileraparraga@xxxxxxxxx>
Cc: stable@xxxxxxxxxxxxxxx # 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 f86c1ea..a84fc55 100644
--- a/drivers/hid/hid-lenovo.c
+++ b/drivers/hid/hid-lenovo.c
@@ -758,6 +758,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;
-- 
2.45.1





[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux