summaryrefslogtreecommitdiff
path: root/drivers/media/i2c
diff options
context:
space:
mode:
authorSakari Ailus <sakari.ailus@linux.intel.com>2020-09-21 19:08:20 +0300
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2020-12-03 14:27:32 +0300
commitebc0bc270e09671b245ebc0bd3e99138bd16e2be (patch)
tree229ac35ff7429b9e80b846f33b4f412527340a9b /drivers/media/i2c
parent2b5b9af811ae0b1376d5ac87cac26757d773c317 (diff)
downloadlinux-ebc0bc270e09671b245ebc0bd3e99138bd16e2be.tar.xz
media: ccs: Use longer pre-I²C sleep for CCS compliant devices
Longer idle period is required on I²C bus before the first transaction after lifting xshutdown. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media/i2c')
-rw-r--r--drivers/media/i2c/ccs/ccs-core.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/media/i2c/ccs/ccs-core.c b/drivers/media/i2c/ccs/ccs-core.c
index 863295b8fb5c..5014aa0d7969 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);
/*