Re: [PATCH v5 18/20] gpio: regmap: Add optional runtime PM support
From: Andy Shevchenko
Date: Mon Aug 31 2026 - 03:16:20 EST
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 <andriy.shevchenko@xxxxxxxxx>
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