diff options
author | Sakari Ailus | 2020-10-08 10:59:26 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab | 2021-01-12 17:34:11 +0100 |
commit | e1988e7ad0015e9d8252b515d5aa23a58428022c (patch) | |
tree | 9d4084466a34749890e2caa86fc9474336542a96 /drivers/media/i2c/ccs | |
parent | 105676ce5940517d2a8a4be32f54c9ff8a021ca5 (diff) |
media: ccs: Only do software reset if we have no hardware reset
The driver always used software reset after the sensor's power sequence
that includes a hardware reset if we have a reset GPIO. Do not use
software reset if we just brought the sensor up from hardware reset state.
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/ccs')
-rw-r--r-- | drivers/media/i2c/ccs/ccs-core.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/media/i2c/ccs/ccs-core.c b/drivers/media/i2c/ccs/ccs-core.c index da7a6bd2c820..fdf2e83eeac3 100644 --- a/drivers/media/i2c/ccs/ccs-core.c +++ b/drivers/media/i2c/ccs/ccs-core.c @@ -1552,10 +1552,12 @@ static int ccs_power_on(struct device *dev) * is found. */ - rval = ccs_write(sensor, SOFTWARE_RESET, CCS_SOFTWARE_RESET_ON); - if (rval < 0) { - dev_err(dev, "software reset failed\n"); - goto out_cci_addr_fail; + if (!sensor->reset && !sensor->xshutdown) { + rval = ccs_write(sensor, SOFTWARE_RESET, CCS_SOFTWARE_RESET_ON); + if (rval < 0) { + dev_err(dev, "software reset failed\n"); + goto out_cci_addr_fail; + } } if (sensor->hwcfg.i2c_addr_alt) { |