gpiolib: of: fix lookup quirk for MIPS Lantiq

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>

authored by Dmitry Torokhov and committed by Bartosz Golaszewski 3645ffaf 22a40d14

+12 -2
+12 -2
drivers/gpio/gpiolib-of.c
··· 203 203 */ 204 204 { "qi,lb60", "rb-gpios", true }, 205 205 #endif 206 + #if IS_ENABLED(CONFIG_PCI_LANTIQ) 207 + /* 208 + * According to the PCI specification, the RST# pin is an 209 + * active-low signal. However, most of the device trees that 210 + * have been widely used for a long time incorrectly describe 211 + * reset GPIO as active-high, and were also using wrong name 212 + * for the property. 213 + */ 214 + { "lantiq,pci-xway", "gpio-reset", false }, 215 + #endif 206 216 }; 207 217 unsigned int i; 208 218 ··· 514 504 { "reset", "reset-n-io", "marvell,nfc-uart" }, 515 505 { "reset", "reset-n-io", "mrvl,nfc-uart" }, 516 506 #endif 517 - #if !IS_ENABLED(CONFIG_PCI_LANTIQ) 507 + #if IS_ENABLED(CONFIG_PCI_LANTIQ) 518 508 /* MIPS Lantiq PCI */ 519 - { "reset", "gpios-reset", "lantiq,pci-xway" }, 509 + { "reset", "gpio-reset", "lantiq,pci-xway" }, 520 510 #endif 521 511 522 512 /*