aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci
diff options
context:
space:
mode:
authorLucas Stach <l.stach@pengutronix.de>2014-03-28 12:52:55 -0400
committerBjorn Helgaas <bhelgaas@google.com>2014-05-30 13:22:46 -0400
commit57526136532408bacf2f68c26027abc2924b45d1 (patch)
tree552a0019890f309f081ea0ae706b0f776c144732 /drivers/pci
parent44cb5e94f96cef72a977fc5fdea8095bc0ae25ba (diff)
PCI: imx6: Use new clock names
As defined in the new binding. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Acked-by: Richard Zhu <r65037@freescale.com>
Diffstat (limited to 'drivers/pci')
-rw-r--r--drivers/pci/host/pci-imx6.c74
1 files changed, 29 insertions, 45 deletions
diff --git a/drivers/pci/host/pci-imx6.c b/drivers/pci/host/pci-imx6.c
index facbf8faa353..e080ae326ba6 100644
--- a/drivers/pci/host/pci-imx6.c
+++ b/drivers/pci/host/pci-imx6.c
@@ -35,10 +35,9 @@ struct imx6_pcie {
35 int power_on_gpio; 35 int power_on_gpio;
36 int wake_up_gpio; 36 int wake_up_gpio;
37 int disable_gpio; 37 int disable_gpio;
38 struct clk *lvds_gate; 38 struct clk *pcie_bus;
39 struct clk *sata_ref_100m; 39 struct clk *pcie_phy;
40 struct clk *pcie_ref_125m; 40 struct clk *pcie;
41 struct clk *pcie_axi;
42 struct pcie_port pp; 41 struct pcie_port pp;
43 struct regmap *iomuxc_gpr; 42 struct regmap *iomuxc_gpr;
44 void __iomem *mem_base; 43 void __iomem *mem_base;
@@ -239,28 +238,22 @@ static int imx6_pcie_deassert_core_reset(struct pcie_port *pp)
239 regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR1, 238 regmap_update_bits(imx6_pcie->iomuxc_gpr, IOMUXC_GPR1,
240 IMX6Q_GPR1_PCIE_REF_CLK_EN, 1 << 16); 239 IMX6Q_GPR1_PCIE_REF_CLK_EN, 1 << 16);
241 240
242 ret = clk_prepare_enable(imx6_pcie->sata_ref_100m); 241 ret = clk_prepare_enable(imx6_pcie->pcie_phy);
243 if (ret) { 242 if (ret) {
244 dev_err(pp->dev, "unable to enable sata_ref_100m\n"); 243 dev_err(pp->dev, "unable to enable pcie_phy clock\n");
245 goto err_sata_ref; 244 goto err_pcie_phy;
246 } 245 }
247 246
248 ret = clk_prepare_enable(imx6_pcie->pcie_ref_125m); 247 ret = clk_prepare_enable(imx6_pcie->pcie_bus);
249 if (ret) { 248 if (ret) {
250 dev_err(pp->dev, "unable to enable pcie_ref_125m\n"); 249 dev_err(pp->dev, "unable to enable pcie_bus clock\n");
251 goto err_pcie_ref; 250 goto err_pcie_bus;
252 } 251 }
253 252
254 ret = clk_prepare_enable(imx6_pcie->lvds_gate); 253 ret = clk_prepare_enable(imx6_pcie->pcie);
255 if (ret) { 254 if (ret) {
256 dev_err(pp->dev, "unable to enable lvds_gate\n"); 255 dev_err(pp->dev, "unable to enable pcie clock\n");
257 goto err_lvds_gate; 256 goto err_pcie;
258 }
259
260 ret = clk_prepare_enable(imx6_pcie->pcie_axi);
261 if (ret) {
262 dev_err(pp->dev, "unable to enable pcie_axi\n");
263 goto err_pcie_axi;
264 } 257 }
265 258
266 /* allow the clocks to stabilize */ 259 /* allow the clocks to stabilize */
@@ -274,13 +267,11 @@ static int imx6_pcie_deassert_core_reset(struct pcie_port *pp)
274 } 267 }
275 return 0; 268 return 0;
276 269
277err_pcie_axi: 270err_pcie:
278 clk_disable_unprepare(imx6_pcie->lvds_gate); 271 clk_disable_unprepare(imx6_pcie->pcie_bus);
279err_lvds_gate: 272err_pcie_bus:
280 clk_disable_unprepare(imx6_pcie->pcie_ref_125m); 273 clk_disable_unprepare(imx6_pcie->pcie_phy);
281err_pcie_ref: 274err_pcie_phy:
282 clk_disable_unprepare(imx6_pcie->sata_ref_100m);
283err_sata_ref:
284 return ret; 275 return ret;
285 276
286} 277}
@@ -583,32 +574,25 @@ static int __init imx6_pcie_probe(struct platform_device *pdev)
583 } 574 }
584 575
585 /* Fetch clocks */ 576 /* Fetch clocks */
586 imx6_pcie->lvds_gate = devm_clk_get(&pdev->dev, "lvds_gate"); 577 imx6_pcie->pcie_phy = devm_clk_get(&pdev->dev, "pcie_phy");
587 if (IS_ERR(imx6_pcie->lvds_gate)) { 578 if (IS_ERR(imx6_pcie->pcie_phy)) {
588 dev_err(&pdev->dev,
589 "lvds_gate clock select missing or invalid\n");
590 return PTR_ERR(imx6_pcie->lvds_gate);
591 }
592
593 imx6_pcie->sata_ref_100m = devm_clk_get(&pdev->dev, "sata_ref_100m");
594 if (IS_ERR(imx6_pcie->sata_ref_100m)) {
595 dev_err(&pdev->dev, 579 dev_err(&pdev->dev,
596 "sata_ref_100m clock source missing or invalid\n"); 580 "pcie_phy clock source missing or invalid\n");
597 return PTR_ERR(imx6_pcie->sata_ref_100m); 581 return PTR_ERR(imx6_pcie->pcie_phy);
598 } 582 }
599 583
600 imx6_pcie->pcie_ref_125m = devm_clk_get(&pdev->dev, "pcie_ref_125m"); 584 imx6_pcie->pcie_bus = devm_clk_get(&pdev->dev, "pcie_bus");
601 if (IS_ERR(imx6_pcie->pcie_ref_125m)) { 585 if (IS_ERR(imx6_pcie->pcie_bus)) {
602 dev_err(&pdev->dev, 586 dev_err(&pdev->dev,
603 "pcie_ref_125m clock source missing or invalid\n"); 587 "pcie_bus clock source missing or invalid\n");
604 return PTR_ERR(imx6_pcie->pcie_ref_125m); 588 return PTR_ERR(imx6_pcie->pcie_bus);
605 } 589 }
606 590
607 imx6_pcie->pcie_axi = devm_clk_get(&pdev->dev, "pcie_axi"); 591 imx6_pcie->pcie = devm_clk_get(&pdev->dev, "pcie");
608 if (IS_ERR(imx6_pcie->pcie_axi)) { 592 if (IS_ERR(imx6_pcie->pcie)) {
609 dev_err(&pdev->dev, 593 dev_err(&pdev->dev,
610 "pcie_axi clock source missing or invalid\n"); 594 "pcie clock source missing or invalid\n");
611 return PTR_ERR(imx6_pcie->pcie_axi); 595 return PTR_ERR(imx6_pcie->pcie);
612 } 596 }
613 597
614 /* Grab GPR config register range */ 598 /* Grab GPR config register range */