HID: sony: Set the quriks flag for Bluetooth controllers
authorFrank Praznik <frank.praznik@oh.rr.com>
Sat, 15 Mar 2014 13:41:16 +0000 (09:41 -0400)
committerJiri Kosina <jkosina@suse.cz>
Tue, 1 Apr 2014 16:44:06 +0000 (18:44 +0200)
The Sixaxis and DualShock 4 want HID output reports sent on the control
endpoint when connected via Bluetooth.  Set the
HID_QUIRK_NO_OUTPUT_REPORTS_ON_INTR_EP flag for these devices so hidraw write()
works properly.

Signed-off-by: Frank Praznik <frank.praznik@oh.rr.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-sony.c

index 31ba01a39e819defa0f3a216190309fec498d319..c364be158ae6d3d811e72c441f374835501f8aca 100644 (file)
@@ -1664,11 +1664,21 @@ static int sony_probe(struct hid_device *hdev, const struct hid_device_id *id)
                sc->worker_initialized = 1;
                INIT_WORK(&sc->state_worker, sixaxis_state_worker);
        } else if (sc->quirks & SIXAXIS_CONTROLLER_BT) {
+               /*
+                * The Sixaxis wants output reports sent on the ctrl endpoint
+                * when connected via Bluetooth.
+                */
+               hdev->quirks |= HID_QUIRK_NO_OUTPUT_REPORTS_ON_INTR_EP;
                ret = sixaxis_set_operational_bt(hdev);
                sc->worker_initialized = 1;
                INIT_WORK(&sc->state_worker, sixaxis_state_worker);
        } else if (sc->quirks & DUALSHOCK4_CONTROLLER) {
                if (sc->quirks & DUALSHOCK4_CONTROLLER_BT) {
+                       /*
+                        * The DualShock 4 wants output reports sent on the ctrl
+                        * endpoint when connected via Bluetooth.
+                        */
+                       hdev->quirks |= HID_QUIRK_NO_OUTPUT_REPORTS_ON_INTR_EP;
                        ret = dualshock4_set_operational_bt(hdev);
                        if (ret < 0) {
                                hid_err(hdev, "failed to set the Dualshock 4 operational mode\n");