diff options
| author | Yu-Chun Lin <eleanor.lin@realtek.com> | 2026-07-26 20:51:59 +0800 |
|---|---|---|
| committer | Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> | 2026-07-30 11:05:07 +0200 |
| commit | de36d18cfc66519fd3bb0dabf92d5f7fbc1dc121 (patch) | |
| tree | c18492a0e85fba16a6145292e3c1140d7e5f301f | |
| parent | ab91ecbc322424916efea4c4e6220e2046a80e8a (diff) | |
| download | linux-de36d18cfc66519fd3bb0dabf92d5f7fbc1dc121.tar.gz linux-de36d18cfc66519fd3bb0dabf92d5f7fbc1dc121.zip | |
gpio: regmap: Add IRQ enable/disable helpers
Add gpio_regmap_enable_irq() and gpio_regmap_disable_irq(). Since struct
gpio_regmap is opaque, drivers cannot access the embedded gpio_chip directly.
Reviewed-by: Michael Walle <mwalle@kernel.org>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Yu-Chun Lin <eleanor.lin@realtek.com>
Link: https://patch.msgid.link/20260726125209.140307-9-eleanor.lin@realtek.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
| -rw-r--r-- | drivers/gpio/gpio-regmap.c | 12 | ||||
| -rw-r--r-- | include/linux/gpio/regmap.h | 5 |
2 files changed, 17 insertions, 0 deletions
diff --git a/drivers/gpio/gpio-regmap.c b/drivers/gpio/gpio-regmap.c index 19e33e361cc4..fb21396e1d02 100644 --- a/drivers/gpio/gpio-regmap.c +++ b/drivers/gpio/gpio-regmap.c @@ -346,6 +346,18 @@ void *gpio_regmap_get_drvdata(struct gpio_regmap *gpio) } EXPORT_SYMBOL_GPL(gpio_regmap_get_drvdata); +void gpio_regmap_enable_irq(struct gpio_regmap *gpio, irq_hw_number_t hwirq) +{ + gpiochip_enable_irq(&gpio->gpio_chip, hwirq); +} +EXPORT_SYMBOL_GPL(gpio_regmap_enable_irq); + +void gpio_regmap_disable_irq(struct gpio_regmap *gpio, irq_hw_number_t hwirq) +{ + gpiochip_disable_irq(&gpio->gpio_chip, hwirq); +} +EXPORT_SYMBOL_GPL(gpio_regmap_disable_irq); + /** * gpio_regmap_register() - Register a generic regmap GPIO controller * @config: configuration for gpio_regmap diff --git a/include/linux/gpio/regmap.h b/include/linux/gpio/regmap.h index dd9de9958409..6f52c140e50d 100644 --- a/include/linux/gpio/regmap.h +++ b/include/linux/gpio/regmap.h @@ -3,6 +3,8 @@ #ifndef _LINUX_GPIO_REGMAP_H #define _LINUX_GPIO_REGMAP_H +#include <linux/types.h> + struct device; struct fwnode_handle; struct gpio_regmap; @@ -165,4 +167,7 @@ void *gpio_regmap_get_drvdata(struct gpio_regmap *gpio); int gpio_regmap_reqres_irq(struct gpio_regmap *gpio, unsigned int offset); void gpio_regmap_relres_irq(struct gpio_regmap *gpio, unsigned int offset); +void gpio_regmap_enable_irq(struct gpio_regmap *gpio, irq_hw_number_t hwirq); +void gpio_regmap_disable_irq(struct gpio_regmap *gpio, irq_hw_number_t hwirq); + #endif /* _LINUX_GPIO_REGMAP_H */ |
