1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * HID driver for PenMount touchscreens
5 * Copyright (c) 2014 Christian Gmeiner <christian.gmeiner <at> gmail.com>
7 * based on hid-penmount copyrighted by
8 * PenMount Touch Solutions <penmount <at> seed.net.tw>
14 #include <linux/module.h>
15 #include <linux/hid.h>
18 static int penmount_input_mapping(struct hid_device *hdev,
19 struct hid_input *hi, struct hid_field *field,
20 struct hid_usage *usage, unsigned long **bit, int *max)
22 if ((usage->hid & HID_USAGE_PAGE) == HID_UP_BUTTON) {
23 if (((usage->hid - 1) & HID_USAGE) == 0) {
24 hid_map_usage(hi, usage, bit, max, EV_KEY, BTN_TOUCH);
34 static const struct hid_device_id penmount_devices[] = {
35 { HID_USB_DEVICE(USB_VENDOR_ID_PENMOUNT, USB_DEVICE_ID_PENMOUNT_6000) },
38 MODULE_DEVICE_TABLE(hid, penmount_devices);
40 static struct hid_driver penmount_driver = {
41 .name = "hid-penmount",
42 .id_table = penmount_devices,
43 .input_mapping = penmount_input_mapping,
46 module_hid_driver(penmount_driver);
48 MODULE_AUTHOR("Christian Gmeiner <christian.gmeiner@gmail.com>");
49 MODULE_DESCRIPTION("PenMount HID TouchScreen driver");
50 MODULE_LICENSE("GPL");