HID: elecom: refer to trackballs by model name instead of series
authorTomasz Kramkowski <tk@the-tk.com>
Thu, 1 Mar 2018 17:22:23 +0000 (17:22 +0000)
committerJiri Kosina <jkosina@suse.cz>
Tue, 6 Mar 2018 14:15:47 +0000 (15:15 +0100)
This patch changes all references to ELECOM trackballs using their
series name to refer to them by their model name.

ELECOM provides multiple series of mice such as EX-G, HUGE, and DEFT.
Although it has not caused conflicts in the driver, there can be more
than one iteration of mice in each series. For example, there are 7
variants of EX-G trackballs but only three (M-XT3URBK, M-XT3DRBK, and
M-XT4DRBK) need a driver to work correctly.

There are also 4 DEFT series trackballs but two of them have the same
VID:PID as the other two. I picked the earlier model for the naming of
the PID macros.

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

index 19c499f5623d776576a51a8da4ea13395f76d69a..4989ec4028bf870c4158401b8925acaece6fb274 100644 (file)
@@ -280,9 +280,9 @@ config HID_ELECOM
        ---help---
        Support for ELECOM devices:
          - BM084 Bluetooth Mouse
-         - EX-G Trackball (Wired and wireless)
-         - DEFT Trackball (Wired and wireless)
-         - HUGE Trackball (Wired and wireless)
+         - EX-G Trackballs (M-XT3DRBK, M-XT3URBK)
+         - DEFT Trackballs (M-DT1DRBK, M-DT1URBK, M-DT2DRBK, M-DT2URBK)
+         - HUGE Trackballs (M-HT1DRBK, M-HT1URBK)
 
 config HID_ELO
        tristate "ELO USB 4000/4500 touchscreen"
index 1a1ecc491c02d4a0f7eca9a095f7956e453ea51c..21e15dc91aaca620e1e171be4804f6be19167fbf 100644 (file)
@@ -1,9 +1,9 @@
 /*
  *  HID driver for ELECOM devices:
  *  - BM084 Bluetooth Mouse
- *  - EX-G Trackball (Wired and wireless)
- *  - DEFT Trackball (Wired and wireless)
- *  - HUGE Trackball (Wired and wireless)
+ *  - EX-G Trackballs (M-XT3DRBK, M-XT3URBK)
+ *  - DEFT Trackballs (M-DT1DRBK, M-DT1URBK, M-DT2DRBK, M-DT2URBK)
+ *  - HUGE Trackballs (M-HT1DRBK, M-HT1URBK)
  *
  *  Copyright (c) 2010 Richard Nauber <Richard.Nauber@gmail.com>
  *  Copyright (c) 2016 Yuxuan Shui <yshuiv7@gmail.com>
@@ -65,14 +65,14 @@ static __u8 *elecom_report_fixup(struct hid_device *hdev, __u8 *rdesc,
                        rdesc[47] = 0x00;
                }
                break;
-       case USB_DEVICE_ID_ELECOM_EX_G_WIRED:
-       case USB_DEVICE_ID_ELECOM_EX_G_WIRELESS:
+       case USB_DEVICE_ID_ELECOM_M_XT3URBK:
+       case USB_DEVICE_ID_ELECOM_M_XT3DRBK:
                mouse_button_fixup(hdev, rdesc, *rsize, 6);
                break;
-       case USB_DEVICE_ID_ELECOM_DEFT_WIRED:
-       case USB_DEVICE_ID_ELECOM_DEFT_WIRELESS:
-       case USB_DEVICE_ID_ELECOM_HUGE_WIRED:
-       case USB_DEVICE_ID_ELECOM_HUGE_WIRELESS:
+       case USB_DEVICE_ID_ELECOM_M_DT1URBK:
+       case USB_DEVICE_ID_ELECOM_M_DT1DRBK:
+       case USB_DEVICE_ID_ELECOM_M_HT1URBK:
+       case USB_DEVICE_ID_ELECOM_M_HT1DRBK:
                mouse_button_fixup(hdev, rdesc, *rsize, 8);
                break;
        }
@@ -81,12 +81,12 @@ static __u8 *elecom_report_fixup(struct hid_device *hdev, __u8 *rdesc,
 
 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_EX_G_WIRED) },
-       { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_EX_G_WIRELESS) },
-       { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_DEFT_WIRED) },
-       { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_DEFT_WIRELESS) },
-       { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_HUGE_WIRED) },
-       { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_HUGE_WIRELESS) },
+       { 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_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) },
+       { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_HT1DRBK) },
        { }
 };
 MODULE_DEVICE_TABLE(hid, elecom_devices);
index 43ddcdfbd0da415b4fc397a89582290f3f37c786..830c022c3624795c5748bc8f82ff798d96cec5f1 100644 (file)
 
 #define USB_VENDOR_ID_ELECOM           0x056e
 #define USB_DEVICE_ID_ELECOM_BM084     0x0061
-#define USB_DEVICE_ID_ELECOM_EX_G_WIRED        0x00fb
-#define USB_DEVICE_ID_ELECOM_EX_G_WIRELESS     0x00fc
-#define USB_DEVICE_ID_ELECOM_DEFT_WIRED        0x00fe
-#define USB_DEVICE_ID_ELECOM_DEFT_WIRELESS     0x00ff
-#define USB_DEVICE_ID_ELECOM_HUGE_WIRED        0x010c
-#define USB_DEVICE_ID_ELECOM_HUGE_WIRELESS     0x010d
+#define USB_DEVICE_ID_ELECOM_M_XT3URBK 0x00fb
+#define USB_DEVICE_ID_ELECOM_M_XT3DRBK 0x00fc
+#define USB_DEVICE_ID_ELECOM_M_DT1URBK 0x00fe
+#define USB_DEVICE_ID_ELECOM_M_DT1DRBK 0x00ff
+#define USB_DEVICE_ID_ELECOM_M_HT1URBK 0x010c
+#define USB_DEVICE_ID_ELECOM_M_HT1DRBK 0x010d
 
 #define USB_VENDOR_ID_DREAM_CHEEKY     0x1d34
 #define USB_DEVICE_ID_DREAM_CHEEKY_WN  0x0004
index 5f6035a5ce367a947aa8fb773de8b39c5bd22bd7..9675cd50077612dbe0243f36b508518031635703 100644 (file)
@@ -335,12 +335,12 @@ static const struct hid_device_id hid_have_special_driver[] = {
 #endif
 #if IS_ENABLED(CONFIG_HID_ELECOM)
        { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_BM084) },
-       { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_EX_G_WIRED) },
-       { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_EX_G_WIRELESS) },
-       { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_DEFT_WIRED) },
-       { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_DEFT_WIRELESS) },
-       { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_HUGE_WIRED) },
-       { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_HUGE_WIRELESS) },
+       { 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_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) },
+       { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_HT1DRBK) },
 #endif
 #if IS_ENABLED(CONFIG_HID_ELO)
        { HID_USB_DEVICE(USB_VENDOR_ID_ELO, 0x0009) },