diff options
-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-dummy.c | 3 | ||||
-rw-r--r-- | drivers/hid/hid-ids.h | 3 | ||||
-rw-r--r-- | drivers/hid/hid-kensington.c | 65 |
6 files changed, 80 insertions, 0 deletions
diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig index 9cc662c7e744..c16fc4fb13bf 100644 --- a/drivers/hid/Kconfig +++ b/drivers/hid/Kconfig | |||
@@ -150,6 +150,13 @@ config HID_GYRATION | |||
150 | ---help--- | 150 | ---help--- |
151 | Support for Gyration remote control. | 151 | Support for Gyration remote control. |
152 | 152 | ||
153 | config HID_KENSINGTON | ||
154 | tristate "Kensington" if EMBEDDED | ||
155 | depends on USB_HID | ||
156 | default !EMBEDDED | ||
157 | ---help--- | ||
158 | Support for Kensington Slimblade Trackball. | ||
159 | |||
153 | config HID_LOGITECH | 160 | config HID_LOGITECH |
154 | tristate "Logitech" if EMBEDDED | 161 | tristate "Logitech" if EMBEDDED |
155 | depends on USB_HID | 162 | depends on USB_HID |
diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile index 0fdbda697991..53e133146b58 100644 --- a/drivers/hid/Makefile +++ b/drivers/hid/Makefile | |||
@@ -29,6 +29,7 @@ obj-$(CONFIG_HID_CYPRESS) += hid-cypress.o | |||
29 | obj-$(CONFIG_DRAGONRISE_FF) += hid-drff.o | 29 | obj-$(CONFIG_DRAGONRISE_FF) += hid-drff.o |
30 | obj-$(CONFIG_HID_EZKEY) += hid-ezkey.o | 30 | obj-$(CONFIG_HID_EZKEY) += hid-ezkey.o |
31 | obj-$(CONFIG_HID_GYRATION) += hid-gyration.o | 31 | obj-$(CONFIG_HID_GYRATION) += hid-gyration.o |
32 | obj-$(CONFIG_HID_KENSINGTON) += hid-kensington.o | ||
32 | obj-$(CONFIG_HID_LOGITECH) += hid-logitech.o | 33 | obj-$(CONFIG_HID_LOGITECH) += hid-logitech.o |
33 | obj-$(CONFIG_HID_MICROSOFT) += hid-microsoft.o | 34 | obj-$(CONFIG_HID_MICROSOFT) += hid-microsoft.o |
34 | obj-$(CONFIG_HID_MONTEREY) += hid-monterey.o | 35 | obj-$(CONFIG_HID_MONTEREY) += hid-monterey.o |
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 7bc2f3744e77..646ba221c00b 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c | |||
@@ -1270,6 +1270,7 @@ static const struct hid_device_id hid_blacklist[] = { | |||
1270 | { HID_USB_DEVICE(USB_VENDOR_ID_GREENASIA, 0x0012) }, | 1270 | { HID_USB_DEVICE(USB_VENDOR_ID_GREENASIA, 0x0012) }, |
1271 | { HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE) }, | 1271 | { HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE) }, |
1272 | { HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE_2) }, | 1272 | { HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE_2) }, |
1273 | { HID_USB_DEVICE(USB_VENDOR_ID_KENSINGTON, USB_DEVICE_ID_KS_SLIMBLADE) }, | ||
1273 | { HID_USB_DEVICE(USB_VENDOR_ID_LABTEC, USB_DEVICE_ID_LABTEC_WIRELESS_KEYBOARD) }, | 1274 | { HID_USB_DEVICE(USB_VENDOR_ID_LABTEC, USB_DEVICE_ID_LABTEC_WIRELESS_KEYBOARD) }, |
1274 | { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_MX3000_RECEIVER) }, | 1275 | { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_MX3000_RECEIVER) }, |
1275 | { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_S510_RECEIVER) }, | 1276 | { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_S510_RECEIVER) }, |
diff --git a/drivers/hid/hid-dummy.c b/drivers/hid/hid-dummy.c index 536aa15af281..28815fd6c285 100644 --- a/drivers/hid/hid-dummy.c +++ b/drivers/hid/hid-dummy.c | |||
@@ -37,6 +37,9 @@ static int __init hid_dummy_init(void) | |||
37 | #ifdef CONFIG_HID_GYRATION_MODULE | 37 | #ifdef CONFIG_HID_GYRATION_MODULE |
38 | HID_COMPAT_CALL_DRIVER(gyration); | 38 | HID_COMPAT_CALL_DRIVER(gyration); |
39 | #endif | 39 | #endif |
40 | #ifdef CONFIG_HID_KENSINGTON_MODULE | ||
41 | HID_COMPAT_CALL_DRIVER(kensington); | ||
42 | #endif | ||
40 | #ifdef CONFIG_HID_LOGITECH_MODULE | 43 | #ifdef CONFIG_HID_LOGITECH_MODULE |
41 | HID_COMPAT_CALL_DRIVER(logitech); | 44 | HID_COMPAT_CALL_DRIVER(logitech); |
42 | #endif | 45 | #endif |
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index 9e83ca41dd70..7270ccc484ab 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h | |||
@@ -274,6 +274,9 @@ | |||
274 | #define USB_DEVICE_ID_LD_POWERCONTROL 0x2030 | 274 | #define USB_DEVICE_ID_LD_POWERCONTROL 0x2030 |
275 | #define USB_DEVICE_ID_LD_MACHINETEST 0x2040 | 275 | #define USB_DEVICE_ID_LD_MACHINETEST 0x2040 |
276 | 276 | ||
277 | #define USB_VENDOR_ID_KENSINGTON 0x047d | ||
278 | #define USB_DEVICE_ID_KS_SLIMBLADE 0x2041 | ||
279 | |||
277 | #define USB_VENDOR_ID_LOGITECH 0x046d | 280 | #define USB_VENDOR_ID_LOGITECH 0x046d |
278 | #define USB_DEVICE_ID_LOGITECH_RECEIVER 0xc101 | 281 | #define USB_DEVICE_ID_LOGITECH_RECEIVER 0xc101 |
279 | #define USB_DEVICE_ID_LOGITECH_HARMONY_FIRST 0xc110 | 282 | #define USB_DEVICE_ID_LOGITECH_HARMONY_FIRST 0xc110 |
diff --git a/drivers/hid/hid-kensington.c b/drivers/hid/hid-kensington.c new file mode 100644 index 000000000000..747fee5b2a73 --- /dev/null +++ b/drivers/hid/hid-kensington.c | |||
@@ -0,0 +1,65 @@ | |||
1 | /* | ||
2 | * HID driver for Kensigton Slimblade Trackball | ||
3 | * | ||
4 | * Copyright (c) 2009 Jiri Kosina | ||
5 | */ | ||
6 | |||
7 | /* | ||
8 | * This program is free software; you can redistribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License as published by the Free | ||
10 | * Software Foundation; either version 2 of the License, or (at your option) | ||
11 | * any later version. | ||
12 | */ | ||
13 | |||
14 | #include <linux/device.h> | ||
15 | #include <linux/input.h> | ||
16 | #include <linux/hid.h> | ||
17 | #include <linux/module.h> | ||
18 | |||
19 | #include "hid-ids.h" | ||
20 | |||
21 | #define ks_map_key(c) hid_map_usage(hi, usage, bit, max, EV_KEY, (c)) | ||
22 | |||
23 | static int ks_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) != HID_UP_MSVENDOR) | ||
28 | return 0; | ||
29 | |||
30 | switch (usage->hid & HID_USAGE) { | ||
31 | case 0x01: ks_map_key(BTN_MIDDLE); break; | ||
32 | case 0x02: ks_map_key(BTN_SIDE); break; | ||
33 | default: | ||
34 | return 0; | ||
35 | } | ||
36 | return 1; | ||
37 | } | ||
38 | |||
39 | static const struct hid_device_id ks_devices[] = { | ||
40 | { HID_USB_DEVICE(USB_VENDOR_ID_KENSINGTON, USB_DEVICE_ID_KS_SLIMBLADE) }, | ||
41 | { } | ||
42 | }; | ||
43 | MODULE_DEVICE_TABLE(hid, ks_devices); | ||
44 | |||
45 | static struct hid_driver ks_driver = { | ||
46 | .name = "kensington", | ||
47 | .id_table = ks_devices, | ||
48 | .input_mapping = ks_input_mapping, | ||
49 | }; | ||
50 | |||
51 | static int ks_init(void) | ||
52 | { | ||
53 | return hid_register_driver(&ks_driver); | ||
54 | } | ||
55 | |||
56 | static void ks_exit(void) | ||
57 | { | ||
58 | hid_unregister_driver(&ks_driver); | ||
59 | } | ||
60 | |||
61 | module_init(ks_init); | ||
62 | module_exit(ks_exit); | ||
63 | MODULE_LICENSE("GPL"); | ||
64 | |||
65 | HID_COMPAT_LOAD_DRIVER(kensington); | ||