Skip to content

Commit 0349678

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
Pull HID updates from Jiri Kosina: - i2c-hid race condition fix from Jean-Baptiste Maneyrol - Logitech driver now supports vendor-specific HID++ protocol, allowing us to deliver a full multitouch support on wider range of Logitech touchpads. Written by Benjamin Tissoires - MS Surface Pro 3 Type Cover support added by Alan Wu - RMI touchpad support improvements from Andrew Duggan - a lot of updates to Wacom driver from Jason Gerecke and Ping Cheng - various small fixes all over the place * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: (56 commits) HID: rmi: The address of query8 must be calculated based on which query registers are present HID: rmi: Check for additional ACM registers appended to F11 data report HID: i2c-hid: prevent buffer overflow in early IRQ HID: logitech-hidpp: disable io in probe error path HID: logitech-hidpp: add boundary check for name retrieval HID: logitech-hidpp: check name retrieval return code HID: logitech-hidpp: do not return the name length HID: wacom: Report input events for each finger on generic devices HID: wacom: Initialize MT slots for generic devices at post_parse_hid HID: wacom: Update maximum X/Y accounding to outbound offset HID: wacom: Add support for DTU-1031X HID: wacom: add defines for new Cintiq and DTU outbound tracking HID: wacom: fix freeze on open when autosuspend is on HID: wacom: re-add accidentally dropped Lenovo PID HID: make hid_report_len as a static inline function in hid.h HID: wacom: Consult the application usage when determining field type HID: wacom: PAD is independent with pen/touch HID: multitouch: Add quirk for VTL touch panels HID: i2c-hid: fix race condition reading reports HID: wacom: Add angular resolution data to some ABS axes ...
2 parents a7cb7bb + 019e129 commit 0349678

26 files changed

+2141
-434
lines changed

drivers/hid/Kconfig

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,13 +371,25 @@ config HID_LOGITECH_DJ
371371
tristate "Logitech Unifying receivers full support"
372372
depends on HIDRAW
373373
depends on HID_LOGITECH
374+
select HID_LOGITECH_HIDPP
374375
---help---
375376
Say Y if you want support for Logitech Unifying receivers and devices.
376377
Unifying receivers are capable of pairing up to 6 Logitech compliant
377378
devices to the same receiver. Without this driver it will be handled by
378379
generic USB_HID driver and all incoming events will be multiplexed
379380
into a single mouse and a single keyboard device.
380381

382+
config HID_LOGITECH_HIDPP
383+
tristate "Logitech HID++ devices support"
384+
depends on HID_LOGITECH
385+
---help---
386+
Support for Logitech devices relyingon the HID++ Logitech specification
387+
388+
Say Y if you want support for Logitech devices relying on the HID++
389+
specification. Such devices are the various Logitech Touchpads (T650,
390+
T651, TK820), some mice (Zone Touch mouse), or even keyboards (Solar
391+
Keayboard).
392+
381393
config LOGITECH_FF
382394
bool "Logitech force feedback support"
383395
depends on HID_LOGITECH
@@ -613,6 +625,13 @@ config HID_PICOLCD_CIR
613625
---help---
614626
Provide access to PicoLCD's CIR interface via remote control (LIRC).
615627

628+
config HID_PLANTRONICS
629+
tristate "Plantronics USB HID Driver"
630+
default !EXPERT
631+
depends on HID
632+
---help---
633+
Provides HID support for Plantronics telephony devices.
634+
616635
config HID_PRIMAX
617636
tristate "Primax non-fully HID-compliant devices"
618637
depends on HID
@@ -629,14 +648,15 @@ config HID_ROCCAT
629648
support for its special functionalities.
630649

631650
config HID_SAITEK
632-
tristate "Saitek non-fully HID-compliant devices"
651+
tristate "Saitek (Mad Catz) non-fully HID-compliant devices"
633652
depends on HID
634653
---help---
635654
Support for Saitek devices that are not fully compliant with the
636655
HID standard.
637656

638657
Supported devices:
639658
- PS1000 Dual Analog Pad
659+
- R.A.T.9 Gaming Mouse
640660
- R.A.T.7 Gaming Mouse
641661
- M.M.O.7 Gaming Mouse
642662

drivers/hid/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ obj-$(CONFIG_HID_LCPOWER) += hid-lcpower.o
6363
obj-$(CONFIG_HID_LENOVO) += hid-lenovo.o
6464
obj-$(CONFIG_HID_LOGITECH) += hid-logitech.o
6565
obj-$(CONFIG_HID_LOGITECH_DJ) += hid-logitech-dj.o
66+
obj-$(CONFIG_HID_LOGITECH_HIDPP) += hid-logitech-hidpp.o
6667
obj-$(CONFIG_HID_MAGICMOUSE) += hid-magicmouse.o
6768
obj-$(CONFIG_HID_MICROSOFT) += hid-microsoft.o
6869
obj-$(CONFIG_HID_MONTEREY) += hid-monterey.o
@@ -94,6 +95,7 @@ ifdef CONFIG_DEBUG_FS
9495
hid-picolcd-y += hid-picolcd_debugfs.o
9596
endif
9697

98+
obj-$(CONFIG_HID_PLANTRONICS) += hid-plantronics.o
9799
obj-$(CONFIG_HID_PRIMAX) += hid-primax.o
98100
obj-$(CONFIG_HID_ROCCAT) += hid-roccat.o hid-roccat-common.o \
99101
hid-roccat-arvo.o hid-roccat-isku.o hid-roccat-kone.o \

drivers/hid/hid-core.c

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,11 @@ static void hid_scan_collection(struct hid_parser *parser, unsigned type)
702702
if (((parser->global.usage_page << 16) == HID_UP_SENSOR) &&
703703
type == HID_COLLECTION_PHYSICAL)
704704
hid->group = HID_GROUP_SENSOR_HUB;
705+
706+
if (hid->vendor == USB_VENDOR_ID_MICROSOFT &&
707+
hid->product == USB_DEVICE_ID_MS_TYPE_COVER_3 &&
708+
hid->group == HID_GROUP_MULTITOUCH)
709+
hid->group = HID_GROUP_GENERIC;
705710
}
706711

707712
static int hid_scan_main(struct hid_parser *parser, struct hid_item *item)
@@ -779,23 +784,20 @@ static int hid_scan_report(struct hid_device *hid)
779784
(hid->group == HID_GROUP_MULTITOUCH))
780785
hid->group = HID_GROUP_MULTITOUCH_WIN_8;
781786

782-
/*
783-
* Vendor specific handlings
784-
*/
785-
if ((hid->vendor == USB_VENDOR_ID_SYNAPTICS) &&
786-
(hid->group == HID_GROUP_GENERIC) &&
787-
/* only bind to the mouse interface of composite USB devices */
788-
(hid->bus != BUS_USB || hid->type == HID_TYPE_USBMOUSE))
789-
/* hid-rmi should take care of them, not hid-generic */
790-
hid->group = HID_GROUP_RMI;
791-
792787
/*
793788
* Vendor specific handlings
794789
*/
795790
switch (hid->vendor) {
796791
case USB_VENDOR_ID_WACOM:
797792
hid->group = HID_GROUP_WACOM;
798793
break;
794+
case USB_VENDOR_ID_SYNAPTICS:
795+
if ((hid->group == HID_GROUP_GENERIC) &&
796+
(hid->bus != BUS_USB || hid->type == HID_TYPE_USBMOUSE))
797+
/* hid-rmi should only bind to the mouse interface of
798+
* composite USB devices */
799+
hid->group = HID_GROUP_RMI;
800+
break;
799801
}
800802

801803
vfree(parser);
@@ -1280,12 +1282,6 @@ void hid_output_report(struct hid_report *report, __u8 *data)
12801282
}
12811283
EXPORT_SYMBOL_GPL(hid_output_report);
12821284

1283-
static int hid_report_len(struct hid_report *report)
1284-
{
1285-
/* equivalent to DIV_ROUND_UP(report->size, 8) + !!(report->id > 0) */
1286-
return ((report->size - 1) >> 3) + 1 + (report->id > 0);
1287-
}
1288-
12891285
/*
12901286
* Allocator for buffer that is going to be passed to hid_output_report()
12911287
*/
@@ -1822,6 +1818,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
18221818
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_S510_RECEIVER_2) },
18231819
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_RECEIVER) },
18241820
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_HARMONY_PS3) },
1821+
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_T651) },
18251822
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_DINOVO_DESKTOP) },
18261823
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_DINOVO_EDGE) },
18271824
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_DINOVO_MINI) },
@@ -1862,6 +1859,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
18621859
{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_DIGITAL_MEDIA_3K) },
18631860
{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_WIRELESS_OPTICAL_DESKTOP_3_0) },
18641861
{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_OFFICE_KB) },
1862+
{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_TYPE_COVER_3) },
18651863
{ HID_USB_DEVICE(USB_VENDOR_ID_MONTEREY, USB_DEVICE_ID_GENIUS_KB29E) },
18661864
{ HID_USB_DEVICE(USB_VENDOR_ID_MSI, USB_DEVICE_ID_MSI_GT683R_LED_PANEL) },
18671865
{ HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN) },
@@ -1887,6 +1885,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
18871885
{ HID_USB_DEVICE(USB_VENDOR_ID_ORTEK, USB_DEVICE_ID_ORTEK_WKB2000) },
18881886
{ HID_USB_DEVICE(USB_VENDOR_ID_PENMOUNT, USB_DEVICE_ID_PENMOUNT_6000) },
18891887
{ HID_USB_DEVICE(USB_VENDOR_ID_PETALYNX, USB_DEVICE_ID_PETALYNX_MAXTER_REMOTE) },
1888+
{ HID_USB_DEVICE(USB_VENDOR_ID_PLANTRONICS, HID_ANY_ID) },
18901889
{ HID_USB_DEVICE(USB_VENDOR_ID_PRIMAX, USB_DEVICE_ID_PRIMAX_KEYBOARD) },
18911890
#if IS_ENABLED(CONFIG_HID_ROCCAT)
18921891
{ HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_ARVO) },
@@ -1910,10 +1909,12 @@ static const struct hid_device_id hid_have_special_driver[] = {
19101909
{ HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_PS1000) },
19111910
{ HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_RAT7) },
19121911
{ HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_MMO7) },
1912+
{ HID_USB_DEVICE(USB_VENDOR_ID_MADCATZ, USB_DEVICE_ID_MADCATZ_RAT9) },
19131913
#endif
19141914
{ HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_IR_REMOTE) },
19151915
{ HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE) },
19161916
{ HID_USB_DEVICE(USB_VENDOR_ID_SKYCABLE, USB_DEVICE_ID_SKYCABLE_WIRELESS_PRESENTER) },
1917+
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SMK, USB_DEVICE_ID_SMK_PS3_BDREMOTE) },
19171918
{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_BUZZ_CONTROLLER) },
19181919
{ HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_WIRELESS_BUZZ_CONTROLLER) },
19191920
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_BDREMOTE) },
@@ -2539,7 +2540,8 @@ int hid_add_device(struct hid_device *hdev)
25392540
* Scan generic devices for group information
25402541
*/
25412542
if (hid_ignore_special_drivers ||
2542-
!hid_match_id(hdev, hid_have_special_driver)) {
2543+
(!hdev->group &&
2544+
!hid_match_id(hdev, hid_have_special_driver))) {
25432545
ret = hid_scan_report(hdev);
25442546
if (ret)
25452547
hid_warn(hdev, "bad device descriptor (%d)\n", ret);

drivers/hid/hid-ids.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@
300300
#define USB_DEVICE_ID_ELAN_TOUCHSCREEN 0x0089
301301
#define USB_DEVICE_ID_ELAN_TOUCHSCREEN_009B 0x009b
302302
#define USB_DEVICE_ID_ELAN_TOUCHSCREEN_0103 0x0103
303+
#define USB_DEVICE_ID_ELAN_TOUCHSCREEN_010c 0x010c
303304
#define USB_DEVICE_ID_ELAN_TOUCHSCREEN_016F 0x016f
304305

305306
#define USB_VENDOR_ID_ELECOM 0x056e
@@ -578,6 +579,7 @@
578579

579580
#define USB_VENDOR_ID_LOGITECH 0x046d
580581
#define USB_DEVICE_ID_LOGITECH_AUDIOHUB 0x0a0e
582+
#define USB_DEVICE_ID_LOGITECH_T651 0xb00c
581583
#define USB_DEVICE_ID_LOGITECH_RECEIVER 0xc101
582584
#define USB_DEVICE_ID_LOGITECH_HARMONY_FIRST 0xc110
583585
#define USB_DEVICE_ID_LOGITECH_HARMONY_LAST 0xc14f
@@ -620,6 +622,7 @@
620622

621623
#define USB_VENDOR_ID_MADCATZ 0x0738
622624
#define USB_DEVICE_ID_MADCATZ_BEATPAD 0x4540
625+
#define USB_DEVICE_ID_MADCATZ_RAT9 0x1709
623626

624627
#define USB_VENDOR_ID_MCC 0x09db
625628
#define USB_DEVICE_ID_MCC_PMD1024LS 0x0076
@@ -649,6 +652,7 @@
649652
#define USB_DEVICE_ID_MS_SURFACE_PRO_2 0x0799
650653
#define USB_DEVICE_ID_MS_TOUCH_COVER_2 0x07a7
651654
#define USB_DEVICE_ID_MS_TYPE_COVER_2 0x07a9
655+
#define USB_DEVICE_ID_MS_TYPE_COVER_3 0x07dc
652656

653657
#define USB_VENDOR_ID_MOJO 0x8282
654658
#define USB_DEVICE_ID_RETRO_ADAPTER 0x3201
@@ -716,6 +720,8 @@
716720
#define USB_DEVICE_ID_ORTEK_PKB1700 0x1700
717721
#define USB_DEVICE_ID_ORTEK_WKB2000 0x2000
718722

723+
#define USB_VENDOR_ID_PLANTRONICS 0x047f
724+
719725
#define USB_VENDOR_ID_PANASONIC 0x04da
720726
#define USB_DEVICE_ID_PANABOARD_UBT780 0x1044
721727
#define USB_DEVICE_ID_PANABOARD_UBT880 0x104d
@@ -813,6 +819,9 @@
813819
#define USB_VENDOR_ID_SKYCABLE 0x1223
814820
#define USB_DEVICE_ID_SKYCABLE_WIRELESS_PRESENTER 0x3F07
815821

822+
#define USB_VENDOR_ID_SMK 0x0609
823+
#define USB_DEVICE_ID_SMK_PS3_BDREMOTE 0x0306
824+
816825
#define USB_VENDOR_ID_SONY 0x054c
817826
#define USB_DEVICE_ID_SONY_VAIO_VGX_MOUSE 0x024b
818827
#define USB_DEVICE_ID_SONY_VAIO_VGP_MOUSE 0x0374
@@ -931,6 +940,9 @@
931940
#define USB_DEVICE_ID_VERNIER_CYCLOPS 0x0004
932941
#define USB_DEVICE_ID_VERNIER_LCSPEC 0x0006
933942

943+
#define USB_VENDOR_ID_VTL 0x0306
944+
#define USB_DEVICE_ID_VTL_MULTITOUCH_FF3F 0xff3f
945+
934946
#define USB_VENDOR_ID_WACOM 0x056a
935947
#define USB_DEVICE_ID_WACOM_GRAPHIRE_BLUETOOTH 0x81
936948
#define USB_DEVICE_ID_WACOM_INTUOS4_BLUETOOTH 0x00BD

drivers/hid/hid-input.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
872872
case 0x2cb: map_key_clear(KEY_KBDINPUTASSIST_ACCEPT); break;
873873
case 0x2cc: map_key_clear(KEY_KBDINPUTASSIST_CANCEL); break;
874874

875-
default: goto ignore;
875+
default: map_key_clear(KEY_UNKNOWN);
876876
}
877877
break;
878878

