aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-keytouch.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-03-18 13:35:30 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-03-18 13:35:30 -0400
commit7fd23a24717a327a66f3c32d11a20a2f169c824f (patch)
tree62a731f3edac9e58427fc27396ad5da8804fa579 /drivers/hid/hid-keytouch.c
parent0a95d92c0054e74fb79607ac2df958b7bf295706 (diff)
parent65b06194c9c9f41bc07ac6a6d42edb4b9e43fea4 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: (48 commits) HID: add support for Logitech Driving Force Pro wheel HID: hid-ortek: remove spurious reference HID: add support for Ortek PKB-1700 HID: roccat-koneplus: vorrect mode of sysfs attr 'sensor' HID: hid-ntrig: init settle and mode check HID: merge hid-egalax into hid-multitouch HID: hid-multitouch: Send events per slot if CONTACTCOUNT is missing HID: ntrig remove if and drop an indent HID: ACRUX - activate the device immediately after binding HID: ntrig: apply NO_INIT_REPORTS quirk HID: hid-magicmouse: Correct touch orientation direction HID: ntrig don't dereference unclaimed hidinput HID: Do not create input devices for feature reports HID: bt hidp: send Output reports using SET_REPORT on the Control channel HID: hid-sony.c: Fix sending Output reports to the Sixaxis HID: add support for Keytouch IEC 60945 HID: Add HID Report Descriptor to sysfs HID: add IRTOUCH infrared USB to hid_have_special_driver HID: kernel oops in out_cleanup in function hidinput_connect HID: Add teletext/color keys - gyration remote - EU version (GYAR3101CKDE) ...
Diffstat (limited to 'drivers/hid/hid-keytouch.c')
-rw-r--r--drivers/hid/hid-keytouch.c66
1 files changed, 66 insertions, 0 deletions
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");