diff mbox series

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

Message ID 20240725004934.301342-1-iam@valdikss.org.ru (mailing list archive)
State New
Delegated to: Jiri Kosina
Headers show
Series [RESEND] HID: lenovo: fix Fn-Lock on Lenovo TrackPoint Keyboard II in USB mode | expand

Commit Message

ValdikSS July 25, 2024, 12:49 a.m. UTC
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@valdikss.org.ru>
Reported-by: Rodrigo Aguilera <rodrigoaguileraparraga@gmail.com>
Tested-by: Rodrigo Aguilera <rodrigoaguileraparraga@gmail.com>
Cc: stable@vger.kernel.org # 6.x
---
 drivers/hid/hid-lenovo.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Jiri Kosina Aug. 13, 2024, 9:28 a.m. UTC | #1
On Thu, 25 Jul 2024, ValdikSS wrote:

> 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@valdikss.org.ru>

Could you please contribute using your real name?

Thanks,
ValdikSS Aug. 13, 2024, 9:38 a.m. UTC | #2
On 13.08.2024 12:28, Jiri Kosina wrote:
>> 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@valdikss.org.ru>
> 
> Could you please contribute using your real name?

I prefer to use my nickname on the internet, and as far as I know, the 
patch accepting policy has been lifted to allow nicknames (pseudonyms) 
since my last contribution.

https://www.kernel.org/doc/html/latest/process/submitting-patches.html#developer-s-certificate-of-origin-1-1

> then you just add a line saying [...] using a _known identity_ (sorry, no anonymous contributions.)

It used to be:

> using your real name (sorry, no pseudonyms or anonymous contributions.)

If I'm reading this wrong, please feel free to resubmit it under your 
name, as has been done with my previous patch.
ValdikSS Oct. 6, 2024, 1:44 p.m. UTC | #3
On 13.08.2024 12:38, ValdikSS wrote:
> On 13.08.2024 12:28, Jiri Kosina wrote:
>>> 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@valdikss.org.ru>
>>
>> Could you please contribute using your real name?
> 
> I prefer to use my nickname on the internet, and as far as I know, the 
> patch accepting policy has been lifted to allow nicknames (pseudonyms) 
> since my last contribution.
> 
> https://www.kernel.org/doc/html/latest/process/submitting-patches.html#developer-s-certificate-of-origin-1-1
> 
>> then you just add a line saying [...] using a _known identity_ (sorry, 
>> no anonymous contributions.)
> 
> It used to be:
> 
>> using your real name (sorry, no pseudonyms or anonymous contributions.)
> 
> If I'm reading this wrong, please feel free to resubmit it under your 
> name, as has been done with my previous patch.

Checked the commit which have changed the kernel policy regarding 
identities:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d4563201f33a022fc0353033d9dfeb1606a88330

And CNCF clarification linked in the commit:
https://github.com/cncf/foundation/blob/659fd32c86dc/dco-guidelines.md

> A real name does not require a legal name, nor a birth name, nor any name that appears on an official ID (e.g. a passport). Your real name is the name you convey to people in the community for them to use to identify you as you. The key concern is that your identification is sufficient enough to contact you if an issue were to arise in the future about your contribution.

Humbly asking to review the patch when the time allows, Jiří.
diff mbox series

Patch

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;