Patch "gpiolib: of: fix lookup quirk for MIPS Lantiq" has been added to the 6.6-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    gpiolib: of: fix lookup quirk for MIPS Lantiq

to the 6.6-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     gpiolib-of-fix-lookup-quirk-for-mips-lantiq.patch
and it can be found in the queue-6.6 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 5128b4508cf8cfc31f848e364b6b3404678b4487
Author: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>
Date:   Mon Jul 1 10:38:50 2024 -0700

    gpiolib: of: fix lookup quirk for MIPS Lantiq
    
    [ 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@xxxxxxxxxx>
    Acked-by: Martin Schiller <ms@xxxxxxxxxx>
    Signed-off-by: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>
    Link: https://lore.kernel.org/r/ZoLpqv1PN08xHioh@xxxxxxxxxx
    Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c
index d9525d95e818d..133d2a4c31a6d 100644
--- a/drivers/gpio/gpiolib-of.c
+++ b/drivers/gpio/gpiolib-of.c
@@ -192,6 +192,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;
@@ -491,9 +501,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
 
 		/*




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux