Skip to content

Commit 3a61e97

Browse files
bentissJiri Kosina
authored andcommitted
HID: logitech-hidpp: support combo keyboard touchpad TK820
The TK820 presents both a keyboard and a touchpad on the same physical (and logical device). Use the generic hid-input processing for the keyboard part. The keyboard input device is created when the receiver is plugged in, so no events are missed on connect. When the device actaully connects, we can set it to use the raw multitouch reporting to have a consistent user experience accross all Logitech touchpads. Signed-off-by: Benjamin Tissoires <[email protected]> Tested-by: Andrew de los Reyes <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 57ac86c commit 3a61e97

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

drivers/hid/hid-logitech-hidpp.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ MODULE_AUTHOR("Nestor Lopez Casado <[email protected]>");
3939
/* bits 1..20 are reserved for classes */
4040
#define HIDPP_QUIRK_DELAYED_INIT BIT(21)
4141
#define HIDPP_QUIRK_WTP_PHYSICAL_BUTTONS BIT(22)
42+
#define HIDPP_QUIRK_MULTI_INPUT BIT(23)
4243

4344
/*
4445
* There are two hidpp protocols in use, the first version hidpp10 is known
@@ -614,6 +615,12 @@ static int wtp_input_mapping(struct hid_device *hdev, struct hid_input *hi,
614615
struct hid_field *field, struct hid_usage *usage,
615616
unsigned long **bit, int *max)
616617
{
618+
struct hidpp_device *hidpp = hid_get_drvdata(hdev);
619+
620+
if ((hidpp->quirks & HIDPP_QUIRK_MULTI_INPUT) &&
621+
(field->application == HID_GD_KEYBOARD))
622+
return 0;
623+
617624
return -1;
618625
}
619626

@@ -622,6 +629,10 @@ static void wtp_populate_input(struct hidpp_device *hidpp,
622629
{
623630
struct wtp_data *wd = hidpp->private_data;
624631

632+
if ((hidpp->quirks & HIDPP_QUIRK_MULTI_INPUT) && origin_is_hid_core)
633+
/* this is the generic hid-input call */
634+
return;
635+
625636
__set_bit(EV_ABS, input_dev->evbit);
626637
__set_bit(EV_KEY, input_dev->evbit);
627638
__clear_bit(EV_REL, input_dev->evbit);
@@ -1114,6 +1125,10 @@ static int hidpp_probe(struct hid_device *hdev, const struct hid_device_id *id)
11141125
if (hidpp->quirks & HIDPP_QUIRK_DELAYED_INIT)
11151126
connect_mask &= ~HID_CONNECT_HIDINPUT;
11161127

1128+
/* Re-enable hidinput for multi-input devices */
1129+
if (hidpp->quirks & HIDPP_QUIRK_MULTI_INPUT)
1130+
connect_mask |= HID_CONNECT_HIDINPUT;
1131+
11171132
ret = hid_hw_start(hdev, connect_mask);
11181133
if (ret) {
11191134
hid_err(hdev, "%s:hid_hw_start returned error\n", __func__);
@@ -1160,6 +1175,11 @@ static const struct hid_device_id hidpp_devices[] = {
11601175
HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH,
11611176
USB_DEVICE_ID_LOGITECH_T651),
11621177
.driver_data = HIDPP_QUIRK_CLASS_WTP },
1178+
{ /* Keyboard TK820 */
1179+
HID_DEVICE(BUS_USB, HID_GROUP_LOGITECH_DJ_DEVICE,
1180+
USB_VENDOR_ID_LOGITECH, 0x4102),
1181+
.driver_data = HIDPP_QUIRK_DELAYED_INIT | HIDPP_QUIRK_MULTI_INPUT |
1182+
HIDPP_QUIRK_CLASS_WTP },
11631183

11641184
{ HID_DEVICE(BUS_USB, HID_GROUP_LOGITECH_DJ_DEVICE,
11651185
USB_VENDOR_ID_LOGITECH, HID_ANY_ID)},

0 commit comments

Comments
 (0)