Skip to content

hid: sony: Clear and restore controller state on suspend and resume

Frank Praznik linux-input 2 versions – Applied

Status from this message: Applied to for-4.5/sony. Thanks Frank,

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 5 repliesApplied
  2. v12 patches 3 repliesSuperseded

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/2hid: sony: Refactor the output report sending functionsdrivers/hid/hid-sony.c+19 -130 replies
2/2hid: sony: Save and restore the controller state on suspend and resumedrivers/hid/hid-sony.c+64 -10 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/2] hid: sony: Clear and restore controller state on suspend and resume

On systems with standby power for charging devices the LEDs and rumble on the controller can continue to function even when the system is in standby since the state is not cleared when the system goes to sleep.

The state on wakeup can also differ from the state when the system entered standby as the LEDs can be cleared when the device is reset on wakeup.

The first patch refactors the output report functions to allow sending an output report without going through the work queue. This is necessary when clearing the state of the controller before the system is goes into standby since the work might not be executed before the system goes to sleep.

The second patch implements the suspend and resume callbacks which serializes and clears the LEDs on suspend and restores them on resume.

Force-feedback is cleared on suspend but the state is not restored on resume since it can potentially result in hardware damage if the device is unattended when the system wakes. A new event will be required to resume force-feedback.