aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorBenjamin Tissoires <benjamin.tissoires@redhat.com>2014-09-30 13:18:35 -0400
committerJiri Kosina <jkosina@suse.cz>2014-10-29 05:51:42 -0400
commit3a61e97563d78a2ca10752902449570d8433ce76 (patch)
treee84789a544c4a8975e68c744ee3c1e62ed33a2a4 /drivers/hid
parent57ac86cf52e903d9e3e0f12b34c814cce6b65550 (diff)
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 <benjamin.tissoires@redhat.com> Tested-by: Andrew de los Reyes <adlr@chromium.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-logitech-hidpp.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
index 17e27e98e442..361e97da1169 100644
--- a/drivers/hid/hid-logitech-hidpp.c
+++ b/drivers/hid/hid-logitech-hidpp.c
@@ -39,6 +39,7 @@ MODULE_AUTHOR("Nestor Lopez Casado <nlopezcasad@logitech.com>");
39/* bits 1..20 are reserved for classes */ 39/* bits 1..20 are reserved for classes */
40#define HIDPP_QUIRK_DELAYED_INIT BIT(21) 40#define HIDPP_QUIRK_DELAYED_INIT BIT(21)
41#define HIDPP_QUIRK_WTP_PHYSICAL_BUTTONS BIT(22) 41#define HIDPP_QUIRK_WTP_PHYSICAL_BUTTONS BIT(22)
42#define HIDPP_QUIRK_MULTI_INPUT BIT(23)
42 43
43/* 44/*
44 * There are two hidpp protocols in use, the first version hidpp10 is known 45 * 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,
614 struct hid_field *field, struct hid_usage *usage, 615 struct hid_field *field, struct hid_usage *usage,
615 unsigned long **bit, int *max) 616 unsigned long **bit, int *max)
616{ 617{
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
617 return -1; 624 return -1;
618} 625}
619 626
@@ -622,6 +629,10 @@ static void wtp_populate_input(struct hidpp_device *hidpp,
622{ 629{
623 struct wtp_data *wd = hidpp->private_data; 630 struct wtp_data *wd = hidpp->private_data;
624 631
632 if ((hidpp->quirks & HIDPP_QUIRK_MULTI_INPUT) && origin_is_hid_core)
633 /* this is the generic hid-input call */
634 return;
635
625 __set_bit(EV_ABS, input_dev->evbit); 636 __set_bit(EV_ABS, input_dev->evbit);
626 __set_bit(EV_KEY, input_dev->evbit); 637 __set_bit(EV_KEY, input_dev->evbit);
627 __clear_bit(EV_REL, input_dev->evbit); 638 __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)
1114 if (hidpp->quirks & HIDPP_QUIRK_DELAYED_INIT) 1125 if (hidpp->quirks & HIDPP_QUIRK_DELAYED_INIT)
1115 connect_mask &= ~HID_CONNECT_HIDINPUT; 1126 connect_mask &= ~HID_CONNECT_HIDINPUT;
1116 1127
1128 /* Re-enable hidinput for multi-input devices */
1129 if (hidpp->quirks & HIDPP_QUIRK_MULTI_INPUT)
1130 connect_mask |= HID_CONNECT_HIDINPUT;
1131
1117 ret = hid_hw_start(hdev, connect_mask); 1132 ret = hid_hw_start(hdev, connect_mask);
1118 if (ret) { 1133 if (ret) {
1119 hid_err(hdev, "%s:hid_hw_start returned error\n", __func__); 1134 hid_err(hdev, "%s:hid_hw_start returned error\n", __func__);
@@ -1160,6 +1175,11 @@ static const struct hid_device_id hidpp_devices[] = {
1160 HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, 1175 HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH,
1161 USB_DEVICE_ID_LOGITECH_T651), 1176 USB_DEVICE_ID_LOGITECH_T651),
1162 .driver_data = HIDPP_QUIRK_CLASS_WTP }, 1177 .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 },
1163 1183
1164 { HID_DEVICE(BUS_USB, HID_GROUP_LOGITECH_DJ_DEVICE, 1184 { HID_DEVICE(BUS_USB, HID_GROUP_LOGITECH_DJ_DEVICE,
1165 USB_VENDOR_ID_LOGITECH, HID_ANY_ID)}, 1185 USB_VENDOR_ID_LOGITECH, HID_ANY_ID)},