HID: hid-elecom: extend to fix descriptor for HUGE trackball
Subsystems (2)
PATCH 1/1 HID: hid-elecom: extend to fix descriptor for HUGE trackball
commit a0933a456ff83a3b5ffa3a1903e0b8de4a56adf5 upstream
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.
Works fine in 4.13, in fact I am succefully using this patch on 4.4 as well (4.4 needs additional cherry pick 0bb7a37f8d15e5fb5d21776875f9fbc74e10753a)
drivers/hid/Kconfig +1 -0
@@ -281,6 +281,7 @@ config HID_ELECOM Support for ELECOM devices: - BM084 Bluetooth Mouse - DEFT Trackball (Wired and wireless) + - HUGE Trackball (Wired and wireless) config HID_ELO tristate "ELO USB 4000/4500 touchscreen"
drivers/hid/hid-core.c +2 -0
@@ -2032,6 +2032,8 @@ 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_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) }, #endif #if IS_ENABLED(CONFIG_HID_ELO) { HID_USB_DEVICE(USB_VENDOR_ID_ELO, 0x0009) },
drivers/hid/hid-elecom.c +9 -4
@@ -3,6 +3,7 @@* Copyright (c) 2010 Richard Nauber <[email protected]> * Copyright (c) 2016 Yuxuan Shui <[email protected]> * Copyright (c) 2017 Diego Elio Pettenò <[email protected]> +* Copyright (c) 2017 Alex Manoussakis <[email protected]> */ /*
@@ -32,9 +33,11 @@ static __u8 *elecom_report_fixup(struct hid_device *hdev, __u8 *rdesc,break ;case USB_DEVICE_ID_ELECOM_DEFT_WIRED :case USB_DEVICE_ID_ELECOM_DEFT_WIRELESS : -/* The DEFT trackball has eight buttons, but its descriptor only -* reports five, disabling the three Fn buttons on the top of -* the mouse. +case USB_DEVICE_ID_ELECOM_HUGE_WIRED : +case USB_DEVICE_ID_ELECOM_HUGE_WIRELESS : +/* The DEFT/HUGE trackball has eight buttons, but its descriptor +* only reports five, disabling the three Fn buttons on the top +* of the mouse. * * Apply the following diff to the descriptor: *
@@ -62,7 +65,7 @@ static __u8 *elecom_report_fixup(struct hid_device *hdev, __u8 *rdesc,* End Collection, End Collection, */ if (*rsize ==213 && rdesc[13 ] ==5 && rdesc[21 ] ==5 ) { -hid_info (hdev,"Fixing up Elecom DEFT Fn buttons\n" ); +hid_info (hdev,"Fixing up Elecom DEFT/HUGE Fn buttons\n" ); rdesc[13 ] =8 ;/* Button/Variable Report Count */ rdesc[21 ] =8 ;/* Button/Variable Usage Maximum */ rdesc[29 ] =0 ;/* Button/Constant Report Count */
@@ -76,6 +79,8 @@ 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_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) }, { } };MODULE_DEVICE_TABLE (hid, elecom_devices);
drivers/hid/hid-ids.h +2 -0
@@ -368,6 +368,8 @@#define USB_DEVICE_ID_ELECOM_BM084 0x0061#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_VENDOR_ID_DREAM_CHEEKY 0x1d34#define USB_DEVICE_ID_DREAM_CHEEKY_WN 0x0004
commit a0933a456ff83a3b5ffa3a1903e0b8de4a56adf5 upstream
Hello, while you evaluate my request to commit 2 USB IDs to 4.13, I would like you to consider putting it in 4.4 and 4.9 also.
I tested tested both of these (patch, build, boot, and usage of the device). It would be great for users of those longterm kernels to have their Elecom HUGE trackball work properly!
The original patch does not apply cleanly to 4.4 and 4.9 however; a trivial adjustment is needed (simply in the unmodified positioning lines of one file). Below is the adjusted patch that will apply without conflicts to 4.4 and 4.9. As mentioned earlier, for kernels prior to 4.12 you
would need to cherry pick 68f9e3d71650c0f4c48d039c83e3baa4e278deed first.
Thanks!
drivers/hid/Kconfig +1 -0
@@ -264,6 +264,7 @@ config HID_ELECOM Support for ELECOM devices: - BM084 Bluetooth Mouse - DEFT Trackball (Wired and wireless) + - HUGE Trackball (Wired and wireless) config HID_ELO tristate "ELO USB 4000/4500 touchscreen"
drivers/hid/hid-core.c +2 -0
@@ -1887,6 +1887,8 @@ 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_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_ELO, 0x0009) }, { HID_USB_DEVICE(USB_VENDOR_ID_ELO, 0x0030) }, { HID_USB_DEVICE(USB_VENDOR_ID_EMS, USB_DEVICE_ID_EMS_TRIO_LINKER_PLUS_II) },
drivers/hid/hid-elecom.c +9 -4
@@ -3,6 +3,7 @@* Copyright (c) 2010 Richard Nauber <[email protected]> * Copyright (c) 2016 Yuxuan Shui <[email protected]> * Copyright (c) 2017 Diego Elio Petten� <[email protected]> +* Copyright (c) 2017 Alex Manoussakis <[email protected]> */ /*
@@ -32,9 +33,11 @@ static __u8 *elecom_report_fixup(struct hid_device *hdev, __u8 *rdesc,break ;case USB_DEVICE_ID_ELECOM_DEFT_WIRED :case USB_DEVICE_ID_ELECOM_DEFT_WIRELESS : -/* The DEFT trackball has eight buttons, but its descriptor only -* reports five, disabling the three Fn buttons on the top of -* the mouse. +case USB_DEVICE_ID_ELECOM_HUGE_WIRED : +case USB_DEVICE_ID_ELECOM_HUGE_WIRELESS : +/* The DEFT/HUGE trackball has eight buttons, but its descriptor +* only reports five, disabling the three Fn buttons on the top +* of the mouse. * * Apply the following diff to the descriptor: *
@@ -62,7 +65,7 @@ static __u8 *elecom_report_fixup(struct hid_device *hdev, __u8 *rdesc,* End Collection, End Collection, */ if (*rsize ==213 && rdesc[13 ] ==5 && rdesc[21 ] ==5 ) { -hid_info (hdev,"Fixing up Elecom DEFT Fn buttons\n" ); +hid_info (hdev,"Fixing up Elecom DEFT/HUGE Fn buttons\n" ); rdesc[13 ] =8 ;/* Button/Variable Report Count */ rdesc[21 ] =8 ;/* Button/Variable Usage Maximum */ rdesc[29 ] =0 ;/* Button/Constant Report Count */
@@ -76,6 +79,8 @@ 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_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) }, { } };MODULE_DEVICE_TABLE (hid, elecom_devices);
drivers/hid/hid-ids.h +2 -0
@@ -355,6 +355,8 @@#define USB_DEVICE_ID_ELECOM_BM084 0x0061#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_VENDOR_ID_DREAM_CHEEKY 0x1d34#define USB_DEVICE_ID_DREAM_CHEEKY_WN 0x0004
Greg Kroah-Hartman
maintainerdrivers/hid/hid-elecom.c line 6
Quoted 7 lines · Alex Manoussakis
drivers/hid/hid-elecom.c +1
-0@@ -3,6 +3,7 @@* Copyright (c) 2010 Richard Nauber <[email protected]> * Copyright (c) 2016 Yuxuan Shui <[email protected]> * Copyright (c) 2017 Diego Elio Petten� <[email protected]> +* Copyright (c) 2017 Alex Manoussakis <[email protected]>
Note, I'm not the maintainer, but you should be aware that adding a line like this, with only the changes as expressed in this patch, is very dubious according to every lawyer that I know. Please be careful about stuff like this, and only add such a line if you really know what you are doing[1]
If you have done other changes to this file, my appologies...
thanks,
greg k-h
[1] There is the real fact that these types of lines mean absolutely nothing, and that lawyers love to cargo-cult worse than programmers do, but that being said, please always know the norms for what this means and represents before using.
Quoted 5 lines
Quoted 4 lines
* Copyright (c) 2010 Richard Nauber <[email protected]> * Copyright (c) 2016 Yuxuan Shui <[email protected]> * Copyright (c) 2017 Diego Elio Petten� <[email protected]> + * Copyright (c) 2017 Alex Manoussakis <[email protected]>
Quoted 7 lines
Note, I'm not the maintainer, but you should be aware that adding a line like this, with only the changes as expressed in this patch, is very dubious according to every lawyer that I know. Please be careful about stuff like this, and only add such a line if you really know what you are doing[1]
If you have done other changes to this file, my appologies...
Hi Greg, thanks for the note. The changes I have done is add new USB IDs and change the text in a couple of places (both comments and messages) to include the new model "HUGE" where it only said "DEFT".
We could remove the copyright line I added if it's a problem. I didn't give it much thought. I copied the linux-input maintainer Jiri, and Diego who added the code for the DEFT trackballs, in my mainline submission and both were ok (Diego wrote me "The patch looks good to me", and Jiri submitted it) and now it's in mainline. Copying Diego in this thread now too.
My goal is simply to make the trackball I purchased work in my favorite OS, and benefit other users who have found or will find themselves with a semi- working device otherwise. And push as far back as 4.4 since some very popular long-term-support distros use this kernel, I use it too, and it works.
Can you commit the patch upstream ? Below is the patch that will apply clean to 4.4 and 4.9, without the extra copyright line if you prefer to use that. Note 4.4 and 4.9 need to cherry pick 0bb7a37f8d15e5fb5d21776875f9fbc74e10753a as a prerequisite which adds support for the DEFT trackballs.
Should I submit a mainline patch that removes the Copyright line I added ? Let me know what I should do and I'll be happy to do it.
Thanks!
Alex
drivers/hid/Kconfig +1 -0
@@ -264,6 +264,7 @@ config HID_ELECOM Support for ELECOM devices: - BM084 Bluetooth Mouse - DEFT Trackball (Wired and wireless) + - HUGE Trackball (Wired and wireless) config HID_ELO tristate "ELO USB 4000/4500 touchscreen"
drivers/hid/hid-core.c +2 -0
@@ -1887,6 +1887,8 @@ 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_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_ELO, 0x0009) }, { HID_USB_DEVICE(USB_VENDOR_ID_ELO, 0x0030) }, { HID_USB_DEVICE(USB_VENDOR_ID_EMS, USB_DEVICE_ID_EMS_TRIO_LINKER_PLUS_II) },
drivers/hid/hid-elecom.c +8 -4
@@ -32,9 +33,11 @@ static __u8 *elecom_report_fixup(struct hid_device *hdev, __u8 *rdesc,break ;case USB_DEVICE_ID_ELECOM_DEFT_WIRED :case USB_DEVICE_ID_ELECOM_DEFT_WIRELESS : -/* The DEFT trackball has eight buttons, but its descriptor only -* reports five, disabling the three Fn buttons on the top of -* the mouse. +case USB_DEVICE_ID_ELECOM_HUGE_WIRED : +case USB_DEVICE_ID_ELECOM_HUGE_WIRELESS : +/* The DEFT/HUGE trackball has eight buttons, but its descriptor +* only reports five, disabling the three Fn buttons on the top +* of the mouse. * * Apply the following diff to the descriptor: *
@@ -62,7 +65,7 @@ static __u8 *elecom_report_fixup(struct hid_device *hdev, __u8 *rdesc,* End Collection, End Collection, */ if (*rsize ==213 && rdesc[13 ] ==5 && rdesc[21 ] ==5 ) { -hid_info (hdev,"Fixing up Elecom DEFT Fn buttons\n" ); +hid_info (hdev,"Fixing up Elecom DEFT/HUGE Fn buttons\n" ); rdesc[13 ] =8 ;/* Button/Variable Report Count */ rdesc[21 ] =8 ;/* Button/Variable Usage Maximum */ rdesc[29 ] =0 ;/* Button/Constant Report Count */
@@ -76,6 +79,8 @@ 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_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) }, { } };MODULE_DEVICE_TABLE (hid, elecom_devices);
drivers/hid/hid-ids.h +2 -0
@@ -355,6 +355,8 @@#define USB_DEVICE_ID_ELECOM_BM084 0x0061#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_VENDOR_ID_DREAM_CHEEKY 0x1d34#define USB_DEVICE_ID_DREAM_CHEEKY_WN 0x0004
Greg Kroah-Hartman
maintainerQuoted 28 lines · Alex Manoussakis
Quoted 5 lines
Quoted 4 lines
* Copyright (c) 2010 Richard Nauber <[email protected]> * Copyright (c) 2016 Yuxuan Shui <[email protected]> * Copyright (c) 2017 Diego Elio Petten� <[email protected]> + * Copyright (c) 2017 Alex Manoussakis <[email protected]>Quoted 7 lines
Note, I'm not the maintainer, but you should be aware that adding a line like this, with only the changes as expressed in this patch, is very dubious according to every lawyer that I know. Please be careful about stuff like this, and only add such a line if you really know what you are doing[1]
If you have done other changes to this file, my appologies...
Hi Greg, thanks for the note. The changes I have done is add new USB IDs and change the text in a couple of places (both comments and messages) to include the new model "HUGE" where it only said "DEFT".
We could remove the copyright line I added if it's a problem. I didn't give it much thought. I copied the linux-input maintainer Jiri, and Diego who added the code for the DEFT trackballs, in my mainline submission and both were ok (Diego wrote me "The patch looks good to me", and Jiri submitted it) and now it's in mainline. Copying Diego in this thread now too.
My goal is simply to make the trackball I purchased work in my favorite OS, and benefit other users who have found or will find themselves with a semi- working device otherwise. And push as far back as 4.4 since some very popular long-term-support distros use this kernel, I use it too, and it works.
Quoted 7 lines
Can you commit the patch upstream ? Below is the patch that will apply clean to 4.4 and 4.9, without the extra copyright line if you prefer to use that. Note 4.4 and 4.9 need to cherry pick
0bb7a37f8d15e5fb5d21776875f9fbc74e10753aas a prerequisite which adds support for the DEFT trackballs.Should I submit a mainline patch that removes the Copyright line I added ? Let me know what I should do and I'll be happy to do it.
Ok, if this is already merged, that's fine, just wanted to point out the obvious copyright statement issues :)
I'll add it to my queue of patches to apply to as stable tree after these next kernels get released, thanks.
greg k-h
Greg Kroah-Hartman
maintainerQuoted 8 lines · Alex Manoussakis
commit
a0933a456ff83a3b5ffa3a1903e0b8de4a56adf5upstreamHello, while you evaluate my request to commit 2 USB IDs to 4.13, I would like you to consider putting it in 4.4 and 4.9 also.
I tested tested both of these (patch, build, boot, and usage of the device). It would be great for users of those longterm kernels to have their Elecom HUGE trackball work properly!
Quoted 5 lines
The original patch does not apply cleanly to 4.4 and 4.9 however; a trivial adjustment is needed (simply in the unmodified positioning lines of one file). Below is the adjusted patch that will apply without conflicts to 4.4 and 4.9. As mentioned earlier, for kernels prior to 4.12 you
would need to cherry pick68f9e3d71650c0f4c48d039c83e3baa4e278deedfirst.
That commit id is not a patch :(
Quoted 7 lines
Thanks!
Cc Greg Kroah-Hartman <[email protected]>Cc <stable@[email protected]> # 4.12.xCc <stable@[email protected]> # 4.9.x: 0bb7a37: HID: elecom: ... DEFT trackballsCc <stable@[email protected]> # 4.4.x: 0bb7a37: HID: elecom: ... DEFT trackballs
Commit 0bb7a37 is a "new feature", and as such, shouldn't be backported to older kernels, right?
I need a very strong agrument from the HID maintainer as to why this should be accepted to the older kernels...
thanks,
greg k-h
Jiri Kosina
maintainerQuoted 10 lines · Greg Kroah-Hartman
Quoted 4 lines
Cc Greg Kroah-Hartman <[email protected]>Cc <stable@[email protected]> # 4.12.xCc <stable@[email protected]> # 4.9.x: 0bb7a37: HID: elecom: ... DEFT trackballsCc <stable@[email protected]> # 4.4.x: 0bb7a37: HID: elecom: ... DEFT trackballsCommit 0bb7a37 is a "new feature", and as such, shouldn't be backported to older kernels, right?
I need a very strong agrument from the HID maintainer as to why this should be accepted to the older kernels...
Hi Greg,
it basically is a new device ID addition (with a small glue code applied only to that device ID), and as such a left the stable markers there. But I don't have strong preference either way -- if you feel that this is beyond the 'new device ID' policy, I wouldn't object strongly.
Thanks,
Signature · 2 lines
Jiri Kosina SUSE Labs
Greg Kroah-Hartman
maintainerQuoted 13 lines · Jiri Kosina
Quoted 10 lines · Greg Kroah-Hartman
Quoted 4 lines
Cc Greg Kroah-Hartman <[email protected]>Cc <stable@[email protected]> # 4.12.xCc <stable@[email protected]> # 4.9.x: 0bb7a37: HID: elecom: ... DEFT trackballsCc <stable@[email protected]> # 4.4.x: 0bb7a37: HID: elecom: ... DEFT trackballsCommit 0bb7a37 is a "new feature", and as such, shouldn't be backported to older kernels, right?
I need a very strong agrument from the HID maintainer as to why this should be accepted to the older kernels...
Quoted 6 lines
Hi Greg,
it basically is a new device ID addition (with a small glue code applied only to that device ID), and as such a left the stable markers there. But I don't have strong preference either way -- if you feel that this is beyond the 'new device ID' policy, I wouldn't object strongly.
I think it's a bit more than just the normal "add a new id or quirk" logic here.
For new devices, it's always best to just update to a newer kernel, there's no reason anyone with these devices should be using 4.9 or older :)
thanks,
greg k-h
Quoted 4 lines
Quoted 2 lines
As mentioned earlier, for kernels prior to 4.12 you
would need to cherry pick68f9e3d71650c0f4c48d039c83e3baa4e278deedfirst.That commit id is not a patch :(
Sorry, I meant 0bb7a37f8d15e5fb5d21776875f9fbc74e10753a. Yes, that cherry pick is a bit more involved than just new device IDs.
Saw your other email regarding your reservations for the older kernels, it's ok, thanks for accepting it for 4.13 !
Alex