]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
media: dw9768: activate runtime PM and turn off device
authorBingbu Cao <bingbu.cao@intel.com>
Fri, 15 Oct 2021 06:08:39 +0000 (07:08 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Mon, 15 Nov 2021 08:11:34 +0000 (08:11 +0000)
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: Bingbu Cao <bingbu.cao@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/i2c/dw9768.c

index c086580efac78a850b8f5d8e853d8209f2fb4877..65c6acf3ced9ad34c269c00a1fa27b3250d5454c 100644 (file)
@@ -469,6 +469,11 @@ static int dw9768_probe(struct i2c_client *client)
 
        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);
        if (!pm_runtime_enabled(dev)) {
                ret = dw9768_runtime_resume(dev);
@@ -483,6 +488,7 @@ static int dw9768_probe(struct i2c_client *client)
                dev_err(dev, "failed to register V4L2 subdev: %d", ret);
                goto err_power_off;
        }
+       pm_runtime_idle(dev);
 
        return 0;