diff mbox series

[2/2] iio: light: vcnl4000: Incorporate iio_device with PM runtime

Message ID 20220929144618.1086985-3-marten.lindahl@axis.com (mailing list archive)
State Rejected
Headers show
Series Synchronize PM runtime enable state with parent | expand

Commit Message

Mårten Lindahl Sept. 29, 2022, 2:46 p.m. UTC
When the vcnl4000 device registers the iio_device, the iio_device
creates basic sysfs power/attribute nodes, but PM runtime is only
enabled for the vcnl4000 device and not for the child iio_device.

A result of this is that the iio_device sysfs power attributes is marked
as 'unsupported' and can not be used for control or monitoring of the
vcnl4000 device.

To fix this the iio_device should be incorporated with the vcnl4000
device by enabling runtime PM for it.

Signed-off-by: Mårten Lindahl <marten.lindahl@axis.com>
---
 drivers/iio/light/vcnl4000.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/drivers/iio/light/vcnl4000.c b/drivers/iio/light/vcnl4000.c
index 3db4e26731bb..a904c7c99456 100644
--- a/drivers/iio/light/vcnl4000.c
+++ b/drivers/iio/light/vcnl4000.c
@@ -1077,6 +1077,7 @@  static int vcnl4000_probe(struct i2c_client *client,
 		goto fail_poweroff;
 
 	pm_runtime_enable(&client->dev);
+	pm_runtime_sync_parent_enable(&indio_dev->dev);
 	pm_runtime_set_autosuspend_delay(&client->dev, VCNL4000_SLEEP_DELAY_MS);
 	pm_runtime_use_autosuspend(&client->dev);