cs40l26: haptics IC reset recovery

Detection:
1. Check effects_in_flight count for vibe_state hang issue. (Trigger
   reset at cs40l26_resume since cs40l26_suspend might have issue
   during the controller bus off or system powering off sequence.)
2. Check I2C errors at the end of functions cs40l26_set_gain_worker,
   cs40l26_vibe_start_worker, cs40l26_vibe_stop_worker,
   cs40l26_upload_effect, cs40l26_erase_effect and cs40l26_resume.

Reset sequence:
Toggle hardware reset pin, reload the current firmware, reset the
state flag and counter, and update vibe_state driver attribute.

Reset cooldown period:
Pause further reset recovery if reset is conducted for 10 times in 5
minutes. Resume reset recovery after 5 minutes.

Bug: 299023920
Bug: 281146462
Test: Vibe_state can be recovered.
Change-Id: I3aaf8191932cfd5ca0fd5f8eee88adb5ffd21527
Signed-off-by: Tai Kuo <taikuo@google.com>
4 files changed