aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2011-02-17 09:12:45 -0500
committerJiri Kosina <jkosina@suse.cz>2011-02-17 09:12:45 -0500
commit177900e8c9ab28cdf097314fe7dd3877774df97d (patch)
tree1936e26251316bdbaebdd07f2f3ede2d1cc9e976 /drivers/hid
parent6d3bfb74341c2c1454fcf5ec9c4dd707011f78e5 (diff)
HID: add support for Keytouch IEC 60945
The keyboard has several bugs in its report descriptor, most importantly the Logical Min/Max are completely off. Replace it with simplified descriptor which describes it properly. Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/Kconfig8
-rw-r--r--drivers/hid/Makefile1
-rw-r--r--drivers/hid/hid-core.c1
-rw-r--r--drivers/hid/hid-ids.h3
-rw-r--r--drivers/hid/hid-keytouch.c66
5 files changed, 79 insertions, 0 deletions
diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
index 94e73db580d2..5fa0b952914c 100644
--- a/drivers/hid/Kconfig
+++ b/drivers/hid/Kconfig
@@ -180,6 +180,14 @@ config HID_EZKEY
180 ---help--- 180 ---help---
181 Support for Ezkey BTC 8193 keyboard. 181 Support for Ezkey BTC 8193 keyboard.
182 182
183config HID_KEYTOUCH
184 tristate "Keyoutch HID devices"
185 depends on USB_HID
186 ---help---
187 Support for Keytouch HID devices not fully compliant with
188 the specification. Currently supported:
189 - Keytouch IEC 60945
190
183config HID_KYE 191config HID_KYE
184 tristate "Kye/Genius Ergo Mouse" if EMBEDDED 192 tristate "Kye/Genius Ergo Mouse" if EMBEDDED
185 depends on USB_HID 193 depends on USB_HID
diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile
index 2e1b1e3326c9..569647763d1b 100644
--- a/drivers/hid/Makefile
+++ b/drivers/hid/Makefile
@@ -41,6 +41,7 @@ obj-$(CONFIG_HID_ELECOM) += hid-elecom.o
41obj-$(CONFIG_HID_EZKEY) += hid-ezkey.o 41obj-$(CONFIG_HID_EZKEY) += hid-ezkey.o
42obj-$(CONFIG_HID_GYRATION) += hid-gyration.o 42obj-$(CONFIG_HID_GYRATION) += hid-gyration.o
43obj-$(CONFIG_HID_KENSINGTON) += hid-kensington.o 43obj-$(CONFIG_HID_KENSINGTON) += hid-kensington.o
44obj-$(CONFIG_HID_KEYTOUCH) += hid-keytouch.o
44obj-$(CONFIG_HID_KYE) += hid-kye.o 45obj-$(CONFIG_HID_KYE) += hid-kye.o
45obj-$(CONFIG_HID_LCPOWER) += hid-lcpower.o 46obj-$(CONFIG_HID_LCPOWER) += hid-lcpower.o
46obj-$(CONFIG_HID_LOGITECH) += hid-logitech.o 47obj-$(CONFIG_HID_LOGITECH) += hid-logitech.o
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 5e0e4eea7065..570db37d574d 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1379,6 +1379,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
1379 { HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE_3) }, 1379 { HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE_3) },
1380 { HID_USB_DEVICE(USB_VENDOR_ID_HANVON, USB_DEVICE_ID_HANVON_MULTITOUCH) }, 1380 { HID_USB_DEVICE(USB_VENDOR_ID_HANVON, USB_DEVICE_ID_HANVON_MULTITOUCH) },
1381 { HID_USB_DEVICE(USB_VENDOR_ID_KENSINGTON, USB_DEVICE_ID_KS_SLIMBLADE) }, 1381 { HID_USB_DEVICE(USB_VENDOR_ID_KENSINGTON, USB_DEVICE_ID_KS_SLIMBLADE) },
1382 { HID_USB_DEVICE(USB_VENDOR_ID_KEYTOUCH, USB_DEVICE_ID_KEYTOUCH_IEC) },
1382 { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_ERGO_525V) }, 1383 { HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_ERGO_525V) },
1383 { HID_USB_DEVICE(USB_VENDOR_ID_LABTEC, USB_DEVICE_ID_LABTEC_WIRELESS_KEYBOARD) }, 1384 { HID_USB_DEVICE(USB_VENDOR_ID_LABTEC, USB_DEVICE_ID_LABTEC_WIRELESS_KEYBOARD) },
1384 { HID_USB_DEVICE(USB_VENDOR_ID_LCPOWER, USB_DEVICE_ID_LCPOWER_LC1000 ) }, 1385 { HID_USB_DEVICE(USB_VENDOR_ID_LCPOWER, USB_DEVICE_ID_LCPOWER_LC1000 ) },
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index 15aca15a0a7b..8fc82a7b2a82 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -345,6 +345,9 @@
345#define USB_VENDOR_ID_KWORLD 0x1b80 345#define USB_VENDOR_ID_KWORLD 0x1b80
346#define USB_DEVICE_ID_KWORLD_RADIO_FM700 0xd700 346#define USB_DEVICE_ID_KWORLD_RADIO_FM700 0xd700
347 347
348#define USB_VENDOR_ID_KEYTOUCH 0x0926
349#define USB_DEVICE_ID_KEYTOUCH_IEC 0x3333
350
348#define USB_VENDOR_ID_KYE 0x0458 351#define USB_VENDOR_ID_KYE 0x0458
349#define USB_DEVICE_ID_KYE_ERGO_525V 0x0087 352#define USB_DEVICE_ID_KYE_ERGO_525V 0x0087
350#define USB_DEVICE_ID_KYE_GPEN_560 0x5003 353#define USB_DEVICE_ID_KYE_GPEN_560 0x5003
diff --git a/drivers/hid/hid-keytouch.c b/drivers/hid/hid-keytouch.c
new file mode 100644
index 000000000000..07cd825f6f01
--- /dev/null
+++ b/drivers/hid/hid-keytouch.c
@@ -0,0 +1,66 @@
1/*
2 * HID driver for Keytouch devices not fully compliant with HID standard
3 *
4 * Copyright (c) 2011 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/hid.h>
16#include <linux/module.h>
17
18#include "hid-ids.h"
19
20/* Replace the broken report descriptor of this device with rather
21 * a default one */
22static __u8 keytouch_fixed_rdesc[] = {
230x05, 0x01, 0x09, 0x06, 0xa1, 0x01, 0x05, 0x07, 0x19, 0xe0, 0x29, 0xe7, 0x15,
240x00, 0x25, 0x01, 0x75, 0x01, 0x95, 0x08, 0x81, 0x02, 0x95, 0x01, 0x75, 0x08,
250x81, 0x01, 0x95, 0x03, 0x75, 0x01, 0x05, 0x08, 0x19, 0x01, 0x29, 0x03, 0x91,
260x02, 0x95, 0x05, 0x75, 0x01, 0x91, 0x01, 0x95, 0x06, 0x75, 0x08, 0x15, 0x00,
270x26, 0xff, 0x00, 0x05, 0x07, 0x19, 0x00, 0x2a, 0xff, 0x00, 0x81, 0x00, 0xc0
28};
29
30static __u8 *keytouch_report_fixup(struct hid_device *hdev, __u8 *rdesc,
31 unsigned int *rsize)
32{
33 hid_info(hdev, "fixing up Keytouch IEC report descriptor\n");
34
35 rdesc = keytouch_fixed_rdesc;
36 *rsize = sizeof(keytouch_fixed_rdesc);
37
38 return rdesc;
39}
40
41static const struct hid_device_id keytouch_devices[] = {
42 { HID_USB_DEVICE(USB_VENDOR_ID_KEYTOUCH, USB_DEVICE_ID_KEYTOUCH_IEC) },
43 { }
44};
45MODULE_DEVICE_TABLE(hid, keytouch_devices);
46
47static struct hid_driver keytouch_driver = {
48 .name = "keytouch",
49 .id_table = keytouch_devices,
50 .report_fixup = keytouch_report_fixup,
51};
52
53static int __init keytouch_init(void)
54{
55 return hid_register_driver(&keytouch_driver);
56}
57
58static void __exit keytouch_exit(void)
59{
60 hid_unregister_driver(&keytouch_driver);
61}
62
63module_init(keytouch_init);
64module_exit(keytouch_exit);
65MODULE_LICENSE("GPL");
66MODULE_AUTHOR("Jiri Kosina");