linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 00/13] HID: new driver for PS5 'DualSense' controller
@ 2021-01-17 23:09 Roderick Colenbrander
  2021-01-17 23:09 ` [PATCH v3 01/12] HID: playstation: initial DualSense USB support Roderick Colenbrander
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: Roderick Colenbrander @ 2021-01-17 23:09 UTC (permalink / raw)
  To: Jiri Kosina, Benjamin Tissoires
  Cc: linux-input, Chris Ye, Roderick Colenbrander

From: Roderick Colenbrander <roderick.colenbrander@sony.com>

Hi,

I would like to share an updated version of the hid-playstation driver.
This new revision contains a few bug fixes, but mostly features small
code changes and minor improvements.

In terms of bugs there were bugs in the sensor code. There was an overflow
issue and EV_MSC/MSC_TIMESTAMP were not set on the device. In addition,
the ps_device spinlock was not initialized.

The biggest change in the driver was the addition of a new 'ps_get_report'
helper function. It handles GET_FEATURE report retrieval and any error handling
including CRC checks for PlayStation Bluetooth devices. This greatly simplified
all the functions (dualsense_get_mac_address, dualsense_calibration_info, ..)
dealing, which used their own report handling and error checking.

Aside for these changes, there were mostly little code style changes like defining
magic constants, cleaning up comments, cleaning up log messages, static_assert
checks etcetera.

Thanks to everyone who provided feedback through the mailing list or privately.

Changes since v2:
- Removed !Expert setting for hid-playstation from Kconfig.
- Removed DualSense from hid-quirks table.
- Added report size checks to dualsense_parse_report.
- Moved mac address endianess comment to struct ps_device.
- Added static_asserts for packed structure size checks.
- Improved readability of battery capacity calculation using 'min'.
- Added spin_lock_init to dualsense_create to initialize ps_device lock. 
- Fixed sensors timestamp overflow.
- Fixed missing MSC_TIMESTAMP and EV_MSC capabilities in ps_sensors_create.
- Used DIV_ROUND_CLOSEST for timestamp calculations to minimize rounding errors.
- Switched to devm_kmalloc_array for lightbar allocation.
- Added CRC32 and NEW_LEDS dependency to Kconfig.
- Added defines for crc32 seed constants.
- Added crc32 check for dualsense_get_mac_address and increased report size to 20.
- Added new ps_get_report call to obtain feature reports.
- Switched to ARRAY_SIZE in dualsense_parse_reports for touch points, accel and gyro data.
- Changed touch point parse loop to use "struct dualsense_touch_point".
- Improved consistency of info and error messages.
- Unified comment style.

Thanks,

Roderick Colenbrander
Sony Interactive Entertainment, LLC

Roderick Colenbrander (13):
  HID: playstation: initial DualSense USB support.
  HID: playstation: use DualSense MAC address as unique identifier.
  HID: playstation: add DualSense battery support.
  HID: playstation: add DualSense touchpad support.
  HID: playstation: add DualSense accelerometer and gyroscope support.
  HID: playstation: track devices in list.
  HID: playstation: add DualSense Bluetooth support.
  HID: playstation: add DualSense classic rumble support.
  HID: playstation: add DualSense lightbar support
  HID: playstation: add microphone mute support for DualSense.
  HID: playstation: add DualSense player LEDs support.
  HID: playstation: DualSense set LEDs to default player id.
  HID: playstation: report DualSense hardware and firmware version.

 MAINTAINERS                   |    6 +
 drivers/hid/Kconfig           |   21 +
 drivers/hid/Makefile          |    1 +
 drivers/hid/hid-ids.h         |    1 +
 drivers/hid/hid-playstation.c | 1492 +++++++++++++++++++++++++++++++++
 5 files changed, 1521 insertions(+)
 create mode 100644 drivers/hid/hid-playstation.c

-- 
2.26.2


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2021-01-17 23:24 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-17 23:09 [PATCH v3 00/13] HID: new driver for PS5 'DualSense' controller Roderick Colenbrander
2021-01-17 23:09 ` [PATCH v3 01/12] HID: playstation: initial DualSense USB support Roderick Colenbrander
2021-01-17 23:09 ` [PATCH v3 02/12] HID: playstation: use DualSense MAC address as unique identifier Roderick Colenbrander
2021-01-17 23:09 ` [PATCH v3 03/12] HID: playstation: add DualSense battery support Roderick Colenbrander
2021-01-17 23:09 ` [PATCH v3 04/12] HID: playstation: add DualSense touchpad support Roderick Colenbrander
2021-01-17 23:09 ` [PATCH v3 05/12] HID: playstation: track devices in list Roderick Colenbrander
2021-01-17 23:09 ` [PATCH v3 06/12] HID: playstation: add DualSense Bluetooth support Roderick Colenbrander
2021-01-17 23:09 ` [PATCH v3 07/12] HID: playstation: add DualSense classic rumble support Roderick Colenbrander
2021-01-17 23:09 ` [PATCH v3 08/12] HID: playstation: add DualSense lightbar support Roderick Colenbrander
2021-01-17 23:09 ` [PATCH v3 09/12] HID: playstation: add microphone mute support for DualSense Roderick Colenbrander
2021-01-17 23:09 ` [PATCH v3 10/12] HID: playstation: add DualSense player LEDs support Roderick Colenbrander
2021-01-17 23:09 ` [PATCH v3 11/12] HID: playstation: DualSense set LEDs to default player id Roderick Colenbrander
2021-01-17 23:09 ` [PATCH v3 12/12] HID: playstation: report DualSense hardware and firmware version Roderick Colenbrander
2021-01-17 23:23 ` [PATCH v3 00/13] HID: new driver for PS5 'DualSense' controller Roderick Colenbrander

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).