diff options
author | Josenivaldo Benito Junior <jrbenito@benito.qsl.br> | 2012-04-10 18:29:04 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2012-04-13 12:15:57 -0400 |
commit | 212da74da783ba9d4459799f4aaecd5de217a312 (patch) | |
tree | 7677b4455e3300dc15bc5fa093903c4666d13597 | |
parent | dc3c78e43469063c5bf4b744214508f94c4129f9 (diff) |
HID: Aureal Remote Control Device Driver
Devices like Aureal Cy se W-01RN USB_V3.1 and some derived hardware
have a bogus HID Report Descriptor. According to that report descriptor,
the maximum logical value for key events is 1 and not 101 (101 keys).
This quirk fixes this wrong Report Descriptor.
Signed-off-by: Josenivaldo Benito Junior <jrbenito@benito.qsl.br>
Signed-off-by: Franco Catrin <fcatrin@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
-rw-r--r-- | drivers/hid/Kconfig | 6 | ||||
-rw-r--r-- | drivers/hid/Makefile | 1 | ||||
-rw-r--r-- | drivers/hid/hid-aureal.c | 54 | ||||
-rw-r--r-- | drivers/hid/hid-core.c | 1 | ||||
-rw-r--r-- | drivers/hid/hid-ids.h | 3 |
5 files changed, 65 insertions, 0 deletions
diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig index a3d033252995..1b3447460b64 100644 --- a/drivers/hid/Kconfig +++ b/drivers/hid/Kconfig | |||
@@ -92,6 +92,12 @@ config HID_APPLE | |||
92 | Say Y here if you want support for keyboards of Apple iBooks, PowerBooks, | 92 | Say Y here if you want support for keyboards of Apple iBooks, PowerBooks, |
93 | MacBooks, MacBook Pros and Apple Aluminum. | 93 | MacBooks, MacBook Pros and Apple Aluminum. |
94 | 94 | ||
95 | config HID_AUREAL | ||
96 | tristate "Aureal" | ||
97 | depends on USB_HID | ||
98 | ---help--- | ||
99 | Support for Aureal Cy se W-01RN Remote Controller and other Aureal derived remotes. | ||
100 | |||
95 | config HID_BELKIN | 101 | config HID_BELKIN |
96 | tristate "Belkin Flip KVM and Wireless keyboard" if EXPERT | 102 | tristate "Belkin Flip KVM and Wireless keyboard" if EXPERT |
97 | depends on USB_HID | 103 | depends on USB_HID |
diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile index 22f1d16cd79c..5363f170d027 100644 --- a/drivers/hid/Makefile +++ b/drivers/hid/Makefile | |||
@@ -36,6 +36,7 @@ endif | |||
36 | obj-$(CONFIG_HID_A4TECH) += hid-a4tech.o | 36 | obj-$(CONFIG_HID_A4TECH) += hid-a4tech.o |
37 | obj-$(CONFIG_HID_ACRUX) += hid-axff.o | 37 | obj-$(CONFIG_HID_ACRUX) += hid-axff.o |
38 | obj-$(CONFIG_HID_APPLE) += hid-apple.o | 38 | obj-$(CONFIG_HID_APPLE) += hid-apple.o |
39 | obj-$(CONFIG_HID_AUREAL) += hid-aureal.o | ||
39 | obj-$(CONFIG_HID_BELKIN) += hid-belkin.o | 40 | obj-$(CONFIG_HID_BELKIN) += hid-belkin.o |
40 | obj-$(CONFIG_HID_CHERRY) += hid-cherry.o | 41 | obj-$(CONFIG_HID_CHERRY) += hid-cherry.o |
41 | obj-$(CONFIG_HID_CHICONY) += hid-chicony.o | 42 | obj-$(CONFIG_HID_CHICONY) += hid-chicony.o |
diff --git a/drivers/hid/hid-aureal.c b/drivers/hid/hid-aureal.c new file mode 100644 index 000000000000..ba64b041b8bf --- /dev/null +++ b/drivers/hid/hid-aureal.c | |||
@@ -0,0 +1,54 @@ | |||
1 | /* | ||
2 | * HID driver for Aureal Cy se W-01RN USB_V3.1 devices | ||
3 | * | ||
4 | * Copyright (c) 2010 Franco Catrin <fcatrin@gmail.com> | ||
5 | * Copyright (c) 2010 Ben Cropley <bcropley@internode.on.net> | ||
6 | * | ||
7 | * Based on HID sunplus driver by | ||
8 | * Copyright (c) 1999 Andreas Gal | ||
9 | * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> | ||
10 | * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc | ||
11 | * Copyright (c) 2006-2007 Jiri Kosina | ||
12 | * Copyright (c) 2007 Paul Walmsley | ||
13 | * Copyright (c) 2008 Jiri Slaby | ||
14 | */ | ||
15 | #include <linux/device.h> | ||
16 | #include <linux/hid.h> | ||
17 | #include <linux/module.h> | ||
18 | |||
19 | #include "hid-ids.h" | ||
20 | |||
21 | static __u8 *aureal_report_fixup(struct hid_device *hdev, __u8 *rdesc, | ||
22 | unsigned int *rsize) | ||
23 | { | ||
24 | if (*rsize >= 54 && rdesc[52] == 0x25 && rdesc[53] == 0x01) { | ||
25 | dev_info(&hdev->dev, "fixing Aureal Cy se W-01RN USB_V3.1 report descriptor.\n"); | ||
26 | rdesc[53] = 0x65; | ||
27 | } return rdesc; | ||
28 | } | ||
29 | |||
30 | static const struct hid_device_id aureal_devices[] = { | ||
31 | { HID_USB_DEVICE(USB_VENDOR_ID_AUREAL, USB_DEVICE_ID_AUREAL_W01RN) }, | ||
32 | { } | ||
33 | }; | ||
34 | MODULE_DEVICE_TABLE(hid, aureal_devices); | ||
35 | |||
36 | static struct hid_driver aureal_driver = { | ||
37 | .name = "aureal", | ||
38 | .id_table = aureal_devices, | ||
39 | .report_fixup = aureal_report_fixup, | ||
40 | }; | ||
41 | |||
42 | static int __init aureal_init(void) | ||
43 | { | ||
44 | return hid_register_driver(&aureal_driver); | ||
45 | } | ||
46 | |||
47 | static void __exit aureal_exit(void) | ||
48 | { | ||
49 | hid_unregister_driver(&aureal_driver); | ||
50 | } | ||
51 | |||
52 | module_init(aureal_init); | ||
53 | module_exit(aureal_exit); | ||
54 | MODULE_LICENSE("GPL"); | ||
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 990fe19330e6..8be458b79b2c 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c | |||
@@ -1387,6 +1387,7 @@ static const struct hid_device_id hid_have_special_driver[] = { | |||
1387 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) }, | 1387 | { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) }, |
1388 | { HID_USB_DEVICE(USB_VENDOR_ID_ASUS, USB_DEVICE_ID_ASUS_T91MT) }, | 1388 | { HID_USB_DEVICE(USB_VENDOR_ID_ASUS, USB_DEVICE_ID_ASUS_T91MT) }, |
1389 | { HID_USB_DEVICE(USB_VENDOR_ID_ASUS, USB_DEVICE_ID_ASUSTEK_MULTITOUCH_YFO) }, | 1389 | { HID_USB_DEVICE(USB_VENDOR_ID_ASUS, USB_DEVICE_ID_ASUSTEK_MULTITOUCH_YFO) }, |
1390 | { HID_USB_DEVICE(USB_VENDOR_ID_AUREAL, USB_DEVICE_ID_AUREAL_W01RN) }, | ||
1390 | { HID_USB_DEVICE(USB_VENDOR_ID_BELKIN, USB_DEVICE_ID_FLIP_KVM) }, | 1391 | { HID_USB_DEVICE(USB_VENDOR_ID_BELKIN, USB_DEVICE_ID_FLIP_KVM) }, |
1391 | { HID_USB_DEVICE(USB_VENDOR_ID_BTC, USB_DEVICE_ID_BTC_EMPREX_REMOTE) }, | 1392 | { HID_USB_DEVICE(USB_VENDOR_ID_BTC, USB_DEVICE_ID_BTC_EMPREX_REMOTE) }, |
1392 | { HID_USB_DEVICE(USB_VENDOR_ID_BTC, USB_DEVICE_ID_BTC_EMPREX_REMOTE_2) }, | 1393 | { HID_USB_DEVICE(USB_VENDOR_ID_BTC, USB_DEVICE_ID_BTC_EMPREX_REMOTE_2) }, |
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index 3eb00902ca40..df87fdbf70bf 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h | |||
@@ -154,6 +154,9 @@ | |||
154 | #define USB_DEVICE_ID_ATMEL_MULTITOUCH 0x211c | 154 | #define USB_DEVICE_ID_ATMEL_MULTITOUCH 0x211c |
155 | #define USB_DEVICE_ID_ATMEL_MXT_DIGITIZER 0x2118 | 155 | #define USB_DEVICE_ID_ATMEL_MXT_DIGITIZER 0x2118 |
156 | 156 | ||
157 | #define USB_VENDOR_ID_AUREAL 0x0755 | ||
158 | #define USB_DEVICE_ID_AUREAL_W01RN 0x2626 | ||
159 | |||
157 | #define USB_VENDOR_ID_AVERMEDIA 0x07ca | 160 | #define USB_VENDOR_ID_AVERMEDIA 0x07ca |
158 | #define USB_DEVICE_ID_AVER_FM_MR800 0xb800 | 161 | #define USB_DEVICE_ID_AVER_FM_MR800 0xb800 |
159 | 162 | ||