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-ntrig.c | 82 |
6 files changed, 97 insertions, 0 deletions
diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig index 65b577eaf823..aadef9abc05d 100644 --- a/drivers/hid/Kconfig +++ b/drivers/hid/Kconfig | |||
@@ -187,6 +187,13 @@ config HID_MONTEREY | |||
187 | ---help--- | 187 | ---help--- |
188 | Support for Monterey Genius KB29E. | 188 | Support for Monterey Genius KB29E. |
189 | 189 | ||
190 | config HID_NTRIG | ||
191 | tristate "NTrig" if EMBEDDED | ||
192 | depends on USB_HID | ||
193 | default y | ||
194 | ---help--- | ||
195 | Support for N-Trig touch screen. | ||
196 | |||
190 | config HID_PANTHERLORD | 197 | config HID_PANTHERLORD |
191 | tristate "Pantherlord devices support" if EMBEDDED | 198 | tristate "Pantherlord devices support" if EMBEDDED |
192 | depends on USB_HID | 199 | depends on USB_HID |
diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile index e2294a8b2a68..7d34e8bf3de5 100644 --- a/drivers/hid/Makefile +++ b/drivers/hid/Makefile | |||
@@ -31,6 +31,7 @@ obj-$(CONFIG_HID_GYRATION) += hid-gyration.o | |||
31 | obj-$(CONFIG_HID_LOGITECH) += hid-logitech.o | 31 | obj-$(CONFIG_HID_LOGITECH) += hid-logitech.o |
32 | obj-$(CONFIG_HID_MICROSOFT) += hid-microsoft.o | 32 | obj-$(CONFIG_HID_MICROSOFT) += hid-microsoft.o |
33 | obj-$(CONFIG_HID_MONTEREY) += hid-monterey.o | 33 | obj-$(CONFIG_HID_MONTEREY) += hid-monterey.o |
34 | obj-$(CONFIG_HID_NTRIG) += hid-ntrig.o | ||
34 | obj-$(CONFIG_HID_PANTHERLORD) += hid-pl.o | 35 | obj-$(CONFIG_HID_PANTHERLORD) += hid-pl.o |
35 | obj-$(CONFIG_HID_PETALYNX) += hid-petalynx.o | 36 | obj-$(CONFIG_HID_PETALYNX) += hid-petalynx.o |
36 | obj-$(CONFIG_HID_SAMSUNG) += hid-samsung.o | 37 | obj-$(CONFIG_HID_SAMSUNG) += hid-samsung.o |
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 8624a8fe085b..344f8fdb2824 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c | |||
@@ -1292,6 +1292,7 @@ static const struct hid_device_id hid_blacklist[] = { | |||
1292 | { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_PRESENTER_8K_USB) }, | 1292 | { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_PRESENTER_8K_USB) }, |
1293 | { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_WIRELESS_OPTICAL_DESKTOP_3_0) }, | 1293 | { HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_WIRELESS_OPTICAL_DESKTOP_3_0) }, |
1294 | { HID_USB_DEVICE(USB_VENDOR_ID_MONTEREY, USB_DEVICE_ID_GENIUS_KB29E) }, | 1294 | { HID_USB_DEVICE(USB_VENDOR_ID_MONTEREY, USB_DEVICE_ID_GENIUS_KB29E) }, |
1295 | { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN) }, | ||
1295 | { HID_USB_DEVICE(USB_VENDOR_ID_PETALYNX, USB_DEVICE_ID_PETALYNX_MAXTER_REMOTE) }, | 1296 | { HID_USB_DEVICE(USB_VENDOR_ID_PETALYNX, USB_DEVICE_ID_PETALYNX_MAXTER_REMOTE) }, |
1296 | { HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_IR_REMOTE) }, | 1297 | { HID_USB_DEVICE(USB_VENDOR_ID_SAMSUNG, USB_DEVICE_ID_SAMSUNG_IR_REMOTE) }, |
1297 | { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_CONTROLLER) }, | 1298 | { HID_USB_DEVICE(USB_VENDOR_ID_SONY, USB_DEVICE_ID_SONY_PS3_CONTROLLER) }, |
diff --git a/drivers/hid/hid-dummy.c b/drivers/hid/hid-dummy.c index e148f86fb58e..4a6af3cf192d 100644 --- a/drivers/hid/hid-dummy.c +++ b/drivers/hid/hid-dummy.c | |||
@@ -43,6 +43,9 @@ static int __init hid_dummy_init(void) | |||
43 | #ifdef CONFIG_HID_MONTEREY_MODULE | 43 | #ifdef CONFIG_HID_MONTEREY_MODULE |
44 | HID_COMPAT_CALL_DRIVER(monterey); | 44 | HID_COMPAT_CALL_DRIVER(monterey); |
45 | #endif | 45 | #endif |
46 | #ifdef CONFIG_HID_NTRIG_MODULE | ||
47 | HID_COMPAT_CALL_DRIVER(ntrig); | ||
48 | #endif | ||
46 | #ifdef CONFIG_HID_PANTHERLORD_MODULE | 49 | #ifdef CONFIG_HID_PANTHERLORD_MODULE |
47 | HID_COMPAT_CALL_DRIVER(pantherlord); | 50 | HID_COMPAT_CALL_DRIVER(pantherlord); |
48 | #endif | 51 | #endif |
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index aae2ceca0bce..2b7b6eeae8c6 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h | |||
@@ -328,6 +328,9 @@ | |||
328 | #define USB_VENDOR_ID_NEC 0x073e | 328 | #define USB_VENDOR_ID_NEC 0x073e |
329 | #define USB_DEVICE_ID_NEC_USB_GAME_PAD 0x0301 | 329 | #define USB_DEVICE_ID_NEC_USB_GAME_PAD 0x0301 |
330 | 330 | ||
331 | #define USB_VENDOR_ID_NTRIG 0x1b96 | ||
332 | #define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN 0x0001 | ||
333 | |||
331 | #define USB_VENDOR_ID_ONTRAK 0x0a07 | 334 | #define USB_VENDOR_ID_ONTRAK 0x0a07 |
332 | #define USB_DEVICE_ID_ONTRAK_ADU100 0x0064 | 335 | #define USB_DEVICE_ID_ONTRAK_ADU100 0x0064 |
333 | 336 | ||
diff --git a/drivers/hid/hid-ntrig.c b/drivers/hid/hid-ntrig.c new file mode 100644 index 000000000000..db44fbd7bdf6 --- /dev/null +++ b/drivers/hid/hid-ntrig.c | |||
@@ -0,0 +1,82 @@ | |||
1 | /* | ||
2 | * HID driver for some ntrig "special" devices | ||
3 | * | ||
4 | * Copyright (c) 1999 Andreas Gal | ||
5 | * Copyright (c) 2000-2005 Vojtech Pavlik <vojtech@suse.cz> | ||
6 | * Copyright (c) 2005 Michael Haboustak <mike-@cinci.rr.com> for Concept2, Inc | ||
7 | * Copyright (c) 2006-2007 Jiri Kosina | ||
8 | * Copyright (c) 2007 Paul Walmsley | ||
9 | * Copyright (c) 2008 Jiri Slaby | ||
10 | * Copyright (c) 2008 Rafi Rubin | ||
11 | * | ||
12 | */ | ||
13 | |||
14 | /* | ||
15 | * This program is free software; you can redistribute it and/or modify it | ||
16 | * under the terms of the GNU General Public License as published by the Free | ||
17 | * Software Foundation; either version 2 of the License, or (at your option) | ||
18 | * any later version. | ||
19 | */ | ||
20 | |||
21 | #include <linux/device.h> | ||
22 | #include <linux/hid.h> | ||
23 | #include <linux/module.h> | ||
24 | |||
25 | #include "hid-ids.h" | ||
26 | |||
27 | #define NTRIG_DUPLICATE_USAGES 0x001 | ||
28 | |||
29 | #define nt_map_key_clear(c) hid_map_usage_clear(hi, usage, bit, max, \ | ||
30 | EV_KEY, (c)) | ||
31 | |||
32 | static int ntrig_input_mapping(struct hid_device *hdev, struct hid_input *hi, | ||
33 | struct hid_field *field, struct hid_usage *usage, | ||
34 | unsigned long **bit, int *max) | ||
35 | { | ||
36 | if ((usage->hid & HID_USAGE_PAGE) == HID_UP_DIGITIZER && | ||
37 | (usage->hid & 0xff) == 0x47) { | ||
38 | nt_map_key_clear(BTN_TOOL_DOUBLETAP); | ||
39 | return 1; | ||
40 | } | ||
41 | return 0; | ||
42 | } | ||
43 | |||
44 | static int ntrig_input_mapped(struct hid_device *hdev, struct hid_input *hi, | ||
45 | struct hid_field *field, struct hid_usage *usage, | ||
46 | unsigned long **bit, int *max) | ||
47 | { | ||
48 | if (usage->type == EV_KEY || usage->type == EV_REL | ||
49 | || usage->type == EV_ABS) | ||
50 | clear_bit(usage->code, *bit); | ||
51 | |||
52 | return 0; | ||
53 | } | ||
54 | static const struct hid_device_id ntrig_devices[] = { | ||
55 | { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN), | ||
56 | .driver_data = NTRIG_DUPLICATE_USAGES }, | ||
57 | { } | ||
58 | }; | ||
59 | MODULE_DEVICE_TABLE(hid, ntrig_devices); | ||
60 | |||
61 | static struct hid_driver ntrig_driver = { | ||
62 | .name = "ntrig", | ||
63 | .id_table = ntrig_devices, | ||
64 | .input_mapping = ntrig_input_mapping, | ||
65 | .input_mapped = ntrig_input_mapped, | ||
66 | }; | ||
67 | |||
68 | static int ntrig_init(void) | ||
69 | { | ||
70 | return hid_register_driver(&ntrig_driver); | ||
71 | } | ||
72 | |||
73 | static void ntrig_exit(void) | ||
74 | { | ||
75 | hid_unregister_driver(&ntrig_driver); | ||
76 | } | ||
77 | |||
78 | module_init(ntrig_init); | ||
79 | module_exit(ntrig_exit); | ||
80 | MODULE_LICENSE("GPL"); | ||
81 | |||
82 | HID_COMPAT_LOAD_DRIVER(ntrig); | ||