summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorJanani Sunil <janani.sunil@analog.com>2026-09-10 19:29:11 +0200
committerBartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>2026-09-16 11:08:26 +0200
commit73748b4ec54da0323bb2ec62b483ea3f60ff657f (patch)
tree83c405190f61468358c547fbf689bee6e8a7d22b /include/linux
parenta4319947b59145b95353aabed4db879e9448ea50 (diff)
downloadlinux-next-73748b4ec54da0323bb2ec62b483ea3f60ff657f.tar.gz
linux-next-73748b4ec54da0323bb2ec62b483ea3f60ff657f.zip
gpio: regmap: Add optional runtime PM support
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. Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Reviewed-by: Michael Walle <mwalle@kernel.org> Signed-off-by: Janani Sunil <janani.sunil@analog.com> Reviewed-by: Linus Walleij <linusw@kernel.org> Link: https://patch.msgid.link/20260910-ad7768-gpio-v8-2-6aaaa15adeb3@analog.com Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/gpio/regmap.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/gpio/regmap.h b/include/linux/gpio/regmap.h
index 6f52c140e50d..6fe0877717cb 100644
--- a/include/linux/gpio/regmap.h
+++ b/include/linux/gpio/regmap.h
@@ -46,6 +46,7 @@ enum gpio_regmap_operation {
* @parent: The parent device
* @regmap: The regmap used to access the registers
* given, the name of the device is used
+ * @pm_dev: (Optional) Device to use for runtime power management.
* @fwnode: (Optional) The firmware node.
* If not given, the fwnode of the parent is used.
* @label: (Optional) Descriptive name for GPIO controller.
@@ -117,6 +118,7 @@ enum gpio_regmap_operation {
struct gpio_regmap_config {
struct device *parent;
struct regmap *regmap;
+ struct device *pm_dev;
struct fwnode_handle *fwnode;
const char *label;