From: Kean <rh_king@163.com>
To: derekjohn.clark@gmail.com, mpearson-lenovo@squebb.ca
Cc: jikos@kernel.org, bentiss@kernel.org,
linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
Kean <rh_king@163.com>
Subject: [PATCH] HID: lenovo: Restore Fn-lock LED state on resume for tp10ubkbd devices
Date: Tue, 12 May 2026 22:22:29 +0800 [thread overview]
Message-ID: <20260512142229.4098386-1-rh_king@163.com> (raw)
The reset_resume callback only restores trackpoint settings for compact
USB keyboards (CUSBKBD, TPIIUSBKBD) but omits the tp10ubkbd device
family: X12_TAB, X12_TAB2, TP10UBKBD, X1_TAB, X1_TAB2, X1_TAB3.
If these devices lose power during suspend, the Fn-lock state reverts
to the hardware default but the driver's cached state and the keyboard
LED are not restored, causing the LED to show the wrong state after
resume.
Add the missing device cases to restore the Fn-lock LED on resume.
Tested:
This patch works on ThinkPad X12_TAB.
Signed-off-by: Kean <rh_king@163.com>
---
drivers/hid/hid-lenovo.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/drivers/hid/hid-lenovo.c b/drivers/hid/hid-lenovo.c
index a6b73e03c16b..4c9fb163b6d6 100644
--- a/drivers/hid/hid-lenovo.c
+++ b/drivers/hid/hid-lenovo.c
@@ -1424,6 +1424,8 @@ static int lenovo_probe(struct hid_device *hdev,
static int lenovo_reset_resume(struct hid_device *hdev)
{
+ struct lenovo_drvdata *data;
+
switch (hdev->product) {
case USB_DEVICE_ID_LENOVO_CUSBKBD:
case USB_DEVICE_ID_LENOVO_TPIIUSBKBD:
@@ -1431,6 +1433,17 @@ static int lenovo_reset_resume(struct hid_device *hdev)
lenovo_features_set_cptkbd(hdev);
break;
+ case USB_DEVICE_ID_LENOVO_X12_TAB:
+ case USB_DEVICE_ID_LENOVO_X12_TAB2:
+ case USB_DEVICE_ID_LENOVO_TP10UBKBD:
+ case USB_DEVICE_ID_LENOVO_X1_TAB:
+ case USB_DEVICE_ID_LENOVO_X1_TAB2:
+ case USB_DEVICE_ID_LENOVO_X1_TAB3:
+ data = hid_get_drvdata(hdev);
+ if (data)
+ lenovo_led_set_tp10ubkbd(hdev, TP10UBKBD_FN_LOCK_LED,
+ data->fn_lock ? LED_ON : LED_OFF);
+ break;
default:
break;
}
--
2.53.0
next reply other threads:[~2026-05-12 14:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-12 14:22 Kean [this message]
2026-05-13 22:27 ` [PATCH] HID: lenovo: Restore Fn-lock LED state on resume for tp10ubkbd devices sashiko-bot
2026-05-14 12:54 ` Kean
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260512142229.4098386-1-rh_king@163.com \
--to=rh_king@163.com \
--cc=bentiss@kernel.org \
--cc=derekjohn.clark@gmail.com \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mpearson-lenovo@squebb.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox