aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-input-quirks.c22
-rw-r--r--drivers/hid/usbhid/hid-quirks.c19
2 files changed, 40 insertions, 1 deletions
diff --git a/drivers/hid/hid-input-quirks.c b/drivers/hid/hid-input-quirks.c
index dceadd0c1419..845d31d08fa5 100644
--- a/drivers/hid/hid-input-quirks.c
+++ b/drivers/hid/hid-input-quirks.c
@@ -276,6 +276,21 @@ static int quirk_btc_8193(struct hid_usage *usage, struct input_dev *input,
276 return 1; 276 return 1;
277} 277}
278 278
279static int quirk_sunplus_wdesktop(struct hid_usage *usage, struct input_dev *input,
280 unsigned long **bit, int *max)
281{
282 if ((usage->hid & HID_USAGE_PAGE) != HID_UP_CONSUMER)
283 return 0;
284
285 switch (usage->hid & HID_USAGE) {
286 case 0x2003: map_key_clear(KEY_ZOOMIN); break;
287 case 0x2103: map_key_clear(KEY_ZOOMOUT); break;
288 default:
289 return 0;
290 }
291 return 1;
292}
293
279#define VENDOR_ID_BELKIN 0x1020 294#define VENDOR_ID_BELKIN 0x1020
280#define DEVICE_ID_BELKIN_WIRELESS_KEYBOARD 0x0006 295#define DEVICE_ID_BELKIN_WIRELESS_KEYBOARD 0x0006
281 296
@@ -306,6 +321,9 @@ static int quirk_btc_8193(struct hid_usage *usage, struct input_dev *input,
306#define VENDOR_ID_PETALYNX 0x18b1 321#define VENDOR_ID_PETALYNX 0x18b1
307#define DEVICE_ID_PETALYNX_MAXTER_REMOTE 0x0037 322#define DEVICE_ID_PETALYNX_MAXTER_REMOTE 0x0037
308 323
324#define VENDOR_ID_SUNPLUS 0x04fc
325#define DEVICE_ID_SUNPLUS_WDESKTOP 0x05d8
326
309static const struct hid_input_blacklist { 327static const struct hid_input_blacklist {
310 __u16 idVendor; 328 __u16 idVendor;
311 __u16 idProduct; 329 __u16 idProduct;
@@ -332,7 +350,9 @@ static const struct hid_input_blacklist {
332 { VENDOR_ID_MONTEREY, DEVICE_ID_GENIUS_KB29E, quirk_cherry_genius_29e }, 350 { VENDOR_ID_MONTEREY, DEVICE_ID_GENIUS_KB29E, quirk_cherry_genius_29e },
333 351
334 { VENDOR_ID_PETALYNX, DEVICE_ID_PETALYNX_MAXTER_REMOTE, quirk_petalynx_remote }, 352 { VENDOR_ID_PETALYNX, DEVICE_ID_PETALYNX_MAXTER_REMOTE, quirk_petalynx_remote },
335 353
354 { VENDOR_ID_SUNPLUS, DEVICE_ID_SUNPLUS_WDESKTOP, quirk_sunplus_wdesktop },
355
336 { 0, 0, 0 } 356 { 0, 0, 0 }
337}; 357};
338 358
diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c
index 81dc5e353dd8..f06356512067 100644
--- a/drivers/hid/usbhid/hid-quirks.c
+++ b/drivers/hid/usbhid/hid-quirks.c
@@ -381,6 +381,9 @@
381#define USB_VENDOR_ID_SUN 0x0430 381#define USB_VENDOR_ID_SUN 0x0430
382#define USB_DEVICE_ID_RARITAN_KVM_DONGLE 0xcdab 382#define USB_DEVICE_ID_RARITAN_KVM_DONGLE 0xcdab
383 383
384#define USB_VENDOR_ID_SUNPLUS 0x04fc
385#define USB_DEVICE_ID_SUNPLUS_WDESKTOP 0x05d8
386
384#define USB_VENDOR_ID_TOPMAX 0x0663 387#define USB_VENDOR_ID_TOPMAX 0x0663
385#define USB_DEVICE_ID_TOPMAX_COBRAPAD 0x0103 388#define USB_DEVICE_ID_TOPMAX_COBRAPAD 0x0103
386 389
@@ -735,6 +738,8 @@ static const struct hid_rdesc_blacklist {
735 738
736 { USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_IR_REMOTE, HID_QUIRK_RDESC_SAMSUNG_REMOTE }, 739 { USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_IR_REMOTE, HID_QUIRK_RDESC_SAMSUNG_REMOTE },
737 740
741 { USB_VENDOR_ID_SUNPLUS, USB_DEVICE_ID_SUNPLUS_WDESKTOP, HID_QUIRK_RDESC_SUNPLUS_WDESKTOP },
742
738 { USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_1, HID_QUIRK_RDESC_SWAPPED_MIN_MAX }, 743 { USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_1, HID_QUIRK_RDESC_SWAPPED_MIN_MAX },
739 { USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_2, HID_QUIRK_RDESC_SWAPPED_MIN_MAX }, 744 { USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_2, HID_QUIRK_RDESC_SWAPPED_MIN_MAX },
740 745
@@ -1009,6 +1014,17 @@ static void usbhid_fixup_logitech_descriptor(unsigned char *rdesc, int rsize)
1009 } 1014 }
1010} 1015}
1011 1016
1017static void usbhid_fixup_sunplus_wdesktop(unsigned char *rdesc, int rsize)
1018{
1019 if (rsize >= 107 && rdesc[104] == 0x26
1020 && rdesc[105] == 0x80
1021 && rdesc[106] == 0x03) {
1022 printk(KERN_INFO "Fixing up Sunplus Wireless Desktop report descriptor\n");
1023 rdesc[105] = rdesc[110] = 0x03;
1024 rdesc[106] = rdesc[111] = 0x21;
1025 }
1026}
1027
1012/* 1028/*
1013 * Samsung IrDA remote controller (reports as Cypress USB Mouse). 1029 * Samsung IrDA remote controller (reports as Cypress USB Mouse).
1014 * 1030 *
@@ -1182,4 +1198,7 @@ void usbhid_fixup_report_descriptor(const u16 idVendor, const u16 idProduct,
1182 __usbhid_fixup_report_descriptor(quirks, rdesc, rsize); 1198 __usbhid_fixup_report_descriptor(quirks, rdesc, rsize);
1183 } 1199 }
1184 1200
1201 if (quirks & HID_QUIRK_RDESC_SUNPLUS_WDESKTOP)
1202 usbhid_fixup_sunplus_wdesktop(rdesc, rsize);
1203
1185} 1204}