Linux IIO development
 help / color / mirror / Atom feed
From: "Mårten Lindahl" <marten.lindahl@axis.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>,
	Pavel Machek <pavel@ucw.cz>, Jonathan Cameron <jic23@kernel.org>
Cc: "Lars-Peter Clausen" <lars@metafoo.de>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	linux-pm@vger.kernel.org, linux-iio@vger.kernel.org,
	kernel@axis.com, "Mårten Lindahl" <marten.lindahl@axis.com>
Subject: [PATCH 2/2] iio: light: vcnl4000: Incorporate iio_device with PM runtime
Date: Thu, 29 Sep 2022 16:46:18 +0200	[thread overview]
Message-ID: <20220929144618.1086985-3-marten.lindahl@axis.com> (raw)
In-Reply-To: <20220929144618.1086985-1-marten.lindahl@axis.com>

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 --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


  parent reply	other threads:[~2022-09-29 14:46 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-29 14:46 [PATCH 0/2] Synchronize PM runtime enable state with parent Mårten Lindahl
2022-09-29 14:46 ` [PATCH 1/2] PM: runtime: " Mårten Lindahl
2022-10-25 16:20   ` Rafael J. Wysocki
2022-10-31 16:48     ` Marten Lindahl
2022-11-06 15:33       ` Jonathan Cameron
2022-11-06 17:16         ` Rafael J. Wysocki
2022-11-12 15:33           ` Jonathan Cameron
2022-11-28 22:50             ` Marten Lindahl
2022-09-29 14:46 ` Mårten Lindahl [this message]
2022-10-16 16:41 ` [PATCH 0/2] " Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220929144618.1086985-3-marten.lindahl@axis.com \
    --to=marten.lindahl@axis.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jic23@kernel.org \
    --cc=kernel@axis.com \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=rafael@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox