880-v6.14-gpio-regmap-Use-generic-request-free-ops.patch 1.3 KB

123456789101112131415161718192021222324252627282930
  1. From b0fa00fe38f673c986633c11087274deeb7ce7b0 Mon Sep 17 00:00:00 2001
  2. From: Sander Vanheule <[email protected]>
  3. Date: Tue, 7 Jan 2025 21:16:20 +0100
  4. Subject: [PATCH] gpio: regmap: Use generic request/free ops
  5. Set the gpiochip request and free ops to the generic implementations.
  6. This way a user can provide a gpio-ranges property defined for a pinmux,
  7. easing muxing of gpio functions. Provided that the pin controller
  8. implementents the pinmux op .gpio_request_enable(), pins will
  9. automatically be muxed to their GPIO function when requested.
  10. Signed-off-by: Sander Vanheule <[email protected]>
  11. Acked-by: Michael Walle <[email protected]>
  12. Link: https://lore.kernel.org/r/[email protected]
  13. Signed-off-by: Bartosz Golaszewski <[email protected]>
  14. ---
  15. drivers/gpio/gpio-regmap.c | 2 ++
  16. 1 file changed, 2 insertions(+)
  17. --- a/drivers/gpio/gpio-regmap.c
  18. +++ b/drivers/gpio/gpio-regmap.c
  19. @@ -262,6 +262,8 @@ struct gpio_regmap *gpio_regmap_register
  20. chip->label = config->label ?: dev_name(config->parent);
  21. chip->can_sleep = regmap_might_sleep(config->regmap);
  22. + chip->request = gpiochip_generic_request;
  23. + chip->free = gpiochip_generic_free;
  24. chip->get = gpio_regmap_get;
  25. if (gpio->reg_set_base && gpio->reg_clr_base)
  26. chip->set = gpio_regmap_set_with_clear;