diff options
author | Chris Schlund <chrisschlund@gmx.de> | 2011-02-03 10:41:47 -0500 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2011-02-03 10:41:59 -0500 |
commit | 75b07022462fc33d6be15669ad604118653210a9 (patch) | |
tree | ac3eb74b5abc38e89e3fcb1711a94ff4fda13be9 /drivers | |
parent | cf28a673666fba5770b40fb084584391f451c07d (diff) |
HID: add support for wireless remote LC Power model RC1000MCE
Signed-off-by: Chris Schlund <chrisschlund@gmx.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/hid/Kconfig | 6 | ||||
-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-lcpower.c | 70 |
5 files changed, 81 insertions, 0 deletions
diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig index 24cca2f69dfc..94e73db580d2 100644 --- a/drivers/hid/Kconfig +++ b/drivers/hid/Kconfig | |||
@@ -218,6 +218,12 @@ config HID_KENSINGTON | |||
218 | ---help--- | 218 | ---help--- |
219 | Support for Kensington Slimblade Trackball. | 219 | Support for Kensington Slimblade Trackball. |
220 | 220 | ||
221 | config HID_LCPOWER | ||
222 | tristate "LC-Power" | ||
223 | depends on USB_HID | ||
224 | ---help--- | ||
225 | Support for LC-Power RC1000MCE RF remote control. | ||
226 | |||
221 | config HID_LOGITECH | 227 | config HID_LOGITECH |
222 | tristate "Logitech devices" if EMBEDDED | 228 | tristate "Logitech devices" if EMBEDDED |
223 | depends on USB_HID | 229 | depends on USB_HID |
diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile index 6efc2a0370ad..2e1b1e3326c9 100644 --- a/drivers/hid/Makefile +++ b/drivers/hid/Makefile | |||
@@ -42,6 +42,7 @@ obj-$(CONFIG_HID_EZKEY) += hid-ezkey.o | |||
42 | obj-$(CONFIG_HID_GYRATION) += hid-gyration.o | 42 | obj-$(CONFIG_HID_GYRATION) += hid-gyration.o |
43 | obj-$(CONFIG_HID_KENSINGTON) += hid-kensington.o | 43 | obj-$(CONFIG_HID_KENSINGTON) += hid-kensington.o |
44 | obj-$(CONFIG_HID_KYE) += hid-kye.o | 44 | obj-$(CONFIG_HID_KYE) += hid-kye.o |
45 | obj-$(CONFIG_HID_LCPOWER) += hid-lcpower.o | ||
45 | obj-$(CONFIG_HID_LOGITECH) += hid-logitech.o | 46 | obj-$(CONFIG_HID_LOGITECH) += hid-logitech.o |
46 | obj-$(CONFIG_HID_MAGICMOUSE) += hid-magicmouse.o | 47 | obj-$(CONFIG_HID_MAGICMOUSE) += hid-magicmouse.o |
47 | obj-$(CONFIG_HID_MICROSOFT) += hid-microsoft.o | 48 | obj-$(CONFIG_HID_MICROSOFT) += hid-microsoft.o |
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index d678cf3d33d5..2dcdf9ff02ea 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c | |||
@@ -1348,6 +1348,7 @@ static const struct hid_device_id hid_have_special_driver[] = { | |||
1348 | { HID_USB_DEVICE(USB_VENDOR_ID_KENSINGTON, USB_DEVICE_ID_KS_SLIMBLADE) }, | 1348 | { HID_USB_DEVICE(USB_VENDOR_ID_KENSINGTON, USB_DEVICE_ID_KS_SLIMBLADE) }, |
1349 | { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_ERGO_525V) }, | 1349 | { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_ERGO_525V) }, |
1350 | { HID_USB_DEVICE(USB_VENDOR_ID_LABTEC, USB_DEVICE_ID_LABTEC_WIRELESS_KEYBOARD) }, | 1350 | { HID_USB_DEVICE(USB_VENDOR_ID_LABTEC, USB_DEVICE_ID_LABTEC_WIRELESS_KEYBOARD) }, |
1351 | { HID_USB_DEVICE(USB_VENDOR_ID_LCPOWER, USB_DEVICE_ID_LCPOWER_LC1000 ) }, | ||
1351 | { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_MX3000_RECEIVER) }, | 1352 | { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_MX3000_RECEIVER) }, |
1352 | { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_S510_RECEIVER) }, | 1353 | { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_S510_RECEIVER) }, |
1353 | { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_S510_RECEIVER_2) }, | 1354 | { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_S510_RECEIVER_2) }, |
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index 92a0d61a7379..15aca15a0a7b 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h | |||
@@ -352,6 +352,9 @@ | |||
352 | #define USB_VENDOR_ID_LABTEC 0x1020 | 352 | #define USB_VENDOR_ID_LABTEC 0x1020 |
353 | #define USB_DEVICE_ID_LABTEC_WIRELESS_KEYBOARD 0x0006 | 353 | #define USB_DEVICE_ID_LABTEC_WIRELESS_KEYBOARD 0x0006 |
354 | 354 | ||
355 | #define USB_VENDOR_ID_LCPOWER 0x1241 | ||
356 | #define USB_DEVICE_ID_LCPOWER_LC1000 0xf767 | ||
357 | |||
355 | #define USB_VENDOR_ID_LD 0x0f11 | 358 | #define USB_VENDOR_ID_LD 0x0f11 |
356 | #define USB_DEVICE_ID_LD_CASSY 0x1000 | 359 | #define USB_DEVICE_ID_LD_CASSY 0x1000 |
357 | #define USB_DEVICE_ID_LD_POCKETCASSY 0x1010 | 360 | #define USB_DEVICE_ID_LD_POCKETCASSY 0x1010 |
diff --git a/drivers/hid/hid-lcpower.c b/drivers/hid/hid-lcpower.c new file mode 100644 index 000000000000..4bdbcf878544 --- /dev/null +++ b/drivers/hid/hid-lcpower.c | |||
@@ -0,0 +1,70 @@ | |||
1 | /* | ||
2 | * HID driver for LC Power Model RC1000MCE | ||
3 | * | ||
4 | * Copyright (c) 2011 Chris Schlund | ||
5 | * based on hid-topseed module | ||
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 0x046: ts_map_key_clear(KEY_YELLOW); break; | ||
32 | case 0x047: ts_map_key_clear(KEY_GREEN); break; | ||
33 | case 0x049: ts_map_key_clear(KEY_RED); break; | ||
34 | case 0x04a: ts_map_key_clear(KEY_BLUE); break; | ||
35 | case 0x00d: ts_map_key_clear(KEY_HOME); break; | ||
36 | case 0x025: ts_map_key_clear(KEY_TV); break; | ||
37 | case 0x048: ts_map_key_clear(KEY_VCR); break; | ||
38 | case 0x024: ts_map_key_clear(KEY_MENU); break; | ||
39 | default: | ||
40 | return 0; | ||
41 | } | ||
42 | |||
43 | return 1; | ||
44 | } | ||
45 | |||
46 | static const struct hid_device_id ts_devices[] = { | ||
47 | { HID_USB_DEVICE( USB_VENDOR_ID_LCPOWER, USB_DEVICE_ID_LCPOWER_LC1000) }, | ||
48 | { } | ||
49 | }; | ||
50 | MODULE_DEVICE_TABLE(hid, ts_devices); | ||
51 | |||
52 | static struct hid_driver ts_driver = { | ||
53 | .name = "LC RC1000MCE", | ||
54 | .id_table = ts_devices, | ||
55 | .input_mapping = ts_input_mapping, | ||
56 | }; | ||
57 | |||
58 | static int __init ts_init(void) | ||
59 | { | ||
60 | return hid_register_driver(&ts_driver); | ||
61 | } | ||
62 | |||
63 | static void __exit ts_exit(void) | ||
64 | { | ||
65 | hid_unregister_driver(&ts_driver); | ||
66 | } | ||
67 | |||
68 | module_init(ts_init); | ||
69 | module_exit(ts_exit); | ||
70 | MODULE_LICENSE("GPL"); | ||