Commit ebc0bc27 authored by Sakari Ailus's avatar Sakari Ailus Committed by Mauro Carvalho Chehab
Browse files

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: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 2b5b9af8
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -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);

	if (ccsdev->flags & CCS_DEVICE_FLAG_IS_SMIA)
		sleep = SMIAPP_RESET_DELAY(sensor->hwcfg.ext_clk);
	else
		sleep = 5000;

	usleep_range(sleep, sleep);

	/*