aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2009-03-04 10:09:40 -0500
committerJiri Kosina <jkosina@suse.cz>2009-03-30 09:12:53 -0400
commitfdf93aa33268889e126aa677f2072238bd76adb0 (patch)
tree62283ae9912df1b74b6062478ef9bd135e39cc8d /drivers/hid
parent3f866fbd52d1863db5c07700e560aef22c4fdc01 (diff)
HID: support for Kensington slimblade device
0x47d/0x2041 device sends two extra buttons in 0xff00 usage page and therefore requires special handling. Reported-by: Jason Noble <nobleja@polezero.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/Kconfig7
-rw-r--r--drivers/hid/Makefile1
-rw-r--r--drivers/hid/hid-core.c1
-rw-r--r--drivers/hid/hid-dummy.c3
-rw-r--r--drivers/hid/hid-ids.h3
-rw-r--r--drivers/hid/hid-kensington.c65
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
153config HID_KENSINGTON
154 tristate "Kensington" if EMBEDDED
155 depends on USB_HID
156 default !EMBEDDED
157 ---help---
158 Support for Kensington Slimblade Trackball.
159
153config HID_LOGITECH 160config 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
29obj-$(CONFIG_DRAGONRISE_FF) += hid-drff.o 29obj-$(CONFIG_DRAGONRISE_FF) += hid-drff.o
30obj-$(CONFIG_HID_EZKEY) += hid-ezkey.o 30obj-$(CONFIG_HID_EZKEY) += hid-ezkey.o
31obj-$(CONFIG_HID_GYRATION) += hid-gyration.o 31obj-$(CONFIG_HID_GYRATION) += hid-gyration.o
32obj-$(CONFIG_HID_KENSINGTON) += hid-kensington.o
32obj-$(CONFIG_HID_LOGITECH) += hid-logitech.o 33obj-$(CONFIG_HID_LOGITECH) += hid-logitech.o
33obj-$(CONFIG_HID_MICROSOFT) += hid-microsoft.o 34obj-$(CONFIG_HID_MICROSOFT) += hid-microsoft.o
34obj-$(CONFIG_HID_MONTEREY) += hid-monterey.o 35obj-$(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
23static 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
39static const struct hid_device_id ks_devices[] = {
40 { HID_USB_DEVICE(USB_VENDOR_ID_KENSINGTON, USB_DEVICE_ID_KS_SLIMBLADE) },
41 { }
42};
43MODULE_DEVICE_TABLE(hid, ks_devices);
44
45static struct hid_driver ks_driver = {
46 .name = "kensington",
47 .id_table = ks_devices,
48 .input_mapping = ks_input_mapping,
49};
50
51static int ks_init(void)
52{
53 return hid_register_driver(&ks_driver);
54}
55
56static void ks_exit(void)
57{
58 hid_unregister_driver(&ks_driver);
59}
60
61module_init(ks_init);
62module_exit(ks_exit);
63MODULE_LICENSE("GPL");
64
65HID_COMPAT_LOAD_DRIVER(kensington);