Commit c09d776e authored by Bingbu Cao's avatar Bingbu Cao Committed by Mauro Carvalho Chehab

media: dw9768: activate runtime PM and turn off device

When dw9768 working with ACPI systems, the dw9768 was turned
by i2c-core during probe, driver need activate the PM runtime
and ask runtime PM to turn off the device.
Signed-off-by: default avatarBingbu Cao <bingbu.cao@intel.com>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 2a998392
...@@ -469,6 +469,11 @@ static int dw9768_probe(struct i2c_client *client) ...@@ -469,6 +469,11 @@ static int dw9768_probe(struct i2c_client *client)
dw9768->sd.entity.function = MEDIA_ENT_F_LENS; dw9768->sd.entity.function = MEDIA_ENT_F_LENS;
/*
* Device is already turned on by i2c-core with ACPI domain PM.
* Attempt to turn off the device to satisfy the privacy LED concerns.
*/
pm_runtime_set_active(dev);
pm_runtime_enable(dev); pm_runtime_enable(dev);
if (!pm_runtime_enabled(dev)) { if (!pm_runtime_enabled(dev)) {
ret = dw9768_runtime_resume(dev); ret = dw9768_runtime_resume(dev);
...@@ -483,6 +488,7 @@ static int dw9768_probe(struct i2c_client *client) ...@@ -483,6 +488,7 @@ static int dw9768_probe(struct i2c_client *client)
dev_err(dev, "failed to register V4L2 subdev: %d", ret); dev_err(dev, "failed to register V4L2 subdev: %d", ret);
goto err_power_off; goto err_power_off;
} }
pm_runtime_idle(dev);
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment