diff options
-rw-r--r-- | drivers/hid/Kconfig | 7 | ||||
-rw-r--r-- | drivers/hid/Makefile | 1 | ||||
-rw-r--r-- | drivers/hid/hid-core.c | 1 | ||||
-rw-r--r-- | drivers/hid/hid-ids.h | 1 | ||||
-rw-r--r-- | drivers/hid/hid-ite.c | 56 |
5 files changed, 66 insertions, 0 deletions
diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig index fe40e5e499dd..c4f65ce65b9a 100644 --- a/drivers/hid/Kconfig +++ b/drivers/hid/Kconfig | |||
@@ -386,6 +386,13 @@ config HID_ICADE | |||
386 | To compile this driver as a module, choose M here: the | 386 | To compile this driver as a module, choose M here: the |
387 | module will be called hid-icade. | 387 | module will be called hid-icade. |
388 | 388 | ||
389 | config HID_ITE | ||
390 | tristate "ITE devices" | ||
391 | depends on HID | ||
392 | default !EXPERT | ||
393 | ---help--- | ||
394 | Support for ITE devices not fully compliant with HID standard. | ||
395 | |||
389 | config HID_TWINHAN | 396 | config HID_TWINHAN |
390 | tristate "Twinhan IR remote control" | 397 | tristate "Twinhan IR remote control" |
391 | depends on HID | 398 | depends on HID |
diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile index fef027bc7fa3..05ac8d375aeb 100644 --- a/drivers/hid/Makefile +++ b/drivers/hid/Makefile | |||
@@ -50,6 +50,7 @@ obj-$(CONFIG_HID_HOLTEK) += hid-holtek-mouse.o | |||
50 | obj-$(CONFIG_HID_HOLTEK) += hid-holtekff.o | 50 | obj-$(CONFIG_HID_HOLTEK) += hid-holtekff.o |
51 | obj-$(CONFIG_HID_HYPERV_MOUSE) += hid-hyperv.o | 51 | obj-$(CONFIG_HID_HYPERV_MOUSE) += hid-hyperv.o |
52 | obj-$(CONFIG_HID_ICADE) += hid-icade.o | 52 | obj-$(CONFIG_HID_ICADE) += hid-icade.o |
53 | obj-$(CONFIG_HID_ITE) += hid-ite.o | ||
53 | obj-$(CONFIG_HID_KENSINGTON) += hid-kensington.o | 54 | obj-$(CONFIG_HID_KENSINGTON) += hid-kensington.o |
54 | obj-$(CONFIG_HID_KEYTOUCH) += hid-keytouch.o | 55 | obj-$(CONFIG_HID_KEYTOUCH) += hid-keytouch.o |
55 | obj-$(CONFIG_HID_KYE) += hid-kye.o | 56 | obj-$(CONFIG_HID_KYE) += hid-kye.o |
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 37084b645785..bd48e1568462 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c | |||
@@ -1913,6 +1913,7 @@ static const struct hid_device_id hid_have_special_driver[] = { | |||
1913 | { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A081) }, | 1913 | { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A081) }, |
1914 | { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A0C2) }, | 1914 | { HID_USB_DEVICE(USB_VENDOR_ID_HOLTEK_ALT, USB_DEVICE_ID_HOLTEK_ALT_MOUSE_A0C2) }, |
1915 | { HID_USB_DEVICE(USB_VENDOR_ID_HUION, USB_DEVICE_ID_HUION_TABLET) }, | 1915 | { HID_USB_DEVICE(USB_VENDOR_ID_HUION, USB_DEVICE_ID_HUION_TABLET) }, |
1916 | { HID_USB_DEVICE(USB_VENDOR_ID_ITE, USB_DEVICE_ID_ITE8595) }, | ||
1916 | { HID_USB_DEVICE(USB_VENDOR_ID_JESS, USB_DEVICE_ID_JESS_ZEN_AIO_KBD) }, | 1917 | { HID_USB_DEVICE(USB_VENDOR_ID_JESS, USB_DEVICE_ID_JESS_ZEN_AIO_KBD) }, |
1917 | { HID_USB_DEVICE(USB_VENDOR_ID_JESS2, USB_DEVICE_ID_JESS2_COLOR_RUMBLE_PAD) }, | 1918 | { HID_USB_DEVICE(USB_VENDOR_ID_JESS2, USB_DEVICE_ID_JESS2_COLOR_RUMBLE_PAD) }, |
1918 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ION, USB_DEVICE_ID_ICADE) }, | 1919 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ION, USB_DEVICE_ID_ICADE) }, |
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index 643390ba749d..79674a3ee118 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h | |||
@@ -559,6 +559,7 @@ | |||
559 | #define USB_DEVICE_ID_ITE_LENOVO_YOGA 0x8386 | 559 | #define USB_DEVICE_ID_ITE_LENOVO_YOGA 0x8386 |
560 | #define USB_DEVICE_ID_ITE_LENOVO_YOGA2 0x8350 | 560 | #define USB_DEVICE_ID_ITE_LENOVO_YOGA2 0x8350 |
561 | #define USB_DEVICE_ID_ITE_LENOVO_YOGA900 0x8396 | 561 | #define USB_DEVICE_ID_ITE_LENOVO_YOGA900 0x8396 |
562 | #define USB_DEVICE_ID_ITE8595 0x8595 | ||
562 | 563 | ||
563 | #define USB_VENDOR_ID_JABRA 0x0b0e | 564 | #define USB_VENDOR_ID_JABRA 0x0b0e |
564 | #define USB_DEVICE_ID_JABRA_SPEAK_410 0x0412 | 565 | #define USB_DEVICE_ID_JABRA_SPEAK_410 0x0412 |
diff --git a/drivers/hid/hid-ite.c b/drivers/hid/hid-ite.c new file mode 100644 index 000000000000..1882a4ab0f29 --- /dev/null +++ b/drivers/hid/hid-ite.c | |||
@@ -0,0 +1,56 @@ | |||
1 | /* | ||
2 | * HID driver for some ITE "special" devices | ||
3 | * Copyright (c) 2017 Hans de Goede <hdegoede@redhat.com> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License version 2 as | ||
7 | * published by the Free Software Foundation. | ||
8 | */ | ||
9 | |||
10 | #include <linux/device.h> | ||
11 | #include <linux/input.h> | ||
12 | #include <linux/hid.h> | ||
13 | #include <linux/module.h> | ||
14 | |||
15 | #include "hid-ids.h" | ||
16 | |||
17 | static int ite_event(struct hid_device *hdev, struct hid_field *field, | ||
18 | struct hid_usage *usage, __s32 value) | ||
19 | { | ||
20 | struct input_dev *input; | ||
21 | |||
22 | if (!(hdev->claimed & HID_CLAIMED_INPUT) || !field->hidinput) | ||
23 | return 0; | ||
24 | |||
25 | input = field->hidinput->input; | ||
26 | |||
27 | /* | ||
28 | * The ITE8595 always reports 0 as value for the rfkill button. Luckily | ||
29 | * it is the only button in its report, and it sends a report on | ||
30 | * release only, so receiving a report means the button was pressed. | ||
31 | */ | ||
32 | if (usage->hid == HID_GD_RFKILL_BTN) { | ||
33 | input_event(input, EV_KEY, KEY_RFKILL, 1); | ||
34 | input_sync(input); | ||
35 | input_event(input, EV_KEY, KEY_RFKILL, 0); | ||
36 | input_sync(input); | ||
37 | return 1; | ||
38 | } | ||
39 | |||
40 | return 0; | ||
41 | } | ||
42 | |||
43 | static const struct hid_device_id ite_devices[] = { | ||
44 | { HID_USB_DEVICE(USB_VENDOR_ID_ITE, USB_DEVICE_ID_ITE8595) }, | ||
45 | { } | ||
46 | }; | ||
47 | MODULE_DEVICE_TABLE(hid, ite_devices); | ||
48 | |||
49 | static struct hid_driver ite_driver = { | ||
50 | .name = "itetech", | ||
51 | .id_table = ite_devices, | ||
52 | .event = ite_event, | ||
53 | }; | ||
54 | module_hid_driver(ite_driver); | ||
55 | |||
56 | MODULE_LICENSE("GPL"); | ||