From: "Pali Rohár" <pali@kernel.org>
To: u-boot@lists.denx.de
Subject: [PATCH] arm64: a37xx: pci: Depends on DM_GPIO
Date: Tue, 25 Aug 2020 10:45:04 +0200 [thread overview]
Message-ID: <20200825084504.11258-1-pali@kernel.org> (raw)
In-Reply-To: <20200819135707.15486-1-pali@kernel.org>
For proper initialization of aardvark pci driver it is required to
de-assert reset GPIO. So depeneds on DM_GPIO option.
Signed-off-by: Pali Roh?r <pali@kernel.org>
---
drivers/pci/Kconfig | 1 +
drivers/pci/pci-aardvark.c | 10 ++--------
2 files changed, 3 insertions(+), 8 deletions(-)
diff --git a/drivers/pci/Kconfig b/drivers/pci/Kconfig
index 5e0a39396b..db70ccc288 100644
--- a/drivers/pci/Kconfig
+++ b/drivers/pci/Kconfig
@@ -30,6 +30,7 @@ config PCI_AARDVARK
bool "Enable Aardvark PCIe driver"
default n
depends on DM_PCI
+ depends on DM_GPIO
depends on ARMADA_3700
help
Say Y here if you want to enable PCIe controller support on
diff --git a/drivers/pci/pci-aardvark.c b/drivers/pci/pci-aardvark.c
index 8996be5309..b2c417701f 100644
--- a/drivers/pci/pci-aardvark.c
+++ b/drivers/pci/pci-aardvark.c
@@ -148,9 +148,7 @@ struct pcie_advk {
void *base;
int first_busno;
struct udevice *dev;
-#if CONFIG_IS_ENABLED(DM_GPIO)
struct gpio_desc reset_gpio;
-#endif
};
static inline void advk_writel(struct pcie_advk *pcie, uint val, uint reg)
@@ -616,7 +614,6 @@ static int pcie_advk_probe(struct udevice *dev)
{
struct pcie_advk *pcie = dev_get_priv(dev);
-#if CONFIG_IS_ENABLED(DM_GPIO)
gpio_request_by_name(dev, "reset-gpios", 0, &pcie->reset_gpio,
GPIOD_IS_OUT);
/*
@@ -637,10 +634,9 @@ static int pcie_advk_probe(struct udevice *dev)
dm_gpio_set_value(&pcie->reset_gpio, 1);
mdelay(200);
dm_gpio_set_value(&pcie->reset_gpio, 0);
+ } else {
+ dev_warn(pcie->dev, "PCIE Reset on GPIO support is missing\n");
}
-#else
- dev_dbg(pcie->dev, "PCIE Reset on GPIO support is missing\n");
-#endif /* DM_GPIO */
pcie->first_busno = dev->seq;
pcie->dev = pci_get_controller(dev);
@@ -650,12 +646,10 @@ static int pcie_advk_probe(struct udevice *dev)
static int pcie_advk_remove(struct udevice *dev)
{
-#if CONFIG_IS_ENABLED(DM_GPIO)
struct pcie_advk *pcie = dev_get_priv(dev);
if (dm_gpio_is_valid(&pcie->reset_gpio))
dm_gpio_set_value(&pcie->reset_gpio, 1);
-#endif /* DM_GPIO */
return 0;
}
--
2.20.1
next prev parent reply other threads:[~2020-08-25 8:45 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-19 13:57 [PATCH 1/2] arm64: a37xx: pci: Make PCIe Reset GPIO DT compatible with Linux kernel DT Pali Rohár
2020-08-19 13:57 ` [PATCH 2/2] arm64: a37xx: pci: Assert PERST# signal when unloading driver Pali Rohár
2020-08-19 17:31 ` [EXT] " Kostya Porotchkin
2020-08-20 7:53 ` Stefan Roese
2020-08-20 5:05 ` Stefan Roese
2020-08-20 7:43 ` Pali Rohár
2020-08-20 7:48 ` Stefan Roese
2020-08-20 7:52 ` Pali Rohár
2020-08-20 8:00 ` Stefan Roese
2020-08-25 8:46 ` Pali Rohár
2020-08-25 9:03 ` Stefan Roese
2020-08-20 8:06 ` [EXT] " Kostya Porotchkin
2020-08-27 16:27 ` Andre Heider
2020-08-31 13:03 ` Stefan Roese
2020-08-19 17:28 ` [EXT] [PATCH 1/2] arm64: a37xx: pci: Make PCIe Reset GPIO DT compatible with Linux kernel DT Kostya Porotchkin
2020-08-20 5:09 ` Stefan Roese
2020-08-20 5:03 ` Stefan Roese
2020-08-20 7:35 ` [EXT] " Kostya Porotchkin
2020-08-25 8:45 ` Pali Rohár [this message]
2020-08-25 9:03 ` [PATCH] arm64: a37xx: pci: Depends on DM_GPIO Stefan Roese
2020-08-27 16:27 ` Andre Heider
2020-08-31 13:05 ` Stefan Roese
2020-08-27 16:27 ` [PATCH 1/2] arm64: a37xx: pci: Make PCIe Reset GPIO DT compatible with Linux kernel DT Andre Heider
2020-08-31 13:03 ` Stefan Roese
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200825084504.11258-1-pali@kernel.org \
--to=pali@kernel.org \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.