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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxx>
---
 drivers/iio/light/vcnl4000.c | 1 +
 1 file changed, 1 insertion(+)

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);
 
-- 
2.30.2




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux