Skip to content

Commit 9327e3e

Browse files
iusmacJiri Kosina
authored andcommitted
HID: lenovo: Restrict F7/9/11 mode to compact keyboards only
Commit 2f2bd7c ("hid: lenovo: Resend all settings on reset_resume for compact keyboards") introduced a regression for ThinkPad TrackPoint Keyboard II by removing the conditional check for enabling F7/9/11 mode needed for compact keyboards only. As a result, the non-compact keyboards can no longer toggle Fn-lock via Fn+Esc, although it can be controlled via sysfs knob that directly sends raw commands. This patch restores the previous conditional check without any additions. Cc: [email protected] Fixes: 2f2bd7c ("hid: lenovo: Resend all settings on reset_resume for compact keyboards") Signed-off-by: Iusico Maxim <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 1a8953f commit 9327e3e

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

drivers/hid/hid-lenovo.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -548,11 +548,14 @@ static void lenovo_features_set_cptkbd(struct hid_device *hdev)
548548

549549
/*
550550
* Tell the keyboard a driver understands it, and turn F7, F9, F11 into
551-
* regular keys
551+
* regular keys (Compact only)
552552
*/
553-
ret = lenovo_send_cmd_cptkbd(hdev, 0x01, 0x03);
554-
if (ret)
555-
hid_warn(hdev, "Failed to switch F7/9/11 mode: %d\n", ret);
553+
if (hdev->product == USB_DEVICE_ID_LENOVO_CUSBKBD ||
554+
hdev->product == USB_DEVICE_ID_LENOVO_CBTKBD) {
555+
ret = lenovo_send_cmd_cptkbd(hdev, 0x01, 0x03);
556+
if (ret)
557+
hid_warn(hdev, "Failed to switch F7/9/11 mode: %d\n", ret);
558+
}
556559

557560
/* Switch middle button to native mode */
558561
ret = lenovo_send_cmd_cptkbd(hdev, 0x09, 0x01);

0 commit comments

Comments
 (0)