Thread (39 messages) flat view 39 messages, 5 authors, 10d ago

Re: [PATCH v5 18/20] gpio: regmap: Add optional runtime PM support

From: Andy Shevchenko <hidden>
Date: 2026-08-31 07:16:03
Also in: linux-doc, linux-gpio, linux-iio, lkml

On Fri, Aug 28, 2026 at 05:30:41PM +0200, Janani Sunil wrote:
Some gpio-regmap consumers share their regmap with a parent device that
may be runtime suspended. GPIO register accesses must resume that device
first.

Add an optional pm_dev field and acquire it before register translation
or access. Release it using runtime autosuspend after each operation.
Keep the device active across the complete direction-output sequence and
propagate failure when setting the initial output value.
LGTM now,
Reviewed-by: Andy Shevchenko <redacted>

In case you need a new version, check a nit-pick below.

...
struct gpio_regmap {
 	struct device *parent;
 	struct regmap *regmap;
 	struct gpio_chip gpio_chip;
+	struct device *pm_dev;
Perhaps move this one line up to be consistent with the below...

	struct device *parent;
	struct regmap *regmap;
	struct device *pm_dev;
// Also add a blank line here
	struct gpio_chip gpio_chip;
 	int reg_stride;
 	int ngpio_per_reg;
 };
...
 struct gpio_regmap_config {
 	struct device *parent;
 	struct regmap *regmap;
+	struct device *pm_dev;
^^^
 	struct fwnode_handle *fwnode;
 
 	const char *label;
-- 
With Best Regards,
Andy Shevchenko

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help