summaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-sony.c
diff options
context:
space:
mode:
authorHongye Yuan <outmatch@gmail.com>2019-01-09 02:18:09 +0100
committerBenjamin Tissoires <benjamin.tissoires@redhat.com>2019-01-09 14:56:30 +0100
commitd03213f1287bcf3ad0102837694f021847737a0d (patch)
treedaacc8bb926c8db9425326adde1548d9b7652ffe /drivers/hid/hid-sony.c
parentHID: sony: Transform one-time SHANWAN check into quirk (diff)
downloadlinux-d03213f1287bcf3ad0102837694f021847737a0d.tar.xz
linux-d03213f1287bcf3ad0102837694f021847737a0d.zip
HID: sony: Fix SHANWAN PS3 GamePad rumble and led settings support
Rumble support on SHANWAN PS3 gamepad is not working when a user program has asked it to. If a HID Output Reports is sent via Control Channel then it will be discard by gamepad, thus rumble motor and led settings in Output Report are ignored. This patch therefore sends HID Output Report via Interrupt Channel to SHANWAN gamepad instead of Control Channel, fixing rumble motor and led settings. Signed-off-by: Hongye Yuan <outmatch@gmail.com> Reviewed-by: Bastien Nocera <hadess@hadess.net> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Diffstat (limited to 'drivers/hid/hid-sony.c')
-rw-r--r--drivers/hid/hid-sony.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/hid/hid-sony.c b/drivers/hid/hid-sony.c
index fc82f02bae75..26fae90b931a 100644
--- a/drivers/hid/hid-sony.c
+++ b/drivers/hid/hid-sony.c
@@ -2100,9 +2100,14 @@ static void sixaxis_send_output_report(struct sony_sc *sc)
}
}
- hid_hw_raw_request(sc->hdev, report->report_id, (u8 *)report,
- sizeof(struct sixaxis_output_report),
- HID_OUTPUT_REPORT, HID_REQ_SET_REPORT);
+ /* SHANWAN controllers require output reports via intr channel */
+ if (sc->quirks & SHANWAN_GAMEPAD)
+ hid_hw_output_report(sc->hdev, (u8 *)report,
+ sizeof(struct sixaxis_output_report));
+ else
+ hid_hw_raw_request(sc->hdev, report->report_id, (u8 *)report,
+ sizeof(struct sixaxis_output_report),
+ HID_OUTPUT_REPORT, HID_REQ_SET_REPORT);
}
static void dualshock4_send_output_report(struct sony_sc *sc)