Comment 14 for bug 1584475

Revision history for this message
Davidian1024 (david-brinovec) wrote :

I think this bug is affecting me as well. I am also aware of two other bug reports that sound related. Bug #1556444 and bug #1328065.

Skimming over the code in the patches I don't think those will work for me. The code specifically looks for this identifier string "FutureMax Dance Mat". My device reports itself with this string "RedOctane USB Pad". So I think the code won't treat my device any differently than the way it's being treated now.

kernel: [ 408.450782] usb 4-2.1: Product: RedOctane USB Pad
kernel: [ 408.460877] input: RedOctane USB Pad as /devices/pci0000:00/0000:00:1a.1/usb4/4-2/4-2.1/4-2.1:1.0/0003:054C:0268.0007/input/input19
kernel: [ 408.520387] sony 0003:054C:0268.0007: input,hiddev0,hidraw3: USB HID v1.11 Joystick [RedOctane USB Pad] on usb-0000:00:1a.1-2.1/input0

Here's my complete and utter beginner attempt at a modified version of the patch for the 4.8 kernel:

####################################################

diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
index 310436a..29a1aa9 100644
--- a/drivers/hid/hid-sony.c
+++ b/drivers/hid/hid-sony.c
@@ -51,6 +51,7 @@
 #define NAVIGATION_CONTROLLER_USB BIT(9)
 #define NAVIGATION_CONTROLLER_BT BIT(10)
 #define SINO_LITE_CONTROLLER BIT(11)
+#define FUTUREMAX_DANCE_MAT BIT(12)
+#define REDOCTANE_USB_PAD BIT(13)

 #define SIXAXIS_CONTROLLER (SIXAXIS_CONTROLLER_USB | SIXAXIS_CONTROLLER_BT)
 #define MOTION_CONTROLLER (MOTION_CONTROLLER_USB | MOTION_CONTROLLER_BT)
@@ -1125,7 +1126,7 @@ static u8 *sony_report_fixup(struct hid_device *hdev, u8 *rdesc,
 {
  struct sony_sc *sc = hid_get_drvdata(hdev);

- if (sc->quirks & SINO_LITE_CONTROLLER)
+ if (sc->quirks & (SINO_LITE_CONTROLLER | FUTUREMAX_DANCE_MAT | REDOCTANE_USB_PAD))
   return rdesc;

  /*
@@ -2289,6 +2290,9 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id)
  struct sony_sc *sc;
  unsigned int connect_mask = HID_CONNECT_DEFAULT;

+ if (!strcmp(hdev->name, "FutureMax Dance Mat"))
+ quirks |= FUTUREMAX_DANCE_MAT;
+
+ if (!strcmp(hdev->name, "RedOctane USB Pad"))
+ quirks |= REDOCTANE_USB_PAD;
+
  sc = devm_kzalloc(&hdev->dev, sizeof(*sc), GFP_KERNEL);
  if (sc == NULL) {
   hid_err(hdev, "can't alloc sony descriptor\n");

####################################################

So, I'm going to attempt to produce an actual patch from this and see if it fixes my problem. Just wanted to drop this note here first and see if anyone comments. I've never done this sort of thing to the kernel code before so there's no telling how long this is going to take me.