public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Neel Bullywon <neelb2403@gmail.com>
Cc: dlechner@baylibre.com, nuno.sa@analog.com, andy@kernel.org,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
	Paul Cercueil <paul@crapouillou.net>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Subject: Re: [PATCH 1/2] iio: pressure: mpl115: add system suspend/resume support
Date: Sun, 22 Feb 2026 16:40:08 +0000	[thread overview]
Message-ID: <20260222164008.7fed0ff4@jic23-huawei> (raw)
In-Reply-To: <20260221172601.77818-1-neelb2403@gmail.com>

On Sat, 21 Feb 2026 12:26:00 -0500
Neel Bullywon <neelb2403@gmail.com> wrote:

> The driver currently only implements runtime PM callbacks to control
> the shutdown GPIO, but lacks system suspend/resume support. This means
> the device may remain powered during system sleep, wasting energy.
> 
> Add system sleep PM ops using pm_runtime_force_suspend() and
> pm_runtime_force_resume() to properly synchronize the runtime PM state
> across system suspend/resume cycles. This ensures the shutdown GPIO is
> asserted during system sleep when the device has a shutdown GPIO
> configured.
> 
> Signed-off-by: Neel Bullywon <neelb2403@gmail.com>

Interestingly for the non exported version we have
DEFINE_RUNTIME_DEV_PM_OPS()
and the docs for that suggest we should use
EXPORT_RUNTIME_DEV_PM_OPS() but as you've realized that doesn't set the
suspend and resume callbacks. If that was intentional then the documentation
is less than clear (and I don't remember that being the intent)

+CC Paul and Rafael.

We have very few users of these macros, so it should be easy enough to
make the export variants consistent if we want to.

Jonathan

> ---
>  drivers/iio/pressure/mpl115.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iio/pressure/mpl115.c b/drivers/iio/pressure/mpl115.c
> index 830a5065c008..29794ce53bc6 100644
> --- a/drivers/iio/pressure/mpl115.c
> +++ b/drivers/iio/pressure/mpl115.c
> @@ -244,8 +244,10 @@ static int mpl115_runtime_resume(struct device *dev)
>  	return 0;
>  }
>  
> -EXPORT_NS_RUNTIME_DEV_PM_OPS(mpl115_dev_pm_ops, mpl115_runtime_suspend,
> -			  mpl115_runtime_resume, NULL, IIO_MPL115);
> +EXPORT_NS_GPL_DEV_PM_OPS(mpl115_dev_pm_ops, IIO_MPL115) = {
> +	SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume)
> +	RUNTIME_PM_OPS(mpl115_runtime_suspend, mpl115_runtime_resume, NULL)
> +};
>  
>  MODULE_AUTHOR("Peter Meerwald <pmeerw@pmeerw.net>");
>  MODULE_DESCRIPTION("Freescale MPL115 pressure/temperature driver");


  parent reply	other threads:[~2026-02-22 16:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-21 17:26 [PATCH 1/2] iio: pressure: mpl115: add system suspend/resume support Neel Bullywon
2026-02-21 17:26 ` [PATCH 2/2] iio: pressure: mpl115: remove stale TODO comment Neel Bullywon
2026-02-21 17:46   ` David Lechner
2026-02-22 16:40 ` Jonathan Cameron [this message]
2026-02-22 18:32   ` [PATCH 1/2] iio: pressure: mpl115: add system suspend/resume support Paul Cercueil
2026-02-28 19:28     ` 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=20260222164008.7fed0ff4@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=andy@kernel.org \
    --cc=dlechner@baylibre.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neelb2403@gmail.com \
    --cc=nuno.sa@analog.com \
    --cc=paul@crapouillou.net \
    --cc=rafael.j.wysocki@intel.com \
    /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