Skip to content

Commit

Permalink
media: ccs: Only do software reset if we have no hardware reset
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
Sakari Ailus authored and mchehab committed Jan 12, 2021
1 parent 105676c commit e1988e7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions drivers/media/i2c/ccs/ccs-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit e1988e7

Please sign in to comment.