diff options
Diffstat (limited to 'drivers/net/ethernet/freescale')
-rw-r--r-- | drivers/net/ethernet/freescale/fec.h | 1 | ||||
-rw-r--r-- | drivers/net/ethernet/freescale/fec_main.c | 18 |
2 files changed, 14 insertions, 5 deletions
diff --git a/drivers/net/ethernet/freescale/fec.h b/drivers/net/ethernet/freescale/fec.h index d44f65bac1d4..ceb4d43c132d 100644 --- a/drivers/net/ethernet/freescale/fec.h +++ b/drivers/net/ethernet/freescale/fec.h | |||
@@ -214,6 +214,7 @@ struct fec_enet_private { | |||
214 | 214 | ||
215 | struct clk *clk_ipg; | 215 | struct clk *clk_ipg; |
216 | struct clk *clk_ahb; | 216 | struct clk *clk_ahb; |
217 | struct clk *clk_enet_out; | ||
217 | struct clk *clk_ptp; | 218 | struct clk *clk_ptp; |
218 | 219 | ||
219 | /* The saved address of a sent-in-place packet/buffer, for skfree(). */ | 220 | /* The saved address of a sent-in-place packet/buffer, for skfree(). */ |
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c index b9748f14ea78..e25bf832e6b3 100644 --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c | |||
@@ -1883,18 +1883,23 @@ fec_probe(struct platform_device *pdev) | |||
1883 | goto failed_clk; | 1883 | goto failed_clk; |
1884 | } | 1884 | } |
1885 | 1885 | ||
1886 | /* enet_out is optional, depends on board */ | ||
1887 | fep->clk_enet_out = devm_clk_get(&pdev->dev, "enet_out"); | ||
1888 | if (IS_ERR(fep->clk_enet_out)) | ||
1889 | fep->clk_enet_out = NULL; | ||
1890 | |||
1886 | fep->clk_ptp = devm_clk_get(&pdev->dev, "ptp"); | 1891 | fep->clk_ptp = devm_clk_get(&pdev->dev, "ptp"); |
1887 | fep->bufdesc_ex = | 1892 | fep->bufdesc_ex = |
1888 | pdev->id_entry->driver_data & FEC_QUIRK_HAS_BUFDESC_EX; | 1893 | pdev->id_entry->driver_data & FEC_QUIRK_HAS_BUFDESC_EX; |
1889 | if (IS_ERR(fep->clk_ptp)) { | 1894 | if (IS_ERR(fep->clk_ptp)) { |
1890 | ret = PTR_ERR(fep->clk_ptp); | 1895 | fep->clk_ptp = NULL; |
1891 | fep->bufdesc_ex = 0; | 1896 | fep->bufdesc_ex = 0; |
1892 | } | 1897 | } |
1893 | 1898 | ||
1894 | clk_prepare_enable(fep->clk_ahb); | 1899 | clk_prepare_enable(fep->clk_ahb); |
1895 | clk_prepare_enable(fep->clk_ipg); | 1900 | clk_prepare_enable(fep->clk_ipg); |
1896 | if (!IS_ERR(fep->clk_ptp)) | 1901 | clk_prepare_enable(fep->clk_enet_out); |
1897 | clk_prepare_enable(fep->clk_ptp); | 1902 | clk_prepare_enable(fep->clk_ptp); |
1898 | 1903 | ||
1899 | reg_phy = devm_regulator_get(&pdev->dev, "phy"); | 1904 | reg_phy = devm_regulator_get(&pdev->dev, "phy"); |
1900 | if (!IS_ERR(reg_phy)) { | 1905 | if (!IS_ERR(reg_phy)) { |
@@ -1962,8 +1967,8 @@ failed_irq: | |||
1962 | failed_regulator: | 1967 | failed_regulator: |
1963 | clk_disable_unprepare(fep->clk_ahb); | 1968 | clk_disable_unprepare(fep->clk_ahb); |
1964 | clk_disable_unprepare(fep->clk_ipg); | 1969 | clk_disable_unprepare(fep->clk_ipg); |
1965 | if (!IS_ERR(fep->clk_ptp)) | 1970 | clk_disable_unprepare(fep->clk_enet_out); |
1966 | clk_disable_unprepare(fep->clk_ptp); | 1971 | clk_disable_unprepare(fep->clk_ptp); |
1967 | failed_pin: | 1972 | failed_pin: |
1968 | failed_clk: | 1973 | failed_clk: |
1969 | failed_ioremap: | 1974 | failed_ioremap: |
@@ -1985,6 +1990,7 @@ fec_drv_remove(struct platform_device *pdev) | |||
1985 | clk_disable_unprepare(fep->clk_ptp); | 1990 | clk_disable_unprepare(fep->clk_ptp); |
1986 | if (fep->ptp_clock) | 1991 | if (fep->ptp_clock) |
1987 | ptp_clock_unregister(fep->ptp_clock); | 1992 | ptp_clock_unregister(fep->ptp_clock); |
1993 | clk_disable_unprepare(fep->clk_enet_out); | ||
1988 | clk_disable_unprepare(fep->clk_ahb); | 1994 | clk_disable_unprepare(fep->clk_ahb); |
1989 | clk_disable_unprepare(fep->clk_ipg); | 1995 | clk_disable_unprepare(fep->clk_ipg); |
1990 | for (i = 0; i < FEC_IRQ_NUM; i++) { | 1996 | for (i = 0; i < FEC_IRQ_NUM; i++) { |
@@ -2010,6 +2016,7 @@ fec_suspend(struct device *dev) | |||
2010 | fec_stop(ndev); | 2016 | fec_stop(ndev); |
2011 | netif_device_detach(ndev); | 2017 | netif_device_detach(ndev); |
2012 | } | 2018 | } |
2019 | clk_disable_unprepare(fep->clk_enet_out); | ||
2013 | clk_disable_unprepare(fep->clk_ahb); | 2020 | clk_disable_unprepare(fep->clk_ahb); |
2014 | clk_disable_unprepare(fep->clk_ipg); | 2021 | clk_disable_unprepare(fep->clk_ipg); |
2015 | 2022 | ||
@@ -2022,6 +2029,7 @@ fec_resume(struct device *dev) | |||
2022 | struct net_device *ndev = dev_get_drvdata(dev); | 2029 | struct net_device *ndev = dev_get_drvdata(dev); |
2023 | struct fec_enet_private *fep = netdev_priv(ndev); | 2030 | struct fec_enet_private *fep = netdev_priv(ndev); |
2024 | 2031 | ||
2032 | clk_prepare_enable(fep->clk_enet_out); | ||
2025 | clk_prepare_enable(fep->clk_ahb); | 2033 | clk_prepare_enable(fep->clk_ahb); |
2026 | clk_prepare_enable(fep->clk_ipg); | 2034 | clk_prepare_enable(fep->clk_ipg); |
2027 | if (netif_running(ndev)) { | 2035 | if (netif_running(ndev)) { |