@@ -1215,7 +1215,7 @@ static void hidinput_led_worker(struct work_struct *work)
12151215
return hid->ll_driver->request(hid, report, HID_REQ_SET_REPORT);
12161216

12171217
/* fall back to generic raw-output-report */
1218-
len = ((report->size - 1) >> 3) + 1 + (report->id > 0);
1218+
len = hid_report_len(report);
12191219
buf = hid_alloc_report_buf(report, GFP_KERNEL);
12201220
if (!buf)
12211221
return;

drivers/hid/hid-lenovo.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ static int lenovo_input_mapping_cptkbd(struct hid_device *hdev,
6262
/* HID_UP_LNVENDOR = USB, HID_UP_MSVENDOR = BT */
6363
if ((usage->hid & HID_USAGE_PAGE) == HID_UP_MSVENDOR ||
6464
(usage->hid & HID_USAGE_PAGE) == HID_UP_LNVENDOR) {
65-
set_bit(EV_REP, hi->input->evbit);
6665
switch (usage->hid & HID_USAGE) {
6766
case 0x00f1: /* Fn-F4: Mic mute */
6867
map_key_clear(KEY_MICMUTE);
@@ -85,13 +84,13 @@ static int lenovo_input_mapping_cptkbd(struct hid_device *hdev,
8584
case 0x00f8: /* Fn-F11: View open applications (3 boxes) */
8685
map_key_clear(KEY_SCALE);
8786
return 1;
88-
case 0x00fa: /* Fn-Esc: Fn-lock toggle */
89-
map_key_clear(KEY_FN_ESC);
90-
return 1;
91-
case 0x00fb: /* Fn-F12: Open My computer (6 boxes) USB-only */
87+
case 0x00f9: /* Fn-F12: Open My computer (6 boxes) USB-only */
9288
/* NB: This mapping is invented in raw_event below */
9389
map_key_clear(KEY_FILE);
9490
return 1;
91+
case 0x00fa: /* Fn-Esc: Fn-lock toggle */
92+
map_key_clear(KEY_FN_ESC);
93+
return 1;
9594
}
9695
}
9796

@@ -207,8 +206,8 @@ static int lenovo_raw_event(struct hid_device *hdev,
207206
&& data[0] == 0x15
208207
&& data[1] == 0x94
209208
&& data[2] == 0x01)) {
210-
data[1] = 0x0;
211-
data[2] = 0x4;
209+
data[1] = 0x00;
210+
data[2] = 0x01;
212211
}
213212

214213
return 0;

0 commit comments

Comments
 (0)