+++ /dev/null
-From c98cd1a155be79deff08d6d3cb364a6ad9a95a19 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Mon, 17 Oct 2022 22:41:02 -0700
-Subject: gpiolib: of: add a quirk for legacy names in Mediatek mt2701-cs42448
-
-From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
-[ Upstream commit 326c3753a6358ffab607749ea0aa95d1d0ad79b0 ]
-
-The driver is using non-standard "i2s1-in-sel-gpio1" and
-"i2s1-in-sel-gpio2" names to describe its gpios. In preparation to
-converting to the standard naming (i2s1-in-sel-gpios) and switching the
-driver to gpiod API add a quirk to gpiolib to keep compatibility with
-existing DTSes.
-
-Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
-Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
-Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-Stable-dep-of: f8d76c2c313c ("gpiolib: of: add polarity quirk for TSC2005")
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/gpio/gpiolib-of.c | 33 +++++++++++++++++++++++++++++++++
- 1 file changed, 33 insertions(+)
-
-diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
-index 0e4e1291604d6..cef4f66341256 100644
---- a/drivers/gpio/gpiolib-of.c
-+++ b/drivers/gpio/gpiolib-of.c
-@@ -488,6 +488,38 @@ static struct gpio_desc *of_find_usb_gpio(struct device_node *np,
- return of_get_named_gpiod_flags(np, con_id, idx, of_flags);
- }
-
-+static struct gpio_desc *of_find_mt2701_gpio(struct device_node *np,
-+ const char *con_id,
-+ unsigned int idx,
-+ enum of_gpio_flags *of_flags)
-+{
-+ struct gpio_desc *desc;
-+ const char *legacy_id;
-+
-+ if (!IS_ENABLED(CONFIG_SND_SOC_MT2701_CS42448))
-+ return ERR_PTR(-ENOENT);
-+
-+ if (!of_device_is_compatible(np, "mediatek,mt2701-cs42448-machine"))
-+ return ERR_PTR(-ENOENT);
-+
-+ if (!con_id || strcmp(con_id, "i2s1-in-sel"))
-+ return ERR_PTR(-ENOENT);
-+
-+ if (idx == 0)
-+ legacy_id = "i2s1-in-sel-gpio1";
-+ else if (idx == 1)
-+ legacy_id = "i2s1-in-sel-gpio2";
-+ else
-+ return ERR_PTR(-ENOENT);
-+
-+ desc = of_get_named_gpiod_flags(np, legacy_id, 0, of_flags);
-+ if (!gpiod_not_found(desc))
-+ pr_info("%s is using legacy gpio name '%s' instead of '%s-gpios'\n",
-+ of_node_full_name(np), legacy_id, con_id);
-+
-+ return desc;
-+}
-+
- typedef struct gpio_desc *(*of_find_gpio_quirk)(struct device_node *np,
- const char *con_id,
- unsigned int idx,
-@@ -498,6 +530,7 @@ static const of_find_gpio_quirk of_find_gpio_quirks[] = {
- of_find_regulator_gpio,
- of_find_arizona_gpio,
- of_find_usb_gpio,
-+ of_find_mt2701_gpio,
- NULL
- };
-
---
-2.43.0
-
+++ /dev/null
-From 02a7a4499b8f000e166f7422115fc9d4a2d070a9 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Mon, 17 Oct 2022 22:41:06 -0700
-Subject: gpiolib: of: add a quirk for reset line for Marvell NFC controller
-
-From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
-[ Upstream commit 9c2cc7171e08eef52110d272fdf2225d6dcd81b6 ]
-
-The controller is using non-standard "reset-n-io" name for its reset
-gpio property, whereas gpiod API expects "<name>-gpios". Add a quirk
-so that gpiod API will still work on unmodified DTSes.
-
-Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
-Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-Stable-dep-of: f8d76c2c313c ("gpiolib: of: add polarity quirk for TSC2005")
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/gpio/gpiolib-of.c | 10 ++++++++++
- 1 file changed, 10 insertions(+)
-
-diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
-index 2b5d1b3095c7b..a9cedc39a2459 100644
---- a/drivers/gpio/gpiolib-of.c
-+++ b/drivers/gpio/gpiolib-of.c
-@@ -390,6 +390,16 @@ static struct gpio_desc *of_find_gpio_rename(struct device_node *np,
- #if IS_ENABLED(CONFIG_MFD_ARIZONA)
- { "wlf,reset", NULL, NULL },
- #endif
-+#if IS_ENABLED(CONFIG_NFC_MRVL_I2C)
-+ { "reset", "reset-n-io", "marvell,nfc-i2c" },
-+#endif
-+#if IS_ENABLED(CONFIG_NFC_MRVL_SPI)
-+ { "reset", "reset-n-io", "marvell,nfc-spi" },
-+#endif
-+#if IS_ENABLED(CONFIG_NFC_MRVL_UART)
-+ { "reset", "reset-n-io", "marvell,nfc-uart" },
-+ { "reset", "reset-n-io", "mrvl,nfc-uart" },
-+#endif
- #if !IS_ENABLED(CONFIG_PCI_LANTIQ)
- /* MIPS Lantiq PCI */
- { "reset", "gpios-reset", "lantiq,pci-xway" },
---
-2.43.0
-
+++ /dev/null
-From 0ab372f75b5473f08e306a1b64a6a7d5fc00a832 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Mon, 17 Oct 2022 22:41:11 -0700
-Subject: gpiolib: of: add a quirk for reset line polarity for Himax LCDs
-
-From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
-[ Upstream commit 99d18d42c942854a073191714a311dc2420ec7d3 ]
-
-Existing DTS that use legacy (non-standard) property name for the reset
-line "gpios-reset" also specify incorrect polarity (0 which maps to
-"active high"). Add a quirk to force polarity to "active low" so that
-once driver is converted to gpiod API that pays attention to line
-polarity it will work properly.
-
-Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
-Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-Stable-dep-of: f8d76c2c313c ("gpiolib: of: add polarity quirk for TSC2005")
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/gpio/gpiolib-of.c | 36 ++++++++++++++++++++++++++++++++++++
- 1 file changed, 36 insertions(+)
-
-diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
-index 618d7781299d4..c76489dec6456 100644
---- a/drivers/gpio/gpiolib-of.c
-+++ b/drivers/gpio/gpiolib-of.c
-@@ -152,11 +152,47 @@ static void of_gpio_quirk_polarity(const struct device_node *np,
- }
- }
-
-+/*
-+ * This quirk does static polarity overrides in cases where existing
-+ * DTS specified incorrect polarity.
-+ */
-+static void of_gpio_try_fixup_polarity(const struct device_node *np,
-+ const char *propname,
-+ enum of_gpio_flags *flags)
-+{
-+ static const struct {
-+ const char *compatible;
-+ const char *propname;
-+ bool active_high;
-+ } gpios[] = {
-+#if !IS_ENABLED(CONFIG_LCD_HX8357)
-+ /*
-+ * Himax LCD controllers used incorrectly named
-+ * "gpios-reset" property and also specified wrong
-+ * polarity.
-+ */
-+ { "himax,hx8357", "gpios-reset", false },
-+ { "himax,hx8369", "gpios-reset", false },
-+#endif
-+ };
-+ unsigned int i;
-+
-+ for (i = 0; i < ARRAY_SIZE(gpios); i++) {
-+ if (of_device_is_compatible(np, gpios[i].compatible) &&
-+ !strcmp(propname, gpios[i].propname)) {
-+ of_gpio_quirk_polarity(np, gpios[i].active_high, flags);
-+ break;
-+ }
-+ }
-+}
-+
- static void of_gpio_flags_quirks(const struct device_node *np,
- const char *propname,
- enum of_gpio_flags *flags,
- int index)
- {
-+ of_gpio_try_fixup_polarity(np, propname, flags);
-+
- /*
- * Some GPIO fixed regulator quirks.
- * Note that active low is the default.
---
-2.43.0
-
+++ /dev/null
-From f5e962846e0715e9edec9e81929fbe6a6e767864 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Wed, 3 Jul 2024 11:26:09 -0700
-Subject: gpiolib: of: add polarity quirk for TSC2005
-
-From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
-[ Upstream commit f8d76c2c313c56d5cb894a243dff4550f048278d ]
-
-DTS for Nokia N900 incorrectly specifies "active high" polarity for
-the reset line, while the chip documentation actually specifies it as
-"active low". In the past the driver fudged gpiod API and inverted
-the logic internally, but it was changed in d0d89493bff8.
-
-Fixes: d0d89493bff8 ("Input: tsc2004/5 - switch to using generic device properties")
-Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-Acked-by: Linus Walleij <linus.walleij@linaro.org>
-Link: https://lore.kernel.org/r/ZoWXwYtwgJIxi-hD@google.com
-Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/gpio/gpiolib-of.c | 8 ++++++++
- 1 file changed, 8 insertions(+)
-
-diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
-index 12b30136df94b..3868909f3d368 100644
---- a/drivers/gpio/gpiolib-of.c
-+++ b/drivers/gpio/gpiolib-of.c
-@@ -183,6 +183,14 @@ static void of_gpio_try_fixup_polarity(const struct device_node *np,
- * for the property.
- */
- { "lantiq,pci-xway", "gpio-reset", false },
-+#endif
-+#if IS_ENABLED(CONFIG_TOUCHSCREEN_TSC2005)
-+ /*
-+ * DTS for Nokia N900 incorrectly specified "active high"
-+ * polarity for the reset line, while the chip actually
-+ * treats it as "active low".
-+ */
-+ { "ti,tsc2005", "reset-gpios", false },
- #endif
- };
- unsigned int i;
---
-2.43.0
-
+++ /dev/null
-From 16cf310c2482fd22f75aac6c14f6c0712459fcd0 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Mon, 17 Oct 2022 22:41:05 -0700
-Subject: gpiolib: of: add quirk for locating reset lines with legacy bindings
-
-From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
-[ Upstream commit fbbbcd177a27508a47c5136b31de5cf4c8d0ab1c ]
-
-Some legacy mappings used "gpio[s]-reset" instead of "reset-gpios",
-add a quirk so that gpiod API will still work on unmodified DTSes.
-
-Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
-Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
-Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-Stable-dep-of: f8d76c2c313c ("gpiolib: of: add polarity quirk for TSC2005")
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/gpio/gpiolib-of.c | 16 ++++++++++++++++
- 1 file changed, 16 insertions(+)
-
-diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
-index 7d4bbf6484bc7..2b5d1b3095c7b 100644
---- a/drivers/gpio/gpiolib-of.c
-+++ b/drivers/gpio/gpiolib-of.c
-@@ -382,9 +382,18 @@ static struct gpio_desc *of_find_gpio_rename(struct device_node *np,
- */
- const char *compatible;
- } gpios[] = {
-+#if !IS_ENABLED(CONFIG_LCD_HX8357)
-+ /* Himax LCD controllers used "gpios-reset" */
-+ { "reset", "gpios-reset", "himax,hx8357" },
-+ { "reset", "gpios-reset", "himax,hx8369" },
-+#endif
- #if IS_ENABLED(CONFIG_MFD_ARIZONA)
- { "wlf,reset", NULL, NULL },
- #endif
-+#if !IS_ENABLED(CONFIG_PCI_LANTIQ)
-+ /* MIPS Lantiq PCI */
-+ { "reset", "gpios-reset", "lantiq,pci-xway" },
-+#endif
-
- /*
- * Some regulator bindings happened before we managed to
-@@ -399,6 +408,13 @@ static struct gpio_desc *of_find_gpio_rename(struct device_node *np,
- { "wlf,ldo2ena", NULL, NULL }, /* WM8994 */
- #endif
-
-+#if IS_ENABLED(CONFIG_SND_SOC_TLV320AIC3X)
-+ { "reset", "gpio-reset", "ti,tlv320aic3x" },
-+ { "reset", "gpio-reset", "ti,tlv320aic33" },
-+ { "reset", "gpio-reset", "ti,tlv320aic3007" },
-+ { "reset", "gpio-reset", "ti,tlv320aic3104" },
-+ { "reset", "gpio-reset", "ti,tlv320aic3106" },
-+#endif
- #if IS_ENABLED(CONFIG_SPI_GPIO)
- /*
- * The SPI GPIO bindings happened before we managed to
---
-2.43.0
-
+++ /dev/null
-From c2b9b11ef350f30614a772048eda7396230f109d Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Mon, 17 Oct 2022 22:41:03 -0700
-Subject: gpiolib: of: consolidate simple renames into a single quirk
-
-From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
-[ Upstream commit b311c5cba779a87e85525d351965bbd2c18111de ]
-
-This consolidates all quirks doing simple renames (either allowing
-suffix-less names or trivial renames, when index changes are not
-required) into a single quirk.
-
-Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
-Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
-Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-Stable-dep-of: f8d76c2c313c ("gpiolib: of: add polarity quirk for TSC2005")
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/gpio/gpiolib-of.c | 183 +++++++++++++++-----------------------
- 1 file changed, 71 insertions(+), 112 deletions(-)
-
-diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
-index cef4f66341256..63c6fa3086f3c 100644
---- a/drivers/gpio/gpiolib-of.c
-+++ b/drivers/gpio/gpiolib-of.c
-@@ -365,127 +365,90 @@ struct gpio_desc *gpiod_get_from_of_node(const struct device_node *node,
- }
- EXPORT_SYMBOL_GPL(gpiod_get_from_of_node);
-
--/*
-- * The SPI GPIO bindings happened before we managed to establish that GPIO
-- * properties should be named "foo-gpios" so we have this special kludge for
-- * them.
-- */
--static struct gpio_desc *of_find_spi_gpio(struct device_node *np,
-- const char *con_id,
-- unsigned int idx,
-- enum of_gpio_flags *of_flags)
--{
-- char prop_name[32]; /* 32 is max size of property name */
--
-- /*
-- * Hopefully the compiler stubs the rest of the function if this
-- * is false.
-- */
-- if (!IS_ENABLED(CONFIG_SPI_MASTER))
-- return ERR_PTR(-ENOENT);
--
-- /* Allow this specifically for "spi-gpio" devices */
-- if (!of_device_is_compatible(np, "spi-gpio") || !con_id)
-- return ERR_PTR(-ENOENT);
--
-- /* Will be "gpio-sck", "gpio-mosi" or "gpio-miso" */
-- snprintf(prop_name, sizeof(prop_name), "%s-%s", "gpio", con_id);
--
-- return of_get_named_gpiod_flags(np, prop_name, idx, of_flags);
--}
--
--/*
-- * The old Freescale bindings use simply "gpios" as name for the chip select
-- * lines rather than "cs-gpios" like all other SPI hardware. Account for this
-- * with a special quirk.
-- */
--static struct gpio_desc *of_find_spi_cs_gpio(struct device_node *np,
-+static struct gpio_desc *of_find_gpio_rename(struct device_node *np,
- const char *con_id,
- unsigned int idx,
- enum of_gpio_flags *of_flags)
- {
-- if (!IS_ENABLED(CONFIG_SPI_MASTER))
-- return ERR_PTR(-ENOENT);
--
-- /* Allow this specifically for Freescale and PPC devices */
-- if (!of_device_is_compatible(np, "fsl,spi") &&
-- !of_device_is_compatible(np, "aeroflexgaisler,spictrl") &&
-- !of_device_is_compatible(np, "ibm,ppc4xx-spi"))
-- return ERR_PTR(-ENOENT);
-- /* Allow only if asking for "cs-gpios" */
-- if (!con_id || strcmp(con_id, "cs"))
-- return ERR_PTR(-ENOENT);
-+ static const struct of_rename_gpio {
-+ const char *con_id;
-+ const char *legacy_id; /* NULL - same as con_id */
-+ /*
-+ * Compatible string can be set to NULL in case where
-+ * matching to a particular compatible is not practical,
-+ * but it should only be done for gpio names that have
-+ * vendor prefix to reduce risk of false positives.
-+ * Addition of such entries is strongly discouraged.
-+ */
-+ const char *compatible;
-+ } gpios[] = {
-+#if IS_ENABLED(CONFIG_MFD_ARIZONA)
-+ { "wlf,reset", NULL, NULL },
-+#endif
-+#if IS_ENABLED(CONFIG_REGULATOR)
-+ /*
-+ * Some regulator bindings happened before we managed to
-+ * establish that GPIO properties should be named
-+ * "foo-gpios" so we have this special kludge for them.
-+ */
-+ { "wlf,ldoena", NULL, NULL }, /* Arizona */
-+ { "wlf,ldo1ena", NULL, NULL }, /* WM8994 */
-+ { "wlf,ldo2ena", NULL, NULL }, /* WM8994 */
-+#endif
-+#if IS_ENABLED(CONFIG_SPI_MASTER)
-
-- /*
-- * While all other SPI controllers use "cs-gpios" the Freescale
-- * uses just "gpios" so translate to that when "cs-gpios" is
-- * requested.
-- */
-- return of_get_named_gpiod_flags(np, "gpios", idx, of_flags);
--}
-+ /*
-+ * The SPI GPIO bindings happened before we managed to
-+ * establish that GPIO properties should be named
-+ * "foo-gpios" so we have this special kludge for them.
-+ */
-+ { "miso", "gpio-miso", "spi-gpio" },
-+ { "mosi", "gpio-mosi", "spi-gpio" },
-+ { "sck", "gpio-sck", "spi-gpio" },
-
--/*
-- * Some regulator bindings happened before we managed to establish that GPIO
-- * properties should be named "foo-gpios" so we have this special kludge for
-- * them.
-- */
--static struct gpio_desc *of_find_regulator_gpio(struct device_node *np,
-- const char *con_id,
-- unsigned int idx,
-- enum of_gpio_flags *of_flags)
--{
-- /* These are the connection IDs we accept as legacy GPIO phandles */
-- const char *whitelist[] = {
-- "wlf,ldoena", /* Arizona */
-- "wlf,ldo1ena", /* WM8994 */
-- "wlf,ldo2ena", /* WM8994 */
-+ /*
-+ * The old Freescale bindings use simply "gpios" as name
-+ * for the chip select lines rather than "cs-gpios" like
-+ * all other SPI hardware. Allow this specifically for
-+ * Freescale and PPC devices.
-+ */
-+ { "cs", "gpios", "fsl,spi" },
-+ { "cs", "gpios", "aeroflexgaisler,spictrl" },
-+ { "cs", "gpios", "ibm,ppc4xx-spi" },
-+#endif
-+#if IS_ENABLED(CONFIG_TYPEC_FUSB302)
-+ /*
-+ * Fairchild FUSB302 host is using undocumented "fcs,int_n"
-+ * property without the compulsory "-gpios" suffix.
-+ */
-+ { "fcs,int_n", NULL, "fcs,fusb302" },
-+#endif
- };
-- int i;
--
-- if (!IS_ENABLED(CONFIG_REGULATOR))
-- return ERR_PTR(-ENOENT);
-+ struct gpio_desc *desc;
-+ const char *legacy_id;
-+ unsigned int i;
-
- if (!con_id)
- return ERR_PTR(-ENOENT);
-
-- i = match_string(whitelist, ARRAY_SIZE(whitelist), con_id);
-- if (i < 0)
-- return ERR_PTR(-ENOENT);
--
-- return of_get_named_gpiod_flags(np, con_id, idx, of_flags);
--}
--
--static struct gpio_desc *of_find_arizona_gpio(struct device_node *np,
-- const char *con_id,
-- unsigned int idx,
-- enum of_gpio_flags *of_flags)
--{
-- if (!IS_ENABLED(CONFIG_MFD_ARIZONA))
-- return ERR_PTR(-ENOENT);
--
-- if (!con_id || strcmp(con_id, "wlf,reset"))
-- return ERR_PTR(-ENOENT);
--
-- return of_get_named_gpiod_flags(np, con_id, idx, of_flags);
--}
-+ for (i = 0; i < ARRAY_SIZE(gpios); i++) {
-+ if (strcmp(con_id, gpios[i].con_id))
-+ continue;
-
--static struct gpio_desc *of_find_usb_gpio(struct device_node *np,
-- const char *con_id,
-- unsigned int idx,
-- enum of_gpio_flags *of_flags)
--{
-- /*
-- * Currently this USB quirk is only for the Fairchild FUSB302 host
-- * which is using an undocumented DT GPIO line named "fcs,int_n"
-- * without the compulsory "-gpios" suffix.
-- */
-- if (!IS_ENABLED(CONFIG_TYPEC_FUSB302))
-- return ERR_PTR(-ENOENT);
-+ if (gpios[i].compatible &&
-+ !of_device_is_compatible(np, gpios[i].compatible))
-+ continue;
-
-- if (!con_id || strcmp(con_id, "fcs,int_n"))
-- return ERR_PTR(-ENOENT);
-+ legacy_id = gpios[i].legacy_id ?: gpios[i].con_id;
-+ desc = of_get_named_gpiod_flags(np, legacy_id, idx, of_flags);
-+ if (!gpiod_not_found(desc)) {
-+ pr_info("%s uses legacy gpio name '%s' instead of '%s-gpios'\n",
-+ of_node_full_name(np), legacy_id, con_id);
-+ return desc;
-+ }
-+ }
-
-- return of_get_named_gpiod_flags(np, con_id, idx, of_flags);
-+ return ERR_PTR(-ENOENT);
- }
-
- static struct gpio_desc *of_find_mt2701_gpio(struct device_node *np,
-@@ -525,11 +488,7 @@ typedef struct gpio_desc *(*of_find_gpio_quirk)(struct device_node *np,
- unsigned int idx,
- enum of_gpio_flags *of_flags);
- static const of_find_gpio_quirk of_find_gpio_quirks[] = {
-- of_find_spi_gpio,
-- of_find_spi_cs_gpio,
-- of_find_regulator_gpio,
-- of_find_arizona_gpio,
-- of_find_usb_gpio,
-+ of_find_gpio_rename,
- of_find_mt2701_gpio,
- NULL
- };
---
-2.43.0
-
+++ /dev/null
-From ed9d3b8645efdec55e7b60311e9b40533fa43f2a Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Mon, 17 Oct 2022 22:41:09 -0700
-Subject: gpiolib: of: factor out code overriding gpio line polarity
-
-From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
-[ Upstream commit e3186e36925fc18384492491ebcf3da749780a30 ]
-
-There are several instances where we use a separate property to
-override polarity specified in gpio property. Factor it out into
-a separate function.
-
-Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
-Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-Stable-dep-of: f8d76c2c313c ("gpiolib: of: add polarity quirk for TSC2005")
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/gpio/gpiolib-of.c | 48 +++++++++++++++++++++++----------------
- 1 file changed, 28 insertions(+), 20 deletions(-)
-
-diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
-index a9cedc39a2459..618d7781299d4 100644
---- a/drivers/gpio/gpiolib-of.c
-+++ b/drivers/gpio/gpiolib-of.c
-@@ -130,6 +130,28 @@ bool of_gpio_need_valid_mask(const struct gpio_chip *gc)
- return false;
- }
-
-+/*
-+ * Overrides stated polarity of a gpio line and warns when there is a
-+ * discrepancy.
-+ */
-+static void of_gpio_quirk_polarity(const struct device_node *np,
-+ bool active_high,
-+ enum of_gpio_flags *flags)
-+{
-+ if (active_high) {
-+ if (*flags & OF_GPIO_ACTIVE_LOW) {
-+ pr_warn("%s GPIO handle specifies active low - ignored\n",
-+ of_node_full_name(np));
-+ *flags &= ~OF_GPIO_ACTIVE_LOW;
-+ }
-+ } else {
-+ if (!(*flags & OF_GPIO_ACTIVE_LOW))
-+ pr_info("%s enforce active low on GPIO handle\n",
-+ of_node_full_name(np));
-+ *flags |= OF_GPIO_ACTIVE_LOW;
-+ }
-+}
-+
- static void of_gpio_flags_quirks(const struct device_node *np,
- const char *propname,
- enum of_gpio_flags *flags,
-@@ -145,7 +167,7 @@ static void of_gpio_flags_quirks(const struct device_node *np,
- (!(strcmp(propname, "enable-gpio") &&
- strcmp(propname, "enable-gpios")) &&
- of_device_is_compatible(np, "regulator-gpio")))) {
-- bool active_low = !of_property_read_bool(np,
-+ bool active_high = of_property_read_bool(np,
- "enable-active-high");
- /*
- * The regulator GPIO handles are specified such that the
-@@ -153,13 +175,7 @@ static void of_gpio_flags_quirks(const struct device_node *np,
- * the polarity of the GPIO line. Any phandle flags must
- * be actively ignored.
- */
-- if ((*flags & OF_GPIO_ACTIVE_LOW) && !active_low) {
-- pr_warn("%s GPIO handle specifies active low - ignored\n",
-- of_node_full_name(np));
-- *flags &= ~OF_GPIO_ACTIVE_LOW;
-- }
-- if (active_low)
-- *flags |= OF_GPIO_ACTIVE_LOW;
-+ of_gpio_quirk_polarity(np, active_high, flags);
- }
- /*
- * Legacy open drain handling for fixed voltage regulators.
-@@ -200,18 +216,10 @@ static void of_gpio_flags_quirks(const struct device_node *np,
- * conflict and the "spi-cs-high" flag will
- * take precedence.
- */
-- if (of_property_read_bool(child, "spi-cs-high")) {
-- if (*flags & OF_GPIO_ACTIVE_LOW) {
-- pr_warn("%s GPIO handle specifies active low - ignored\n",
-- of_node_full_name(child));
-- *flags &= ~OF_GPIO_ACTIVE_LOW;
-- }
-- } else {
-- if (!(*flags & OF_GPIO_ACTIVE_LOW))
-- pr_info("%s enforce active low on chipselect handle\n",
-- of_node_full_name(child));
-- *flags |= OF_GPIO_ACTIVE_LOW;
-- }
-+ bool active_high = of_property_read_bool(child,
-+ "spi-cs-high");
-+ of_gpio_quirk_polarity(child, active_high,
-+ flags);
- of_node_put(child);
- break;
- }
---
-2.43.0
-
+++ /dev/null
-From 0c19b751bd6b1abe1d23e99ef833ea3c4a19e63c Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Mon, 1 Jul 2024 10:38:50 -0700
-Subject: gpiolib: of: fix lookup quirk for MIPS Lantiq
-
-From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
-[ Upstream commit 3645ffaf2b334abaf5f53e5ca0f47465d91e69d2 ]
-
-As it turns out, there is a large number of out-of-tree DTSes (in
-OpenWrt project) that used to specify incorrect (active high) polarity
-for the Lantiq reset GPIO, so to keep compatibility while they are
-being updated a quirk for force the polarity low is needed. Luckily
-these old DTSes used nonstandard name for the property ("gpio-reset" vs
-"reset-gpios") so the quirk will not hurt if there are any new devices
-that need inverted polarity as they can specify the right polarity in
-their DTS when using the standard "reset-gpios" property.
-
-Additionally the condition to enable the transition from standard to
-non-standard reset GPIO property name was inverted and the replacement
-name for the property was not correct. Fix this as well.
-
-Fixes: fbbbcd177a27 ("gpiolib: of: add quirk for locating reset lines with legacy bindings")
-Fixes: 90c2d2eb7ab5 ("MIPS: pci: lantiq: switch to using gpiod API")
-Reported-by: Martin Schiller <ms@dev.tdt.de>
-Acked-by: Martin Schiller <ms@dev.tdt.de>
-Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-Link: https://lore.kernel.org/r/ZoLpqv1PN08xHioh@google.com
-Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-Stable-dep-of: f8d76c2c313c ("gpiolib: of: add polarity quirk for TSC2005")
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/gpio/gpiolib-of.c | 14 ++++++++++++--
- 1 file changed, 12 insertions(+), 2 deletions(-)
-
-diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
-index c76489dec6456..12b30136df94b 100644
---- a/drivers/gpio/gpiolib-of.c
-+++ b/drivers/gpio/gpiolib-of.c
-@@ -173,6 +173,16 @@ static void of_gpio_try_fixup_polarity(const struct device_node *np,
- */
- { "himax,hx8357", "gpios-reset", false },
- { "himax,hx8369", "gpios-reset", false },
-+#endif
-+#if IS_ENABLED(CONFIG_PCI_LANTIQ)
-+ /*
-+ * According to the PCI specification, the RST# pin is an
-+ * active-low signal. However, most of the device trees that
-+ * have been widely used for a long time incorrectly describe
-+ * reset GPIO as active-high, and were also using wrong name
-+ * for the property.
-+ */
-+ { "lantiq,pci-xway", "gpio-reset", false },
- #endif
- };
- unsigned int i;
-@@ -444,9 +454,9 @@ static struct gpio_desc *of_find_gpio_rename(struct device_node *np,
- { "reset", "reset-n-io", "marvell,nfc-uart" },
- { "reset", "reset-n-io", "mrvl,nfc-uart" },
- #endif
--#if !IS_ENABLED(CONFIG_PCI_LANTIQ)
-+#if IS_ENABLED(CONFIG_PCI_LANTIQ)
- /* MIPS Lantiq PCI */
-- { "reset", "gpios-reset", "lantiq,pci-xway" },
-+ { "reset", "gpio-reset", "lantiq,pci-xway" },
- #endif
-
- /*
---
-2.43.0
-
+++ /dev/null
-From 7f1ae24290c0e91b2f514a4c8bdd6c7c104f0b7b Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Mon, 17 Oct 2022 22:41:04 -0700
-Subject: gpiolib: of: tighten selection of gpio renaming quirks
-
-From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-
-[ Upstream commit 307c593ba5f915e308fd23a2daae7e9a5209b604 ]
-
-Tighten selection of legacy gpio renaming quirks so that they only
-considered on more relevant configurations.
-
-Suggested-by: Daniel Thompson <daniel.thompson@linaro.org>
-Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
-Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
-Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
-Stable-dep-of: f8d76c2c313c ("gpiolib: of: add polarity quirk for TSC2005")
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/gpio/gpiolib-of.c | 12 ++++++++++--
- 1 file changed, 10 insertions(+), 2 deletions(-)
-
-diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
-index 63c6fa3086f3c..7d4bbf6484bc7 100644
---- a/drivers/gpio/gpiolib-of.c
-+++ b/drivers/gpio/gpiolib-of.c
-@@ -385,18 +385,21 @@ static struct gpio_desc *of_find_gpio_rename(struct device_node *np,
- #if IS_ENABLED(CONFIG_MFD_ARIZONA)
- { "wlf,reset", NULL, NULL },
- #endif
--#if IS_ENABLED(CONFIG_REGULATOR)
-+
- /*
- * Some regulator bindings happened before we managed to
- * establish that GPIO properties should be named
- * "foo-gpios" so we have this special kludge for them.
- */
-+#if IS_ENABLED(CONFIG_REGULATOR_ARIZONA_LDO1)
- { "wlf,ldoena", NULL, NULL }, /* Arizona */
-+#endif
-+#if IS_ENABLED(CONFIG_REGULATOR_WM8994)
- { "wlf,ldo1ena", NULL, NULL }, /* WM8994 */
- { "wlf,ldo2ena", NULL, NULL }, /* WM8994 */
- #endif
--#if IS_ENABLED(CONFIG_SPI_MASTER)
-
-+#if IS_ENABLED(CONFIG_SPI_GPIO)
- /*
- * The SPI GPIO bindings happened before we managed to
- * establish that GPIO properties should be named
-@@ -405,6 +408,7 @@ static struct gpio_desc *of_find_gpio_rename(struct device_node *np,
- { "miso", "gpio-miso", "spi-gpio" },
- { "mosi", "gpio-mosi", "spi-gpio" },
- { "sck", "gpio-sck", "spi-gpio" },
-+#endif
-
- /*
- * The old Freescale bindings use simply "gpios" as name
-@@ -412,10 +416,14 @@ static struct gpio_desc *of_find_gpio_rename(struct device_node *np,
- * all other SPI hardware. Allow this specifically for
- * Freescale and PPC devices.
- */
-+#if IS_ENABLED(CONFIG_SPI_FSL_SPI)
- { "cs", "gpios", "fsl,spi" },
- { "cs", "gpios", "aeroflexgaisler,spictrl" },
-+#endif
-+#if IS_ENABLED(CONFIG_SPI_PPC4xx)
- { "cs", "gpios", "ibm,ppc4xx-spi" },
- #endif
-+
- #if IS_ENABLED(CONFIG_TYPEC_FUSB302)
- /*
- * Fairchild FUSB302 host is using undocumented "fcs,int_n"
---
-2.43.0
-
selftests-make-order-checking-verbose-in-msg_zerocop.patch
inet_diag-initialize-pad-field-in-struct-inet_diag_r.patch
mlxsw-core_linecards-fix-double-memory-deallocation-.patch
-gpiolib-of-add-a-quirk-for-legacy-names-in-mediatek-.patch
-gpiolib-of-consolidate-simple-renames-into-a-single-.patch
-gpiolib-of-tighten-selection-of-gpio-renaming-quirks.patch
-gpiolib-of-add-quirk-for-locating-reset-lines-with-l.patch
-gpiolib-of-add-a-quirk-for-reset-line-for-marvell-nf.patch
-gpiolib-of-factor-out-code-overriding-gpio-line-pola.patch
-gpiolib-of-add-a-quirk-for-reset-line-polarity-for-h.patch
-gpiolib-of-fix-lookup-quirk-for-mips-lantiq.patch
-gpiolib-of-add-polarity-quirk-for-tsc2005.patch
platform-x86-toshiba_acpi-fix-quickstart-quirk-handling.patch
revert-igc-fix-a-log-entry-using-uninitialized-netdev.patch
nilfs2-fix-inode-number-range-checks.patch