Skip to contentSkip to conversation

gpiolib: of: Fix and amendment of OF quirks

PATCH Applied Andy Shevchenko 3 participants 6 messages Apr 2, 2025 – Apr 15, 2025 GPIO

lore
Share & tools
lore
#0 lore raw

cover gpiolib: of: Fix and amendment of OF quirks

Just a couple of minor updates to the GPIO OF quirks.

Andy Shevchenko (2):
gpiolib: of: Fix the choice for Ingenic NAND quirk
gpiolib: of: Move Atmel HSMCI quirk up out of the regulator comment

 drivers/gpio/gpiolib-of.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
Signature · 1 line
2.47.2
#1 lore raw

PATCH 1/2 gpiolib: of: Fix the choice for Ingenic NAND quirk

The Ingenic NAND quirk has been added under CONFIG_LCD_HX8357 ifdeffery which sounds quite wrong. Fix the choice for Ingenic NAND quirk by wrapping it into own ifdeffery related to the respective driver.

Fixes 3a7fd473bd5d ("mtd: rawnand: ingenic: move the GPIO quirk to gpiolib-of.c")
---
 drivers/gpio/gpiolib-of.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpio/gpiolib-of.c +2 -0
index eb667f8f1ead..8fff6fdfb4a1 100644
@@ -193,6 +193,8 @@ 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_MTD_NAND_JZ4780)
 		/*
 		 * The rb-gpios semantics was undocumented and qi,lb60 (along with
 		 * the ingenic driver) got it wrong. The active state encodes the
Signature · 1 line
2.47.2
Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH v1 1/2] gpiolib: of: Fix the choice for Ingenic NAND quirk

Quoted 6 lines · Andy Shevchenko

The Ingenic NAND quirk has been added under CONFIG_LCD_HX8357 ifdeffery which sounds quite wrong. Fix the choice for Ingenic NAND quirk by wrapping it into own ifdeffery related to the respective driver.

Fixes 3a7fd473bd5d ("mtd: rawnand: ingenic: move the GPIO quirk to gpiolib-of.c")

Yours,
Linus Walleij

#3 lore raw

PATCH 2/2 gpiolib: of: Move Atmel HSMCI quirk up out of the regulator comment

In reply to Andy Shevchenko

The regulator comment in of_gpio_set_polarity_by_property() made on top of a couple of the cases, while Atmel HSMCI quirk is not related to that. Make it clear by moving Atmel HSMCI quirk up out of the scope of the regulator comment.

---
 drivers/gpio/gpiolib-of.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpio/gpiolib-of.c +3 -3
index 8fff6fdfb4a1..65f6a7177b78 100644
@@ -268,6 +268,9 @@ static void of_gpio_set_polarity_by_property(const struct device_node *np,
 		{ "fsl,imx8qm-fec",  "phy-reset-gpios", "phy-reset-active-high" },
 		{ "fsl,s32v234-fec", "phy-reset-gpios", "phy-reset-active-high" },
 #endif
+#if IS_ENABLED(CONFIG_MMC_ATMELMCI)
+		{ "atmel,hsmci",       "cd-gpios",     "cd-inverted" },
+#endif
 #if IS_ENABLED(CONFIG_PCI_IMX6)
 		{ "fsl,imx6q-pcie",  "reset-gpio", "reset-gpio-active-high" },
 		{ "fsl,imx6sx-pcie", "reset-gpio", "reset-gpio-active-high" },
@@ -293,9 +296,6 @@ static void of_gpio_set_polarity_by_property(const struct device_node *np,
 #if IS_ENABLED(CONFIG_REGULATOR_GPIO)
 		{ "regulator-gpio",    "enable-gpio",  "enable-active-high" },
 		{ "regulator-gpio",    "enable-gpios", "enable-active-high" },
-#endif
-#if IS_ENABLED(CONFIG_MMC_ATMELMCI)
-		{ "atmel,hsmci",       "cd-gpios",     "cd-inverted" },
 #endif
 	};
 	unsigned int i;
Signature · 1 line
2.47.2
Reviewed-by on v1 2/2
#4 lore raw

Re: [PATCH v1 2/2] gpiolib: of: Move Atmel HSMCI quirk up out of the regulator comment

Quoted 6 lines · Andy Shevchenko

The regulator comment in of_gpio_set_polarity_by_property() made on top of a couple of the cases, while Atmel HSMCI quirk is not related to that. Make it clear by moving Atmel HSMCI quirk up out of the scope of the regulator comment.

Yours,
Linus Walleij

#5 lore raw
In reply to Andy Shevchenko

From: Bartosz Golaszewski <[email protected]>

Quoted 10 lines · Andy Shevchenko

Just a couple of minor updates to the GPIO OF quirks.

Andy Shevchenko (2):
gpiolib: of: Fix the choice for Ingenic NAND quirk
gpiolib: of: Move Atmel HSMCI quirk up out of the regulator comment

drivers/gpio/gpiolib-of.c | 8 +++++---

 1 file changed, 5 insertions(+), 3 deletions(-)

[...]

Applied, thanks!

[1/2] gpiolib: of: Fix the choice for Ingenic NAND quirk

      https://git.kernel.org/brgl/linux/c/2b9c536430126c233552cdcd6ec9d5077454ece4
[2/2] gpiolib: of: Move Atmel HSMCI quirk up out of the regulator comment
      https://git.kernel.org/brgl/linux/c/b8c7a1ac884cc267d1031f8de07f1a689a69fbab

Best regards,

Signature · 1 line
Bartosz Golaszewski <[email protected]>