media: atomisp: gc0310: Fix power on/off sleep times

Reduce the unnecessary long msleep(100) done on stream start to 10 ms and
move this to gc0310_resume() so that it is also done on the initial
power-up done by gc0310_detect(), which should fix gc0310_detect()
sometimes failing.

While at it switch the sleeps from msleep() / usleep_range() to fsleep().

Signed-off-by: Hans de Goede <hansg@kernel.org>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Link: https://lore.kernel.org/r/20250517114106.43494-13-hansg@kernel.org
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
Hans de Goede
2025-05-17 13:40:55 +02:00
committed by Mauro Carvalho Chehab
parent b9ea99652e
commit f934362be2

View File

@@ -473,8 +473,6 @@ static int gc0310_s_stream(struct v4l2_subdev *sd, int enable)
if (ret < 0)
goto error_power_down;
msleep(100);
ret = regmap_multi_reg_write(sensor->regmap,
gc0310_reset_register,
ARRAY_SIZE(gc0310_reset_register));
@@ -803,10 +801,11 @@ static int gc0310_resume(struct device *dev)
struct v4l2_subdev *sd = dev_get_drvdata(dev);
struct gc0310_device *sensor = to_gc0310_sensor(sd);
usleep_range(10000, 15000);
fsleep(10 * USEC_PER_MSEC);
gpiod_set_value_cansleep(sensor->reset, 0);
usleep_range(10000, 15000);
fsleep(10 * USEC_PER_MSEC);
gpiod_set_value_cansleep(sensor->powerdown, 0);
fsleep(10 * USEC_PER_MSEC);
return 0;
}