]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.6-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 31 Oct 2025 13:25:10 +0000 (14:25 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 31 Oct 2025 13:25:10 +0000 (14:25 +0100)
added patches:
bits-add-comments-and-newlines-to-if-else-and-endif-directives.patch
bits-introduce-fixed-type-genmask_u.patch
gpio-idio-16-define-fixed-direction-of-the-gpio-lines.patch
gpio-regmap-add-the-.fixed_direction_output-configuration-parameter.patch
gpio-regmap-allow-to-allocate-regmap-irq-device.patch

queue-6.6/bits-add-comments-and-newlines-to-if-else-and-endif-directives.patch [new file with mode: 0644]
queue-6.6/bits-introduce-fixed-type-genmask_u.patch [new file with mode: 0644]
queue-6.6/gpio-idio-16-define-fixed-direction-of-the-gpio-lines.patch [new file with mode: 0644]
queue-6.6/gpio-regmap-add-the-.fixed_direction_output-configuration-parameter.patch [new file with mode: 0644]
queue-6.6/gpio-regmap-allow-to-allocate-regmap-irq-device.patch [new file with mode: 0644]
queue-6.6/series

diff --git a/queue-6.6/bits-add-comments-and-newlines-to-if-else-and-endif-directives.patch b/queue-6.6/bits-add-comments-and-newlines-to-if-else-and-endif-directives.patch
new file mode 100644 (file)
index 0000000..08006dc
--- /dev/null
@@ -0,0 +1,56 @@
+From stable+bounces-191816-greg=kroah.com@vger.kernel.org Fri Oct 31 14:12:18 2025
+From: William Breathitt Gray <wbg@kernel.org>
+Date: Fri, 31 Oct 2025 22:11:57 +0900
+Subject: bits: add comments and newlines to #if, #else and #endif directives
+To: stable@vger.kernel.org
+Cc: Vincent Mailhol <mailhol.vincent@wanadoo.fr>, Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Yury Norov <yury.norov@gmail.com>, William Breathitt Gray <wbg@kernel.org>
+Message-ID: <20251031131203.973066-1-wbg@kernel.org>
+
+From: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
+
+[ Upstream commit 31299a5e0211241171b2222c5633aad4763bf700 ]
+
+This is a preparation for the upcoming GENMASK_U*() and BIT_U*()
+changes. After introducing those new macros, there will be a lot of
+scrolling between the #if, #else and #endif.
+
+Add a comment to the #else and #endif preprocessor macros to help keep
+track of which context we are in. Also, add new lines to better
+visually separate the non-asm and asm sections.
+
+Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
+Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
+Signed-off-by: Yury Norov <yury.norov@gmail.com>
+Stable-dep-of: 2ba5772e530f ("gpio: idio-16: Define fixed direction of the GPIO lines")
+Signed-off-by: William Breathitt Gray <wbg@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ include/linux/bits.h |    8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+--- a/include/linux/bits.h
++++ b/include/linux/bits.h
+@@ -18,17 +18,21 @@
+  * GENMASK_ULL(39, 21) gives us the 64bit vector 0x000000ffffe00000.
+  */
+ #if !defined(__ASSEMBLY__)
++
+ #include <linux/build_bug.h>
+ #define GENMASK_INPUT_CHECK(h, l) \
+       (BUILD_BUG_ON_ZERO(__builtin_choose_expr( \
+               __is_constexpr((l) > (h)), (l) > (h), 0)))
+-#else
++
++#else /* defined(__ASSEMBLY__) */
++
+ /*
+  * BUILD_BUG_ON_ZERO is not available in h files included from asm files,
+  * disable the input check if that is the case.
+  */
+ #define GENMASK_INPUT_CHECK(h, l) 0
+-#endif
++
++#endif /* !defined(__ASSEMBLY__) */
+ #define __GENMASK(h, l) \
+       (((~UL(0)) - (UL(1) << (l)) + 1) & \
diff --git a/queue-6.6/bits-introduce-fixed-type-genmask_u.patch b/queue-6.6/bits-introduce-fixed-type-genmask_u.patch
new file mode 100644 (file)
index 0000000..7645f52
--- /dev/null
@@ -0,0 +1,117 @@
+From stable+bounces-191817-greg=kroah.com@vger.kernel.org Fri Oct 31 14:12:21 2025
+From: William Breathitt Gray <wbg@kernel.org>
+Date: Fri, 31 Oct 2025 22:11:58 +0900
+Subject: bits: introduce fixed-type GENMASK_U*()
+To: stable@vger.kernel.org
+Cc: Vincent Mailhol <mailhol.vincent@wanadoo.fr>, Yury Norov <yury.norov@gmail.com>, Lucas De Marchi <lucas.demarchi@intel.com>, Jani Nikula <jani.nikula@intel.com>, Andy Shevchenko <andriy.shevchenko@linux.intel.com>, William Breathitt Gray <wbg@kernel.org>
+Message-ID: <20251031131203.973066-2-wbg@kernel.org>
+
+From: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
+
+[ Upstream commit 19408200c094858d952a90bf4977733dc89a4df5 ]
+
+Add GENMASK_TYPE() which generalizes __GENMASK() to support different
+types, and implement fixed-types versions of GENMASK() based on it.
+The fixed-type version allows more strict checks to the min/max values
+accepted, which is useful for defining registers like implemented by
+i915 and xe drivers with their REG_GENMASK*() macros.
+
+The strict checks rely on shift-count-overflow compiler check to fail
+the build if a number outside of the range allowed is passed.
+Example:
+
+  #define FOO_MASK GENMASK_U32(33, 4)
+
+will generate a warning like:
+
+  include/linux/bits.h:51:27: error: right shift count >= width of type [-Werror=shift-count-overflow]
+     51 |               type_max(t) >> (BITS_PER_TYPE(t) - 1 - (h)))))
+        |                           ^~
+
+The result is casted to the corresponding fixed width type. For
+example, GENMASK_U8() returns an u8. Note that because of the C
+promotion rules, GENMASK_U8() and GENMASK_U16() will immediately be
+promoted to int if used in an expression. Regardless, the main goal is
+not to get the correct type, but rather to enforce more checks at
+compile time.
+
+While GENMASK_TYPE() is crafted to cover all variants, including the
+already existing GENMASK(), GENMASK_ULL() and GENMASK_U128(), for the
+moment, only use it for the newly introduced GENMASK_U*(). The
+consolidation will be done in a separate change.
+
+Co-developed-by: Yury Norov <yury.norov@gmail.com>
+Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
+Acked-by: Jani Nikula <jani.nikula@intel.com>
+Signed-off-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
+Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
+Signed-off-by: Yury Norov <yury.norov@gmail.com>
+Stable-dep-of: 2ba5772e530f ("gpio: idio-16: Define fixed direction of the GPIO lines")
+Signed-off-by: William Breathitt Gray <wbg@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ include/linux/bitops.h |    1 -
+ include/linux/bits.h   |   30 ++++++++++++++++++++++++++++++
+ 2 files changed, 30 insertions(+), 1 deletion(-)
+
+--- a/include/linux/bitops.h
++++ b/include/linux/bitops.h
+@@ -15,7 +15,6 @@
+ #  define aligned_byte_mask(n) (~0xffUL << (BITS_PER_LONG - 8 - 8*(n)))
+ #endif
+-#define BITS_PER_TYPE(type)   (sizeof(type) * BITS_PER_BYTE)
+ #define BITS_TO_LONGS(nr)     __KERNEL_DIV_ROUND_UP(nr, BITS_PER_TYPE(long))
+ #define BITS_TO_U64(nr)               __KERNEL_DIV_ROUND_UP(nr, BITS_PER_TYPE(u64))
+ #define BITS_TO_U32(nr)               __KERNEL_DIV_ROUND_UP(nr, BITS_PER_TYPE(u32))
+--- a/include/linux/bits.h
++++ b/include/linux/bits.h
+@@ -11,6 +11,7 @@
+ #define BIT_ULL_MASK(nr)      (ULL(1) << ((nr) % BITS_PER_LONG_LONG))
+ #define BIT_ULL_WORD(nr)      ((nr) / BITS_PER_LONG_LONG)
+ #define BITS_PER_BYTE         8
++#define BITS_PER_TYPE(type)   (sizeof(type) * BITS_PER_BYTE)
+ /*
+  * Create a contiguous bitmask starting at bit position @l and ending at
+@@ -19,11 +20,40 @@
+  */
+ #if !defined(__ASSEMBLY__)
++/*
++ * Missing asm support
++ *
++ * GENMASK_U*() depend on BITS_PER_TYPE() which relies on sizeof(),
++ * something not available in asm. Nevertheless, fixed width integers is a C
++ * concept. Assembly code can rely on the long and long long versions instead.
++ */
++
+ #include <linux/build_bug.h>
++#include <linux/overflow.h>
+ #define GENMASK_INPUT_CHECK(h, l) \
+       (BUILD_BUG_ON_ZERO(__builtin_choose_expr( \
+               __is_constexpr((l) > (h)), (l) > (h), 0)))
++/*
++ * Generate a mask for the specified type @t. Additional checks are made to
++ * guarantee the value returned fits in that type, relying on
++ * -Wshift-count-overflow compiler check to detect incompatible arguments.
++ * For example, all these create build errors or warnings:
++ *
++ * - GENMASK(15, 20): wrong argument order
++ * - GENMASK(72, 15): doesn't fit unsigned long
++ * - GENMASK_U32(33, 15): doesn't fit in a u32
++ */
++#define GENMASK_TYPE(t, h, l)                                 \
++      ((t)(GENMASK_INPUT_CHECK(h, l) +                        \
++           (type_max(t) << (l) &                              \
++            type_max(t) >> (BITS_PER_TYPE(t) - 1 - (h)))))
++
++#define GENMASK_U8(h, l)      GENMASK_TYPE(u8, h, l)
++#define GENMASK_U16(h, l)     GENMASK_TYPE(u16, h, l)
++#define GENMASK_U32(h, l)     GENMASK_TYPE(u32, h, l)
++#define GENMASK_U64(h, l)     GENMASK_TYPE(u64, h, l)
++
+ #else /* defined(__ASSEMBLY__) */
+ /*
diff --git a/queue-6.6/gpio-idio-16-define-fixed-direction-of-the-gpio-lines.patch b/queue-6.6/gpio-idio-16-define-fixed-direction-of-the-gpio-lines.patch
new file mode 100644 (file)
index 0000000..506a3d7
--- /dev/null
@@ -0,0 +1,62 @@
+From stable+bounces-191820-greg=kroah.com@vger.kernel.org Fri Oct 31 14:12:25 2025
+From: William Breathitt Gray <wbg@kernel.org>
+Date: Fri, 31 Oct 2025 22:12:01 +0900
+Subject: gpio: idio-16: Define fixed direction of the GPIO lines
+To: stable@vger.kernel.org
+Cc: William Breathitt Gray <wbg@kernel.org>, Mark Cave-Ayland <mark.caveayland@nutanix.com>, Michael Walle <mwalle@kernel.org>, Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Linus Walleij <linus.walleij@linaro.org>, Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
+Message-ID: <20251031131203.973066-5-wbg@kernel.org>
+
+From: William Breathitt Gray <wbg@kernel.org>
+
+[ Upstream commit 2ba5772e530f73eb847fb96ce6c4017894869552 ]
+
+The direction of the IDIO-16 GPIO lines is fixed with the first 16 lines
+as output and the remaining 16 lines as input. Set the gpio_config
+fixed_direction_output member to represent the fixed direction of the
+GPIO lines.
+
+Fixes: db02247827ef ("gpio: idio-16: Migrate to the regmap API")
+Reported-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
+Closes: https://lore.kernel.org/r/9b0375fd-235f-4ee1-a7fa-daca296ef6bf@nutanix.com
+Suggested-by: Michael Walle <mwalle@kernel.org>
+Cc: stable@vger.kernel.org # ae495810cffe: gpio: regmap: add the .fixed_direction_output configuration parameter
+Cc: stable@vger.kernel.org
+Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
+Signed-off-by: William Breathitt Gray <wbg@kernel.org>
+Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
+Link: https://lore.kernel.org/r/20251020-fix-gpio-idio-16-regmap-v2-3-ebeb50e93c33@kernel.org
+Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
+Signed-off-by: William Breathitt Gray <wbg@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpio/gpio-idio-16.c |    5 +++++
+ 1 file changed, 5 insertions(+)
+
+--- a/drivers/gpio/gpio-idio-16.c
++++ b/drivers/gpio/gpio-idio-16.c
+@@ -3,6 +3,7 @@
+  * GPIO library for the ACCES IDIO-16 family
+  * Copyright (C) 2022 William Breathitt Gray
+  */
++#include <linux/bitmap.h>
+ #include <linux/bits.h>
+ #include <linux/device.h>
+ #include <linux/err.h>
+@@ -106,6 +107,7 @@ int devm_idio_16_regmap_register(struct
+       struct idio_16_data *data;
+       struct regmap_irq_chip *chip;
+       struct regmap_irq_chip_data *chip_data;
++      DECLARE_BITMAP(fixed_direction_output, IDIO_16_NGPIO);
+       if (!config->parent)
+               return -EINVAL;
+@@ -163,6 +165,9 @@ int devm_idio_16_regmap_register(struct
+       gpio_config.irq_domain = regmap_irq_get_domain(chip_data);
+       gpio_config.reg_mask_xlate = idio_16_reg_mask_xlate;
++      bitmap_from_u64(fixed_direction_output, GENMASK_U64(15, 0));
++      gpio_config.fixed_direction_output = fixed_direction_output;
++
+       return PTR_ERR_OR_ZERO(devm_gpio_regmap_register(dev, &gpio_config));
+ }
+ EXPORT_SYMBOL_GPL(devm_idio_16_regmap_register);
diff --git a/queue-6.6/gpio-regmap-add-the-.fixed_direction_output-configuration-parameter.patch b/queue-6.6/gpio-regmap-add-the-.fixed_direction_output-configuration-parameter.patch
new file mode 100644 (file)
index 0000000..98ef847
--- /dev/null
@@ -0,0 +1,128 @@
+From stable+bounces-191819-greg=kroah.com@vger.kernel.org Fri Oct 31 14:12:23 2025
+From: William Breathitt Gray <wbg@kernel.org>
+Date: Fri, 31 Oct 2025 22:12:00 +0900
+Subject: gpio: regmap: add the .fixed_direction_output configuration parameter
+To: stable@vger.kernel.org
+Cc: Ioana Ciornei <ioana.ciornei@nxp.com>, Bartosz Golaszewski <bartosz.golaszewski@linaro.org>, Michael Walle <mwalle@kernel.org>, William Breathitt Gray <wbg@kernel.org>
+Message-ID: <20251031131203.973066-4-wbg@kernel.org>
+
+From: Ioana Ciornei <ioana.ciornei@nxp.com>
+
+[ Upstream commit 00aaae60faf554c27c95e93d47f200a93ff266ef ]
+
+There are GPIO controllers such as the one present in the LX2160ARDB
+QIXIS FPGA which have fixed-direction input and output GPIO lines mixed
+together in a single register. This cannot be modeled using the
+gpio-regmap as-is since there is no way to present the true direction of
+a GPIO line.
+
+In order to make this use case possible, add a new configuration
+parameter - fixed_direction_output - into the gpio_regmap_config
+structure. This will enable user drivers to provide a bitmap that
+represents the fixed direction of the GPIO lines.
+
+Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
+Acked-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
+Reviewed-by: Michael Walle <mwalle@kernel.org>
+Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
+Stable-dep-of: 2ba5772e530f ("gpio: idio-16: Define fixed direction of the GPIO lines")
+Signed-off-by: William Breathitt Gray <wbg@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpio/gpio-regmap.c  |   26 ++++++++++++++++++++++++--
+ include/linux/gpio/regmap.h |    5 +++++
+ 2 files changed, 29 insertions(+), 2 deletions(-)
+
+--- a/drivers/gpio/gpio-regmap.c
++++ b/drivers/gpio/gpio-regmap.c
+@@ -29,6 +29,7 @@ struct gpio_regmap {
+       unsigned int reg_clr_base;
+       unsigned int reg_dir_in_base;
+       unsigned int reg_dir_out_base;
++      unsigned long *fixed_direction_output;
+ #ifdef CONFIG_REGMAP_IRQ
+       int regmap_irq_line;
+@@ -122,6 +123,13 @@ static int gpio_regmap_get_direction(str
+       unsigned int base, val, reg, mask;
+       int invert, ret;
++      if (gpio->fixed_direction_output) {
++              if (test_bit(offset, gpio->fixed_direction_output))
++                      return GPIO_LINE_DIRECTION_OUT;
++              else
++                      return GPIO_LINE_DIRECTION_IN;
++      }
++
+       if (gpio->reg_dat_base && !gpio->reg_set_base)
+               return GPIO_LINE_DIRECTION_IN;
+       if (gpio->reg_set_base && !gpio->reg_dat_base)
+@@ -280,9 +288,20 @@ struct gpio_regmap *gpio_regmap_register
+               chip->direction_output = gpio_regmap_direction_output;
+       }
++      if (config->fixed_direction_output) {
++              gpio->fixed_direction_output = bitmap_alloc(chip->ngpio,
++                                                          GFP_KERNEL);
++              if (!gpio->fixed_direction_output) {
++                      ret = -ENOMEM;
++                      goto err_free_gpio;
++              }
++              bitmap_copy(gpio->fixed_direction_output,
++                          config->fixed_direction_output, chip->ngpio);
++      }
++
+       ret = gpiochip_add_data(chip, gpio);
+       if (ret < 0)
+-              goto err_free_gpio;
++              goto err_free_bitmap;
+ #ifdef CONFIG_REGMAP_IRQ
+       if (config->regmap_irq_chip) {
+@@ -291,7 +310,7 @@ struct gpio_regmap *gpio_regmap_register
+                                                config->regmap_irq_line, config->regmap_irq_flags,
+                                                0, config->regmap_irq_chip, &gpio->irq_chip_data);
+               if (ret)
+-                      goto err_free_gpio;
++                      goto err_free_bitmap;
+               irq_domain = regmap_irq_get_domain(gpio->irq_chip_data);
+       } else
+@@ -308,6 +327,8 @@ struct gpio_regmap *gpio_regmap_register
+ err_remove_gpiochip:
+       gpiochip_remove(chip);
++err_free_bitmap:
++      bitmap_free(gpio->fixed_direction_output);
+ err_free_gpio:
+       kfree(gpio);
+       return ERR_PTR(ret);
+@@ -326,6 +347,7 @@ void gpio_regmap_unregister(struct gpio_
+ #endif
+       gpiochip_remove(&gpio->gpio_chip);
++      bitmap_free(gpio->fixed_direction_output);
+       kfree(gpio);
+ }
+ EXPORT_SYMBOL_GPL(gpio_regmap_unregister);
+--- a/include/linux/gpio/regmap.h
++++ b/include/linux/gpio/regmap.h
+@@ -37,6 +37,10 @@ struct regmap;
+  *                    offset to a register/bitmask pair. If not
+  *                    given the default gpio_regmap_simple_xlate()
+  *                    is used.
++ * @fixed_direction_output:
++ *                    (Optional) Bitmap representing the fixed direction of
++ *                    the GPIO lines. Useful when there are GPIO lines with a
++ *                    fixed direction mixed together in the same register.
+  * @drvdata:          (Optional) Pointer to driver specific data which is
+  *                    not used by gpio-remap but is provided "as is" to the
+  *                    driver callback(s).
+@@ -82,6 +86,7 @@ struct gpio_regmap_config {
+       int reg_stride;
+       int ngpio_per_reg;
+       struct irq_domain *irq_domain;
++      unsigned long *fixed_direction_output;
+ #ifdef CONFIG_REGMAP_IRQ
+       struct regmap_irq_chip *regmap_irq_chip;
diff --git a/queue-6.6/gpio-regmap-allow-to-allocate-regmap-irq-device.patch b/queue-6.6/gpio-regmap-allow-to-allocate-regmap-irq-device.patch
new file mode 100644 (file)
index 0000000..ed70f5e
--- /dev/null
@@ -0,0 +1,114 @@
+From stable+bounces-191818-greg=kroah.com@vger.kernel.org Fri Oct 31 14:18:18 2025
+From: William Breathitt Gray <wbg@kernel.org>
+Date: Fri, 31 Oct 2025 22:11:59 +0900
+Subject: gpio: regmap: Allow to allocate regmap-irq device
+To: stable@vger.kernel.org
+Cc: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>, Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Bartosz Golaszewski <bartosz.golaszewski@linaro.org>, Lee Jones <lee@kernel.org>, William Breathitt Gray <wbg@kernel.org>
+Message-ID: <20251031131203.973066-3-wbg@kernel.org>
+
+From: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
+
+[ Upstream commit 553b75d4bfe9264f631d459fe9996744e0672b0e ]
+
+GPIO controller often have support for IRQ: allow to easily allocate
+both gpio-regmap and regmap-irq in one operation.
+
+Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
+Acked-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
+Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
+Link: https://lore.kernel.org/r/20250824-mdb-max7360-support-v14-5-435cfda2b1ea@bootlin.com
+Signed-off-by: Lee Jones <lee@kernel.org>
+Stable-dep-of: 2ba5772e530f ("gpio: idio-16: Define fixed direction of the GPIO lines")
+Signed-off-by: William Breathitt Gray <wbg@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/gpio/gpio-regmap.c  |   29 +++++++++++++++++++++++++++--
+ include/linux/gpio/regmap.h |   11 +++++++++++
+ 2 files changed, 38 insertions(+), 2 deletions(-)
+
+--- a/drivers/gpio/gpio-regmap.c
++++ b/drivers/gpio/gpio-regmap.c
+@@ -30,6 +30,11 @@ struct gpio_regmap {
+       unsigned int reg_dir_in_base;
+       unsigned int reg_dir_out_base;
++#ifdef CONFIG_REGMAP_IRQ
++      int regmap_irq_line;
++      struct regmap_irq_chip_data *irq_chip_data;
++#endif
++
+       int (*reg_mask_xlate)(struct gpio_regmap *gpio, unsigned int base,
+                             unsigned int offset, unsigned int *reg,
+                             unsigned int *mask);
+@@ -203,6 +208,7 @@ EXPORT_SYMBOL_GPL(gpio_regmap_get_drvdat
+  */
+ struct gpio_regmap *gpio_regmap_register(const struct gpio_regmap_config *config)
+ {
++      struct irq_domain *irq_domain;
+       struct gpio_regmap *gpio;
+       struct gpio_chip *chip;
+       int ret;
+@@ -278,8 +284,22 @@ struct gpio_regmap *gpio_regmap_register
+       if (ret < 0)
+               goto err_free_gpio;
+-      if (config->irq_domain) {
+-              ret = gpiochip_irqchip_add_domain(chip, config->irq_domain);
++#ifdef CONFIG_REGMAP_IRQ
++      if (config->regmap_irq_chip) {
++              gpio->regmap_irq_line = config->regmap_irq_line;
++              ret = regmap_add_irq_chip_fwnode(dev_fwnode(config->parent), config->regmap,
++                                               config->regmap_irq_line, config->regmap_irq_flags,
++                                               0, config->regmap_irq_chip, &gpio->irq_chip_data);
++              if (ret)
++                      goto err_free_gpio;
++
++              irq_domain = regmap_irq_get_domain(gpio->irq_chip_data);
++      } else
++#endif
++      irq_domain = config->irq_domain;
++
++      if (irq_domain) {
++              ret = gpiochip_irqchip_add_domain(chip, irq_domain);
+               if (ret)
+                       goto err_remove_gpiochip;
+       }
+@@ -300,6 +320,11 @@ EXPORT_SYMBOL_GPL(gpio_regmap_register);
+  */
+ void gpio_regmap_unregister(struct gpio_regmap *gpio)
+ {
++#ifdef CONFIG_REGMAP_IRQ
++      if (gpio->irq_chip_data)
++              regmap_del_irq_chip(gpio->regmap_irq_line, gpio->irq_chip_data);
++#endif
++
+       gpiochip_remove(&gpio->gpio_chip);
+       kfree(gpio);
+ }
+--- a/include/linux/gpio/regmap.h
++++ b/include/linux/gpio/regmap.h
+@@ -40,6 +40,11 @@ struct regmap;
+  * @drvdata:          (Optional) Pointer to driver specific data which is
+  *                    not used by gpio-remap but is provided "as is" to the
+  *                    driver callback(s).
++ * @regmap_irq_chip:  (Optional) Pointer on an regmap_irq_chip structure. If
++ *                    set, a regmap-irq device will be created and the IRQ
++ *                    domain will be set accordingly.
++ * @regmap_irq_line   (Optional) The IRQ the device uses to signal interrupts.
++ * @regmap_irq_flags  (Optional) The IRQF_ flags to use for the interrupt.
+  *
+  * The ->reg_mask_xlate translates a given base address and GPIO offset to
+  * register and mask pair. The base address is one of the given register
+@@ -78,6 +83,12 @@ struct gpio_regmap_config {
+       int ngpio_per_reg;
+       struct irq_domain *irq_domain;
++#ifdef CONFIG_REGMAP_IRQ
++      struct regmap_irq_chip *regmap_irq_chip;
++      int regmap_irq_line;
++      unsigned long regmap_irq_flags;
++#endif
++
+       int (*reg_mask_xlate)(struct gpio_regmap *gpio, unsigned int base,
+                             unsigned int offset, unsigned int *reg,
+                             unsigned int *mask);
index a377bd7871d79973bbc58a76955334a0bdd73c33..b70de99fcd36d62c4ca80d2abae6550730ce06a2 100644 (file)
@@ -25,3 +25,8 @@ xhci-dbc-allow-users-to-modify-dbc-poll-interval-via-sysfs.patch
 xhci-dbc-improve-performance-by-removing-delay-in-transfer-event-polling.patch
 xhci-dbc-avoid-event-polling-busyloop-if-pending-rx-transfers-are-inactive.patch
 xhci-dbc-fix-bogus-1024-byte-prefix-if-ttydbc-read-races-with-stall-event.patch
+bits-add-comments-and-newlines-to-if-else-and-endif-directives.patch
+bits-introduce-fixed-type-genmask_u.patch
+gpio-regmap-allow-to-allocate-regmap-irq-device.patch
+gpio-regmap-add-the-.fixed_direction_output-configuration-parameter.patch
+gpio-idio-16-define-fixed-direction-of-the-gpio-lines.patch