HID: elecom: add support for EX-G M-XT4DRBK trackball
authorTomasz Kramkowski <tk@the-tk.com>
Thu, 1 Mar 2018 17:22:24 +0000 (17:22 +0000)
committerJiri Kosina <jkosina@suse.cz>
Tue, 6 Mar 2018 14:15:47 +0000 (15:15 +0100)
This patch enables the 6th button on the ELECOM EX-G M-XT4DRBK
trackball mouse.

This is a left handed EX-G variant which only comes in a wireless (D)
model. It has a total of 6 buttons but one of these is not available
because of how the HID descriptor is configured.

Signed-off-by: Tomasz Kramkowski <tk@the-tk.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-elecom.c
drivers/hid/hid-ids.h
drivers/hid/hid-quirks.c

index 21e15dc91aaca620e1e171be4804f6be19167fbf..ae8e9413c79d55b5f80fab056757d8a1b2624313 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *  HID driver for ELECOM devices:
  *  - BM084 Bluetooth Mouse
- *  - EX-G Trackballs (M-XT3DRBK, M-XT3URBK)
+ *  - EX-G Trackballs (M-XT3DRBK, M-XT3URBK, M-XT4DRBK)
  *  - DEFT Trackballs (M-DT1DRBK, M-DT1URBK, M-DT2DRBK, M-DT2URBK)
  *  - HUGE Trackballs (M-HT1DRBK, M-HT1URBK)
  *
@@ -67,6 +67,7 @@ static __u8 *elecom_report_fixup(struct hid_device *hdev, __u8 *rdesc,
                break;
        case USB_DEVICE_ID_ELECOM_M_XT3URBK:
        case USB_DEVICE_ID_ELECOM_M_XT3DRBK:
+       case USB_DEVICE_ID_ELECOM_M_XT4DRBK:
                mouse_button_fixup(hdev, rdesc, *rsize, 6);
                break;
        case USB_DEVICE_ID_ELECOM_M_DT1URBK:
@@ -83,6 +84,7 @@ static const struct hid_device_id elecom_devices[] = {
        { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_BM084) },
        { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT3URBK) },
        { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT3DRBK) },
+       { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT4DRBK) },
        { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_DT1URBK) },
        { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_DT1DRBK) },
        { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_HT1URBK) },
index 830c022c3624795c5748bc8f82ff798d96cec5f1..c8902f2f0e23d78b051a84f08b265890fabfba8a 100644 (file)
 #define USB_DEVICE_ID_ELECOM_BM084     0x0061
 #define USB_DEVICE_ID_ELECOM_M_XT3URBK 0x00fb
 #define USB_DEVICE_ID_ELECOM_M_XT3DRBK 0x00fc
+#define USB_DEVICE_ID_ELECOM_M_XT4DRBK 0x00fd
 #define USB_DEVICE_ID_ELECOM_M_DT1URBK 0x00fe
 #define USB_DEVICE_ID_ELECOM_M_DT1DRBK 0x00ff
 #define USB_DEVICE_ID_ELECOM_M_HT1URBK 0x010c
index 9675cd50077612dbe0243f36b508518031635703..91049dff301f499a601b90ea422111d6bbecb79a 100644 (file)
@@ -337,6 +337,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
        { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_BM084) },
        { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT3URBK) },
        { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT3DRBK) },
+       { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT4DRBK) },
        { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_DT1URBK) },
        { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_DT1DRBK) },
        { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_HT1URBK) },