aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2012-03-20 08:18:05 -0400
committerJiri Kosina <jkosina@suse.cz>2012-03-20 08:18:05 -0400
commit4a247a4119ee932e06e985e0a95a13c3eed4715b (patch)
tree42b6a7c9edf2f40c7b645a493d63bdb67e5f7100 /drivers/hid
parent77aa8e65f0e20c294907a9fa8af92a3dbe0e0a51 (diff)
parent4d5df5d11e8027c11c1079205757527cbaade62d (diff)
Merge branch 'upstream' into for-linus
Conflicts: drivers/hid/Makefile
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/Kconfig28
-rw-r--r--drivers/hid/Makefile2
-rw-r--r--drivers/hid/hid-chicony.c7
-rw-r--r--drivers/hid/hid-core.c21
-rw-r--r--drivers/hid/hid-ids.h16
-rw-r--r--drivers/hid/hid-kye.c399
-rw-r--r--drivers/hid/hid-magicmouse.c2
-rw-r--r--drivers/hid/hid-multitouch.c5
-rw-r--r--drivers/hid/hid-saitek.c70
-rw-r--r--drivers/hid/hid-sjoy.c6
-rw-r--r--drivers/hid/hid-tivo.c90
-rw-r--r--drivers/hid/hid-uclogic.c413
-rw-r--r--drivers/hid/hid-wacom.c1
-rw-r--r--drivers/hid/hid-waltop.c881
-rw-r--r--drivers/hid/usbhid/hid-quirks.c3
15 files changed, 860 insertions, 1084 deletions
diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
index 3890ac698061..a3d033252995 100644
--- a/drivers/hid/Kconfig
+++ b/drivers/hid/Kconfig
@@ -200,11 +200,14 @@ config HID_KEYTOUCH
200 - Keytouch IEC 60945 200 - Keytouch IEC 60945
201 201
202config HID_KYE 202config HID_KYE
203 tristate "Kye/Genius Ergo Mouse" if EXPERT 203 tristate "KYE/Genius devices"
204 depends on USB_HID 204 depends on USB_HID
205 default !EXPERT
206 ---help--- 205 ---help---
207 Support for Kye/Genius Ergo Mouse. 206 Support for KYE/Genius devices not fully compliant with HID standard:
207 - Ergo Mouse
208 - EasyPen i405X tablet
209 - MousePen i608X tablet
210 - EasyPen M610X tablet
208 211
209config HID_UCLOGIC 212config HID_UCLOGIC
210 tristate "UC-Logic" 213 tristate "UC-Logic"
@@ -257,7 +260,9 @@ config HID_LOGITECH_DJ
257 ---help--- 260 ---help---
258 Say Y if you want support for Logitech Unifying receivers and devices. 261 Say Y if you want support for Logitech Unifying receivers and devices.
259 Unifying receivers are capable of pairing up to 6 Logitech compliant 262 Unifying receivers are capable of pairing up to 6 Logitech compliant
260 devices to the same receiver. 263 devices to the same receiver. Without this driver it will be handled by
264 generic USB_HID driver and all incomming events will be multiplexed
265 into a single mouse and a single keyboard device.
261 266
262config LOGITECH_FF 267config LOGITECH_FF
263 bool "Logitech force feedback support" 268 bool "Logitech force feedback support"
@@ -485,6 +490,15 @@ config HID_ROCCAT
485 Say Y here if you have a Roccat mouse or keyboard and want 490 Say Y here if you have a Roccat mouse or keyboard and want
486 support for its special functionalities. 491 support for its special functionalities.
487 492
493config HID_SAITEK
494 tristate "Saitek non-fully HID-compliant devices"
495 depends on USB_HID
496 ---help---
497 Support for Saitek devices that are not fully compliant with the
498 HID standard.
499
500 Currently only supports the PS1000 controller.
501
488config HID_SAMSUNG 502config HID_SAMSUNG
489 tristate "Samsung InfraRed remote control or keyboards" 503 tristate "Samsung InfraRed remote control or keyboards"
490 depends on USB_HID 504 depends on USB_HID
@@ -549,6 +563,12 @@ config SMARTJOYPLUS_FF
549 Say Y here if you have a SmartJoy PLUS PS2/USB adapter and want to 563 Say Y here if you have a SmartJoy PLUS PS2/USB adapter and want to
550 enable force feedback support for it. 564 enable force feedback support for it.
551 565
566config HID_TIVO
567 tristate "TiVo Slide Bluetooth remote control support"
568 depends on (USB_HID || BT_HIDP)
569 ---help---
570 Say Y if you have a TiVo Slide Bluetooth remote control.
571
552config HID_TOPSEED 572config HID_TOPSEED
553 tristate "TopSeed Cyberlink, BTC Emprex, Conceptronic remote control support" 573 tristate "TopSeed Cyberlink, BTC Emprex, Conceptronic remote control support"
554 depends on USB_HID 574 depends on USB_HID
diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile
index 7d926719e21b..22f1d16cd79c 100644
--- a/drivers/hid/Makefile
+++ b/drivers/hid/Makefile
@@ -67,6 +67,7 @@ obj-$(CONFIG_HID_PRIMAX) += hid-primax.o
67obj-$(CONFIG_HID_ROCCAT) += hid-roccat.o hid-roccat-common.o \ 67obj-$(CONFIG_HID_ROCCAT) += hid-roccat.o hid-roccat-common.o \
68 hid-roccat-arvo.o hid-roccat-isku.o hid-roccat-kone.o \ 68 hid-roccat-arvo.o hid-roccat-isku.o hid-roccat-kone.o \
69 hid-roccat-koneplus.o hid-roccat-kovaplus.o hid-roccat-pyra.o 69 hid-roccat-koneplus.o hid-roccat-kovaplus.o hid-roccat-pyra.o
70obj-$(CONFIG_HID_SAITEK) += hid-saitek.o
70obj-$(CONFIG_HID_SAMSUNG) += hid-samsung.o 71obj-$(CONFIG_HID_SAMSUNG) += hid-samsung.o
71obj-$(CONFIG_HID_SMARTJOYPLUS) += hid-sjoy.o 72obj-$(CONFIG_HID_SMARTJOYPLUS) += hid-sjoy.o
72obj-$(CONFIG_HID_SONY) += hid-sony.o 73obj-$(CONFIG_HID_SONY) += hid-sony.o
@@ -74,6 +75,7 @@ obj-$(CONFIG_HID_SPEEDLINK) += hid-speedlink.o
74obj-$(CONFIG_HID_SUNPLUS) += hid-sunplus.o 75obj-$(CONFIG_HID_SUNPLUS) += hid-sunplus.o
75obj-$(CONFIG_HID_GREENASIA) += hid-gaff.o 76obj-$(CONFIG_HID_GREENASIA) += hid-gaff.o
76obj-$(CONFIG_HID_THRUSTMASTER) += hid-tmff.o 77obj-$(CONFIG_HID_THRUSTMASTER) += hid-tmff.o
78obj-$(CONFIG_HID_TIVO) += hid-tivo.o
77obj-$(CONFIG_HID_TOPSEED) += hid-topseed.o 79obj-$(CONFIG_HID_TOPSEED) += hid-topseed.o
78obj-$(CONFIG_HID_TWINHAN) += hid-twinhan.o 80obj-$(CONFIG_HID_TWINHAN) += hid-twinhan.o
79obj-$(CONFIG_HID_UCLOGIC) += hid-uclogic.o 81obj-$(CONFIG_HID_UCLOGIC) += hid-uclogic.o
diff --git a/drivers/hid/hid-chicony.c b/drivers/hid/hid-chicony.c
index 8965ad93d510..b99af346fdff 100644
--- a/drivers/hid/hid-chicony.c
+++ b/drivers/hid/hid-chicony.c
@@ -45,6 +45,12 @@ static int ch_input_mapping(struct hid_device *hdev, struct hid_input *hi,
45 case 0xff09: ch_map_key_clear(BTN_9); break; 45 case 0xff09: ch_map_key_clear(BTN_9); break;
46 case 0xff0a: ch_map_key_clear(BTN_A); break; 46 case 0xff0a: ch_map_key_clear(BTN_A); break;
47 case 0xff0b: ch_map_key_clear(BTN_B); break; 47 case 0xff0b: ch_map_key_clear(BTN_B); break;
48 case 0x00f1: ch_map_key_clear(KEY_WLAN); break;
49 case 0x00f2: ch_map_key_clear(KEY_BRIGHTNESSDOWN); break;
50 case 0x00f3: ch_map_key_clear(KEY_BRIGHTNESSUP); break;
51 case 0x00f4: ch_map_key_clear(KEY_DISPLAY_OFF); break;
52 case 0x00f7: ch_map_key_clear(KEY_CAMERA); break;
53 case 0x00f8: ch_map_key_clear(KEY_PROG1); break;
48 default: 54 default:
49 return 0; 55 return 0;
50 } 56 }
@@ -53,6 +59,7 @@ static int ch_input_mapping(struct hid_device *hdev, struct hid_input *hi,
53 59
54static const struct hid_device_id ch_devices[] = { 60static const struct hid_device_id ch_devices[] = {
55 { HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_TACTICAL_PAD) }, 61 { HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_TACTICAL_PAD) },
62 { HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_WIRELESS2) },
56 { } 63 { }
57}; 64};
58MODULE_DEVICE_TABLE(hid, ch_devices); 65MODULE_DEVICE_TABLE(hid, ch_devices);
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 05a0c9a35bf2..f5d1ca8272c5 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -4,7 +4,7 @@
4 * Copyright (c) 1999 Andreas Gal 4 * Copyright (c) 1999 Andreas Gal
5 * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> 5 * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz>
6 * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc 6 * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc
7 * Copyright (c) 2006-2010 Jiri Kosina 7 * Copyright (c) 2006-2012 Jiri Kosina
8 */ 8 */
9 9
10/* 10/*
@@ -50,6 +50,10 @@ module_param_named(debug, hid_debug, int, 0600);
50MODULE_PARM_DESC(debug, "toggle HID debugging messages"); 50MODULE_PARM_DESC(debug, "toggle HID debugging messages");
51EXPORT_SYMBOL_GPL(hid_debug); 51EXPORT_SYMBOL_GPL(hid_debug);
52 52
53static int hid_ignore_special_drivers = 0;
54module_param_named(ignore_special_drivers, hid_ignore_special_drivers, int, 0600);
55MODULE_PARM_DESC(debug, "Ignore any special drivers and handle all devices by generic driver");
56
53/* 57/*
54 * Register a new report for a device. 58 * Register a new report for a device.
55 */ 59 */
@@ -1395,6 +1399,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
1395 { HID_USB_DEVICE(USB_VENDOR_ID_CHERRY, USB_DEVICE_ID_CHERRY_CYMOTION_SOLAR) }, 1399 { HID_USB_DEVICE(USB_VENDOR_ID_CHERRY, USB_DEVICE_ID_CHERRY_CYMOTION_SOLAR) },
1396 { HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_TACTICAL_PAD) }, 1400 { HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_TACTICAL_PAD) },
1397 { HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_WIRELESS) }, 1401 { HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_WIRELESS) },
1402 { HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_WIRELESS2) },
1398 { HID_USB_DEVICE(USB_VENDOR_ID_CHUNGHWAT, USB_DEVICE_ID_CHUNGHWAT_MULTITOUCH) }, 1403 { HID_USB_DEVICE(USB_VENDOR_ID_CHUNGHWAT, USB_DEVICE_ID_CHUNGHWAT_MULTITOUCH) },
1399 { HID_USB_DEVICE(USB_VENDOR_ID_CREATIVELABS, USB_DEVICE_ID_PRODIKEYS_PCMIDI) }, 1404 { HID_USB_DEVICE(USB_VENDOR_ID_CREATIVELABS, USB_DEVICE_ID_PRODIKEYS_PCMIDI) },
1400 { HID_USB_DEVICE(USB_VENDOR_ID_CVTOUCH, USB_DEVICE_ID_CVTOUCH_SCREEN) }, 1405 { HID_USB_DEVICE(USB_VENDOR_ID_CVTOUCH, USB_DEVICE_ID_CVTOUCH_SCREEN) },
@@ -1418,6 +1423,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
1418 { HID_USB_DEVICE(USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_TS2515) }, 1423 { HID_USB_DEVICE(USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_TS2515) },
1419 { HID_USB_DEVICE(USB_VENDOR_ID_EMS, USB_DEVICE_ID_EMS_TRIO_LINKER_PLUS_II) }, 1424 { HID_USB_DEVICE(USB_VENDOR_ID_EMS, USB_DEVICE_ID_EMS_TRIO_LINKER_PLUS_II) },
1420 { HID_USB_DEVICE(USB_VENDOR_ID_EZKEY, USB_DEVICE_ID_BTC_8193) }, 1425 { HID_USB_DEVICE(USB_VENDOR_ID_EZKEY, USB_DEVICE_ID_BTC_8193) },
1426 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_FRUCTEL, USB_DEVICE_ID_GAMETEL_MT_MODE) },
1421 { HID_USB_DEVICE(USB_VENDOR_ID_GAMERON, USB_DEVICE_ID_GAMERON_DUAL_PSX_ADAPTOR) }, 1427 { HID_USB_DEVICE(USB_VENDOR_ID_GAMERON, USB_DEVICE_ID_GAMERON_DUAL_PSX_ADAPTOR) },
1422 { HID_USB_DEVICE(USB_VENDOR_ID_GAMERON, USB_DEVICE_ID_GAMERON_DUAL_PCS_ADAPTOR) }, 1428 { HID_USB_DEVICE(USB_VENDOR_ID_GAMERON, USB_DEVICE_ID_GAMERON_DUAL_PCS_ADAPTOR) },
1423 { HID_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH, USB_DEVICE_ID_GENERAL_TOUCH_WIN7_TWOFINGERS) }, 1429 { HID_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH, USB_DEVICE_ID_GENERAL_TOUCH_WIN7_TWOFINGERS) },
@@ -1436,6 +1442,9 @@ static const struct hid_device_id hid_have_special_driver[] = {
1436 { HID_USB_DEVICE(USB_VENDOR_ID_KENSINGTON, USB_DEVICE_ID_KS_SLIMBLADE) }, 1442 { HID_USB_DEVICE(USB_VENDOR_ID_KENSINGTON, USB_DEVICE_ID_KS_SLIMBLADE) },
1437 { HID_USB_DEVICE(USB_VENDOR_ID_KEYTOUCH, USB_DEVICE_ID_KEYTOUCH_IEC) }, 1443 { HID_USB_DEVICE(USB_VENDOR_ID_KEYTOUCH, USB_DEVICE_ID_KEYTOUCH_IEC) },
1438 { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_ERGO_525V) }, 1444 { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_ERGO_525V) },
1445 { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_EASYPEN_I405X) },
1446 { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_MOUSEPEN_I608X) },
1447 { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_EASYPEN_M610X) },
1439 { HID_USB_DEVICE(USB_VENDOR_ID_LABTEC, USB_DEVICE_ID_LABTEC_WIRELESS_KEYBOARD) }, 1448 { HID_USB_DEVICE(USB_VENDOR_ID_LABTEC, USB_DEVICE_ID_LABTEC_WIRELESS_KEYBOARD) },
1440 { HID_USB_DEVICE(USB_VENDOR_ID_LCPOWER, USB_DEVICE_ID_LCPOWER_LC1000 ) }, 1449 { HID_USB_DEVICE(USB_VENDOR_ID_LCPOWER, USB_DEVICE_ID_LCPOWER_LC1000 ) },
1441 { HID_USB_DEVICE(USB_VENDOR_ID_LG, USB_DEVICE_ID_LG_MULTITOUCH) }, 1450 { HID_USB_DEVICE(USB_VENDOR_ID_LG, USB_DEVICE_ID_LG_MULTITOUCH) },
@@ -1463,8 +1472,10 @@ static const struct hid_device_id hid_have_special_driver[] = {
1463 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_DFGT_WHEEL) }, 1472 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_DFGT_WHEEL) },
1464 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_G25_WHEEL) }, 1473 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_G25_WHEEL) },
1465 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_G27_WHEEL) }, 1474 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_G27_WHEEL) },
1475#if IS_ENABLED(CONFIG_HID_LOGITECH_DJ)
1466 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_UNIFYING_RECEIVER) }, 1476 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_UNIFYING_RECEIVER) },
1467 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_UNIFYING_RECEIVER_2) }, 1477 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_UNIFYING_RECEIVER_2) },
1478#endif
1468 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_WII_WHEEL) }, 1479 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_WII_WHEEL) },
1469 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_RUMBLEPAD2) }, 1480 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_RUMBLEPAD2) },
1470 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_SPACETRAVELLER) }, 1481 { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_SPACETRAVELLER) },
@@ -1519,6 +1530,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
1519 { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_KOVAPLUS) }, 1530 { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_KOVAPLUS) },
1520 { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_PYRA_WIRED) }, 1531 { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_PYRA_WIRED) },
1521 { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_PYRA_WIRELESS) }, 1532 { HID_USB_DEVICE(USB_VENDOR_ID_ROCCAT, USB_DEVICE_ID_ROCCAT_PYRA_WIRELESS) },
1533 { HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_PS1000) },
1522 { HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_IR_REMOTE) }, 1534 { HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_IR_REMOTE) },
1523 { HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE) }, 1535 { HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_WIRELESS_KBD_MOUSE) },
1524 { HID_USB_DEVICE(USB_VENDOR_ID_SKYCABLE, USB_DEVICE_ID_SKYCABLE_WIRELESS_PRESENTER) }, 1536 { HID_USB_DEVICE(USB_VENDOR_ID_SKYCABLE, USB_DEVICE_ID_SKYCABLE_WIRELESS_PRESENTER) },
@@ -1538,6 +1550,8 @@ static const struct hid_device_id hid_have_special_driver[] = {
1538 { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb653) }, 1550 { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb653) },
1539 { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb654) }, 1551 { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb654) },
1540 { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb65a) }, 1552 { HID_USB_DEVICE(USB_VENDOR_ID_THRUSTMASTER, 0xb65a) },
1553 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_TIVO, USB_DEVICE_ID_TIVO_SLIDE_BT) },
1554 { HID_USB_DEVICE(USB_VENDOR_ID_TIVO, USB_DEVICE_ID_TIVO_SLIDE) },
1541 { HID_USB_DEVICE(USB_VENDOR_ID_TOPSEED, USB_DEVICE_ID_TOPSEED_CYBERLINK) }, 1555 { HID_USB_DEVICE(USB_VENDOR_ID_TOPSEED, USB_DEVICE_ID_TOPSEED_CYBERLINK) },
1542 { HID_USB_DEVICE(USB_VENDOR_ID_TOPSEED2, USB_DEVICE_ID_TOPSEED2_RF_COMBO) }, 1556 { HID_USB_DEVICE(USB_VENDOR_ID_TOPSEED2, USB_DEVICE_ID_TOPSEED2_RF_COMBO) },
1543 { HID_USB_DEVICE(USB_VENDOR_ID_TOUCH_INTL, USB_DEVICE_ID_TOUCH_INTL_MULTI_TOUCH) }, 1557 { HID_USB_DEVICE(USB_VENDOR_ID_TOUCH_INTL, USB_DEVICE_ID_TOUCH_INTL_MULTI_TOUCH) },
@@ -1551,6 +1565,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
1551 { HID_USB_DEVICE(USB_VENDOR_ID_UNITEC, USB_DEVICE_ID_UNITEC_USB_TOUCH_0709) }, 1565 { HID_USB_DEVICE(USB_VENDOR_ID_UNITEC, USB_DEVICE_ID_UNITEC_USB_TOUCH_0709) },
1552 { HID_USB_DEVICE(USB_VENDOR_ID_UNITEC, USB_DEVICE_ID_UNITEC_USB_TOUCH_0A19) }, 1566 { HID_USB_DEVICE(USB_VENDOR_ID_UNITEC, USB_DEVICE_ID_UNITEC_USB_TOUCH_0A19) },
1553 { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_SMARTJOY_PLUS) }, 1567 { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_SMARTJOY_PLUS) },
1568 { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_SUPER_JOY_BOX_3) },
1554 { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_DUAL_USB_JOYPAD) }, 1569 { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_DUAL_USB_JOYPAD) },
1555 { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP_LTD, USB_DEVICE_ID_SUPER_JOY_BOX_3_PRO) }, 1570 { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP_LTD, USB_DEVICE_ID_SUPER_JOY_BOX_3_PRO) },
1556 { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP_LTD, USB_DEVICE_ID_SUPER_DUAL_BOX_PRO) }, 1571 { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP_LTD, USB_DEVICE_ID_SUPER_DUAL_BOX_PRO) },
@@ -1559,6 +1574,8 @@ static const struct hid_device_id hid_have_special_driver[] = {
1559 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS4_BLUETOOTH) }, 1574 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_WACOM, USB_DEVICE_ID_WACOM_INTUOS4_BLUETOOTH) },
1560 { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_SLIM_TABLET_5_8_INCH) }, 1575 { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_SLIM_TABLET_5_8_INCH) },
1561 { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_SLIM_TABLET_12_1_INCH) }, 1576 { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_SLIM_TABLET_12_1_INCH) },
1577 { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_Q_PAD) },
1578 { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_PID_0038) },
1562 { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_MEDIA_TABLET_10_6_INCH) }, 1579 { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_MEDIA_TABLET_10_6_INCH) },
1563 { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_MEDIA_TABLET_14_1_INCH) }, 1580 { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, USB_DEVICE_ID_WALTOP_MEDIA_TABLET_14_1_INCH) },
1564 { HID_USB_DEVICE(USB_VENDOR_ID_XAT, USB_DEVICE_ID_XAT_CSR) }, 1581 { HID_USB_DEVICE(USB_VENDOR_ID_XAT, USB_DEVICE_ID_XAT_CSR) },
@@ -1674,7 +1691,7 @@ static int hid_bus_match(struct device *dev, struct device_driver *drv)
1674 return 0; 1691 return 0;
1675 1692
1676 /* generic wants all that don't have specialized driver */ 1693 /* generic wants all that don't have specialized driver */
1677 if (!strncmp(hdrv->name, "generic-", 8)) 1694 if (!strncmp(hdrv->name, "generic-", 8) && !hid_ignore_special_drivers)
1678 return !hid_match_id(hdev, hid_have_special_driver); 1695 return !hid_match_id(hdev, hid_have_special_driver);
1679 1696
1680 return 1; 1697 return 1;
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index 55360fefee5b..3eb00902ca40 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -177,6 +177,7 @@
177#define USB_VENDOR_ID_CH 0x068e 177#define USB_VENDOR_ID_CH 0x068e
178#define USB_DEVICE_ID_CH_PRO_THROTTLE 0x00f1 178#define USB_DEVICE_ID_CH_PRO_THROTTLE 0x00f1
179#define USB_DEVICE_ID_CH_PRO_PEDALS 0x00f2 179#define USB_DEVICE_ID_CH_PRO_PEDALS 0x00f2
180#define USB_DEVICE_ID_CH_FIGHTERSTICK 0x00f3
180#define USB_DEVICE_ID_CH_COMBATSTICK 0x00f4 181#define USB_DEVICE_ID_CH_COMBATSTICK 0x00f4
181#define USB_DEVICE_ID_CH_FLIGHT_SIM_ECLIPSE_YOKE 0x0051 182#define USB_DEVICE_ID_CH_FLIGHT_SIM_ECLIPSE_YOKE 0x0051
182#define USB_DEVICE_ID_CH_FLIGHT_SIM_YOKE 0x00ff 183#define USB_DEVICE_ID_CH_FLIGHT_SIM_YOKE 0x00ff
@@ -194,6 +195,7 @@
194#define USB_DEVICE_ID_CHICONY_TACTICAL_PAD 0x0418 195#define USB_DEVICE_ID_CHICONY_TACTICAL_PAD 0x0418
195#define USB_DEVICE_ID_CHICONY_MULTI_TOUCH 0xb19d 196#define USB_DEVICE_ID_CHICONY_MULTI_TOUCH 0xb19d
196#define USB_DEVICE_ID_CHICONY_WIRELESS 0x0618 197#define USB_DEVICE_ID_CHICONY_WIRELESS 0x0618
198#define USB_DEVICE_ID_CHICONY_WIRELESS2 0x1123
197 199
198#define USB_VENDOR_ID_CHUNGHWAT 0x2247 200#define USB_VENDOR_ID_CHUNGHWAT 0x2247
199#define USB_DEVICE_ID_CHUNGHWAT_MULTITOUCH 0x0001 201#define USB_DEVICE_ID_CHUNGHWAT_MULTITOUCH 0x0001
@@ -280,6 +282,9 @@
280#define USB_VENDOR_ID_EZKEY 0x0518 282#define USB_VENDOR_ID_EZKEY 0x0518
281#define USB_DEVICE_ID_BTC_8193 0x0002 283#define USB_DEVICE_ID_BTC_8193 0x0002
282 284
285#define USB_VENDOR_ID_FRUCTEL 0x25B6
286#define USB_DEVICE_ID_GAMETEL_MT_MODE 0x0002
287
283#define USB_VENDOR_ID_GAMERON 0x0810 288#define USB_VENDOR_ID_GAMERON 0x0810
284#define USB_DEVICE_ID_GAMERON_DUAL_PSX_ADAPTOR 0x0001 289#define USB_DEVICE_ID_GAMERON_DUAL_PSX_ADAPTOR 0x0001
285#define USB_DEVICE_ID_GAMERON_DUAL_PCS_ADAPTOR 0x0002 290#define USB_DEVICE_ID_GAMERON_DUAL_PCS_ADAPTOR 0x0002
@@ -417,6 +422,9 @@
417#define USB_VENDOR_ID_KYE 0x0458 422#define USB_VENDOR_ID_KYE 0x0458
418#define USB_DEVICE_ID_KYE_ERGO_525V 0x0087 423#define USB_DEVICE_ID_KYE_ERGO_525V 0x0087
419#define USB_DEVICE_ID_KYE_GPEN_560 0x5003 424#define USB_DEVICE_ID_KYE_GPEN_560 0x5003
425#define USB_DEVICE_ID_KYE_EASYPEN_I405X 0x5010
426#define USB_DEVICE_ID_KYE_MOUSEPEN_I608X 0x5011
427#define USB_DEVICE_ID_KYE_EASYPEN_M610X 0x5013
420 428
421#define USB_VENDOR_ID_LABTEC 0x1020 429#define USB_VENDOR_ID_LABTEC 0x1020
422#define USB_DEVICE_ID_LABTEC_WIRELESS_KEYBOARD 0x0006 430#define USB_DEVICE_ID_LABTEC_WIRELESS_KEYBOARD 0x0006
@@ -629,6 +637,7 @@
629 637
630#define USB_VENDOR_ID_SAITEK 0x06a3 638#define USB_VENDOR_ID_SAITEK 0x06a3
631#define USB_DEVICE_ID_SAITEK_RUMBLEPAD 0xff17 639#define USB_DEVICE_ID_SAITEK_RUMBLEPAD 0xff17
640#define USB_DEVICE_ID_SAITEK_PS1000 0x0621
632 641
633#define USB_VENDOR_ID_SAMSUNG 0x0419 642#define USB_VENDOR_ID_SAMSUNG 0x0419
634#define USB_DEVICE_ID_SAMSUNG_IR_REMOTE 0x0001 643#define USB_DEVICE_ID_SAMSUNG_IR_REMOTE 0x0001
@@ -670,6 +679,10 @@
670 679
671#define USB_VENDOR_ID_THRUSTMASTER 0x044f 680#define USB_VENDOR_ID_THRUSTMASTER 0x044f
672 681
682#define USB_VENDOR_ID_TIVO 0x150a
683#define USB_DEVICE_ID_TIVO_SLIDE_BT 0x1200
684#define USB_DEVICE_ID_TIVO_SLIDE 0x1201
685
673#define USB_VENDOR_ID_TOPSEED 0x0766 686#define USB_VENDOR_ID_TOPSEED 0x0766
674#define USB_DEVICE_ID_TOPSEED_CYBERLINK 0x0204 687#define USB_DEVICE_ID_TOPSEED_CYBERLINK 0x0204
675 688
@@ -720,6 +733,8 @@
720#define USB_VENDOR_ID_WALTOP 0x172f 733#define USB_VENDOR_ID_WALTOP 0x172f
721#define USB_DEVICE_ID_WALTOP_SLIM_TABLET_5_8_INCH 0x0032 734#define USB_DEVICE_ID_WALTOP_SLIM_TABLET_5_8_INCH 0x0032
722#define USB_DEVICE_ID_WALTOP_SLIM_TABLET_12_1_INCH 0x0034 735#define USB_DEVICE_ID_WALTOP_SLIM_TABLET_12_1_INCH 0x0034
736#define USB_DEVICE_ID_WALTOP_Q_PAD 0x0037
737#define USB_DEVICE_ID_WALTOP_PID_0038 0x0038
723#define USB_DEVICE_ID_WALTOP_MEDIA_TABLET_10_6_INCH 0x0501 738#define USB_DEVICE_ID_WALTOP_MEDIA_TABLET_10_6_INCH 0x0501
724#define USB_DEVICE_ID_WALTOP_MEDIA_TABLET_14_1_INCH 0x0500 739#define USB_DEVICE_ID_WALTOP_MEDIA_TABLET_14_1_INCH 0x0500
725 740
@@ -728,6 +743,7 @@
728#define USB_DEVICE_ID_1_PHIDGETSERVO_20 0x8101 743#define USB_DEVICE_ID_1_PHIDGETSERVO_20 0x8101
729#define USB_DEVICE_ID_4_PHIDGETSERVO_20 0x8104 744#define USB_DEVICE_ID_4_PHIDGETSERVO_20 0x8104
730#define USB_DEVICE_ID_8_8_4_IF_KIT 0x8201 745#define USB_DEVICE_ID_8_8_4_IF_KIT 0x8201
746#define USB_DEVICE_ID_SUPER_JOY_BOX_3 0x8888
731#define USB_DEVICE_ID_QUAD_USB_JOYPAD 0x8800 747#define USB_DEVICE_ID_QUAD_USB_JOYPAD 0x8800
732#define USB_DEVICE_ID_DUAL_USB_JOYPAD 0x8866 748#define USB_DEVICE_ID_DUAL_USB_JOYPAD 0x8866
733 749
diff --git a/drivers/hid/hid-kye.c b/drivers/hid/hid-kye.c
index f2ba9efc3a53..b4f0d8216fd0 100644
--- a/drivers/hid/hid-kye.c
+++ b/drivers/hid/hid-kye.c
@@ -3,6 +3,7 @@
3 * 3 *
4 * Copyright (c) 2009 Jiri Kosina 4 * Copyright (c) 2009 Jiri Kosina
5 * Copyright (c) 2009 Tomas Hanak 5 * Copyright (c) 2009 Tomas Hanak
6 * Copyright (c) 2012 Nikolai Kondrashov
6 */ 7 */
7 8
8/* 9/*
@@ -15,36 +16,399 @@
15#include <linux/device.h> 16#include <linux/device.h>
16#include <linux/hid.h> 17#include <linux/hid.h>
17#include <linux/module.h> 18#include <linux/module.h>
19#include <linux/usb.h>
20#include "usbhid/usbhid.h"
18 21
19#include "hid-ids.h" 22#include "hid-ids.h"
20 23
21/* the fixups that need to be done: 24/*
22 * - change led usage page to button for extra buttons 25 * See EasyPen i405X description, device and HID report descriptors at
23 * - report size 8 count 1 must be size 1 count 8 for button bitfield 26 * http://sf.net/apps/mediawiki/digimend/?title=KYE_EasyPen_i405X
24 * - change the button usage range to 4-7 for the extra buttons
25 */ 27 */
28
29/* Original EasyPen i405X report descriptor size */
30#define EASYPEN_I405X_RDESC_ORIG_SIZE 476
31
32/* Fixed EasyPen i405X report descriptor */
33static __u8 easypen_i405x_rdesc_fixed[] = {
34 0x06, 0x00, 0xFF, /* Usage Page (FF00h), */
35 0x09, 0x01, /* Usage (01h), */
36 0xA1, 0x01, /* Collection (Application), */
37 0x85, 0x05, /* Report ID (5), */
38 0x09, 0x01, /* Usage (01h), */
39 0x15, 0x80, /* Logical Minimum (-128), */
40 0x25, 0x7F, /* Logical Maximum (127), */
41 0x75, 0x08, /* Report Size (8), */
42 0x95, 0x07, /* Report Count (7), */
43 0xB1, 0x02, /* Feature (Variable), */
44 0xC0, /* End Collection, */
45 0x05, 0x0D, /* Usage Page (Digitizer), */
46 0x09, 0x02, /* Usage (Pen), */
47 0xA1, 0x01, /* Collection (Application), */
48 0x85, 0x10, /* Report ID (16), */
49 0x09, 0x20, /* Usage (Stylus), */
50 0xA0, /* Collection (Physical), */
51 0x14, /* Logical Minimum (0), */
52 0x25, 0x01, /* Logical Maximum (1), */
53 0x75, 0x01, /* Report Size (1), */
54 0x09, 0x42, /* Usage (Tip Switch), */
55 0x09, 0x44, /* Usage (Barrel Switch), */
56 0x09, 0x46, /* Usage (Tablet Pick), */
57 0x95, 0x03, /* Report Count (3), */
58 0x81, 0x02, /* Input (Variable), */
59 0x95, 0x04, /* Report Count (4), */
60 0x81, 0x03, /* Input (Constant, Variable), */
61 0x09, 0x32, /* Usage (In Range), */
62 0x95, 0x01, /* Report Count (1), */
63 0x81, 0x02, /* Input (Variable), */
64 0x75, 0x10, /* Report Size (16), */
65 0x95, 0x01, /* Report Count (1), */
66 0xA4, /* Push, */
67 0x05, 0x01, /* Usage Page (Desktop), */
68 0x55, 0xFD, /* Unit Exponent (-3), */
69 0x65, 0x13, /* Unit (Inch), */
70 0x34, /* Physical Minimum (0), */
71 0x09, 0x30, /* Usage (X), */
72 0x46, 0x7C, 0x15, /* Physical Maximum (5500), */
73 0x26, 0x00, 0x37, /* Logical Maximum (14080), */
74 0x81, 0x02, /* Input (Variable), */
75 0x09, 0x31, /* Usage (Y), */
76 0x46, 0xA0, 0x0F, /* Physical Maximum (4000), */
77 0x26, 0x00, 0x28, /* Logical Maximum (10240), */
78 0x81, 0x02, /* Input (Variable), */
79 0xB4, /* Pop, */
80 0x09, 0x30, /* Usage (Tip Pressure), */
81 0x26, 0xFF, 0x03, /* Logical Maximum (1023), */
82 0x81, 0x02, /* Input (Variable), */
83 0xC0, /* End Collection, */
84 0xC0 /* End Collection */
85};
86
87/*
88 * See MousePen i608X description, device and HID report descriptors at
89 * http://sf.net/apps/mediawiki/digimend/?title=KYE_MousePen_i608X
90 */
91
92/* Original MousePen i608X report descriptor size */
93#define MOUSEPEN_I608X_RDESC_ORIG_SIZE 476
94
95/* Fixed MousePen i608X report descriptor */
96static __u8 mousepen_i608x_rdesc_fixed[] = {
97 0x06, 0x00, 0xFF, /* Usage Page (FF00h), */
98 0x09, 0x01, /* Usage (01h), */
99 0xA1, 0x01, /* Collection (Application), */
100 0x85, 0x05, /* Report ID (5), */
101 0x09, 0x01, /* Usage (01h), */
102 0x15, 0x80, /* Logical Minimum (-128), */
103 0x25, 0x7F, /* Logical Maximum (127), */
104 0x75, 0x08, /* Report Size (8), */
105 0x95, 0x07, /* Report Count (7), */
106 0xB1, 0x02, /* Feature (Variable), */
107 0xC0, /* End Collection, */
108 0x05, 0x0D, /* Usage Page (Digitizer), */
109 0x09, 0x02, /* Usage (Pen), */
110 0xA1, 0x01, /* Collection (Application), */
111 0x85, 0x10, /* Report ID (16), */
112 0x09, 0x20, /* Usage (Stylus), */
113 0xA0, /* Collection (Physical), */
114 0x14, /* Logical Minimum (0), */
115 0x25, 0x01, /* Logical Maximum (1), */
116 0x75, 0x01, /* Report Size (1), */
117 0x09, 0x42, /* Usage (Tip Switch), */
118 0x09, 0x44, /* Usage (Barrel Switch), */
119 0x09, 0x46, /* Usage (Tablet Pick), */
120 0x95, 0x03, /* Report Count (3), */
121 0x81, 0x02, /* Input (Variable), */
122 0x95, 0x04, /* Report Count (4), */
123 0x81, 0x03, /* Input (Constant, Variable), */
124 0x09, 0x32, /* Usage (In Range), */
125 0x95, 0x01, /* Report Count (1), */
126 0x81, 0x02, /* Input (Variable), */
127 0x75, 0x10, /* Report Size (16), */
128 0x95, 0x01, /* Report Count (1), */
129 0xA4, /* Push, */
130 0x05, 0x01, /* Usage Page (Desktop), */
131 0x55, 0xFD, /* Unit Exponent (-3), */
132 0x65, 0x13, /* Unit (Inch), */
133 0x34, /* Physical Minimum (0), */
134 0x09, 0x30, /* Usage (X), */
135 0x46, 0x40, 0x1F, /* Physical Maximum (8000), */
136 0x26, 0x00, 0x50, /* Logical Maximum (20480), */
137 0x81, 0x02, /* Input (Variable), */
138 0x09, 0x31, /* Usage (Y), */
139 0x46, 0x70, 0x17, /* Physical Maximum (6000), */
140 0x26, 0x00, 0x3C, /* Logical Maximum (15360), */
141 0x81, 0x02, /* Input (Variable), */
142 0xB4, /* Pop, */
143 0x09, 0x30, /* Usage (Tip Pressure), */
144 0x26, 0xFF, 0x03, /* Logical Maximum (1023), */
145 0x81, 0x02, /* Input (Variable), */
146 0xC0, /* End Collection, */
147 0xC0, /* End Collection, */
148 0x05, 0x01, /* Usage Page (Desktop), */
149 0x09, 0x02, /* Usage (Mouse), */
150 0xA1, 0x01, /* Collection (Application), */
151 0x85, 0x11, /* Report ID (17), */
152 0x09, 0x01, /* Usage (Pointer), */
153 0xA0, /* Collection (Physical), */
154 0x14, /* Logical Minimum (0), */
155 0xA4, /* Push, */
156 0x05, 0x09, /* Usage Page (Button), */
157 0x75, 0x01, /* Report Size (1), */
158 0x19, 0x01, /* Usage Minimum (01h), */
159 0x29, 0x03, /* Usage Maximum (03h), */
160 0x25, 0x01, /* Logical Maximum (1), */
161 0x95, 0x03, /* Report Count (3), */
162 0x81, 0x02, /* Input (Variable), */
163 0x95, 0x05, /* Report Count (5), */
164 0x81, 0x01, /* Input (Constant), */
165 0xB4, /* Pop, */
166 0x95, 0x01, /* Report Count (1), */
167 0xA4, /* Push, */
168 0x55, 0xFD, /* Unit Exponent (-3), */
169 0x65, 0x13, /* Unit (Inch), */
170 0x34, /* Physical Minimum (0), */
171 0x75, 0x10, /* Report Size (16), */
172 0x09, 0x30, /* Usage (X), */
173 0x46, 0x40, 0x1F, /* Physical Maximum (8000), */
174 0x26, 0x00, 0x50, /* Logical Maximum (20480), */
175 0x81, 0x02, /* Input (Variable), */
176 0x09, 0x31, /* Usage (Y), */
177 0x46, 0x70, 0x17, /* Physical Maximum (6000), */
178 0x26, 0x00, 0x3C, /* Logical Maximum (15360), */
179 0x81, 0x02, /* Input (Variable), */
180 0xB4, /* Pop, */
181 0x75, 0x08, /* Report Size (8), */
182 0x09, 0x38, /* Usage (Wheel), */
183 0x15, 0xFF, /* Logical Minimum (-1), */
184 0x25, 0x01, /* Logical Maximum (1), */
185 0x81, 0x06, /* Input (Variable, Relative), */
186 0x81, 0x01, /* Input (Constant), */
187 0xC0, /* End Collection, */
188 0xC0 /* End Collection */
189};
190
191/*
192 * See EasyPen M610X description, device and HID report descriptors at
193 * http://sf.net/apps/mediawiki/digimend/?title=KYE_EasyPen_M610X
194 */
195
196/* Original EasyPen M610X report descriptor size */
197#define EASYPEN_M610X_RDESC_ORIG_SIZE 476
198
199/* Fixed EasyPen M610X report descriptor */
200static __u8 easypen_m610x_rdesc_fixed[] = {
201 0x06, 0x00, 0xFF, /* Usage Page (FF00h), */
202 0x09, 0x01, /* Usage (01h), */
203 0xA1, 0x01, /* Collection (Application), */
204 0x85, 0x05, /* Report ID (5), */
205 0x09, 0x01, /* Usage (01h), */
206 0x15, 0x80, /* Logical Minimum (-128), */
207 0x25, 0x7F, /* Logical Maximum (127), */
208 0x75, 0x08, /* Report Size (8), */
209 0x95, 0x07, /* Report Count (7), */
210 0xB1, 0x02, /* Feature (Variable), */
211 0xC0, /* End Collection, */
212 0x05, 0x0D, /* Usage Page (Digitizer), */
213 0x09, 0x02, /* Usage (Pen), */
214 0xA1, 0x01, /* Collection (Application), */
215 0x85, 0x10, /* Report ID (16), */
216 0x09, 0x20, /* Usage (Stylus), */
217 0xA0, /* Collection (Physical), */
218 0x14, /* Logical Minimum (0), */
219 0x25, 0x01, /* Logical Maximum (1), */
220 0x75, 0x01, /* Report Size (1), */
221 0x09, 0x42, /* Usage (Tip Switch), */
222 0x09, 0x44, /* Usage (Barrel Switch), */
223 0x09, 0x46, /* Usage (Tablet Pick), */
224 0x95, 0x03, /* Report Count (3), */
225 0x81, 0x02, /* Input (Variable), */
226 0x95, 0x04, /* Report Count (4), */
227 0x81, 0x03, /* Input (Constant, Variable), */
228 0x09, 0x32, /* Usage (In Range), */
229 0x95, 0x01, /* Report Count (1), */
230 0x81, 0x02, /* Input (Variable), */
231 0x75, 0x10, /* Report Size (16), */
232 0x95, 0x01, /* Report Count (1), */
233 0xA4, /* Push, */
234 0x05, 0x01, /* Usage Page (Desktop), */
235 0x55, 0xFD, /* Unit Exponent (-3), */
236 0x65, 0x13, /* Unit (Inch), */
237 0x34, /* Physical Minimum (0), */
238 0x09, 0x30, /* Usage (X), */
239 0x46, 0x10, 0x27, /* Physical Maximum (10000), */
240 0x27, 0x00, 0xA0, 0x00, 0x00, /* Logical Maximum (40960), */
241 0x81, 0x02, /* Input (Variable), */
242 0x09, 0x31, /* Usage (Y), */
243 0x46, 0x6A, 0x18, /* Physical Maximum (6250), */
244 0x26, 0x00, 0x64, /* Logical Maximum (25600), */
245 0x81, 0x02, /* Input (Variable), */
246 0xB4, /* Pop, */
247 0x09, 0x30, /* Usage (Tip Pressure), */
248 0x26, 0xFF, 0x03, /* Logical Maximum (1023), */
249 0x81, 0x02, /* Input (Variable), */
250 0xC0, /* End Collection, */
251 0xC0, /* End Collection, */
252 0x05, 0x0C, /* Usage Page (Consumer), */
253 0x09, 0x01, /* Usage (Consumer Control), */
254 0xA1, 0x01, /* Collection (Application), */
255 0x85, 0x12, /* Report ID (18), */
256 0x14, /* Logical Minimum (0), */
257 0x25, 0x01, /* Logical Maximum (1), */
258 0x75, 0x01, /* Report Size (1), */
259 0x95, 0x04, /* Report Count (4), */
260 0x0A, 0x1A, 0x02, /* Usage (AC Undo), */
261 0x0A, 0x79, 0x02, /* Usage (AC Redo Or Repeat), */
262 0x0A, 0x2D, 0x02, /* Usage (AC Zoom In), */
263 0x0A, 0x2E, 0x02, /* Usage (AC Zoom Out), */
264 0x81, 0x02, /* Input (Variable), */
265 0x95, 0x01, /* Report Count (1), */
266 0x75, 0x14, /* Report Size (20), */
267 0x81, 0x03, /* Input (Constant, Variable), */
268 0x75, 0x20, /* Report Size (32), */
269 0x81, 0x03, /* Input (Constant, Variable), */
270 0xC0 /* End Collection */
271};
272
26static __u8 *kye_report_fixup(struct hid_device *hdev, __u8 *rdesc, 273static __u8 *kye_report_fixup(struct hid_device *hdev, __u8 *rdesc,
27 unsigned int *rsize) 274 unsigned int *rsize)
28{ 275{
29 if (*rsize >= 74 && 276 switch (hdev->product) {
30 rdesc[61] == 0x05 && rdesc[62] == 0x08 && 277 case USB_DEVICE_ID_KYE_ERGO_525V:
31 rdesc[63] == 0x19 && rdesc[64] == 0x08 && 278 /* the fixups that need to be done:
32 rdesc[65] == 0x29 && rdesc[66] == 0x0f && 279 * - change led usage page to button for extra buttons
33 rdesc[71] == 0x75 && rdesc[72] == 0x08 && 280 * - report size 8 count 1 must be size 1 count 8 for button
34 rdesc[73] == 0x95 && rdesc[74] == 0x01) { 281 * bitfield
35 hid_info(hdev, 282 * - change the button usage range to 4-7 for the extra
36 "fixing up Kye/Genius Ergo Mouse report descriptor\n"); 283 * buttons
37 rdesc[62] = 0x09; 284 */
38 rdesc[64] = 0x04; 285 if (*rsize >= 74 &&
39 rdesc[66] = 0x07; 286 rdesc[61] == 0x05 && rdesc[62] == 0x08 &&
40 rdesc[72] = 0x01; 287 rdesc[63] == 0x19 && rdesc[64] == 0x08 &&
41 rdesc[74] = 0x08; 288 rdesc[65] == 0x29 && rdesc[66] == 0x0f &&
289 rdesc[71] == 0x75 && rdesc[72] == 0x08 &&
290 rdesc[73] == 0x95 && rdesc[74] == 0x01) {
291 hid_info(hdev,
292 "fixing up Kye/Genius Ergo Mouse "
293 "report descriptor\n");
294 rdesc[62] = 0x09;
295 rdesc[64] = 0x04;
296 rdesc[66] = 0x07;
297 rdesc[72] = 0x01;
298 rdesc[74] = 0x08;
299 }
300 break;
301 case USB_DEVICE_ID_KYE_EASYPEN_I405X:
302 if (*rsize == EASYPEN_I405X_RDESC_ORIG_SIZE) {
303 rdesc = easypen_i405x_rdesc_fixed;
304 *rsize = sizeof(easypen_i405x_rdesc_fixed);
305 }
306 break;
307 case USB_DEVICE_ID_KYE_MOUSEPEN_I608X:
308 if (*rsize == MOUSEPEN_I608X_RDESC_ORIG_SIZE) {
309 rdesc = mousepen_i608x_rdesc_fixed;
310 *rsize = sizeof(mousepen_i608x_rdesc_fixed);
311 }
312 break;
313 case USB_DEVICE_ID_KYE_EASYPEN_M610X:
314 if (*rsize == EASYPEN_M610X_RDESC_ORIG_SIZE) {
315 rdesc = easypen_m610x_rdesc_fixed;
316 *rsize = sizeof(easypen_m610x_rdesc_fixed);
317 }
318 break;
42 } 319 }
43 return rdesc; 320 return rdesc;
44} 321}
45 322
323/**
324 * Enable fully-functional tablet mode by setting a special feature report.
325 *
326 * @hdev: HID device
327 *
328 * The specific report ID and data were discovered by sniffing the
329 * Windows driver traffic.
330 */
331static int kye_tablet_enable(struct hid_device *hdev)
332{
333 struct list_head *list;
334 struct list_head *head;
335 struct hid_report *report;
336 __s32 *value;
337
338 list = &hdev->report_enum[HID_FEATURE_REPORT].report_list;
339 list_for_each(head, list) {
340 report = list_entry(head, struct hid_report, list);
341 if (report->id == 5)
342 break;
343 }
344
345 if (head == list) {
346 hid_err(hdev, "tablet-enabling feature report not found\n");
347 return -ENODEV;
348 }
349
350 if (report->maxfield < 1 || report->field[0]->report_count < 7) {
351 hid_err(hdev, "invalid tablet-enabling feature report\n");
352 return -ENODEV;
353 }
354
355 value = report->field[0]->value;
356
357 value[0] = 0x12;
358 value[1] = 0x10;
359 value[2] = 0x11;
360 value[3] = 0x12;
361 value[4] = 0x00;
362 value[5] = 0x00;
363 value[6] = 0x00;
364 usbhid_submit_report(hdev, report, USB_DIR_OUT);
365
366 return 0;
367}
368
369static int kye_probe(struct hid_device *hdev, const struct hid_device_id *id)
370{
371 int ret;
372
373 ret = hid_parse(hdev);
374 if (ret) {
375 hid_err(hdev, "parse failed\n");
376 goto err;
377 }
378
379 ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT);
380 if (ret) {
381 hid_err(hdev, "hw start failed\n");
382 goto err;
383 }
384
385 switch (id->product) {
386 case USB_DEVICE_ID_KYE_EASYPEN_I405X:
387 case USB_DEVICE_ID_KYE_MOUSEPEN_I608X:
388 case USB_DEVICE_ID_KYE_EASYPEN_M610X:
389 ret = kye_tablet_enable(hdev);
390 if (ret) {
391 hid_err(hdev, "tablet enabling failed\n");
392 goto enabling_err;
393 }
394 break;
395 }
396
397 return 0;
398enabling_err:
399 hid_hw_stop(hdev);
400err:
401 return ret;
402}
403
46static const struct hid_device_id kye_devices[] = { 404static const struct hid_device_id kye_devices[] = {
47 { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_ERGO_525V) }, 405 { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_ERGO_525V) },
406 { HID_USB_DEVICE(USB_VENDOR_ID_KYE,
407 USB_DEVICE_ID_KYE_EASYPEN_I405X) },
408 { HID_USB_DEVICE(USB_VENDOR_ID_KYE,
409 USB_DEVICE_ID_KYE_MOUSEPEN_I608X) },
410 { HID_USB_DEVICE(USB_VENDOR_ID_KYE,
411 USB_DEVICE_ID_KYE_EASYPEN_M610X) },
48 { } 412 { }
49}; 413};
50MODULE_DEVICE_TABLE(hid, kye_devices); 414MODULE_DEVICE_TABLE(hid, kye_devices);
@@ -52,6 +416,7 @@ MODULE_DEVICE_TABLE(hid, kye_devices);
52static struct hid_driver kye_driver = { 416static struct hid_driver kye_driver = {
53 .name = "kye", 417 .name = "kye",
54 .id_table = kye_devices, 418 .id_table = kye_devices,
419 .probe = kye_probe,
55 .report_fixup = kye_report_fixup, 420 .report_fixup = kye_report_fixup,
56}; 421};
57 422
diff --git a/drivers/hid/hid-magicmouse.c b/drivers/hid/hid-magicmouse.c
index 2ab71758e2e2..7cf3ffe4b7bc 100644
--- a/drivers/hid/hid-magicmouse.c
+++ b/drivers/hid/hid-magicmouse.c
@@ -418,6 +418,8 @@ static void magicmouse_setup_input(struct input_dev *input, struct hid_device *h
418 __set_bit(BTN_TOOL_TRIPLETAP, input->keybit); 418 __set_bit(BTN_TOOL_TRIPLETAP, input->keybit);
419 __set_bit(BTN_TOOL_QUADTAP, input->keybit); 419 __set_bit(BTN_TOOL_QUADTAP, input->keybit);
420 __set_bit(BTN_TOUCH, input->keybit); 420 __set_bit(BTN_TOUCH, input->keybit);
421 __set_bit(INPUT_PROP_POINTER, input->propbit);
422 __set_bit(INPUT_PROP_BUTTONPAD, input->propbit);
421 } 423 }
422 424
423 if (report_touches) { 425 if (report_touches) {
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 6fb46d70f39d..1d5b94167b52 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -837,6 +837,11 @@ static const struct hid_device_id mt_devices[] = {
837 HID_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH, 837 HID_USB_DEVICE(USB_VENDOR_ID_GENERAL_TOUCH,
838 USB_DEVICE_ID_GENERAL_TOUCH_WIN7_TWOFINGERS) }, 838 USB_DEVICE_ID_GENERAL_TOUCH_WIN7_TWOFINGERS) },
839 839
840 /* Gametel game controller */
841 { .driver_data = MT_CLS_DEFAULT,
842 HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_FRUCTEL,
843 USB_DEVICE_ID_GAMETEL_MT_MODE) },
844
840 /* GoodTouch panels */ 845 /* GoodTouch panels */
841 { .driver_data = MT_CLS_DEFAULT, 846 { .driver_data = MT_CLS_DEFAULT,
842 HID_USB_DEVICE(USB_VENDOR_ID_GOODTOUCH, 847 HID_USB_DEVICE(USB_VENDOR_ID_GOODTOUCH,
diff --git a/drivers/hid/hid-saitek.c b/drivers/hid/hid-saitek.c
new file mode 100644
index 000000000000..45aea77bb611
--- /dev/null
+++ b/drivers/hid/hid-saitek.c
@@ -0,0 +1,70 @@
1/*
2 * HID driver for Saitek devices, currently only the PS1000 (USB gamepad).
3 * Fixes the HID report descriptor by removing a non-existent axis and
4 * clearing the constant bit on the input reports for buttons and d-pad.
5 * (This module is based on "hid-ortek".)
6 *
7 * Copyright (c) 2012 Andreas Hübner
8 */
9
10/*
11 * This program is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU General Public License as published by the Free
13 * Software Foundation; either version 2 of the License, or (at your option)
14 * any later version.
15 */
16
17#include <linux/device.h>
18#include <linux/hid.h>
19#include <linux/module.h>
20#include <linux/kernel.h>
21
22#include "hid-ids.h"
23
24static __u8 *saitek_report_fixup(struct hid_device *hdev, __u8 *rdesc,
25 unsigned int *rsize)
26{
27 if (*rsize == 137 && rdesc[20] == 0x09 && rdesc[21] == 0x33
28 && rdesc[94] == 0x81 && rdesc[95] == 0x03
29 && rdesc[110] == 0x81 && rdesc[111] == 0x03) {
30
31 hid_info(hdev, "Fixing up Saitek PS1000 report descriptor\n");
32
33 /* convert spurious axis to a "noop" Logical Minimum (0) */
34 rdesc[20] = 0x15;
35 rdesc[21] = 0x00;
36
37 /* clear constant bit on buttons and d-pad */
38 rdesc[95] = 0x02;
39 rdesc[111] = 0x02;
40
41 }
42 return rdesc;
43}
44
45static const struct hid_device_id saitek_devices[] = {
46 { HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_PS1000)},
47 { }
48};
49
50MODULE_DEVICE_TABLE(hid, saitek_devices);
51
52static struct hid_driver saitek_driver = {
53 .name = "saitek",
54 .id_table = saitek_devices,
55 .report_fixup = saitek_report_fixup
56};
57
58static int __init saitek_init(void)
59{
60 return hid_register_driver(&saitek_driver);
61}
62
63static void __exit saitek_exit(void)
64{
65 hid_unregister_driver(&saitek_driver);
66}
67
68module_init(saitek_init);
69module_exit(saitek_exit);
70MODULE_LICENSE("GPL");
diff --git a/drivers/hid/hid-sjoy.c b/drivers/hid/hid-sjoy.c
index 4b1448613ea6..42257acfeb73 100644
--- a/drivers/hid/hid-sjoy.c
+++ b/drivers/hid/hid-sjoy.c
@@ -155,7 +155,8 @@ err:
155} 155}
156 156
157static const struct hid_device_id sjoy_devices[] = { 157static const struct hid_device_id sjoy_devices[] = {
158 { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP_LTD, USB_DEVICE_ID_SUPER_JOY_BOX_3_PRO) }, 158 { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP_LTD, USB_DEVICE_ID_SUPER_JOY_BOX_3_PRO),
159 .driver_data = HID_QUIRK_NOGET },
159 { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP_LTD, USB_DEVICE_ID_SUPER_DUAL_BOX_PRO), 160 { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP_LTD, USB_DEVICE_ID_SUPER_DUAL_BOX_PRO),
160 .driver_data = HID_QUIRK_MULTI_INPUT | HID_QUIRK_NOGET | 161 .driver_data = HID_QUIRK_MULTI_INPUT | HID_QUIRK_NOGET |
161 HID_QUIRK_SKIP_OUTPUT_REPORTS }, 162 HID_QUIRK_SKIP_OUTPUT_REPORTS },
@@ -163,8 +164,9 @@ static const struct hid_device_id sjoy_devices[] = {
163 .driver_data = HID_QUIRK_MULTI_INPUT | HID_QUIRK_NOGET | 164 .driver_data = HID_QUIRK_MULTI_INPUT | HID_QUIRK_NOGET |
164 HID_QUIRK_SKIP_OUTPUT_REPORTS }, 165 HID_QUIRK_SKIP_OUTPUT_REPORTS },
165 { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_SMARTJOY_PLUS) }, 166 { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_SMARTJOY_PLUS) },
167 { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_SUPER_JOY_BOX_3) },
166 { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_DUAL_USB_JOYPAD), 168 { HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_DUAL_USB_JOYPAD),
167 .driver_data = HID_QUIRK_MULTI_INPUT | HID_QUIRK_NOGET | 169 .driver_data = HID_QUIRK_MULTI_INPUT |
168 HID_QUIRK_SKIP_OUTPUT_REPORTS }, 170 HID_QUIRK_SKIP_OUTPUT_REPORTS },
169 { } 171 { }
170}; 172};
diff --git a/drivers/hid/hid-tivo.c b/drivers/hid/hid-tivo.c
new file mode 100644
index 000000000000..de47039c708c
--- /dev/null
+++ b/drivers/hid/hid-tivo.c
@@ -0,0 +1,90 @@
1/*
2 * HID driver for TiVo Slide Bluetooth remote
3 *
4 * Copyright (c) 2011 Jarod Wilson <jarod@redhat.com>
5 * based on the hid-topseed driver, which is in turn, based on hid-cherry...
6 */
7
8/*
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by the Free
11 * Software Foundation; either version 2 of the License, or (at your option)
12 * any later version.
13 */
14
15#include <linux/device.h>
16#include <linux/hid.h>
17#include <linux/module.h>
18
19#include "hid-ids.h"
20
21#define HID_UP_TIVOVENDOR 0xffff0000
22#define tivo_map_key_clear(c) hid_map_usage_clear(hi, usage, bit, max, \
23 EV_KEY, (c))
24
25static int tivo_input_mapping(struct hid_device *hdev, struct hid_input *hi,
26 struct hid_field *field, struct hid_usage *usage,
27 unsigned long **bit, int *max)
28{
29 switch (usage->hid & HID_USAGE_PAGE) {
30 case HID_UP_TIVOVENDOR:
31 switch (usage->hid & HID_USAGE) {
32 /* TiVo button */
33 case 0x3d: tivo_map_key_clear(KEY_MEDIA); break;
34 /* Live TV */
35 case 0x3e: tivo_map_key_clear(KEY_TV); break;
36 /* Red thumbs down */
37 case 0x41: tivo_map_key_clear(KEY_KPMINUS); break;
38 /* Green thumbs up */
39 case 0x42: tivo_map_key_clear(KEY_KPPLUS); break;
40 default:
41 return 0;
42 }
43 break;
44 case HID_UP_CONSUMER:
45 switch (usage->hid & HID_USAGE) {
46 /* Enter/Last (default mapping: KEY_LAST) */
47 case 0x083: tivo_map_key_clear(KEY_ENTER); break;
48 /* Info (default mapping: KEY_PROPS) */
49 case 0x209: tivo_map_key_clear(KEY_INFO); break;
50 default:
51 return 0;
52 }
53 break;
54 default:
55 return 0;
56 }
57
58 /* This means we found a matching mapping here, else, look in the
59 * standard hid mappings in hid-input.c */
60 return 1;
61}
62
63static const struct hid_device_id tivo_devices[] = {
64 /* TiVo Slide Bluetooth remote, pairs with a Broadcom dongle */
65 { HID_USB_DEVICE(USB_VENDOR_ID_TIVO, USB_DEVICE_ID_TIVO_SLIDE_BT) },
66 { HID_USB_DEVICE(USB_VENDOR_ID_TIVO, USB_DEVICE_ID_TIVO_SLIDE) },
67 { }
68};
69MODULE_DEVICE_TABLE(hid, tivo_devices);
70
71static struct hid_driver tivo_driver = {
72 .name = "tivo_slide",
73 .id_table = tivo_devices,
74 .input_mapping = tivo_input_mapping,
75};
76
77static int __init tivo_init(void)
78{
79 return hid_register_driver(&tivo_driver);
80}
81
82static void __exit tivo_exit(void)
83{
84 hid_unregister_driver(&tivo_driver);
85}
86
87module_init(tivo_init);
88module_exit(tivo_exit);
89MODULE_LICENSE("GPL");
90MODULE_AUTHOR("Jarod Wilson <jarod@redhat.com>");
diff --git a/drivers/hid/hid-uclogic.c b/drivers/hid/hid-uclogic.c
index e15732f1a22d..1f1128910337 100644
--- a/drivers/hid/hid-uclogic.c
+++ b/drivers/hid/hid-uclogic.c
@@ -18,141 +18,16 @@
18#include "hid-ids.h" 18#include "hid-ids.h"
19 19
20/* 20/*
21 * The original descriptors of WPXXXXU tablets have three report IDs, of 21 * See WPXXXXU model descriptions, device and HID report descriptors at
22 * which only two are used (8 and 9), and the remaining (7) seems to have 22 * http://sf.net/apps/mediawiki/digimend/?title=UC-Logic_Tablet_WP4030U
23 * the originally intended pen description which was abandoned for some 23 * http://sf.net/apps/mediawiki/digimend/?title=UC-Logic_Tablet_WP5540U
24 * reason. From this unused description it is possible to extract the 24 * http://sf.net/apps/mediawiki/digimend/?title=UC-Logic_Tablet_WP8060U
25 * actual physical extents and resolution. All the models use the same
26 * descriptor with different extents for the unused report ID.
27 *
28 * Here it is:
29 *
30 * Usage Page (Digitizer), ; Digitizer (0Dh)
31 * Usage (Pen), ; Pen (02h, application collection)
32 * Collection (Application),
33 * Report ID (7),
34 * Usage (Stylus), ; Stylus (20h, logical collection)
35 * Collection (Physical),
36 * Usage (Tip Switch), ; Tip switch (42h, momentary control)
37 * Usage (Barrel Switch), ; Barrel switch (44h, momentary control)
38 * Usage (Eraser), ; Eraser (45h, momentary control)
39 * Logical Minimum (0),
40 * Logical Maximum (1),
41 * Report Size (1),
42 * Report Count (3),
43 * Input (Variable),
44 * Report Count (3),
45 * Input (Constant, Variable),
46 * Usage (In Range), ; In range (32h, momentary control)
47 * Report Count (1),
48 * Input (Variable),
49 * Report Count (1),
50 * Input (Constant, Variable),
51 * Usage Page (Desktop), ; Generic desktop controls (01h)
52 * Usage (X), ; X (30h, dynamic value)
53 * Report Size (16),
54 * Report Count (1),
55 * Push,
56 * Unit Exponent (13),
57 * Unit (Inch^3),
58 * Physical Minimum (0),
59 * Physical Maximum (Xpm),
60 * Logical Maximum (Xlm),
61 * Input (Variable),
62 * Usage (Y), ; Y (31h, dynamic value)
63 * Physical Maximum (Ypm),
64 * Logical Maximum (Ylm),
65 * Input (Variable),
66 * Pop,
67 * Usage Page (Digitizer), ; Digitizer (0Dh)
68 * Usage (Tip Pressure), ; Tip pressure (30h, dynamic value)
69 * Logical Maximum (1023),
70 * Input (Variable),
71 * Report Size (16),
72 * End Collection,
73 * End Collection,
74 * Usage Page (Desktop), ; Generic desktop controls (01h)
75 * Usage (Mouse), ; Mouse (02h, application collection)
76 * Collection (Application),
77 * Report ID (8),
78 * Usage (Pointer), ; Pointer (01h, physical collection)
79 * Collection (Physical),
80 * Usage Page (Button), ; Button (09h)
81 * Usage Minimum (01h),
82 * Usage Maximum (03h),
83 * Logical Minimum (0),
84 * Logical Maximum (1),
85 * Report Count (3),
86 * Report Size (1),
87 * Input (Variable),
88 * Report Count (5),
89 * Input (Constant),
90 * Usage Page (Desktop), ; Generic desktop controls (01h)
91 * Usage (X), ; X (30h, dynamic value)
92 * Usage (Y), ; Y (31h, dynamic value)
93 * Usage (Wheel), ; Wheel (38h, dynamic value)
94 * Usage (00h),
95 * Logical Minimum (-127),
96 * Logical Maximum (127),
97 * Report Size (8),
98 * Report Count (4),
99 * Input (Variable, Relative),
100 * End Collection,
101 * End Collection,
102 * Usage Page (Desktop), ; Generic desktop controls (01h)
103 * Usage (Mouse), ; Mouse (02h, application collection)
104 * Collection (Application),
105 * Report ID (9),
106 * Usage (Pointer), ; Pointer (01h, physical collection)
107 * Collection (Physical),
108 * Usage Page (Button), ; Button (09h)
109 * Usage Minimum (01h),
110 * Usage Maximum (03h),
111 * Logical Minimum (0),
112 * Logical Maximum (1),
113 * Report Count (3),
114 * Report Size (1),
115 * Input (Variable),
116 * Report Count (5),
117 * Input (Constant),
118 * Usage Page (Desktop), ; Generic desktop controls (01h)
119 * Usage (X), ; X (30h, dynamic value)
120 * Usage (Y), ; Y (31h, dynamic value)
121 * Logical Minimum (0),
122 * Logical Maximum (32767),
123 * Physical Minimum (0),
124 * Physical Maximum (32767),
125 * Report Count (2),
126 * Report Size (16),
127 * Input (Variable),
128 * Usage Page (Digitizer), ; Digitizer (0Dh)
129 * Usage (Tip Pressure), ; Tip pressure (30h, dynamic value)
130 * Logical Maximum (1023),
131 * Report Count (1),
132 * Report Size (16),
133 * Input (Variable),
134 * End Collection,
135 * End Collection
136 *
137 * Here are the extents values for the WPXXXXU models:
138 *
139 * Xpm Xlm Ypm Ylm
140 * WP4030U 4000 8000 3000 6000
141 * WP5540U 5500 11000 4000 8000
142 * WP8060U 8000 16000 6000 12000
143 *
144 * This suggests that all of them have 2000 LPI resolution, as advertised.
145 */ 25 */
146 26
147/* Size of the original descriptor of WPXXXXU tablets */ 27/* Size of the original descriptor of WPXXXXU tablets */
148#define WPXXXXU_RDESC_ORIG_SIZE 212 28#define WPXXXXU_RDESC_ORIG_SIZE 212
149 29
150/* 30/* Fixed WP4030U report descriptor */
151 * Fixed WP4030U report descriptor.
152 * Although the hardware might actually support it, the mouse description
153 * has been removed, since there seems to be no devices having one and it
154 * wouldn't make much sense because of the working area size.
155 */
156static __u8 wp4030u_rdesc_fixed[] = { 31static __u8 wp4030u_rdesc_fixed[] = {
157 0x05, 0x0D, /* Usage Page (Digitizer), */ 32 0x05, 0x0D, /* Usage Page (Digitizer), */
158 0x09, 0x02, /* Usage (Pen), */ 33 0x09, 0x02, /* Usage (Pen), */
@@ -343,148 +218,14 @@ static __u8 wp8060u_rdesc_fixed[] = {
343}; 218};
344 219
345/* 220/*
346 * Original WP1062 report descriptor. 221 * See WP1062 description, device and HID report descriptors at
347 * 222 * http://sf.net/apps/mediawiki/digimend/?title=UC-Logic_Tablet_WP1062
348 * Only report ID 9 is actually used.
349 *
350 * Usage Page (Digitizer), ; Digitizer (0Dh)
351 * Usage (Pen), ; Pen (02h, application collection)
352 * Collection (Application),
353 * Report ID (7),
354 * Usage (Stylus), ; Stylus (20h, logical collection)
355 * Collection (Physical),
356 * Usage (Tip Switch), ; Tip switch (42h, momentary control)
357 * Usage (Barrel Switch), ; Barrel switch (44h, momentary control)
358 * Usage (Eraser), ; Eraser (45h, momentary control)
359 * Logical Minimum (0),
360 * Logical Maximum (1),
361 * Report Size (1),
362 * Report Count (3),
363 * Input (Variable),
364 * Report Count (3),
365 * Input (Constant, Variable),
366 * Usage (In Range), ; In range (32h, momentary control)
367 * Report Count (1),
368 * Input (Variable),
369 * Report Count (1),
370 * Input (Constant, Variable),
371 * Usage Page (Desktop), ; Generic desktop controls (01h)
372 * Usage (X), ; X (30h, dynamic value)
373 * Report Size (16),
374 * Report Count (1),
375 * Push,
376 * Unit Exponent (13),
377 * Unit (Inch),
378 * Physical Minimum (0),
379 * Physical Maximum (10000),
380 * Logical Maximum (20000),
381 * Input (Variable),
382 * Usage (Y), ; Y (31h, dynamic value)
383 * Physical Maximum (6583),
384 * Logical Maximum (13166),
385 * Input (Variable),
386 * Pop,
387 * Usage Page (Digitizer), ; Digitizer (0Dh)
388 * Usage (Tip Pressure), ; Tip pressure (30h, dynamic value)
389 * Logical Maximum (1023),
390 * Input (Variable),
391 * Report Size (16),
392 * End Collection,
393 * End Collection,
394 * Usage Page (Desktop), ; Generic desktop controls (01h)
395 * Usage (Mouse), ; Mouse (02h, application collection)
396 * Collection (Application),
397 * Report ID (8),
398 * Usage (Pointer), ; Pointer (01h, physical collection)
399 * Collection (Physical),
400 * Usage Page (Button), ; Button (09h)
401 * Usage Minimum (01h),
402 * Usage Maximum (03h),
403 * Logical Minimum (0),
404 * Logical Maximum (1),
405 * Report Count (3),
406 * Report Size (1),
407 * Input (Variable),
408 * Report Count (5),
409 * Input (Constant),
410 * Usage Page (Desktop), ; Generic desktop controls (01h)
411 * Usage (X), ; X (30h, dynamic value)
412 * Usage (Y), ; Y (31h, dynamic value)
413 * Usage (Wheel), ; Wheel (38h, dynamic value)
414 * Usage (00h),
415 * Logical Minimum (-127),
416 * Logical Maximum (127),
417 * Report Size (8),
418 * Report Count (4),
419 * Input (Variable, Relative),
420 * End Collection,
421 * End Collection,
422 * Usage Page (Desktop), ; Generic desktop controls (01h)
423 * Usage (Mouse), ; Mouse (02h, application collection)
424 * Collection (Application),
425 * Report ID (9),
426 * Usage (Pointer), ; Pointer (01h, physical collection)
427 * Collection (Physical),
428 * Usage Page (Button), ; Button (09h)
429 * Usage Minimum (01h),
430 * Usage Maximum (03h),
431 * Logical Minimum (0),
432 * Logical Maximum (1),
433 * Report Count (3),
434 * Report Size (1),
435 * Input (Variable),
436 * Report Count (4),
437 * Input (Constant),
438 * Usage Page (Digitizer), ; Digitizer (0Dh)
439 * Usage (In Range), ; In range (32h, momentary control)
440 * Report Count (1),
441 * Input (Variable),
442 * Usage Page (Desktop), ; Generic desktop controls (01h)
443 * Usage (X), ; X (30h, dynamic value)
444 * Report Size (16),
445 * Report Count (1),
446 * Push,
447 * Unit Exponent (13),
448 * Unit (Inch),
449 * Physical Minimum (0),
450 * Physical Maximum (10000),
451 * Logical Maximum (20000),
452 * Input (Variable),
453 * Usage (Y), ; Y (31h, dynamic value)
454 * Physical Maximum (6583),
455 * Logical Maximum (13166),
456 * Input (Variable),
457 * Pop,
458 * Usage Page (Digitizer), ; Digitizer (0Dh)
459 * Usage (Tip Pressure), ; Tip pressure (30h, dynamic value)
460 * Logical Maximum (1023),
461 * Report Count (1),
462 * Report Size (16),
463 * Input (Variable),
464 * End Collection,
465 * End Collection,
466 * Usage Page (Desktop), ; Generic desktop controls (01h)
467 * Usage (00h),
468 * Collection (Application),
469 * Report ID (4),
470 * Logical Minimum (0),
471 * Logical Maximum (255),
472 * Usage (00h),
473 * Report Size (8),
474 * Report Count (3),
475 * Feature (Variable),
476 * End Collection
477 */ 223 */
478 224
479/* Size of the original descriptor of WP1062 tablet */ 225/* Size of the original descriptor of WP1062 tablet */
480#define WP1062_RDESC_ORIG_SIZE 254 226#define WP1062_RDESC_ORIG_SIZE 254
481 227
482/* 228/* Fixed WP1062 report descriptor */
483 * Fixed WP1062 report descriptor.
484 *
485 * Removed unused reports, corrected second barrel button usage code, physical
486 * units.
487 */
488static __u8 wp1062_rdesc_fixed[] = { 229static __u8 wp1062_rdesc_fixed[] = {
489 0x05, 0x0D, /* Usage Page (Digitizer), */ 230 0x05, 0x0D, /* Usage Page (Digitizer), */
490 0x09, 0x02, /* Usage (Pen), */ 231 0x09, 0x02, /* Usage (Pen), */
@@ -530,146 +271,14 @@ static __u8 wp1062_rdesc_fixed[] = {
530}; 271};
531 272
532/* 273/*
533 * Original PF1209 report descriptor. 274 * See PF1209 description, device and HID report descriptors at
534 * 275 * http://sf.net/apps/mediawiki/digimend/?title=UC-Logic_Tablet_PF1209
535 * The descriptor is similar to WPXXXXU descriptors, with an addition of a
536 * feature report (ID 4) of unknown purpose.
537 *
538 * Although the advertised resolution is 4000 LPI the unused report ID
539 * (taken from WPXXXXU, it seems) states 2000 LPI, but it is probably
540 * incorrect and is a result of blind copying without understanding. Anyway
541 * the real logical extents are always scaled to 0..32767, which IMHO spoils
542 * the precision.
543 *
544 * Usage Page (Digitizer), ; Digitizer (0Dh)
545 * Usage (Pen), ; Pen (02h, application collection)
546 * Collection (Application),
547 * Report ID (7),
548 * Usage (Stylus), ; Stylus (20h, logical collection)
549 * Collection (Physical),
550 * Usage (Tip Switch), ; Tip switch (42h, momentary control)
551 * Usage (Barrel Switch), ; Barrel switch (44h, momentary control)
552 * Usage (Eraser), ; Eraser (45h, momentary control)
553 * Logical Minimum (0),
554 * Logical Maximum (1),
555 * Report Size (1),
556 * Report Count (3),
557 * Input (Variable),
558 * Report Count (3),
559 * Input (Constant, Variable),
560 * Usage (In Range), ; In range (32h, momentary control)
561 * Report Count (1),
562 * Input (Variable),
563 * Report Count (1),
564 * Input (Constant, Variable),
565 * Usage Page (Desktop), ; Generic desktop controls (01h)
566 * Usage (X), ; X (30h, dynamic value)
567 * Report Size (16),
568 * Report Count (1),
569 * Push,
570 * Unit Exponent (13),
571 * Unit (Inch^3),
572 * Physical Minimum (0),
573 * Physical Maximum (12000),
574 * Logical Maximum (24000),
575 * Input (Variable),
576 * Usage (Y), ; Y (31h, dynamic value)
577 * Physical Maximum (9000),
578 * Logical Maximum (18000),
579 * Input (Variable),
580 * Pop,
581 * Usage Page (Digitizer), ; Digitizer (0Dh)
582 * Usage (Tip Pressure), ; Tip pressure (30h, dynamic value)
583 * Logical Maximum (1023),
584 * Input (Variable),
585 * Report Size (16),
586 * End Collection,
587 * End Collection,
588 * Usage Page (Desktop), ; Generic desktop controls (01h)
589 * Usage (Mouse), ; Mouse (02h, application collection)
590 * Collection (Application),
591 * Report ID (8),
592 * Usage (Pointer), ; Pointer (01h, physical collection)
593 * Collection (Physical),
594 * Usage Page (Button), ; Button (09h)
595 * Usage Minimum (01h),
596 * Usage Maximum (03h),
597 * Logical Minimum (0),
598 * Logical Maximum (1),
599 * Report Count (3),
600 * Report Size (1),
601 * Input (Variable),
602 * Report Count (5),
603 * Input (Constant),
604 * Usage Page (Desktop), ; Generic desktop controls (01h)
605 * Usage (X), ; X (30h, dynamic value)
606 * Usage (Y), ; Y (31h, dynamic value)
607 * Usage (Wheel), ; Wheel (38h, dynamic value)
608 * Usage (00h),
609 * Logical Minimum (-127),
610 * Logical Maximum (127),
611 * Report Size (8),
612 * Report Count (4),
613 * Input (Variable, Relative),
614 * End Collection,
615 * End Collection,
616 * Usage Page (Desktop), ; Generic desktop controls (01h)
617 * Usage (Mouse), ; Mouse (02h, application collection)
618 * Collection (Application),
619 * Report ID (9),
620 * Usage (Pointer), ; Pointer (01h, physical collection)
621 * Collection (Physical),
622 * Usage Page (Button), ; Button (09h)
623 * Usage Minimum (01h),
624 * Usage Maximum (03h),
625 * Logical Minimum (0),
626 * Logical Maximum (1),
627 * Report Count (3),
628 * Report Size (1),
629 * Input (Variable),
630 * Report Count (5),
631 * Input (Constant),
632 * Usage Page (Desktop), ; Generic desktop controls (01h)
633 * Usage (X), ; X (30h, dynamic value)
634 * Usage (Y), ; Y (31h, dynamic value)
635 * Logical Minimum (0),
636 * Logical Maximum (32767),
637 * Physical Minimum (0),
638 * Physical Maximum (32767),
639 * Report Count (2),
640 * Report Size (16),
641 * Input (Variable),
642 * Usage Page (Digitizer), ; Digitizer (0Dh)
643 * Usage (Tip Pressure), ; Tip pressure (30h, dynamic value)
644 * Logical Maximum (1023),
645 * Report Count (1),
646 * Report Size (16),
647 * Input (Variable),
648 * End Collection,
649 * End Collection,
650 * Usage Page (Desktop), ; Generic desktop controls (01h)
651 * Usage (00h),
652 * Collection (Application),
653 * Report ID (4),
654 * Logical Minimum (0),
655 * Logical Maximum (255),
656 * Usage (00h),
657 * Report Size (8),
658 * Report Count (3),
659 * Feature (Variable),
660 * End Collection
661 */ 276 */
662 277
663/* Size of the original descriptor of PF1209 tablet */ 278/* Size of the original descriptor of PF1209 tablet */
664#define PF1209_RDESC_ORIG_SIZE 234 279#define PF1209_RDESC_ORIG_SIZE 234
665 280
666/* 281/* Fixed PF1209 report descriptor */
667 * Fixed PF1209 report descriptor
668 *
669 * The descriptor is fixed similarly to WP5540U and WP8060U, plus the
670 * feature report is removed, because its purpose is unknown and it is of no
671 * use to the generic HID driver anyway for now.
672 */
673static __u8 pf1209_rdesc_fixed[] = { 282static __u8 pf1209_rdesc_fixed[] = {
674 0x05, 0x0D, /* Usage Page (Digitizer), */ 283 0x05, 0x0D, /* Usage Page (Digitizer), */
675 0x09, 0x02, /* Usage (Pen), */ 284 0x09, 0x02, /* Usage (Pen), */
diff --git a/drivers/hid/hid-wacom.c b/drivers/hid/hid-wacom.c
index 694545d5bfea..067e2963314c 100644
--- a/drivers/hid/hid-wacom.c
+++ b/drivers/hid/hid-wacom.c
@@ -590,6 +590,7 @@ static int wacom_probe(struct hid_device *hdev,
590 wacom_poke(hdev, 1); 590 wacom_poke(hdev, 1);
591 break; 591 break;
592 case USB_DEVICE_ID_WACOM_INTUOS4_BLUETOOTH: 592 case USB_DEVICE_ID_WACOM_INTUOS4_BLUETOOTH:
593 sprintf(hdev->name, "%s", "Wacom Intuos4 WL");
593 wdata->features = 0; 594 wdata->features = 0;
594 wacom_set_features(hdev); 595 wacom_set_features(hdev);
595 break; 596 break;
diff --git a/drivers/hid/hid-waltop.c b/drivers/hid/hid-waltop.c
index b3a4163f2e67..2cfd95c4467b 100644
--- a/drivers/hid/hid-waltop.c
+++ b/drivers/hid/hid-waltop.c
@@ -43,139 +43,14 @@
43 */ 43 */
44 44
45/* 45/*
46 * Original Slim Tablet 5.8 inch report descriptor. 46 * See Slim Tablet 5.8 inch description, device and HID report descriptors at
47 * 47 * http://sf.net/apps/mediawiki/digimend/?title=Waltop_Slim_Tablet_5.8%22
48 * All the reports except the report with ID 16 (the stylus) are unused,
49 * possibly because the tablet is not configured to, or because they were
50 * just copied from a more capable model. The full purpose of features
51 * described for report ID 2 is unknown.
52 *
53 * The stylus buttons are described as three bit fields, whereas actually
54 * it's an "array", i.e. they're reported as button numbers (1, 2 and 3).
55 * The "eraser" field is not used. There is also a "push" without a "pop" in
56 * the stylus description.
57 *
58 * Usage Page (Desktop), ; Generic desktop controls (01h)
59 * Usage (Mouse), ; Mouse (02h, application collection)
60 * Collection (Application),
61 * Report ID (1),
62 * Usage (Pointer), ; Pointer (01h, physical collection)
63 * Collection (Physical),
64 * Usage Page (Button), ; Button (09h)
65 * Usage Minimum (01h),
66 * Usage Maximum (05h),
67 * Logical Minimum (0),
68 * Logical Maximum (1),
69 * Report Size (1),
70 * Report Count (5),
71 * Input (Variable),
72 * Report Size (3),
73 * Report Count (1),
74 * Input (Constant, Variable),
75 * Usage Page (Desktop), ; Generic desktop controls (01h)
76 * Usage (X), ; X (30h, dynamic value)
77 * Usage (Y), ; Y (31h, dynamic value)
78 * Usage (Wheel), ; Wheel (38h, dynamic value)
79 * Logical Minimum (-127),
80 * Logical Maximum (127),
81 * Report Size (8),
82 * Report Count (3),
83 * Input (Variable, Relative),
84 * End Collection,
85 * End Collection,
86 * Usage Page (Digitizer), ; Digitizer (0Dh)
87 * Usage (Pen), ; Pen (02h, application collection)
88 * Collection (Application),
89 * Report ID (2),
90 * Usage (Stylus), ; Stylus (20h, logical collection)
91 * Collection (Physical),
92 * Usage (00h),
93 * Logical Minimum (0),
94 * Logical Maximum (255),
95 * Report Size (8),
96 * Report Count (7),
97 * Input (Variable),
98 * Usage (Azimuth), ; Azimuth (3Fh, dynamic value)
99 * Usage (Altitude), ; Altitude (40h, dynamic value)
100 * Logical Minimum (0),
101 * Logical Maximum (255),
102 * Report Size (8),
103 * Report Count (2),
104 * Feature (Variable),
105 * End Collection,
106 * Report ID (5),
107 * Usage Page (Digitizer), ; Digitizer (0Dh)
108 * Usage (Stylus), ; Stylus (20h, logical collection)
109 * Collection (Physical),
110 * Usage (00h),
111 * Logical Minimum (0),
112 * Logical Maximum (255),
113 * Report Size (8),
114 * Report Count (7),
115 * Input (Variable),
116 * End Collection,
117 * Report ID (10),
118 * Usage Page (Digitizer), ; Digitizer (0Dh)
119 * Usage (Stylus), ; Stylus (20h, logical collection)
120 * Collection (Physical),
121 * Usage (00h),
122 * Logical Minimum (0),
123 * Logical Maximum (255),
124 * Report Size (8),
125 * Report Count (3),
126 * Input (Variable),
127 * End Collection,
128 * Report ID (16),
129 * Usage (Stylus), ; Stylus (20h, logical collection)
130 * Collection (Physical),
131 * Usage (Tip Switch), ; Tip switch (42h, momentary control)
132 * Usage (Barrel Switch), ; Barrel switch (44h, momentary control)
133 * Usage (Invert), ; Invert (3Ch, momentary control)
134 * Usage (Eraser), ; Eraser (45h, momentary control)
135 * Usage (In Range), ; In range (32h, momentary control)
136 * Logical Minimum (0),
137 * Logical Maximum (1),
138 * Report Size (1),
139 * Report Count (5),
140 * Input (Variable),
141 * Report Count (3),
142 * Input (Constant, Variable),
143 * Usage Page (Desktop), ; Generic desktop controls (01h)
144 * Usage (X), ; X (30h, dynamic value)
145 * Report Size (16),
146 * Report Count (1),
147 * Push,
148 * Unit Exponent (13),
149 * Unit (Inch^3),
150 * Logical Minimum (0),
151 * Logical Maximum (10000),
152 * Physical Minimum (0),
153 * Physical Maximum (10000),
154 * Input (Variable),
155 * Usage (Y), ; Y (31h, dynamic value)
156 * Logical Maximum (6000),
157 * Physical Maximum (6000),
158 * Input (Variable),
159 * Usage Page (Digitizer), ; Digitizer (0Dh)
160 * Usage (Tip Pressure), ; Tip pressure (30h, dynamic value)
161 * Logical Minimum (0),
162 * Logical Maximum (1023),
163 * Physical Minimum (0),
164 * Physical Maximum (1023),
165 * Input (Variable),
166 * End Collection,
167 * End Collection
168 */ 48 */
169 49
170/* Size of the original report descriptor of Slim Tablet 5.8 inch */ 50/* Size of the original report descriptor of Slim Tablet 5.8 inch */
171#define SLIM_TABLET_5_8_INCH_RDESC_ORIG_SIZE 222 51#define SLIM_TABLET_5_8_INCH_RDESC_ORIG_SIZE 222
172 52
173/* 53/* Fixed Slim Tablet 5.8 inch descriptor */
174 * Fixed Slim Tablet 5.8 inch descriptor.
175 *
176 * All the reports except the stylus report (ID 16) were removed as unused.
177 * The stylus buttons description was fixed.
178 */
179static __u8 slim_tablet_5_8_inch_rdesc_fixed[] = { 54static __u8 slim_tablet_5_8_inch_rdesc_fixed[] = {
180 0x05, 0x0D, /* Usage Page (Digitizer), */ 55 0x05, 0x0D, /* Usage Page (Digitizer), */
181 0x09, 0x02, /* Usage (Pen), */ 56 0x09, 0x02, /* Usage (Pen), */
@@ -224,158 +99,14 @@ static __u8 slim_tablet_5_8_inch_rdesc_fixed[] = {
224}; 99};
225 100
226/* 101/*
227 * Original Slim Tablet 12.1 inch report descriptor. 102 * See Slim Tablet 12.1 inch description, device and HID report descriptors at
228 * 103 * http://sf.net/apps/mediawiki/digimend/?title=Waltop_Slim_Tablet_12.1%22
229 * The descriptor is similar to the Slim Tablet 5.8 inch descriptor with the
230 * addition of a keyboard report, seemingly unused. It may have get here
231 * from a Media Tablet - probably an unimplemented feature.
232 *
233 * Usage Page (Desktop), ; Generic desktop controls (01h)
234 * Usage (Mouse), ; Mouse (02h, application collection)
235 * Collection (Application),
236 * Report ID (1),
237 * Usage (Pointer), ; Pointer (01h, physical collection)
238 * Collection (Physical),
239 * Usage Page (Button), ; Button (09h)
240 * Usage Minimum (01h),
241 * Usage Maximum (05h),
242 * Logical Minimum (0),
243 * Logical Maximum (1),
244 * Report Size (1),
245 * Report Count (5),
246 * Input (Variable),
247 * Report Size (3),
248 * Report Count (1),
249 * Input (Constant, Variable),
250 * Usage Page (Desktop), ; Generic desktop controls (01h)
251 * Usage (X), ; X (30h, dynamic value)
252 * Usage (Y), ; Y (31h, dynamic value)
253 * Usage (Wheel), ; Wheel (38h, dynamic value)
254 * Logical Minimum (-127),
255 * Logical Maximum (127),
256 * Report Size (8),
257 * Report Count (3),
258 * Input (Variable, Relative),
259 * End Collection,
260 * End Collection,
261 * Usage Page (Digitizer), ; Digitizer (0Dh)
262 * Usage (Pen), ; Pen (02h, application collection)
263 * Collection (Application),
264 * Report ID (2),
265 * Usage (Stylus), ; Stylus (20h, logical collection)
266 * Collection (Physical),
267 * Usage (00h),
268 * Logical Minimum (0),
269 * Logical Maximum (255),
270 * Report Size (8),
271 * Report Count (7),
272 * Input (Variable),
273 * Usage (Azimuth), ; Azimuth (3Fh, dynamic value)
274 * Usage (Altitude), ; Altitude (40h, dynamic value)
275 * Logical Minimum (0),
276 * Logical Maximum (255),
277 * Report Size (8),
278 * Report Count (2),
279 * Feature (Variable),
280 * End Collection,
281 * Report ID (5),
282 * Usage Page (Digitizer), ; Digitizer (0Dh)
283 * Usage (Stylus), ; Stylus (20h, logical collection)
284 * Collection (Physical),
285 * Usage (00h),
286 * Logical Minimum (0),
287 * Logical Maximum (255),
288 * Report Size (8),
289 * Report Count (7),
290 * Input (Variable),
291 * End Collection,
292 * Report ID (10),
293 * Usage Page (Digitizer), ; Digitizer (0Dh)
294 * Usage (Stylus), ; Stylus (20h, logical collection)
295 * Collection (Physical),
296 * Usage (00h),
297 * Logical Minimum (0),
298 * Logical Maximum (255),
299 * Report Size (8),
300 * Report Count (3),
301 * Input (Variable),
302 * End Collection,
303 * Report ID (16),
304 * Usage (Stylus), ; Stylus (20h, logical collection)
305 * Collection (Physical),
306 * Usage (Tip Switch), ; Tip switch (42h, momentary control)
307 * Usage (Barrel Switch), ; Barrel switch (44h, momentary control)
308 * Usage (Invert), ; Invert (3Ch, momentary control)
309 * Usage (Eraser), ; Eraser (45h, momentary control)
310 * Usage (In Range), ; In range (32h, momentary control)
311 * Logical Minimum (0),
312 * Logical Maximum (1),
313 * Report Size (1),
314 * Report Count (5),
315 * Input (Variable),
316 * Report Count (3),
317 * Input (Constant, Variable),
318 * Usage Page (Desktop), ; Generic desktop controls (01h)
319 * Usage (X), ; X (30h, dynamic value)
320 * Report Size (16),
321 * Report Count (1),
322 * Push,
323 * Unit Exponent (13),
324 * Unit (Inch^3),
325 * Logical Minimum (0),
326 * Logical Maximum (20000),
327 * Physical Minimum (0),
328 * Physical Maximum (20000),
329 * Input (Variable),
330 * Usage (Y), ; Y (31h, dynamic value)
331 * Logical Maximum (12500),
332 * Physical Maximum (12500),
333 * Input (Variable),
334 * Usage Page (Digitizer), ; Digitizer (0Dh)
335 * Usage (Tip Pressure), ; Tip pressure (30h, dynamic value)
336 * Logical Minimum (0),
337 * Logical Maximum (1023),
338 * Physical Minimum (0),
339 * Physical Maximum (1023),
340 * Input (Variable),
341 * End Collection,
342 * End Collection,
343 * Usage Page (Desktop), ; Generic desktop controls (01h)
344 * Usage (Keyboard), ; Keyboard (06h, application collection)
345 * Collection (Application),
346 * Report ID (13),
347 * Usage Page (Keyboard), ; Keyboard/keypad (07h)
348 * Usage Minimum (KB Leftcontrol), ; Keyboard left control
349 * ; (E0h, dynamic value)
350 * Usage Maximum (KB Right GUI), ; Keyboard right GUI (E7h, dynamic value)
351 * Logical Minimum (0),
352 * Logical Maximum (1),
353 * Report Size (1),
354 * Report Count (8),
355 * Input (Variable),
356 * Report Size (8),
357 * Report Count (1),
358 * Input (Constant),
359 * Usage Page (Keyboard), ; Keyboard/keypad (07h)
360 * Usage Minimum (None), ; No event (00h, selector)
361 * Usage Maximum (KB Application), ; Keyboard Application (65h, selector)
362 * Logical Minimum (0),
363 * Logical Maximum (101),
364 * Report Size (8),
365 * Report Count (5),
366 * Input,
367 * End Collection
368 */ 104 */
369 105
370/* Size of the original report descriptor of Slim Tablet 12.1 inch */ 106/* Size of the original report descriptor of Slim Tablet 12.1 inch */
371#define SLIM_TABLET_12_1_INCH_RDESC_ORIG_SIZE 269 107#define SLIM_TABLET_12_1_INCH_RDESC_ORIG_SIZE 269
372 108
373/* 109/* Fixed Slim Tablet 12.1 inch descriptor */
374 * Fixed Slim Tablet 12.1 inch descriptor.
375 *
376 * All the reports except the stylus report (ID 16) were removed as unused.
377 * The stylus buttons description was fixed.
378 */
379static __u8 slim_tablet_12_1_inch_rdesc_fixed[] = { 110static __u8 slim_tablet_12_1_inch_rdesc_fixed[] = {
380 0x05, 0x0D, /* Usage Page (Digitizer), */ 111 0x05, 0x0D, /* Usage Page (Digitizer), */
381 0x09, 0x02, /* Usage (Pen), */ 112 0x09, 0x02, /* Usage (Pen), */
@@ -424,217 +155,128 @@ static __u8 slim_tablet_12_1_inch_rdesc_fixed[] = {
424}; 155};
425 156
426/* 157/*
427 * Original Media Tablet 10.6 inch report descriptor. 158 * See Q Pad description, device and HID report descriptors at
428 * 159 * http://sf.net/apps/mediawiki/digimend/?title=Waltop_Q_Pad
429 * There are at least two versions of this model in the wild. They are
430 * represented by Genius G-Pen M609 (older version) and Genius G-Pen M609X
431 * (newer version).
432 *
433 * Both versions have the usual pen with two barrel buttons and two
434 * identical wheels with center buttons in the top corners of the tablet
435 * base. They also have buttons on the top, between the wheels, for
436 * selecting the wheels' functions and wide/standard mode. In the wide mode
437 * the whole working surface is sensed, in the standard mode a narrower area
438 * is sensed, but the logical report extents remain the same. These modes
439 * correspond roughly to 16:9 and 4:3 aspect ratios respectively.
440 *
441 * The older version has three wheel function buttons ("scroll", "zoom" and
442 * "volume") and two separate buttons for wide and standard mode. The newer
443 * version has four wheel function buttons (plus "brush") and only one
444 * button is used for selecting wide/standard mode. So, the total number of
445 * buttons remains the same, but one of the mode buttons is repurposed as a
446 * wheels' function button in the newer version.
447 *
448 * The wheel functions are:
449 * scroll - the wheels act as scroll wheels, the center buttons switch
450 * between vertical and horizontal scrolling;
451 * zoom - the wheels zoom in/out, the buttons supposedly reset to 100%;
452 * volume - the wheels control the sound volume, the buttons mute;
453 * brush - the wheels are supposed to control brush width in a graphics
454 * editor, the buttons do nothing.
455 *
456 * Below is the newer version's report descriptor. It may very well be that
457 * the older version's descriptor is different and thus it won't be
458 * supported.
459 *
460 * The mouse report (ID 1) only uses the wheel field for reporting the tablet
461 * wheels' scroll mode. The keyboard report (ID 13) is used to report the
462 * wheels' zoom and brush control functions as key presses. The report ID 12
463 * is used to report the wheels' volume control functions. The stylus report
464 * (ID 16) has the same problems as the Slim Tablet 5.8 inch report has.
465 *
466 * The rest of the reports are unused, at least in the default configuration.
467 * The purpose of the features is unknown.
468 *
469 * Usage Page (Desktop),
470 * Usage (Mouse),
471 * Collection (Application),
472 * Report ID (1),
473 * Usage (Pointer),
474 * Collection (Physical),
475 * Usage Page (Button),
476 * Usage Minimum (01h),
477 * Usage Maximum (05h),
478 * Logical Minimum (0),
479 * Logical Maximum (1),
480 * Report Size (1),
481 * Report Count (5),
482 * Input (Variable),
483 * Report Size (3),
484 * Report Count (1),
485 * Input (Constant, Variable),
486 * Usage Page (Desktop),
487 * Usage (X),
488 * Usage (Y),
489 * Usage (Wheel),
490 * Logical Minimum (-127),
491 * Logical Maximum (127),
492 * Report Size (8),
493 * Report Count (3),
494 * Input (Variable, Relative),
495 * End Collection,
496 * End Collection,
497 * Usage Page (Digitizer),
498 * Usage (Pen),
499 * Collection (Application),
500 * Report ID (2),
501 * Usage (Stylus),
502 * Collection (Physical),
503 * Usage (00h),
504 * Logical Minimum (0),
505 * Logical Maximum (255),
506 * Report Size (8),
507 * Report Count (7),
508 * Input (Variable),
509 * Usage (Azimuth),
510 * Usage (Altitude),
511 * Logical Minimum (0),
512 * Logical Maximum (255),
513 * Report Size (8),
514 * Report Count (2),
515 * Feature (Variable),
516 * End Collection,
517 * Report ID (5),
518 * Usage Page (Digitizer),
519 * Usage (Stylus),
520 * Collection (Physical),
521 * Usage (00h),
522 * Logical Minimum (0),
523 * Logical Maximum (255),
524 * Report Size (8),
525 * Report Count (7),
526 * Input (Variable),
527 * End Collection,
528 * Report ID (10),
529 * Usage Page (Digitizer),
530 * Usage (Stylus),
531 * Collection (Physical),
532 * Usage (00h),
533 * Logical Minimum (0),
534 * Logical Maximum (255),
535 * Report Size (8),
536 * Report Count (7),
537 * Input (Variable),
538 * End Collection,
539 * Report ID (16),
540 * Usage (Stylus),
541 * Collection (Physical),
542 * Usage (Tip Switch),
543 * Usage (Barrel Switch),
544 * Usage (Invert),
545 * Usage (Eraser),
546 * Usage (In Range),
547 * Logical Minimum (0),
548 * Logical Maximum (1),
549 * Report Size (1),
550 * Report Count (5),
551 * Input (Variable),
552 * Report Count (3),
553 * Input (Constant, Variable),
554 * Usage Page (Desktop),
555 * Usage (X),
556 * Report Size (16),
557 * Report Count (1),
558 * Push,
559 * Unit Exponent (13),
560 * Unit (Inch^3),
561 * Logical Minimum (0),
562 * Logical Maximum (18000),
563 * Physical Minimum (0),
564 * Physical Maximum (18000),
565 * Input (Variable),
566 * Usage (Y),
567 * Logical Maximum (11000),
568 * Physical Maximum (11000),
569 * Input (Variable),
570 * Usage Page (Digitizer),
571 * Usage (Tip Pressure),
572 * Logical Minimum (0),
573 * Logical Maximum (1023),
574 * Physical Minimum (0),
575 * Physical Maximum (1023),
576 * Input (Variable),
577 * End Collection,
578 * End Collection,
579 * Usage Page (Desktop),
580 * Usage (Keyboard),
581 * Collection (Application),
582 * Report ID (13),
583 * Usage Page (Keyboard),
584 * Usage Minimum (KB Leftcontrol),
585 * Usage Maximum (KB Right GUI),
586 * Logical Minimum (0),
587 * Logical Maximum (1),
588 * Report Size (1),
589 * Report Count (8),
590 * Input (Variable),
591 * Report Size (8),
592 * Report Count (1),
593 * Input (Constant),
594 * Usage Page (Keyboard),
595 * Usage Minimum (None),
596 * Usage Maximum (KB Application),
597 * Logical Minimum (0),
598 * Logical Maximum (101),
599 * Report Size (8),
600 * Report Count (5),
601 * Input,
602 * End Collection,
603 * Usage Page (Consumer),
604 * Usage (Consumer Control),
605 * Collection (Application),
606 * Report ID (12),
607 * Usage (Volume Inc),
608 * Usage (Volume Dec),
609 * Usage (Mute),
610 * Logical Minimum (0),
611 * Logical Maximum (1),
612 * Report Size (1),
613 * Report Count (3),
614 * Input (Variable, Relative),
615 * Report Size (5),
616 * Report Count (1),
617 * Input (Constant, Variable, Relative),
618 * End Collection
619 */ 160 */
620 161
621/* Size of the original report descriptor of Media Tablet 10.6 inch */ 162/* Size of the original report descriptor of Q Pad */
622#define MEDIA_TABLET_10_6_INCH_RDESC_ORIG_SIZE 300 163#define Q_PAD_RDESC_ORIG_SIZE 241
164
165/* Fixed Q Pad descriptor */
166static __u8 q_pad_rdesc_fixed[] = {
167 0x05, 0x0D, /* Usage Page (Digitizer), */
168 0x09, 0x02, /* Usage (Pen), */
169 0xA1, 0x01, /* Collection (Application), */
170 0x85, 0x10, /* Report ID (16), */
171 0x09, 0x20, /* Usage (Stylus), */
172 0xA0, /* Collection (Physical), */
173 0x09, 0x42, /* Usage (Tip Switch), */
174 0x09, 0x44, /* Usage (Barrel Switch), */
175 0x09, 0x46, /* Usage (Tablet Pick), */
176 0x15, 0x01, /* Logical Minimum (1), */
177 0x25, 0x03, /* Logical Maximum (3), */
178 0x75, 0x04, /* Report Size (4), */
179 0x95, 0x01, /* Report Count (1), */
180 0x80, /* Input, */
181 0x09, 0x32, /* Usage (In Range), */
182 0x14, /* Logical Minimum (0), */
183 0x25, 0x01, /* Logical Maximum (1), */
184 0x75, 0x01, /* Report Size (1), */
185 0x95, 0x01, /* Report Count (1), */
186 0x81, 0x02, /* Input (Variable), */
187 0x95, 0x03, /* Report Count (3), */
188 0x81, 0x03, /* Input (Constant, Variable), */
189 0x75, 0x10, /* Report Size (16), */
190 0x95, 0x01, /* Report Count (1), */
191 0x14, /* Logical Minimum (0), */
192 0xA4, /* Push, */
193 0x05, 0x01, /* Usage Page (Desktop), */
194 0x65, 0x13, /* Unit (Inch), */
195 0x55, 0xFD, /* Unit Exponent (-3), */
196 0x34, /* Physical Minimum (0), */
197 0x09, 0x30, /* Usage (X), */
198 0x46, 0x70, 0x17, /* Physical Maximum (6000), */
199 0x26, 0x00, 0x30, /* Logical Maximum (12288), */
200 0x81, 0x02, /* Input (Variable), */
201 0x09, 0x31, /* Usage (Y), */
202 0x46, 0x94, 0x11, /* Physical Maximum (4500), */
203 0x26, 0x00, 0x24, /* Logical Maximum (9216), */
204 0x81, 0x02, /* Input (Variable), */
205 0xB4, /* Pop, */
206 0x09, 0x30, /* Usage (Tip Pressure), */
207 0x26, 0xFF, 0x03, /* Logical Maximum (1023), */
208 0x81, 0x02, /* Input (Variable), */
209 0xC0, /* End Collection, */
210 0xC0 /* End Collection */
211};
623 212
624/* 213/*
625 * Fixed Media Tablet 10.6 inch descriptor. 214 * See description, device and HID report descriptors of tablet with PID 0038 at
626 * 215 * http://sf.net/apps/mediawiki/digimend/?title=Waltop_PID_0038
627 * The descriptions of reports unused in the default configuration are 216 */
628 * removed. The stylus report (ID 16) is fixed similarly to Slim Tablet 5.8 217
629 * inch. The unused mouse report (ID 1) fields are replaced with constant 218/* Size of the original report descriptor of tablet with PID 0038 */
630 * padding. 219#define PID_0038_RDESC_ORIG_SIZE 241
631 * 220
632 * The keyboard report (ID 13) is hacked to instead have an "array" field 221/*
633 * reporting consumer page controls, and all the unused bits are masked out 222 * Fixed report descriptor for tablet with PID 0038.
634 * with constant padding. The "brush" wheels' function is represented as "Scan 223 */
635 * Previous/Next Track" controls due to the lack of brush controls in the 224static __u8 pid_0038_rdesc_fixed[] = {
636 * usage tables specification. 225 0x05, 0x0D, /* Usage Page (Digitizer), */
226 0x09, 0x02, /* Usage (Pen), */
227 0xA1, 0x01, /* Collection (Application), */
228 0x85, 0x10, /* Report ID (16), */
229 0x09, 0x20, /* Usage (Stylus), */
230 0xA0, /* Collection (Physical), */
231 0x09, 0x42, /* Usage (Tip Switch), */
232 0x09, 0x44, /* Usage (Barrel Switch), */
233 0x09, 0x46, /* Usage (Tablet Pick), */
234 0x15, 0x01, /* Logical Minimum (1), */
235 0x25, 0x03, /* Logical Maximum (3), */
236 0x75, 0x04, /* Report Size (4), */
237 0x95, 0x01, /* Report Count (1), */
238 0x80, /* Input, */
239 0x09, 0x32, /* Usage (In Range), */
240 0x14, /* Logical Minimum (0), */
241 0x25, 0x01, /* Logical Maximum (1), */
242 0x75, 0x01, /* Report Size (1), */
243 0x95, 0x01, /* Report Count (1), */
244 0x81, 0x02, /* Input (Variable), */
245 0x95, 0x03, /* Report Count (3), */
246 0x81, 0x03, /* Input (Constant, Variable), */
247 0x75, 0x10, /* Report Size (16), */
248 0x95, 0x01, /* Report Count (1), */
249 0x14, /* Logical Minimum (0), */
250 0xA4, /* Push, */
251 0x05, 0x01, /* Usage Page (Desktop), */
252 0x65, 0x13, /* Unit (Inch), */
253 0x55, 0xFD, /* Unit Exponent (-3), */
254 0x34, /* Physical Minimum (0), */
255 0x09, 0x30, /* Usage (X), */
256 0x46, 0x2E, 0x22, /* Physical Maximum (8750), */
257 0x26, 0x00, 0x46, /* Logical Maximum (17920), */
258 0x81, 0x02, /* Input (Variable), */
259 0x09, 0x31, /* Usage (Y), */
260 0x46, 0x82, 0x14, /* Physical Maximum (5250), */
261 0x26, 0x00, 0x2A, /* Logical Maximum (10752), */
262 0x81, 0x02, /* Input (Variable), */
263 0xB4, /* Pop, */
264 0x09, 0x30, /* Usage (Tip Pressure), */
265 0x26, 0xFF, 0x03, /* Logical Maximum (1023), */
266 0x81, 0x02, /* Input (Variable), */
267 0xC0, /* End Collection, */
268 0xC0 /* End Collection */
269};
270
271/*
272 * See Media Tablet 10.6 inch description, device and HID report descriptors at
273 * http://sf.net/apps/mediawiki/digimend/?title=Waltop_Media_Tablet_10.6%22
637 */ 274 */
275
276/* Size of the original report descriptor of Media Tablet 10.6 inch */
277#define MEDIA_TABLET_10_6_INCH_RDESC_ORIG_SIZE 300
278
279/* Fixed Media Tablet 10.6 inch descriptor */
638static __u8 media_tablet_10_6_inch_rdesc_fixed[] = { 280static __u8 media_tablet_10_6_inch_rdesc_fixed[] = {
639 0x05, 0x0D, /* Usage Page (Digitizer), */ 281 0x05, 0x0D, /* Usage Page (Digitizer), */
640 0x09, 0x02, /* Usage (Pen), */ 282 0x09, 0x02, /* Usage (Pen), */
@@ -745,187 +387,14 @@ static __u8 media_tablet_10_6_inch_rdesc_fixed[] = {
745}; 387};
746 388
747/* 389/*
748 * Original Media Tablet 14.1 inch report descriptor. 390 * See Media Tablet 14.1 inch description, device and HID report descriptors at
749 * 391 * http://sf.net/apps/mediawiki/digimend/?title=Waltop_Media_Tablet_14.1%22
750 * There are at least two versions of this model in the wild. They are
751 * represented by Genius G-Pen M712 (older version) and Genius G-Pen M712X
752 * (newer version). The hardware difference between these versions is the same
753 * as between older and newer versions of Media Tablet 10.6 inch. The report
754 * descriptors are identical for both versions.
755 *
756 * The function, behavior and report descriptor of this tablet is similar to
757 * that of Media Tablet 10.6 inch. However, there is one more field (with
758 * Consumer AC Pan usage) in the mouse description. Then the tablet X and Y
759 * logical extents both get scaled to 0..16383 range (a hardware limit?),
760 * which kind of defeats the advertised 4000 LPI resolution, considering the
761 * physical extents of 12x7.25 inches. Plus, reports 5, 10 and 255 are used
762 * sometimes (while moving the pen) with unknown purpose. Also, the key codes
763 * generated for zoom in/out are different.
764 *
765 * Usage Page (Desktop),
766 * Usage (Mouse),
767 * Collection (Application),
768 * Report ID (1),
769 * Usage (Pointer),
770 * Collection (Physical),
771 * Usage Page (Button),
772 * Usage Minimum (01h),
773 * Usage Maximum (05h),
774 * Logical Minimum (0),
775 * Logical Maximum (1),
776 * Report Size (1),
777 * Report Count (5),
778 * Input (Variable),
779 * Report Size (3),
780 * Report Count (1),
781 * Input (Constant, Variable),
782 * Usage Page (Desktop),
783 * Usage (X),
784 * Usage (Y),
785 * Usage (Wheel),
786 * Logical Minimum (-127),
787 * Logical Maximum (127),
788 * Report Size (8),
789 * Report Count (3),
790 * Input (Variable, Relative),
791 * Usage Page (Consumer),
792 * Logical Minimum (-127),
793 * Logical Maximum (127),
794 * Report Size (8),
795 * Report Count (1),
796 * Usage (AC Pan),
797 * Input (Variable, Relative),
798 * End Collection,
799 * End Collection,
800 * Usage Page (Digitizer),
801 * Usage (Pen),
802 * Collection (Application),
803 * Report ID (2),
804 * Usage (Stylus),
805 * Collection (Physical),
806 * Usage (00h),
807 * Logical Minimum (0),
808 * Logical Maximum (255),
809 * Report Size (8),
810 * Report Count (7),
811 * Input (Variable),
812 * Usage (Azimuth),
813 * Usage (Altitude),
814 * Logical Minimum (0),
815 * Logical Maximum (255),
816 * Report Size (8),
817 * Report Count (2),
818 * Feature (Variable),
819 * End Collection,
820 * Report ID (5),
821 * Usage Page (Digitizer),
822 * Usage (Stylus),
823 * Collection (Physical),
824 * Usage (00h),
825 * Logical Minimum (0),
826 * Logical Maximum (255),
827 * Report Size (8),
828 * Report Count (7),
829 * Input (Variable),
830 * End Collection,
831 * Report ID (10),
832 * Usage Page (Digitizer),
833 * Usage (Stylus),
834 * Collection (Physical),
835 * Usage (00h),
836 * Logical Minimum (0),
837 * Logical Maximum (255),
838 * Report Size (8),
839 * Report Count (7),
840 * Input (Variable),
841 * End Collection,
842 * Report ID (16),
843 * Usage (Stylus),
844 * Collection (Physical),
845 * Usage (Tip Switch),
846 * Usage (Barrel Switch),
847 * Usage (Invert),
848 * Usage (Eraser),
849 * Usage (In Range),
850 * Logical Minimum (0),
851 * Logical Maximum (1),
852 * Report Size (1),
853 * Report Count (5),
854 * Input (Variable),
855 * Report Count (3),
856 * Input (Constant, Variable),
857 * Usage Page (Desktop),
858 * Usage (X),
859 * Report Size (16),
860 * Report Count (1),
861 * Push,
862 * Unit Exponent (13),
863 * Unit (Inch^3),
864 * Logical Minimum (0),
865 * Logical Maximum (16383),
866 * Physical Minimum (0),
867 * Physical Maximum (16383),
868 * Input (Variable),
869 * Usage (Y),
870 * Input (Variable),
871 * Usage Page (Digitizer),
872 * Usage (Tip Pressure),
873 * Logical Minimum (0),
874 * Logical Maximum (1023),
875 * Physical Minimum (0),
876 * Physical Maximum (1023),
877 * Input (Variable),
878 * End Collection,
879 * End Collection,
880 * Usage Page (Desktop),
881 * Usage (Keyboard),
882 * Collection (Application),
883 * Report ID (13),
884 * Usage Page (Keyboard),
885 * Usage Minimum (KB Leftcontrol),
886 * Usage Maximum (KB Right GUI),
887 * Logical Minimum (0),
888 * Logical Maximum (1),
889 * Report Size (1),
890 * Report Count (8),
891 * Input (Variable),
892 * Report Size (8),
893 * Report Count (1),
894 * Input (Constant),
895 * Usage Page (Keyboard),
896 * Usage Minimum (None),
897 * Usage Maximum (KB Application),
898 * Logical Minimum (0),
899 * Logical Maximum (101),
900 * Report Size (8),
901 * Report Count (5),
902 * Input,
903 * End Collection,
904 * Usage Page (Consumer),
905 * Usage (Consumer Control),
906 * Collection (Application),
907 * Report ID (12),
908 * Usage (Volume Inc),
909 * Usage (Volume Dec),
910 * Usage (Mute),
911 * Logical Minimum (0),
912 * Logical Maximum (1),
913 * Report Size (1),
914 * Report Count (3),
915 * Input (Variable, Relative),
916 * Report Size (5),
917 * Report Count (1),
918 * Input (Constant, Variable, Relative),
919 * End Collection
920 */ 392 */
921 393
922/* Size of the original report descriptor of Media Tablet 14.1 inch */ 394/* Size of the original report descriptor of Media Tablet 14.1 inch */
923#define MEDIA_TABLET_14_1_INCH_RDESC_ORIG_SIZE 309 395#define MEDIA_TABLET_14_1_INCH_RDESC_ORIG_SIZE 309
924 396
925/* 397/* Fixed Media Tablet 14.1 inch descriptor */
926 * Fixed Media Tablet 14.1 inch descriptor.
927 * It is fixed similarly to the Media Tablet 10.6 inch descriptor.
928 */
929static __u8 media_tablet_14_1_inch_rdesc_fixed[] = { 398static __u8 media_tablet_14_1_inch_rdesc_fixed[] = {
930 0x05, 0x0D, /* Usage Page (Digitizer), */ 399 0x05, 0x0D, /* Usage Page (Digitizer), */
931 0x09, 0x02, /* Usage (Pen), */ 400 0x09, 0x02, /* Usage (Pen), */
@@ -1033,6 +502,47 @@ static __u8 media_tablet_14_1_inch_rdesc_fixed[] = {
1033 0xC0 /* End Collection */ 502 0xC0 /* End Collection */
1034}; 503};
1035 504
505struct waltop_state {
506 u8 pressure0;
507 u8 pressure1;
508};
509
510static int waltop_probe(struct hid_device *hdev,
511 const struct hid_device_id *id)
512{
513 int ret;
514 struct waltop_state *s;
515
516 s = kzalloc(sizeof(*s), GFP_KERNEL);
517 if (s == NULL) {
518 hid_err(hdev, "can't allocate device state\n");
519 ret = -ENOMEM;
520 goto err;
521 }
522
523 s->pressure0 = 0;
524 s->pressure1 = 0;
525
526 hid_set_drvdata(hdev, s);
527
528 ret = hid_parse(hdev);
529 if (ret) {
530 hid_err(hdev, "parse failed\n");
531 goto err;
532 }
533
534 ret = hid_hw_start(hdev, HID_CONNECT_DEFAULT);
535 if (ret) {
536 hid_err(hdev, "hw start failed\n");
537 goto err;
538 }
539
540 return 0;
541err:
542 kfree(s);
543 return ret;
544}
545
1036static __u8 *waltop_report_fixup(struct hid_device *hdev, __u8 *rdesc, 546static __u8 *waltop_report_fixup(struct hid_device *hdev, __u8 *rdesc,
1037 unsigned int *rsize) 547 unsigned int *rsize)
1038{ 548{
@@ -1049,6 +559,18 @@ static __u8 *waltop_report_fixup(struct hid_device *hdev, __u8 *rdesc,
1049 *rsize = sizeof(slim_tablet_12_1_inch_rdesc_fixed); 559 *rsize = sizeof(slim_tablet_12_1_inch_rdesc_fixed);
1050 } 560 }
1051 break; 561 break;
562 case USB_DEVICE_ID_WALTOP_Q_PAD:
563 if (*rsize == Q_PAD_RDESC_ORIG_SIZE) {
564 rdesc = q_pad_rdesc_fixed;
565 *rsize = sizeof(q_pad_rdesc_fixed);
566 }
567 break;
568 case USB_DEVICE_ID_WALTOP_PID_0038:
569 if (*rsize == PID_0038_RDESC_ORIG_SIZE) {
570 rdesc = pid_0038_rdesc_fixed;
571 *rsize = sizeof(pid_0038_rdesc_fixed);
572 }
573 break;
1052 case USB_DEVICE_ID_WALTOP_MEDIA_TABLET_10_6_INCH: 574 case USB_DEVICE_ID_WALTOP_MEDIA_TABLET_10_6_INCH:
1053 if (*rsize == MEDIA_TABLET_10_6_INCH_RDESC_ORIG_SIZE) { 575 if (*rsize == MEDIA_TABLET_10_6_INCH_RDESC_ORIG_SIZE) {
1054 rdesc = media_tablet_10_6_inch_rdesc_fixed; 576 rdesc = media_tablet_10_6_inch_rdesc_fixed;
@@ -1065,12 +587,54 @@ static __u8 *waltop_report_fixup(struct hid_device *hdev, __u8 *rdesc,
1065 return rdesc; 587 return rdesc;
1066} 588}
1067 589
590static int waltop_raw_event(struct hid_device *hdev, struct hid_report *report,
591 u8 *data, int size)
592{
593 /* If this is a pen input report of a tablet with PID 0038 */
594 if (hdev->product == USB_DEVICE_ID_WALTOP_PID_0038 &&
595 report->type == HID_INPUT_REPORT &&
596 report->id == 16 &&
597 size == 8) {
598 struct waltop_state *s = hid_get_drvdata(hdev);
599
600 /*
601 * Ignore maximum pressure reported when a barrel button is
602 * pressed.
603 */
604
605 /* If a barrel button is pressed */
606 if ((data[1] & 0xF) > 1) {
607 /* Use the last known pressure */
608 data[6] = s->pressure0;
609 data[7] = s->pressure1;
610 } else {
611 /* Remember reported pressure */
612 s->pressure0 = data[6];
613 s->pressure1 = data[7];
614 }
615 }
616
617 return 0;
618}
619
620static void waltop_remove(struct hid_device *hdev)
621{
622 struct waltop_state *s = hid_get_drvdata(hdev);
623
624 hid_hw_stop(hdev);
625 kfree(s);
626}
627
1068static const struct hid_device_id waltop_devices[] = { 628static const struct hid_device_id waltop_devices[] = {
1069 { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, 629 { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP,
1070 USB_DEVICE_ID_WALTOP_SLIM_TABLET_5_8_INCH) }, 630 USB_DEVICE_ID_WALTOP_SLIM_TABLET_5_8_INCH) },
1071 { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, 631 { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP,
1072 USB_DEVICE_ID_WALTOP_SLIM_TABLET_12_1_INCH) }, 632 USB_DEVICE_ID_WALTOP_SLIM_TABLET_12_1_INCH) },
1073 { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, 633 { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP,
634 USB_DEVICE_ID_WALTOP_Q_PAD) },
635 { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP,
636 USB_DEVICE_ID_WALTOP_PID_0038) },
637 { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP,
1074 USB_DEVICE_ID_WALTOP_MEDIA_TABLET_10_6_INCH) }, 638 USB_DEVICE_ID_WALTOP_MEDIA_TABLET_10_6_INCH) },
1075 { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP, 639 { HID_USB_DEVICE(USB_VENDOR_ID_WALTOP,
1076 USB_DEVICE_ID_WALTOP_MEDIA_TABLET_14_1_INCH) }, 640 USB_DEVICE_ID_WALTOP_MEDIA_TABLET_14_1_INCH) },
@@ -1081,7 +645,10 @@ MODULE_DEVICE_TABLE(hid, waltop_devices);
1081static struct hid_driver waltop_driver = { 645static struct hid_driver waltop_driver = {
1082 .name = "waltop", 646 .name = "waltop",
1083 .id_table = waltop_devices, 647 .id_table = waltop_devices,
648 .probe = waltop_probe,
1084 .report_fixup = waltop_report_fixup, 649 .report_fixup = waltop_report_fixup,
650 .raw_event = waltop_raw_event,
651 .remove = waltop_remove,
1085}; 652};
1086 653
1087static int __init waltop_init(void) 654static int __init waltop_init(void)
diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c
index 0dd0bebac69f..782c63955f29 100644
--- a/drivers/hid/usbhid/hid-quirks.c
+++ b/drivers/hid/usbhid/hid-quirks.c
@@ -60,6 +60,7 @@ static const struct hid_blacklist {
60 { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_2PORTKVM, HID_QUIRK_NOGET }, 60 { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_2PORTKVM, HID_QUIRK_NOGET },
61 { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_4PORTKVM, HID_QUIRK_NOGET }, 61 { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_4PORTKVM, HID_QUIRK_NOGET },
62 { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_4PORTKVMC, HID_QUIRK_NOGET }, 62 { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_4PORTKVMC, HID_QUIRK_NOGET },
63 { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_FIGHTERSTICK, HID_QUIRK_NOGET },
63 { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_COMBATSTICK, HID_QUIRK_NOGET }, 64 { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_COMBATSTICK, HID_QUIRK_NOGET },
64 { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_FLIGHT_SIM_ECLIPSE_YOKE, HID_QUIRK_NOGET }, 65 { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_FLIGHT_SIM_ECLIPSE_YOKE, HID_QUIRK_NOGET },
65 { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_FLIGHT_SIM_YOKE, HID_QUIRK_NOGET }, 66 { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_FLIGHT_SIM_YOKE, HID_QUIRK_NOGET },
@@ -96,6 +97,8 @@ static const struct hid_blacklist {
96 { USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_MULTI_TOUCH, HID_QUIRK_MULTI_INPUT }, 97 { USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_MULTI_TOUCH, HID_QUIRK_MULTI_INPUT },
97 { USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_WIRELESS, HID_QUIRK_MULTI_INPUT }, 98 { USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_WIRELESS, HID_QUIRK_MULTI_INPUT },
98 { USB_VENDOR_ID_SIGMA_MICRO, USB_DEVICE_ID_SIGMA_MICRO_KEYBOARD, HID_QUIRK_NO_INIT_REPORTS }, 99 { USB_VENDOR_ID_SIGMA_MICRO, USB_DEVICE_ID_SIGMA_MICRO_KEYBOARD, HID_QUIRK_NO_INIT_REPORTS },
100 { USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_MOUSEPEN_I608X, HID_QUIRK_MULTI_INPUT },
101 { USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_EASYPEN_M610X, HID_QUIRK_MULTI_INPUT },
99 { 0, 0 } 102 { 0, 0 }
100}; 103};
101 104