public inbox for linux-iio@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] iio: pressure: mpl115: add system suspend/resume support
@ 2026-02-21 17:26 Neel Bullywon
  2026-02-21 17:26 ` [PATCH 2/2] iio: pressure: mpl115: remove stale TODO comment Neel Bullywon
  2026-02-22 16:40 ` [PATCH 1/2] iio: pressure: mpl115: add system suspend/resume support Jonathan Cameron
  0 siblings, 2 replies; 6+ messages in thread
From: Neel Bullywon @ 2026-02-21 17:26 UTC (permalink / raw)
  To: jic23, dlechner, nuno.sa, andy; +Cc: linux-iio, linux-kernel, Neel Bullywon

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>
---
 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");
-- 
2.44.0


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

end of thread, other threads:[~2026-02-28 19:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH 1/2] iio: pressure: mpl115: add system suspend/resume support Jonathan Cameron
2026-02-22 18:32   ` Paul Cercueil
2026-02-28 19:28     ` Jonathan Cameron

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