]> www.infradead.org Git - users/dwmw2/linux.git/commit
MIPS: pci: lantiq: restore reset gpio polarity
authorMartin Schiller <ms@dev.tdt.de>
Fri, 7 Jun 2024 09:04:00 +0000 (11:04 +0200)
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>
Tue, 11 Jun 2024 14:05:12 +0000 (16:05 +0200)
commit277a0363120276645ae598d8d5fea7265e076ae9
treebd6b6ec3fe0a5d0a5f17f0687b620a77081508a2
parentae9daffd9028f2500c9ac1517e46d4f2b57efb80
MIPS: pci: lantiq: restore reset gpio polarity

Commit 90c2d2eb7ab5 ("MIPS: pci: lantiq: switch to using gpiod API") not
only switched to the gpiod API, but also inverted / changed the polarity
of the GPIO.

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 (mainly in the openWrt project) define this GPIO as
active-high and the old driver code inverted the signal internally.

Apparently there are actually boards where the reset gpio must be
operated inverted. For this reason, we cannot use the GPIOD_OUT_LOW/HIGH
flag for initialization. Instead, we must explicitly set the gpio to
value 1 in order to take into account any "GPIO_ACTIVE_LOW" flag that
may have been set.

In order to remain compatible with all these existing device trees, we
should therefore keep the logic as it was before the commit.

Fixes: 90c2d2eb7ab5 ("MIPS: pci: lantiq: switch to using gpiod API")
Cc: stable@vger.kernel.org
Signed-off-by: Martin Schiller <ms@dev.tdt.de>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
arch/mips/pci/pci-lantiq.c