[v3,2/2] HID: sony: Fix SHANWAN PS3 GamePad rumbling on USB again
diff mbox series

Message ID 20181230105618.11867-3-outmatch@gmail.com
State Mainlined
Commit d03213f1287bcf3ad0102837694f021847737a0d
Delegated to: Jiri Kosina
Headers show
Series
  • Fix SHANWAN PS3 GamePad rumble on USB again
Related show

Commit Message

Hongye Yuan Dec. 30, 2018, 10:56 a.m. UTC
SHANWAN DS3 clone gamepad requires HID Output Reports via Interrupt EP.

Signed-off-by: Hongye Yuan <outmatch@gmail.com>
---
 drivers/hid/hid-sony.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

Comments

Bastien Nocera Jan. 7, 2019, 11:42 a.m. UTC | #1
On Sun, 2018-12-30 at 18:56 +0800, Hongye Yuan wrote:
> SHANWAN DS3 clone gamepad requires HID Output Reports via Interrupt
> EP.

This doesn't explain what it fixes, and I'm not sure "rumbling again"
is correct either. The device was absolutely unusable before, and would
rumble _all the time_ when plugged in.

> Signed-off-by: Hongye Yuan <outmatch@gmail.com>
> ---
>  drivers/hid/hid-sony.c | 11 ++++++++---
>  1 file 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)

Patch
diff mbox series

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)