diff options
Diffstat (limited to 'drivers/pci/controller/dwc')
| -rw-r--r-- | drivers/pci/controller/dwc/pci-imx6.c | 11 | ||||
| -rw-r--r-- | drivers/pci/controller/dwc/pci-meson.c | 1 | ||||
| -rw-r--r-- | drivers/pci/controller/dwc/pcie-armada8k.c | 16 |
3 files changed, 8 insertions, 20 deletions
diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c index 52e47dac028f..80f843030e36 100644 --- a/drivers/pci/controller/dwc/pci-imx6.c +++ b/drivers/pci/controller/dwc/pci-imx6.c | |||
| @@ -310,6 +310,9 @@ static int imx6_pcie_attach_pd(struct device *dev) | |||
| 310 | imx6_pcie->pd_pcie = dev_pm_domain_attach_by_name(dev, "pcie"); | 310 | imx6_pcie->pd_pcie = dev_pm_domain_attach_by_name(dev, "pcie"); |
| 311 | if (IS_ERR(imx6_pcie->pd_pcie)) | 311 | if (IS_ERR(imx6_pcie->pd_pcie)) |
| 312 | return PTR_ERR(imx6_pcie->pd_pcie); | 312 | return PTR_ERR(imx6_pcie->pd_pcie); |
| 313 | /* Do nothing when power domain missing */ | ||
| 314 | if (!imx6_pcie->pd_pcie) | ||
| 315 | return 0; | ||
| 313 | link = device_link_add(dev, imx6_pcie->pd_pcie, | 316 | link = device_link_add(dev, imx6_pcie->pd_pcie, |
| 314 | DL_FLAG_STATELESS | | 317 | DL_FLAG_STATELESS | |
| 315 | DL_FLAG_PM_RUNTIME | | 318 | DL_FLAG_PM_RUNTIME | |
| @@ -323,13 +326,13 @@ static int imx6_pcie_attach_pd(struct device *dev) | |||
| 323 | if (IS_ERR(imx6_pcie->pd_pcie_phy)) | 326 | if (IS_ERR(imx6_pcie->pd_pcie_phy)) |
| 324 | return PTR_ERR(imx6_pcie->pd_pcie_phy); | 327 | return PTR_ERR(imx6_pcie->pd_pcie_phy); |
| 325 | 328 | ||
| 326 | device_link_add(dev, imx6_pcie->pd_pcie_phy, | 329 | link = device_link_add(dev, imx6_pcie->pd_pcie_phy, |
| 327 | DL_FLAG_STATELESS | | 330 | DL_FLAG_STATELESS | |
| 328 | DL_FLAG_PM_RUNTIME | | 331 | DL_FLAG_PM_RUNTIME | |
| 329 | DL_FLAG_RPM_ACTIVE); | 332 | DL_FLAG_RPM_ACTIVE); |
| 330 | if (IS_ERR(link)) { | 333 | if (!link) { |
| 331 | dev_err(dev, "Failed to add device_link to pcie_phy pd: %ld\n", PTR_ERR(link)); | 334 | dev_err(dev, "Failed to add device_link to pcie_phy pd.\n"); |
| 332 | return PTR_ERR(link); | 335 | return -EINVAL; |
| 333 | } | 336 | } |
| 334 | 337 | ||
| 335 | return 0; | 338 | return 0; |
diff --git a/drivers/pci/controller/dwc/pci-meson.c b/drivers/pci/controller/dwc/pci-meson.c index 241ebe0c4505..e35e9eaa50ee 100644 --- a/drivers/pci/controller/dwc/pci-meson.c +++ b/drivers/pci/controller/dwc/pci-meson.c | |||
| @@ -8,6 +8,7 @@ | |||
| 8 | 8 | ||
| 9 | #include <linux/clk.h> | 9 | #include <linux/clk.h> |
| 10 | #include <linux/delay.h> | 10 | #include <linux/delay.h> |
| 11 | #include <linux/gpio/consumer.h> | ||
| 11 | #include <linux/of_device.h> | 12 | #include <linux/of_device.h> |
| 12 | #include <linux/of_gpio.h> | 13 | #include <linux/of_gpio.h> |
| 13 | #include <linux/pci.h> | 14 | #include <linux/pci.h> |
diff --git a/drivers/pci/controller/dwc/pcie-armada8k.c b/drivers/pci/controller/dwc/pcie-armada8k.c index b171b6bc15c8..0c389a30ef5d 100644 --- a/drivers/pci/controller/dwc/pcie-armada8k.c +++ b/drivers/pci/controller/dwc/pcie-armada8k.c | |||
| @@ -22,7 +22,6 @@ | |||
| 22 | #include <linux/resource.h> | 22 | #include <linux/resource.h> |
| 23 | #include <linux/of_pci.h> | 23 | #include <linux/of_pci.h> |
| 24 | #include <linux/of_irq.h> | 24 | #include <linux/of_irq.h> |
| 25 | #include <linux/gpio/consumer.h> | ||
| 26 | 25 | ||
| 27 | #include "pcie-designware.h" | 26 | #include "pcie-designware.h" |
| 28 | 27 | ||
| @@ -30,7 +29,6 @@ struct armada8k_pcie { | |||
| 30 | struct dw_pcie *pci; | 29 | struct dw_pcie *pci; |
| 31 | struct clk *clk; | 30 | struct clk *clk; |
| 32 | struct clk *clk_reg; | 31 | struct clk *clk_reg; |
| 33 | struct gpio_desc *reset_gpio; | ||
| 34 | }; | 32 | }; |
| 35 | 33 | ||
| 36 | #define PCIE_VENDOR_REGS_OFFSET 0x8000 | 34 | #define PCIE_VENDOR_REGS_OFFSET 0x8000 |
| @@ -139,12 +137,6 @@ static int armada8k_pcie_host_init(struct pcie_port *pp) | |||
| 139 | struct dw_pcie *pci = to_dw_pcie_from_pp(pp); | 137 | struct dw_pcie *pci = to_dw_pcie_from_pp(pp); |
| 140 | struct armada8k_pcie *pcie = to_armada8k_pcie(pci); | 138 | struct armada8k_pcie *pcie = to_armada8k_pcie(pci); |
| 141 | 139 | ||
| 142 | if (pcie->reset_gpio) { | ||
| 143 | /* assert and then deassert the reset signal */ | ||
| 144 | gpiod_set_value_cansleep(pcie->reset_gpio, 1); | ||
| 145 | msleep(100); | ||
| 146 | gpiod_set_value_cansleep(pcie->reset_gpio, 0); | ||
| 147 | } | ||
| 148 | dw_pcie_setup_rc(pp); | 140 | dw_pcie_setup_rc(pp); |
| 149 | armada8k_pcie_establish_link(pcie); | 141 | armada8k_pcie_establish_link(pcie); |
| 150 | 142 | ||
| @@ -257,14 +249,6 @@ static int armada8k_pcie_probe(struct platform_device *pdev) | |||
| 257 | goto fail_clkreg; | 249 | goto fail_clkreg; |
| 258 | } | 250 | } |
| 259 | 251 | ||
| 260 | /* Get reset gpio signal and hold asserted (logically high) */ | ||
| 261 | pcie->reset_gpio = devm_gpiod_get_optional(dev, "reset", | ||
| 262 | GPIOD_OUT_HIGH); | ||
| 263 | if (IS_ERR(pcie->reset_gpio)) { | ||
| 264 | ret = PTR_ERR(pcie->reset_gpio); | ||
| 265 | goto fail_clkreg; | ||
| 266 | } | ||
| 267 | |||
| 268 | platform_set_drvdata(pdev, pcie); | 252 | platform_set_drvdata(pdev, pcie); |
| 269 | 253 | ||
| 270 | ret = armada8k_add_pcie_port(pcie, pdev); | 254 | ret = armada8k_add_pcie_port(pcie, pdev); |
