aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRafi Rubin <rafi@seas.upenn.edu>2008-11-19 09:54:46 -0500
committerJiri Kosina <jkosina@suse.cz>2009-01-03 19:00:51 -0500
commit94011f93f2cd7410401e22390cf7a14fe5495a22 (patch)
treeb0e96a437574d2a5ce9f34d695b8f78bdc2c3916 /drivers
parent9188e79ec3fd43a0a605274324aecfb731baa88b (diff)
HID: add n-trig digitizer support
Added quirks for the N-Trig digitizer. Signed-off-by: Rafi Rubin <rafi@seas.upenn.edu> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers')
-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-ntrig.c82
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
190config 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
190config HID_PANTHERLORD 197config 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
31obj-$(CONFIG_HID_LOGITECH) += hid-logitech.o 31obj-$(CONFIG_HID_LOGITECH) += hid-logitech.o
32obj-$(CONFIG_HID_MICROSOFT) += hid-microsoft.o 32obj-$(CONFIG_HID_MICROSOFT) += hid-microsoft.o
33obj-$(CONFIG_HID_MONTEREY) += hid-monterey.o 33obj-$(CONFIG_HID_MONTEREY) += hid-monterey.o
34obj-$(CONFIG_HID_NTRIG) += hid-ntrig.o
34obj-$(CONFIG_HID_PANTHERLORD) += hid-pl.o 35obj-$(CONFIG_HID_PANTHERLORD) += hid-pl.o
35obj-$(CONFIG_HID_PETALYNX) += hid-petalynx.o 36obj-$(CONFIG_HID_PETALYNX) += hid-petalynx.o
36obj-$(CONFIG_HID_SAMSUNG) += hid-samsung.o 37obj-$(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
32static 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
44static 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}
54static 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};
59MODULE_DEVICE_TABLE(hid, ntrig_devices);
60
61static 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
68static int ntrig_init(void)
69{
70 return hid_register_driver(&ntrig_driver);
71}
72
73static void ntrig_exit(void)
74{
75 hid_unregister_driver(&ntrig_driver);
76}
77
78module_init(ntrig_init);
79module_exit(ntrig_exit);
80MODULE_LICENSE("GPL");
81
82HID_COMPAT_LOAD_DRIVER(ntrig);