aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/ethernet/freescale/fec.c10
-rw-r--r--drivers/net/ethernet/freescale/fec.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
index 6d965bb32908..dd098ea44d48 100644
--- a/drivers/net/ethernet/freescale/fec.c
+++ b/drivers/net/ethernet/freescale/fec.c
@@ -1802,6 +1802,11 @@ fec_probe(struct platform_device *pdev)
1802 goto failed_clk; 1802 goto failed_clk;
1803 } 1803 }
1804 1804
1805 /* enet_out is optional, depends on board */
1806 fep->clk_enet_out = devm_clk_get(&pdev->dev, "enet_out");
1807 if (IS_ERR(fep->clk_enet_out))
1808 fep->clk_enet_out = NULL;
1809
1805 fep->clk_ptp = devm_clk_get(&pdev->dev, "ptp"); 1810 fep->clk_ptp = devm_clk_get(&pdev->dev, "ptp");
1806 fep->bufdesc_ex = 1811 fep->bufdesc_ex =
1807 pdev->id_entry->driver_data & FEC_QUIRK_HAS_BUFDESC_EX; 1812 pdev->id_entry->driver_data & FEC_QUIRK_HAS_BUFDESC_EX;
@@ -1812,6 +1817,7 @@ fec_probe(struct platform_device *pdev)
1812 1817
1813 clk_prepare_enable(fep->clk_ahb); 1818 clk_prepare_enable(fep->clk_ahb);
1814 clk_prepare_enable(fep->clk_ipg); 1819 clk_prepare_enable(fep->clk_ipg);
1820 clk_prepare_enable(fep->clk_enet_out);
1815 clk_prepare_enable(fep->clk_ptp); 1821 clk_prepare_enable(fep->clk_ptp);
1816 1822
1817 reg_phy = devm_regulator_get(&pdev->dev, "phy"); 1823 reg_phy = devm_regulator_get(&pdev->dev, "phy");
@@ -1877,6 +1883,7 @@ failed_irq:
1877failed_regulator: 1883failed_regulator:
1878 clk_disable_unprepare(fep->clk_ahb); 1884 clk_disable_unprepare(fep->clk_ahb);
1879 clk_disable_unprepare(fep->clk_ipg); 1885 clk_disable_unprepare(fep->clk_ipg);
1886 clk_disable_unprepare(fep->clk_enet_out);
1880 clk_disable_unprepare(fep->clk_ptp); 1887 clk_disable_unprepare(fep->clk_ptp);
1881failed_pin: 1888failed_pin:
1882failed_clk: 1889failed_clk:
@@ -1903,6 +1910,7 @@ fec_drv_remove(struct platform_device *pdev)
1903 clk_disable_unprepare(fep->clk_ptp); 1910 clk_disable_unprepare(fep->clk_ptp);
1904 if (fep->ptp_clock) 1911 if (fep->ptp_clock)
1905 ptp_clock_unregister(fep->ptp_clock); 1912 ptp_clock_unregister(fep->ptp_clock);
1913 clk_disable_unprepare(fep->clk_enet_out);
1906 clk_disable_unprepare(fep->clk_ahb); 1914 clk_disable_unprepare(fep->clk_ahb);
1907 clk_disable_unprepare(fep->clk_ipg); 1915 clk_disable_unprepare(fep->clk_ipg);
1908 for (i = 0; i < FEC_IRQ_NUM; i++) { 1916 for (i = 0; i < FEC_IRQ_NUM; i++) {
@@ -1933,6 +1941,7 @@ fec_suspend(struct device *dev)
1933 fec_stop(ndev); 1941 fec_stop(ndev);
1934 netif_device_detach(ndev); 1942 netif_device_detach(ndev);
1935 } 1943 }
1944 clk_disable_unprepare(fep->clk_enet_out);
1936 clk_disable_unprepare(fep->clk_ahb); 1945 clk_disable_unprepare(fep->clk_ahb);
1937 clk_disable_unprepare(fep->clk_ipg); 1946 clk_disable_unprepare(fep->clk_ipg);
1938 1947
@@ -1945,6 +1954,7 @@ fec_resume(struct device *dev)
1945 struct net_device *ndev = dev_get_drvdata(dev); 1954 struct net_device *ndev = dev_get_drvdata(dev);
1946 struct fec_enet_private *fep = netdev_priv(ndev); 1955 struct fec_enet_private *fep = netdev_priv(ndev);
1947 1956
1957 clk_prepare_enable(fep->clk_enet_out);
1948 clk_prepare_enable(fep->clk_ahb); 1958 clk_prepare_enable(fep->clk_ahb);
1949 clk_prepare_enable(fep->clk_ipg); 1959 clk_prepare_enable(fep->clk_ipg);
1950 if (netif_running(ndev)) { 1960 if (netif_running(ndev)) {
diff --git a/drivers/net/ethernet/freescale/fec.h b/drivers/net/ethernet/freescale/fec.h
index eb4372962839..feabcb6a78b4 100644
--- a/drivers/net/ethernet/freescale/fec.h
+++ b/drivers/net/ethernet/freescale/fec.h
@@ -207,6 +207,7 @@ struct fec_enet_private {
207 207
208 struct clk *clk_ipg; 208 struct clk *clk_ipg;
209 struct clk *clk_ahb; 209 struct clk *clk_ahb;
210 struct clk *clk_enet_out;
210 struct clk *clk_ptp; 211 struct clk *clk_ptp;
211 212
212 /* The saved address of a sent-in-place packet/buffer, for skfree(). */ 213 /* The saved address of a sent-in-place packet/buffer, for skfree(). */