Message ID | ZoLpqv1PN08xHioh@google.com |
---|---|
State | New |
Headers | show |
Series | [v2] gpiolib: of: fix lookup quirk for MIPS Lantiq | expand |
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> On Mon, 01 Jul 2024 10:38:50 -0700, Dmitry Torokhov wrote: > 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. > > [...] Applied, thanks! [1/1] gpiolib: of: fix lookup quirk for MIPS Lantiq commit: 3645ffaf2b334abaf5f53e5ca0f47465d91e69d2 Best regards,
diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c index d75f6ee37028..38679cf1969f 100644 --- a/drivers/gpio/gpiolib-of.c +++ b/drivers/gpio/gpiolib-of.c @@ -202,6 +202,16 @@ static void of_gpio_try_fixup_polarity(const struct device_node *np, * helper, and be consistent with what other drivers do. */ { "qi,lb60", "rb-gpios", true }, +#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; @@ -504,9 +514,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 /*