2014-11-09 08:36:39

by Jamie Lentin

[permalink] [raw]
Subject: [PATCH 0/2] HID: lenovo: Small fixups for compact keyboards

Some small problems that have since been picked up since my patchset that
introduced support for the Thinkpad Compact Keyboards[0]. Both have been tested
on 3.18-rc1.

There are other outstanding problems that will require less trivial patches:

* The USB keyboard needs a patch to the HID descriptor table for the horizontal
scroll wheel events to be recognised.

* There is potentially a sensitivity control to expose via. sysfs, but needs
more investigation.

* The bluetooth keyboard mouse buttons still autorepeat. Since they are part of
the same input device as the keys I'm not sure this is currently solvable.

The first 2 I will sort out once enough free time appears, if you would prefer
a single large patchset, feel free to ignore this and wait for a bigger
patchset.

Many thanks,

[0] https://lkml.org/lkml/2014/7/23/702

Jamie Lentin (2):
HID: lenovo: Move USB KEY_FILE to 0x00f9 to prevent scancode clash
HID: lenovo: Don't set EV_REP to avoid repeating mice buttons

drivers/hid/hid-lenovo.c | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)

--
2.1.0


2014-11-09 08:36:30

by Jamie Lentin

[permalink] [raw]
Subject: [PATCH 2/2] HID: lenovo: Don't set EV_REP to avoid repeating mice buttons

On the USB keyboard, the VENDOR hotkeys share the same device as the
mouse. Setting EV_REP also affects mouse buttons, so leave it off.

The bluetooth keyboard still has autorepeating mouse buttons, as it
only has one device and is set by the KEYBOARD pages.

Signed-off-by: Jamie Lentin <[email protected]>
---
drivers/hid/hid-lenovo.c | 1 -
1 file changed, 1 deletion(-)

diff --git a/drivers/hid/hid-lenovo.c b/drivers/hid/hid-lenovo.c
index 4716f1e..4c55f4d 100644
--- a/drivers/hid/hid-lenovo.c
+++ b/drivers/hid/hid-lenovo.c
@@ -62,7 +62,6 @@ static int lenovo_input_mapping_cptkbd(struct hid_device *hdev,
/* HID_UP_LNVENDOR = USB, HID_UP_MSVENDOR = BT */
if ((usage->hid & HID_USAGE_PAGE) == HID_UP_MSVENDOR ||
(usage->hid & HID_USAGE_PAGE) == HID_UP_LNVENDOR) {
- set_bit(EV_REP, hi->input->evbit);
switch (usage->hid & HID_USAGE) {
case 0x00f1: /* Fn-F4: Mic mute */
map_key_clear(KEY_MICMUTE);
--
2.1.0

2014-11-09 08:36:28

by Jamie Lentin

[permalink] [raw]
Subject: [PATCH 1/2] HID: lenovo: Move USB KEY_FILE to 0x00f9 to prevent scancode clash

The bluetooth keyboard also generates 0x00fa when the middle button is
pressed. Move the made-up report out of the way so we don't trigger
KEY_FILE when middle button is pressed

Signed-off-by: Jamie Lentin <[email protected]>
---
drivers/hid/hid-lenovo.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/hid/hid-lenovo.c b/drivers/hid/hid-lenovo.c
index bf227f7..4716f1e 100644
--- a/drivers/hid/hid-lenovo.c
+++ b/drivers/hid/hid-lenovo.c
@@ -85,13 +85,13 @@ static int lenovo_input_mapping_cptkbd(struct hid_device *hdev,
case 0x00f8: /* Fn-F11: View open applications (3 boxes) */
map_key_clear(KEY_SCALE);
return 1;
- case 0x00fa: /* Fn-Esc: Fn-lock toggle */
- map_key_clear(KEY_FN_ESC);
- return 1;
- case 0x00fb: /* Fn-F12: Open My computer (6 boxes) USB-only */
+ case 0x00f9: /* Fn-F12: Open My computer (6 boxes) USB-only */
/* NB: This mapping is invented in raw_event below */
map_key_clear(KEY_FILE);
return 1;
+ case 0x00fa: /* Fn-Esc: Fn-lock toggle */
+ map_key_clear(KEY_FN_ESC);
+ return 1;
}
}

@@ -207,8 +207,8 @@ static int lenovo_raw_event(struct hid_device *hdev,
&& data[0] == 0x15
&& data[1] == 0x94
&& data[2] == 0x01)) {
- data[1] = 0x0;
- data[2] = 0x4;
+ data[1] = 0x00;
+ data[2] = 0x01;
}

return 0;
--
2.1.0

2014-11-11 10:47:41

by Jiri Kosina

[permalink] [raw]
Subject: Re: [PATCH 0/2] HID: lenovo: Small fixups for compact keyboards

On Sun, 9 Nov 2014, Jamie Lentin wrote:

> Some small problems that have since been picked up since my patchset that
> introduced support for the Thinkpad Compact Keyboards[0]. Both have been tested
> on 3.18-rc1.

Both patches applied.

Thanks,

--
Jiri Kosina
SUSE Labs