Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 373957
b: refs/heads/master
c: daa7d39
h: refs/heads/master
i:
  373955: 47a1859
v: v3
  • Loading branch information
Wolfram Sang authored and Shawn Guo committed Apr 4, 2013
1 parent ff22d8f commit e162235
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c29dc2d771411850777eb027756b12106b5f6cd5
refs/heads/master: daa7d392ffe67e698ee442694276061624b4b0a1
10 changes: 10 additions & 0 deletions trunk/drivers/net/ethernet/freescale/fec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1802,6 +1802,11 @@ fec_probe(struct platform_device *pdev)
goto failed_clk;
}

/* enet_out is optional, depends on board */
fep->clk_enet_out = devm_clk_get(&pdev->dev, "enet_out");
if (IS_ERR(fep->clk_enet_out))
fep->clk_enet_out = NULL;

fep->clk_ptp = devm_clk_get(&pdev->dev, "ptp");
fep->bufdesc_ex =
pdev->id_entry->driver_data & FEC_QUIRK_HAS_BUFDESC_EX;
Expand All @@ -1812,6 +1817,7 @@ fec_probe(struct platform_device *pdev)

clk_prepare_enable(fep->clk_ahb);
clk_prepare_enable(fep->clk_ipg);
clk_prepare_enable(fep->clk_enet_out);
clk_prepare_enable(fep->clk_ptp);

reg_phy = devm_regulator_get(&pdev->dev, "phy");
Expand Down Expand Up @@ -1877,6 +1883,7 @@ fec_probe(struct platform_device *pdev)
failed_regulator:
clk_disable_unprepare(fep->clk_ahb);
clk_disable_unprepare(fep->clk_ipg);
clk_disable_unprepare(fep->clk_enet_out);
clk_disable_unprepare(fep->clk_ptp);
failed_pin:
failed_clk:
Expand All @@ -1903,6 +1910,7 @@ fec_drv_remove(struct platform_device *pdev)
clk_disable_unprepare(fep->clk_ptp);
if (fep->ptp_clock)
ptp_clock_unregister(fep->ptp_clock);
clk_disable_unprepare(fep->clk_enet_out);
clk_disable_unprepare(fep->clk_ahb);
clk_disable_unprepare(fep->clk_ipg);
for (i = 0; i < FEC_IRQ_NUM; i++) {
Expand Down Expand Up @@ -1933,6 +1941,7 @@ fec_suspend(struct device *dev)
fec_stop(ndev);
netif_device_detach(ndev);
}
clk_disable_unprepare(fep->clk_enet_out);
clk_disable_unprepare(fep->clk_ahb);
clk_disable_unprepare(fep->clk_ipg);

Expand All @@ -1945,6 +1954,7 @@ fec_resume(struct device *dev)
struct net_device *ndev = dev_get_drvdata(dev);
struct fec_enet_private *fep = netdev_priv(ndev);

clk_prepare_enable(fep->clk_enet_out);
clk_prepare_enable(fep->clk_ahb);
clk_prepare_enable(fep->clk_ipg);
if (netif_running(ndev)) {
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/ethernet/freescale/fec.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ struct fec_enet_private {

struct clk *clk_ipg;
struct clk *clk_ahb;
struct clk *clk_enet_out;
struct clk *clk_ptp;

/* The saved address of a sent-in-place packet/buffer, for skfree(). */
Expand Down

0 comments on commit e162235

Please sign in to comment.