1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * HID driver for EVision devices
4 * For now, only ignore bogus consumer reports
5 * sent after the keyboard has been configured
7 * Copyright (c) 2022 Philippe Valembois
10 #include <linux/device.h>
11 #include <linux/input.h>
12 #include <linux/hid.h>
13 #include <linux/module.h>
17 static int evision_input_mapping(struct hid_device *hdev, struct hid_input *hi,
18 struct hid_field *field, struct hid_usage *usage,
19 unsigned long **bit, int *max)
21 if ((usage->hid & HID_USAGE_PAGE) != HID_UP_CONSUMER)
24 /* Ignore key down event */
25 if ((usage->hid & HID_USAGE) >> 8 == 0x05)
27 /* Ignore key up event */
28 if ((usage->hid & HID_USAGE) >> 8 == 0x06)
31 switch (usage->hid & HID_USAGE) {
32 /* Ignore configuration saved event */
33 case 0x0401: return -1;
34 /* Ignore reset event */
35 case 0x0402: return -1;
40 static const struct hid_device_id evision_devices[] = {
41 { HID_USB_DEVICE(USB_VENDOR_ID_EVISION, USB_DEVICE_ID_EVISION_ICL01) },
44 MODULE_DEVICE_TABLE(hid, evision_devices);
46 static struct hid_driver evision_driver = {
48 .id_table = evision_devices,
49 .input_mapping = evision_input_mapping,
51 module_hid_driver(evision_driver);
53 MODULE_LICENSE("GPL");