summarylogtreecommitdiffstats
path: root/hid-sony-ds3usb.patch
diff options
context:
space:
mode:
Diffstat (limited to 'hid-sony-ds3usb.patch')
-rw-r--r--hid-sony-ds3usb.patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/hid-sony-ds3usb.patch b/hid-sony-ds3usb.patch
new file mode 100644
index 000000000000..76371dc5b6ea
--- /dev/null
+++ b/hid-sony-ds3usb.patch
@@ -0,0 +1,37 @@
+diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
+index 4c6ed6ef31f1..50c1d9cc6dab 100644
+--- a/drivers/hid/hid-sony.c
++++ b/drivers/hid/hid-sony.c
+@@ -867,6 +867,23 @@ static u8 *sony_report_fixup(struct hid_device *hdev, u8 *rdesc,
+ if (sc->quirks & PS3REMOTE)
+ return ps3remote_fixup(hdev, rdesc, rsize);
+
++ /*
++ * Some knock-off USB dongles incorrectly report their button count
++ * as 13 instead of 16 causing three non-functional buttons.
++ */
++ if ((sc->quirks & SIXAXIS_CONTROLLER_USB) && *rsize >= 45 &&
++ /* Report Count (13) */
++ rdesc[23] == 0x95 && rdesc[24] == 0x0D &&
++ /* Usage Maximum (13) */
++ rdesc[37] == 0x29 && rdesc[38] == 0x0D &&
++ /* Report Count (3) */
++ rdesc[43] == 0x95 && rdesc[44] == 0x03) {
++ hid_info(hdev, "Fixing up USB dongle report descriptor\n");
++ rdesc[24] = 0x10;
++ rdesc[38] = 0x10;
++ rdesc[44] = 0x00;
++ }
++
+ return rdesc;
+ }
+
+@@ -3008,7 +3025,7 @@ static const struct hid_device_id sony_devices[] = {
+ MODULE_DEVICE_TABLE(hid, sony_devices);
+
+ static struct hid_driver sony_driver = {
+- .name = "sony",
++ .name = "sony-ds3usb",
+ .id_table = sony_devices,
+ .input_mapping = sony_mapping,
+ .input_configured = sony_input_configured,