linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] PCI: amlogic: Fix reset assertion via gpio descriptor
@ 2019-09-01 13:39 Remi Pommarel
  2019-09-01 21:46 ` Martin Blumenstingl
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Remi Pommarel @ 2019-09-01 13:39 UTC (permalink / raw)
  To: Yue Wang, Lorenzo Pieralisi, Bjorn Helgaas, Kevin Hilman
  Cc: linux-pci, linux-amlogic, Remi Pommarel

Normally asserting reset signal on gpio would be achieved with:
	gpiod_set_value_cansleep(reset_gpio, 1);

Meson PCI driver set reset value to '0' instead of '1' as it takes into
account the PERST# signal polarity. The polarity should be taken care
in the device tree instead.

This fixes the reset assertion meaning and moves out the polarity
configuration in DT (please note that there is no DT currently using
this driver).

Signed-off-by: Remi Pommarel <repk@triplefau.lt>
---
 drivers/pci/controller/dwc/pci-meson.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/pci/controller/dwc/pci-meson.c b/drivers/pci/controller/dwc/pci-meson.c
index e35e9eaa50ee..541f37a6f6a5 100644
--- a/drivers/pci/controller/dwc/pci-meson.c
+++ b/drivers/pci/controller/dwc/pci-meson.c
@@ -287,9 +287,9 @@ static inline void meson_cfg_writel(struct meson_pcie *mp, u32 val, u32 reg)
 
 static void meson_pcie_assert_reset(struct meson_pcie *mp)
 {
-	gpiod_set_value_cansleep(mp->reset_gpio, 0);
-	udelay(500);
 	gpiod_set_value_cansleep(mp->reset_gpio, 1);
+	udelay(500);
+	gpiod_set_value_cansleep(mp->reset_gpio, 0);
 }
 
 static void meson_pcie_init_dw(struct meson_pcie *mp)
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-10-15 14:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-09-01 13:39 [PATCH] PCI: amlogic: Fix reset assertion via gpio descriptor Remi Pommarel
2019-09-01 21:46 ` Martin Blumenstingl
2019-09-02  8:11 ` Neil Armstrong
2019-09-02 10:55 ` Andrew Murray
2019-09-02 14:43   ` Remi Pommarel
2019-09-02 22:34   ` Martin Blumenstingl
2019-10-15 14:02 ` Lorenzo Pieralisi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).