mbox series

[00/13] hid: playstation: add DualShock4 support

Message ID 20221029184851.282366-1-roderick.colenbrander@sony.com
Headers show
Series hid: playstation: add DualShock4 support | expand

Message

Roderick Colenbrander Oct. 29, 2022, 6:48 p.m. UTC
Hi,

Last year, we introduced hid-playstation as the start of a new driver
for officially supported PlayStation peripherals. The driver initially
only supported DualSense devices, but we promised to also bring support
for at least DualShock4 as well.

This patch series adds DualShock4 support to hid-playstation. It should
be considered a brand new driver written from scratch in the same design
as hid-playstation. The driver is more documented and uses structures
instead of byte offsets with magical values. The driver should be more
clear and easier to follow. A few little sections of code cary over, which
Sony contributed before for sensor calibration or dongle support.

Functionality wise the driver is equivalent to hid-sony. The only subtle
change is in the naming of the lightbar LEDs. Previously they used a naming
scheme like '<mac_address>:<color>", which doesn't follow the LED class standards.
The new scheme uses '<device_name>:<color>' (e.g. input10:red), which is more
compliant. Due to backwards compatibility in particular for Android, we couldn't
make it fully compliant. Nor were we able to use the new multicolor LED class.

Aside from the LED code, the other features behave the same way. The hid-tools
tests all pass as well. One small change is that we use a different HID report
0x12 to get the MAC address in USB mode. This report is the official one even
though other ones can get the info too, but e.g. clone devices don't tend to
support it.

Thanks,
Roderick Colenbrander
Sony Interactive Entertainment, LLC

Roderick Colenbrander (13):
  HID: playstation: initial DualShock4 USB support.
  HID: playstation: report DualShock4 hardware and firmware version.
  HID: playstation: add DualShock4 battery support.
  HID: playstation: add DualShock4 touchpad support.
  HID: playstation: add DualShock4 accelerometer and gyroscope support.
  HID: playstation: Add DualShock4 rumble support.
  HID: playstation: make LED brightness adjustable in ps_led_register.
  HID: playstation: support DualShock4 lightbar.
  HID: playstation: support DualShock4 lightbar blink.
  HID: playstation: add option to ignore CRC in ps_get_report.
  HID: playstation: add DualShock4 bluetooth support.
  HID: playstation: set default DualShock4 BT poll interval to 4ms.
  HID: playstation: add DualShock4 dongle support.

 drivers/hid/hid-playstation.c | 1135 ++++++++++++++++++++++++++++++++-
 1 file changed, 1120 insertions(+), 15 deletions(-)

Comments

Jiri Kosina Nov. 11, 2022, 10:08 a.m. UTC | #1
On Sat, 29 Oct 2022, Roderick Colenbrander wrote:

> Hi,
> 
> Last year, we introduced hid-playstation as the start of a new driver
> for officially supported PlayStation peripherals. The driver initially
> only supported DualSense devices, but we promised to also bring support
> for at least DualShock4 as well.
> 
> This patch series adds DualShock4 support to hid-playstation. It should
> be considered a brand new driver written from scratch in the same design
> as hid-playstation. The driver is more documented and uses structures
> instead of byte offsets with magical values. The driver should be more
> clear and easier to follow. A few little sections of code cary over, which
> Sony contributed before for sensor calibration or dongle support.
> 
> Functionality wise the driver is equivalent to hid-sony. The only subtle
> change is in the naming of the lightbar LEDs. Previously they used a naming
> scheme like '<mac_address>:<color>", which doesn't follow the LED class standards.
> The new scheme uses '<device_name>:<color>' (e.g. input10:red), which is more
> compliant. Due to backwards compatibility in particular for Android, we couldn't
> make it fully compliant. Nor were we able to use the new multicolor LED class.
> 
> Aside from the LED code, the other features behave the same way. The hid-tools
> tests all pass as well. One small change is that we use a different HID report
> 0x12 to get the MAC address in USB mode. This report is the official one even
> though other ones can get the info too, but e.g. clone devices don't tend to
> support it.

Hi Roderick,

this is now queued in hid.git#for-6.2/sony.

Thanks for all the work on this,