Linux Media Controller development
 help / color / mirror / Atom feed
* [PATCH] media: dw9768: activate runtime PM and turn off device
@ 2021-10-15  6:08 Bingbu Cao
  2021-11-05  6:54 ` Tomasz Figa
  0 siblings, 1 reply; 15+ messages in thread
From: Bingbu Cao @ 2021-10-15  6:08 UTC (permalink / raw)
  To: linux-media, sakari.ailus, dongchun.zhu, tfiga
  Cc: tian.shu.qiu, bingbu.cao, bingbu.cao

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>
---
 drivers/media/i2c/dw9768.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/media/i2c/dw9768.c b/drivers/media/i2c/dw9768.c
index c086580efac7..65c6acf3ced9 100644
--- a/drivers/media/i2c/dw9768.c
+++ b/drivers/media/i2c/dw9768.c
@@ -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;
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2022-07-20 10:28 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-15  6:08 [PATCH] media: dw9768: activate runtime PM and turn off device Bingbu Cao
2021-11-05  6:54 ` Tomasz Figa
2021-11-05 12:52   ` Cao, Bingbu
2021-11-16  4:57     ` Tomasz Figa
2022-04-12  9:39       ` Tomasz Figa
2022-04-12 11:05         ` Bingbu Cao
2022-04-12 11:15           ` Tomasz Figa
2022-04-13 11:40             ` sakari.ailus
2022-04-13 12:17               ` Tomasz Figa
2022-04-13 13:36                 ` sakari.ailus
2022-04-13 13:44                   ` Tomasz Figa
2022-07-14  9:08                     ` Bingbu Cao
2022-07-20 10:28                       ` Tomasz Figa
2022-04-13 11:38   ` Bingbu Cao
2022-04-13 12:13     ` Tomasz Figa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox