gpiolib: of: add quirk for locating reset lines with legacy bindings
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Tue, 18 Oct 2022 05:41:05 +0000 (22:41 -0700)
committerBartosz Golaszewski <bartosz.golaszewski@linaro.org>
Thu, 20 Oct 2022 11:53:42 +0000 (13:53 +0200)
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>
drivers/gpio/gpiolib-of.c

index 7d4bbf6484bc7b1b674db3c611c75c8543101a58..2b5d1b3095c7b99bc5f3710a9cd4b4b1c5a1807e 100644 (file)
@@ -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