media: ov2740: Ensure proper reset sequence on probe()
authorHans de Goede <hdegoede@redhat.com>
Mon, 6 May 2024 13:24:38 +0000 (15:24 +0200)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Fri, 10 May 2024 09:20:02 +0000 (11:20 +0200)
commit6983352784a7b87a9c39dbbfaa33733fa1ccb0a5
tree48420428174ad120dfe22acecec9706c2236493c
parent4ff61c4ce93677cd94a0ddefbd6f3bc3c40457c4
media: ov2740: Ensure proper reset sequence on probe()

Before this commit on probe() the driver would do:

reset=1                // from probe() calling gpiod_get(GPIOD_OUT_HIGH)
reset=0                // from resume()
msleep(20)             // from resume()

So if reset was 0 before getting the GPIO the reset line would only be
driven high for a very short time and sometimes there would be errors
reading the id register afterwards.

Add a msleep(20) after getting the reset line to ensure the sensor is
properly reset:

reset=1                // from probe() calling gpiod_get(GPIOD_OUT_HIGH)
msleep(20)             // from probe()
reset=0                // from resume()
msleep(20)             // from resume()

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Stanislaw Gruszka <stanislaw.gruszka@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
drivers/media/i2c/ov2740.c