media: hi556: Fix reset GPIO timings
authorHans de Goede <hdegoede@redhat.com>
Sat, 31 May 2025 19:05:33 +0000 (21:05 +0200)
committerHans Verkuil <hverkuil@xs4all.nl>
Thu, 10 Jul 2025 09:32:25 +0000 (11:32 +0200)
commit99f2211a9d89fe34b3fa847fd7a4475171406cd0
treeb5e501a616db67fbe8e679c9fb496d80bf05f180
parent00e0b9455fb4c74fc777289a129f646b4cb112f8
media: hi556: Fix reset GPIO timings

probe() requests the reset GPIO to be set to high when getting it.
Immeditately after this hi556_resume() is called and sets the GPIO low.

If the GPIO was low before requesting it this will result in the GPIO
only very briefly spiking high and the sensor not being properly reset.
The same problem also happens on back to back runtime suspend + resume.

Fix this by adding a sleep of 2 ms in hi556_resume() before setting
the GPIO low (if there is a reset GPIO).

The final sleep is kept unconditional, because if there is e.g. no reset
GPIO but a controllable clock then the sensor also needs some time after
enabling the clock.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
drivers/media/i2c/hi556.c