Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

HID: elecom: add support for TrackBall 056E:011C

Make function buttons on ELECOM M-HT1DRBK trackball mouse work. This model
has two devices with different device IDs (010D and 011C). Both of
them misreports the number of buttons as 5 in the report descriptor, even
though they have 8 buttons. hid-elecom overwrites the report to fix them,
but supports only on 010D and does not work on 011C. This patch fixes
011C in the similar way but with specialized position parameters.
In fact, it is sufficient to rewrite only 17th byte (05 -> 08). However I
followed the existing way.

Signed-off-by: Takahiro Fujii <fujii@xaxxi.net>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>

authored by

Takahiro Fujii and committed by
Jiri Kosina
29f316a1 3782c0d6

+18 -4
+14 -2
drivers/hid/hid-elecom.c
··· 12 12 * Copyright (c) 2017 Alex Manoussakis <amanou@gnu.org> 13 13 * Copyright (c) 2017 Tomasz Kramkowski <tk@the-tk.com> 14 14 * Copyright (c) 2020 YOSHIOKA Takuma <lo48576@hard-wi.red> 15 + * Copyright (c) 2022 Takahiro Fujii <fujii@xaxxi.net> 15 16 */ 16 17 17 18 /* ··· 90 89 case USB_DEVICE_ID_ELECOM_M_DT1URBK: 91 90 case USB_DEVICE_ID_ELECOM_M_DT1DRBK: 92 91 case USB_DEVICE_ID_ELECOM_M_HT1URBK: 93 - case USB_DEVICE_ID_ELECOM_M_HT1DRBK: 92 + case USB_DEVICE_ID_ELECOM_M_HT1DRBK_010D: 94 93 /* 95 94 * Report descriptor format: 96 95 * 12: button bit count ··· 99 98 * 20: button usage maximum 100 99 */ 101 100 mouse_button_fixup(hdev, rdesc, *rsize, 12, 30, 14, 20, 8); 101 + break; 102 + case USB_DEVICE_ID_ELECOM_M_HT1DRBK_011C: 103 + /* 104 + * Report descriptor format: 105 + * 22: button bit count 106 + * 30: padding bit count 107 + * 24: button report size 108 + * 16: button usage maximum 109 + */ 110 + mouse_button_fixup(hdev, rdesc, *rsize, 22, 30, 24, 16, 8); 102 111 break; 103 112 } 104 113 return rdesc; ··· 123 112 { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_DT1URBK) }, 124 113 { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_DT1DRBK) }, 125 114 { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_HT1URBK) }, 126 - { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_HT1DRBK) }, 115 + { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_HT1DRBK_010D) }, 116 + { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_HT1DRBK_011C) }, 127 117 { } 128 118 }; 129 119 MODULE_DEVICE_TABLE(hid, elecom_devices);
+2 -1
drivers/hid/hid-ids.h
··· 428 428 #define USB_DEVICE_ID_ELECOM_M_DT1URBK 0x00fe 429 429 #define USB_DEVICE_ID_ELECOM_M_DT1DRBK 0x00ff 430 430 #define USB_DEVICE_ID_ELECOM_M_HT1URBK 0x010c 431 - #define USB_DEVICE_ID_ELECOM_M_HT1DRBK 0x010d 431 + #define USB_DEVICE_ID_ELECOM_M_HT1DRBK_010D 0x010d 432 + #define USB_DEVICE_ID_ELECOM_M_HT1DRBK_011C 0x011c 432 433 433 434 #define USB_VENDOR_ID_DREAM_CHEEKY 0x1d34 434 435 #define USB_DEVICE_ID_DREAM_CHEEKY_WN 0x0004
+2 -1
drivers/hid/hid-quirks.c
··· 393 393 { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_DT1URBK) }, 394 394 { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_DT1DRBK) }, 395 395 { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_HT1URBK) }, 396 - { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_HT1DRBK) }, 396 + { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_HT1DRBK_010D) }, 397 + { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_HT1DRBK_011C) }, 397 398 #endif 398 399 #if IS_ENABLED(CONFIG_HID_ELO) 399 400 { HID_USB_DEVICE(USB_VENDOR_ID_ELO, 0x0009) },