Skip to content

Commit a0933a4

Browse files
Alex ManoussakisJiri Kosina
authored andcommitted
HID: hid-elecom: extend to fix descriptor for HUGE trackball
In addition to DEFT, Elecom introduced a larger trackball called HUGE, in both wired (M-HT1URBK) and wireless (M-HT1DRBK) versions. It has the same buttons and behavior as the DEFT. This patch adds the two relevant USB IDs to enable operation of the three Fn buttons on the top of the device. Cc: Diego Elio Petteno <flameeyes@flameeyes.eu> Signed-off-by: Alex Manoussakis <amanou@gnu.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
1 parent f043bfc commit a0933a4

4 files changed

Lines changed: 14 additions & 4 deletions

File tree

‎drivers/hid/Kconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ config HID_ELECOM
281281
Support for ELECOM devices:
282282
- BM084 Bluetooth Mouse
283283
- DEFT Trackball (Wired and wireless)
284+
- HUGE Trackball (Wired and wireless)
284285

285286
config HID_ELO
286287
tristate "ELO USB 4000/4500 touchscreen"

‎drivers/hid/hid-core.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2032,6 +2032,8 @@ static const struct hid_device_id hid_have_special_driver[] = {
20322032
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_BM084) },
20332033
{ HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_DEFT_WIRED) },
20342034
{ HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_DEFT_WIRELESS) },
2035+
{ HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_HUGE_WIRED) },
2036+
{ HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_HUGE_WIRELESS) },
20352037
#endif
20362038
#if IS_ENABLED(CONFIG_HID_ELO)
20372039
{ HID_USB_DEVICE(USB_VENDOR_ID_ELO, 0x0009) },

‎drivers/hid/hid-elecom.c‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright (c) 2010 Richard Nauber <Richard.Nauber@gmail.com>
44
* Copyright (c) 2016 Yuxuan Shui <yshuiv7@gmail.com>
55
* Copyright (c) 2017 Diego Elio Pettenò <flameeyes@flameeyes.eu>
6+
* Copyright (c) 2017 Alex Manoussakis <amanou@gnu.org>
67
*/
78

89
/*
@@ -32,9 +33,11 @@ static __u8 *elecom_report_fixup(struct hid_device *hdev, __u8 *rdesc,
3233
break;
3334
case USB_DEVICE_ID_ELECOM_DEFT_WIRED:
3435
case USB_DEVICE_ID_ELECOM_DEFT_WIRELESS:
35-
/* The DEFT trackball has eight buttons, but its descriptor only
36-
* reports five, disabling the three Fn buttons on the top of
37-
* the mouse.
36+
case USB_DEVICE_ID_ELECOM_HUGE_WIRED:
37+
case USB_DEVICE_ID_ELECOM_HUGE_WIRELESS:
38+
/* The DEFT/HUGE trackball has eight buttons, but its descriptor
39+
* only reports five, disabling the three Fn buttons on the top
40+
* of the mouse.
3841
*
3942
* Apply the following diff to the descriptor:
4043
*
@@ -62,7 +65,7 @@ static __u8 *elecom_report_fixup(struct hid_device *hdev, __u8 *rdesc,
6265
* End Collection, End Collection,
6366
*/
6467
if (*rsize == 213 && rdesc[13] == 5 && rdesc[21] == 5) {
65-
hid_info(hdev, "Fixing up Elecom DEFT Fn buttons\n");
68+
hid_info(hdev, "Fixing up Elecom DEFT/HUGE Fn buttons\n");
6669
rdesc[13] = 8; /* Button/Variable Report Count */
6770
rdesc[21] = 8; /* Button/Variable Usage Maximum */
6871
rdesc[29] = 0; /* Button/Constant Report Count */
@@ -76,6 +79,8 @@ static const struct hid_device_id elecom_devices[] = {
7679
{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_BM084) },
7780
{ HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_DEFT_WIRED) },
7881
{ HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_DEFT_WIRELESS) },
82+
{ HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_HUGE_WIRED) },
83+
{ HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_HUGE_WIRELESS) },
7984
{ }
8085
};
8186
MODULE_DEVICE_TABLE(hid, elecom_devices);

‎drivers/hid/hid-ids.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,8 @@
368368
#define USB_DEVICE_ID_ELECOM_BM084 0x0061
369369
#define USB_DEVICE_ID_ELECOM_DEFT_WIRED 0x00fe
370370
#define USB_DEVICE_ID_ELECOM_DEFT_WIRELESS 0x00ff
371+
#define USB_DEVICE_ID_ELECOM_HUGE_WIRED 0x010c
372+
#define USB_DEVICE_ID_ELECOM_HUGE_WIRELESS 0x010d
371373

372374
#define USB_VENDOR_ID_DREAM_CHEEKY 0x1d34
373375
#define USB_DEVICE_ID_DREAM_CHEEKY_WN 0x0004

0 commit comments

Comments
 (0)