diff options
author | Lev Babiev <harley@hosers.org> | 2009-01-03 18:36:56 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2009-01-03 19:00:53 -0500 |
commit | f14f526d02b14fd0b8c1ac4ec413e4577ad5f62e (patch) | |
tree | 4763b65d1cda9b50eda1815b7cfe2acf375d1b21 | |
parent | ac09952babed8e2ac6999127b7f95d7a2bbfd7af (diff) |
HID: driver for TopSeed Cyberlink quirky remote
I recently picked up a Cyberlink branded remote control produced
by TopSeed Tech Corp. Alas, it appears that this device is using
non-standard mappings for some of it's keys (Usage page 0xffbc).
Signed-off-by: Lev Babiev <harley@hosers.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
-rw-r--r-- | drivers/hid/Kconfig | 7 | ||||
-rw-r--r-- | drivers/hid/Makefile | 1 | ||||
-rw-r--r-- | drivers/hid/hid-core.c | 1 | ||||
-rw-r--r-- | drivers/hid/hid-ids.h | 3 | ||||
-rw-r--r-- | drivers/hid/hid-topseed.c | 77 |
5 files changed, 89 insertions, 0 deletions
diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig index 81dd9b8eeeaa..4c65e75d5b8d 100644 --- a/drivers/hid/Kconfig +++ b/drivers/hid/Kconfig | |||
@@ -246,6 +246,13 @@ config GREENASIA_FF | |||
246 | (like MANTA Warior MM816 and SpeedLink Strike2 SL-6635) or adapter | 246 | (like MANTA Warior MM816 and SpeedLink Strike2 SL-6635) or adapter |
247 | and want to enable force feedback support for it. | 247 | and want to enable force feedback support for it. |
248 | 248 | ||
249 | config HID_TOPSEED | ||
250 | tristate "TopSeed Cyberlink remote control support" if EMBEDDED | ||
251 | depends on USB_HID | ||
252 | default y | ||
253 | ---help--- | ||
254 | Say Y if you have a TopSeed Cyberlink remote control. | ||
255 | |||
249 | config THRUSTMASTER_FF | 256 | config THRUSTMASTER_FF |
250 | tristate "ThrustMaster devices support" | 257 | tristate "ThrustMaster devices support" |
251 | depends on USB_HID | 258 | depends on USB_HID |
diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile index 3354eacffa49..fbd021f153f1 100644 --- a/drivers/hid/Makefile +++ b/drivers/hid/Makefile | |||
@@ -39,6 +39,7 @@ obj-$(CONFIG_HID_SONY) += hid-sony.o | |||
39 | obj-$(CONFIG_HID_SUNPLUS) += hid-sunplus.o | 39 | obj-$(CONFIG_HID_SUNPLUS) += hid-sunplus.o |
40 | obj-$(CONFIG_GREENASIA_FF) += hid-gaff.o | 40 | obj-$(CONFIG_GREENASIA_FF) += hid-gaff.o |
41 | obj-$(CONFIG_THRUSTMASTER_FF) += hid-tmff.o | 41 | obj-$(CONFIG_THRUSTMASTER_FF) += hid-tmff.o |
42 | obj-$(CONFIG_HID_TOPSEED) += hid-topseed.o | ||
42 | obj-$(CONFIG_ZEROPLUS_FF) += hid-zpff.o | 43 | obj-$(CONFIG_ZEROPLUS_FF) += hid-zpff.o |
43 | 44 | ||
44 | obj-$(CONFIG_USB_HID) += usbhid/ | 45 | obj-$(CONFIG_USB_HID) += usbhid/ |
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 8fd35a697c5b..58a706dc7496 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c | |||
@@ -1299,6 +1299,7 @@ static const struct hid_device_id hid_blacklist[] = { | |||
1299 | { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_CONTROLLER) }, | 1299 | { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_CONTROLLER) }, |
1300 | { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGX_MOUSE) }, | 1300 | { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_VAIO_VGX_MOUSE) }, |
1301 | { HID_USB_DEVICE(USB_VENDOR_ID_SUNPLUS, USB_DEVICE_ID_SUNPLUS_WDESKTOP) }, | 1301 | { HID_USB_DEVICE(USB_VENDOR_ID_SUNPLUS, USB_DEVICE_ID_SUNPLUS_WDESKTOP) }, |
1302 | { HID_USB_DEVICE(USB_VENDOR_ID_TOPSEED, USB_DEVICE_ID_TOPSEED_CYBERLINK) }, | ||
1302 | 1303 | ||
1303 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, 0x030c) }, | 1304 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, 0x030c) }, |
1304 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_PRESENTER_8K_BT) }, | 1305 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_PRESENTER_8K_BT) }, |
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index 2b7b6eeae8c6..daced0bf9d49 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h | |||
@@ -375,6 +375,9 @@ | |||
375 | #define USB_VENDOR_ID_TOPMAX 0x0663 | 375 | #define USB_VENDOR_ID_TOPMAX 0x0663 |
376 | #define USB_DEVICE_ID_TOPMAX_COBRAPAD 0x0103 | 376 | #define USB_DEVICE_ID_TOPMAX_COBRAPAD 0x0103 |
377 | 377 | ||
378 | #define USB_VENDOR_ID_TOPSEED 0x0766 | ||
379 | #define USB_DEVICE_ID_TOPSEED_CYBERLINK 0x0204 | ||
380 | |||
378 | #define USB_VENDOR_ID_TURBOX 0x062a | 381 | #define USB_VENDOR_ID_TURBOX 0x062a |
379 | #define USB_DEVICE_ID_TURBOX_KEYBOARD 0x0201 | 382 | #define USB_DEVICE_ID_TURBOX_KEYBOARD 0x0201 |
380 | 383 | ||
diff --git a/drivers/hid/hid-topseed.c b/drivers/hid/hid-topseed.c new file mode 100644 index 000000000000..cca64a0564a9 --- /dev/null +++ b/drivers/hid/hid-topseed.c | |||
@@ -0,0 +1,77 @@ | |||
1 | /* | ||
2 | * HID driver for TopSeed Cyberlink remote | ||
3 | * | ||
4 | * Copyright (c) 2008 Lev Babiev | ||
5 | * based on hid-cherry driver | ||
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 ts_map_key_clear(c) hid_map_usage_clear(hi, usage, bit, max, \ | ||
22 | EV_KEY, (c)) | ||
23 | static int ts_input_mapping(struct hid_device *hdev, struct hid_input *hi, | ||
24 | struct hid_field *field, struct hid_usage *usage, | ||
25 | unsigned long **bit, int *max) | ||
26 | { | ||
27 | if ((usage->hid & HID_USAGE_PAGE) != 0x0ffbc0000) | ||
28 | return 0; | ||
29 | |||
30 | switch (usage->hid & HID_USAGE) { | ||
31 | case 0x00d: ts_map_key_clear(KEY_HOME); break; | ||
32 | case 0x024: ts_map_key_clear(KEY_MENU); break; | ||
33 | case 0x025: ts_map_key_clear(KEY_TV); break; | ||
34 | case 0x048: ts_map_key_clear(KEY_RED); break; | ||
35 | case 0x047: ts_map_key_clear(KEY_GREEN); break; | ||
36 | case 0x049: ts_map_key_clear(KEY_YELLOW); break; | ||
37 | case 0x04a: ts_map_key_clear(KEY_BLUE); break; | ||
38 | case 0x04b: ts_map_key_clear(KEY_ANGLE); break; | ||
39 | case 0x04c: ts_map_key_clear(KEY_LANGUAGE); break; | ||
40 | case 0x04d: ts_map_key_clear(KEY_SUBTITLE); break; | ||
41 | case 0x031: ts_map_key_clear(KEY_AUDIO); break; | ||
42 | case 0x032: ts_map_key_clear(KEY_TEXT); break; | ||
43 | case 0x033: ts_map_key_clear(KEY_CHANNEL); break; | ||
44 | default: | ||
45 | return 0; | ||
46 | } | ||
47 | |||
48 | return 1; | ||
49 | } | ||
50 | |||
51 | static const struct hid_device_id ts_devices[] = { | ||
52 | { HID_USB_DEVICE(USB_VENDOR_ID_TOPSEED, USB_DEVICE_ID_TOPSEED_CYBERLINK) }, | ||
53 | { } | ||
54 | }; | ||
55 | MODULE_DEVICE_TABLE(hid, ts_devices); | ||
56 | |||
57 | static struct hid_driver ts_driver = { | ||
58 | .name = "topseed", | ||
59 | .id_table = ts_devices, | ||
60 | .input_mapping = ts_input_mapping, | ||
61 | }; | ||
62 | |||
63 | static int ts_init(void) | ||
64 | { | ||
65 | return hid_register_driver(&ts_driver); | ||
66 | } | ||
67 | |||
68 | static void ts_exit(void) | ||
69 | { | ||
70 | hid_unregister_driver(&ts_driver); | ||
71 | } | ||
72 | |||
73 | module_init(ts_init); | ||
74 | module_exit(ts_exit); | ||
75 | MODULE_LICENSE("GPL"); | ||
76 | |||
77 | HID_COMPAT_LOAD_DRIVER(topseed); | ||