Linux Audio

Check our new training course

Loading...
v6.13.7
 1// SPDX-License-Identifier: GPL-2.0-or-later
 2/*
 3 * HID driver for Elo Accutouch touchscreens
 4 *
 5 * Copyright (c) 2016, Collabora Ltd.
 6 * Copyright (c) 2016, General Electric Company
 7 *
 8 * based on hid-penmount.c
 9 *  Copyright (c) 2014 Christian Gmeiner <christian.gmeiner <at> gmail.com>
10 */
11
12/*
 
 
 
 
13 */
14
15#include <linux/hid.h>
16#include <linux/module.h>
17#include "hid-ids.h"
18
19static int accutouch_input_mapping(struct hid_device *hdev,
20				   struct hid_input *hi,
21				   struct hid_field *field,
22				   struct hid_usage *usage,
23				   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 accutouch_devices[] = {
34	{ HID_USB_DEVICE(USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_ACCUTOUCH_2216) },
35	{ }
36};
37MODULE_DEVICE_TABLE(hid, accutouch_devices);
38
39static struct hid_driver accutouch_driver = {
40	.name = "hid-accutouch",
41	.id_table = accutouch_devices,
42	.input_mapping = accutouch_input_mapping,
43};
44
45module_hid_driver(accutouch_driver);
46
47MODULE_AUTHOR("Martyn Welch <martyn.welch@collabora.co.uk");
48MODULE_DESCRIPTION("Elo Accutouch HID TouchScreen driver");
49MODULE_LICENSE("GPL");
v4.17
 
 1/*
 2 * HID driver for Elo Accutouch touchscreens
 3 *
 4 * Copyright (c) 2016, Collabora Ltd.
 5 * Copyright (c) 2016, General Electric Company
 6 *
 7 * based on hid-penmount.c
 8 *  Copyright (c) 2014 Christian Gmeiner <christian.gmeiner <at> gmail.com>
 9 */
10
11/*
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the Free
14 * Software Foundation; either version 2 of the License, or (at your option)
15 * any later version.
16 */
17
18#include <linux/hid.h>
19#include <linux/module.h>
20#include "hid-ids.h"
21
22static int accutouch_input_mapping(struct hid_device *hdev,
23				   struct hid_input *hi,
24				   struct hid_field *field,
25				   struct hid_usage *usage,
26				   unsigned long **bit, int *max)
27{
28	if ((usage->hid & HID_USAGE_PAGE) == HID_UP_BUTTON) {
29		hid_map_usage(hi, usage, bit, max, EV_KEY, BTN_TOUCH);
30		return 1;
31	}
32
33	return 0;
34}
35
36static const struct hid_device_id accutouch_devices[] = {
37	{ HID_USB_DEVICE(USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_ACCUTOUCH_2216) },
38	{ }
39};
40MODULE_DEVICE_TABLE(hid, accutouch_devices);
41
42static struct hid_driver accutouch_driver = {
43	.name = "hid-accutouch",
44	.id_table = accutouch_devices,
45	.input_mapping = accutouch_input_mapping,
46};
47
48module_hid_driver(accutouch_driver);
49
50MODULE_AUTHOR("Martyn Welch <martyn.welch@collabora.co.uk");
51MODULE_DESCRIPTION("Elo Accutouch HID TouchScreen driver");
52MODULE_LICENSE("GPL");