aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorChristian Gmeiner <christian.gmeiner@gmail.com>2014-09-03 04:33:53 -0400
committerJiri Kosina <jkosina@suse.cz>2014-09-04 05:23:51 -0400
commitffe51d0d8abce3139a970c640ed48e73e9c360bb (patch)
tree9a5d3288bf94f08765d9b1532ea104d5a93b4e1a /drivers/hid
parent67a97845830f79584c9db8849ac723e5d2d57f65 (diff)
HID: add support for PenMount HID TouchScreen Driver
This patch adds a seperate hid-penmount driver to work around an issue with the HID report descriptor. The descriptor does not contain the ContactID usage and as result the touchscreen is represented as normal mouse to the system. This driver maps the button 0 emitted by the touchscreen to BTN_TOUCH. This makes it possible to use touch events in userspace. Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/Kconfig11
-rw-r--r--drivers/hid/Makefile1
-rw-r--r--drivers/hid/hid-core.c1
-rw-r--r--drivers/hid/hid-ids.h1
-rw-r--r--drivers/hid/hid-penmount.c49
5 files changed, 63 insertions, 0 deletions
diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
index c18d5d71062d..f42df4dd58d2 100644
--- a/drivers/hid/Kconfig
+++ b/drivers/hid/Kconfig
@@ -530,6 +530,17 @@ config PANTHERLORD_FF
530 Say Y here if you have a PantherLord/GreenAsia based game controller 530 Say Y here if you have a PantherLord/GreenAsia based game controller
531 or adapter and want to enable force feedback support for it. 531 or adapter and want to enable force feedback support for it.
532 532
533config HID_PENMOUNT
534 tristate "Penmount touch device"
535 depends on USB_HID
536 ---help---
537 This selects a driver for the PenMount 6000 touch controller.
538
539 The driver works around a problem in the report descript allowing
540 the userspace to touch events instead of mouse events.
541
542 Say Y here if you have a Penmount based touch controller.
543
533config HID_PETALYNX 544config HID_PETALYNX
534 tristate "Petalynx Maxter remote control" 545 tristate "Petalynx Maxter remote control"
535 depends on HID 546 depends on HID
diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile
index 4dbac7f8530c..e2850d8af9ca 100644
--- a/drivers/hid/Makefile
+++ b/drivers/hid/Makefile
@@ -71,6 +71,7 @@ obj-$(CONFIG_HID_NTRIG) += hid-ntrig.o
71obj-$(CONFIG_HID_ORTEK) += hid-ortek.o 71obj-$(CONFIG_HID_ORTEK) += hid-ortek.o
72obj-$(CONFIG_HID_PRODIKEYS) += hid-prodikeys.o 72obj-$(CONFIG_HID_PRODIKEYS) += hid-prodikeys.o
73obj-$(CONFIG_HID_PANTHERLORD) += hid-pl.o 73obj-$(CONFIG_HID_PANTHERLORD) += hid-pl.o
74obj-$(CONFIG_HID_PENMOUNT) += hid-penmount.o
74obj-$(CONFIG_HID_PETALYNX) += hid-petalynx.o 75obj-$(CONFIG_HID_PETALYNX) += hid-petalynx.o
75obj-$(CONFIG_HID_PICOLCD) += hid-picolcd.o 76obj-$(CONFIG_HID_PICOLCD) += hid-picolcd.o
76hid-picolcd-y += hid-picolcd_core.o 77hid-picolcd-y += hid-picolcd_core.o
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 12b6e67d9de0..6827196be3fc 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1880,6 +1880,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
1880 { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_18) }, 1880 { HID_USB_DEVICE(USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_18) },
1881 { HID_USB_DEVICE(USB_VENDOR_ID_ORTEK, USB_DEVICE_ID_ORTEK_PKB1700) }, 1881 { HID_USB_DEVICE(USB_VENDOR_ID_ORTEK, USB_DEVICE_ID_ORTEK_PKB1700) },
1882 { HID_USB_DEVICE(USB_VENDOR_ID_ORTEK, USB_DEVICE_ID_ORTEK_WKB2000) }, 1882 { HID_USB_DEVICE(USB_VENDOR_ID_ORTEK, USB_DEVICE_ID_ORTEK_WKB2000) },
1883 { HID_USB_DEVICE(USB_VENDOR_ID_PENMOUNT, USB_DEVICE_ID_PENMOUNT_6000) },
1883 { HID_USB_DEVICE(USB_VENDOR_ID_PETALYNX, USB_DEVICE_ID_PETALYNX_MAXTER_REMOTE) }, 1884 { HID_USB_DEVICE(USB_VENDOR_ID_PETALYNX, USB_DEVICE_ID_PETALYNX_MAXTER_REMOTE) },
1884 { HID_USB_DEVICE(USB_VENDOR_ID_PRIMAX, USB_DEVICE_ID_PRIMAX_KEYBOARD) }, 1885 { HID_USB_DEVICE(USB_VENDOR_ID_PRIMAX, USB_DEVICE_ID_PRIMAX_KEYBOARD) },
1885#if IS_ENABLED(CONFIG_HID_ROCCAT) 1886#if IS_ENABLED(CONFIG_HID_ROCCAT)
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index 25cd674d6064..3943ffe1a333 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -722,6 +722,7 @@
722#define USB_DEVICE_ID_PENMOUNT_PCI 0x3500 722#define USB_DEVICE_ID_PENMOUNT_PCI 0x3500
723#define USB_DEVICE_ID_PENMOUNT_1610 0x1610 723#define USB_DEVICE_ID_PENMOUNT_1610 0x1610
724#define USB_DEVICE_ID_PENMOUNT_1640 0x1640 724#define USB_DEVICE_ID_PENMOUNT_1640 0x1640
725#define USB_DEVICE_ID_PENMOUNT_6000 0x6000
725 726
726#define USB_VENDOR_ID_PETALYNX 0x18b1 727#define USB_VENDOR_ID_PETALYNX 0x18b1
727#define USB_DEVICE_ID_PETALYNX_MAXTER_REMOTE 0x0037 728#define USB_DEVICE_ID_PETALYNX_MAXTER_REMOTE 0x0037
diff --git a/drivers/hid/hid-penmount.c b/drivers/hid/hid-penmount.c
new file mode 100644
index 000000000000..c11dce85cd18
--- /dev/null
+++ b/drivers/hid/hid-penmount.c
@@ -0,0 +1,49 @@
1/*
2 * HID driver for PenMount touchscreens
3 *
4 * Copyright (c) 2014 Christian Gmeiner <christian.gmeiner <at> gmail.com>
5 *
6 * based on hid-penmount copyrighted by
7 * PenMount Touch Solutions <penmount <at> seed.net.tw>
8 */
9
10/*
11 * This program is free software; you can redistribute it and/or modify it
12 * under the terms of the GNU General Public License as published by the Free
13 * Software Foundation; either version 2 of the License, or (at your option)
14 * any later version.
15 */
16
17#include <linux/module.h>
18#include <linux/hid.h>
19#include "hid-ids.h"
20
21static int penmount_input_mapping(struct hid_device *hdev,
22 struct hid_input *hi, struct hid_field *field,
23 struct hid_usage *usage, unsigned long **bit, int *max)
24{
25 if ((usage->hid & HID_USAGE_PAGE) == HID_UP_BUTTON) {
26 hid_map_usage(hi, usage, bit, max, EV_KEY, BTN_TOUCH);
27 return 1;
28 }
29
30 return 0;
31}
32
33static const struct hid_device_id penmount_devices[] = {
34 { HID_USB_DEVICE(USB_VENDOR_ID_PENMOUNT, USB_DEVICE_ID_PENMOUNT_6000) },
35 { }
36};
37MODULE_DEVICE_TABLE(hid, penmount_devices);
38
39static struct hid_driver penmount_driver = {
40 .name = "hid-penmount",
41 .id_table = penmount_devices,
42 .input_mapping = penmount_input_mapping,
43};
44
45module_hid_driver(penmount_driver);
46
47MODULE_AUTHOR("Christian Gmeiner <christian.gmeiner@gmail.com>");
48MODULE_DESCRIPTION("PenMount HID TouchScreen driver");
49MODULE_LICENSE("GPL");