From ebc0bc270e09671b245ebc0bd3e99138bd16e2be Mon Sep 17 00:00:00 2001 From: Sakari Ailus Date: Mon, 21 Sep 2020 18:08:20 +0200 Subject: [PATCH] =?utf8?q?media:=20ccs:=20Use=20longer=20pre-I=C2=B2C=20sl?= =?utf8?q?eep=20for=20CCS=20compliant=20devices?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Longer idle period is required on I²C bus before the first transaction after lifting xshutdown. Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab --- drivers/media/i2c/ccs/ccs-core.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/ccs/ccs-core.c b/drivers/media/i2c/ccs/ccs-core.c index 863295b8fb5c5..5014aa0d79695 100644 --- a/drivers/media/i2c/ccs/ccs-core.c +++ b/drivers/media/i2c/ccs/ccs-core.c @@ -1300,6 +1300,7 @@ static int ccs_power_on(struct device *dev) */ struct ccs_sensor *sensor = container_of(ssd, struct ccs_sensor, ssds[0]); + const struct ccs_device *ccsdev = device_get_match_data(dev); unsigned int sleep; int rval; @@ -1320,7 +1321,11 @@ static int ccs_power_on(struct device *dev) gpiod_set_value(sensor->reset, 0); gpiod_set_value(sensor->xshutdown, 1); - sleep = SMIAPP_RESET_DELAY(sensor->hwcfg.ext_clk); + if (ccsdev->flags & CCS_DEVICE_FLAG_IS_SMIA) + sleep = SMIAPP_RESET_DELAY(sensor->hwcfg.ext_clk); + else + sleep = 5000; + usleep_range(sleep, sleep); /* -- 2.30.2