}
usleep_range(1000, 1000);
+ gpiod_set_value(sensor->reset, 0);
gpiod_set_value(sensor->xshutdown, 1);
sleep = SMIAPP_RESET_DELAY(sensor->hwcfg->ext_clk);
return 0;
out_cci_addr_fail:
+ gpiod_set_value(sensor->reset, 1);
gpiod_set_value(sensor->xshutdown, 0);
clk_disable_unprepare(sensor->ext_clk);
if (sensor->hwcfg->i2c_addr_alt)
ccs_write(sensor, SOFTWARE_RESET, CCS_SOFTWARE_RESET_ON);
+ gpiod_set_value(sensor->reset, 1);
gpiod_set_value(sensor->xshutdown, 0);
clk_disable_unprepare(sensor->ext_clk);
usleep_range(5000, 5000);
return -EINVAL;
}
- sensor->xshutdown = devm_gpiod_get_optional(&client->dev, "xshutdown",
- GPIOD_OUT_LOW);
+ sensor->reset = devm_gpiod_get_optional(&client->dev, "reset",
+ GPIOD_OUT_HIGH);
+ if (IS_ERR(sensor->reset))
+ return PTR_ERR(sensor->reset);
+ /* Support old users that may have used "xshutdown" property. */
+ if (!sensor->reset)
+ sensor->xshutdown = devm_gpiod_get_optional(&client->dev,
+ "xshutdown",
+ GPIOD_OUT_LOW);
if (IS_ERR(sensor->xshutdown))
return PTR_ERR(sensor->xshutdown);