Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-or-later
0002 /*
0003  * HID driver for Elo Accutouch touchscreens
0004  *
0005  * Copyright (c) 2016, Collabora Ltd.
0006  * Copyright (c) 2016, General Electric Company
0007  *
0008  * based on hid-penmount.c
0009  *  Copyright (c) 2014 Christian Gmeiner <christian.gmeiner <at> gmail.com>
0010  */
0011 
0012 /*
0013  */
0014 
0015 #include <linux/hid.h>
0016 #include <linux/module.h>
0017 #include "hid-ids.h"
0018 
0019 static int accutouch_input_mapping(struct hid_device *hdev,
0020                    struct hid_input *hi,
0021                    struct hid_field *field,
0022                    struct hid_usage *usage,
0023                    unsigned long **bit, int *max)
0024 {
0025     if ((usage->hid & HID_USAGE_PAGE) == HID_UP_BUTTON) {
0026         hid_map_usage(hi, usage, bit, max, EV_KEY, BTN_TOUCH);
0027         return 1;
0028     }
0029 
0030     return 0;
0031 }
0032 
0033 static const struct hid_device_id accutouch_devices[] = {
0034     { HID_USB_DEVICE(USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_ACCUTOUCH_2216) },
0035     { }
0036 };
0037 MODULE_DEVICE_TABLE(hid, accutouch_devices);
0038 
0039 static struct hid_driver accutouch_driver = {
0040     .name = "hid-accutouch",
0041     .id_table = accutouch_devices,
0042     .input_mapping = accutouch_input_mapping,
0043 };
0044 
0045 module_hid_driver(accutouch_driver);
0046 
0047 MODULE_AUTHOR("Martyn Welch <martyn.welch@collabora.co.uk");
0048 MODULE_DESCRIPTION("Elo Accutouch HID TouchScreen driver");
0049 MODULE_LICENSE("GPL");