summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorJun Li <r65092@freescale.com>2010-01-11 15:38:44 +0800
committerAlejandro Gonzalez <alex.gonzalez@digi.com>2010-05-24 11:50:03 +0200
commit50ece9945c968bcd39162c79b8bda056907f545e (patch)
tree1499bf015966e974f35f9da3982653c4dcf147e3 /drivers/net
parent902761b214614c386224320f582c9b6ccb8baba3 (diff)
ENGR00119899 Add FEC iomux config and PHY reset.
FEC driver of 2.6.31 kernel remove pin iomux config and PHY reset, which is in fec_gpio_active() needed for i.MX25 and i.MX35. Signed-off-by: Li Jun <r65092@freescale.com> Signed-off-by: Alejandro Gonzalez <alex.gonzalez@digi.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/fec.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index 74644f02ae2c..43b6cf2d491c 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -1940,6 +1940,7 @@ fec_probe(struct platform_device *pdev)
struct net_device *ndev;
int i, irq, ret = 0;
struct resource *r;
+ struct fec_platform_data *pdata = pdev->dev.platform_data;
r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!r)
@@ -1985,6 +1986,10 @@ fec_probe(struct platform_device *pdev)
}
}
+ if (pdata && pdata->init)
+ if (pdata->init())
+ goto failed_platform_init;
+
fep->clk = clk_get(&pdev->dev, "fec_clk");
if (IS_ERR(fep->clk)) {
ret = PTR_ERR(fep->clk);
@@ -2008,6 +2013,7 @@ failed_init:
clk_disable(fep->clk);
clk_put(fep->clk);
failed_clk:
+failed_platform_init:
for (i = 0; i < 3; i++) {
irq = platform_get_irq(pdev, i);
if (irq > 0)
@@ -2026,10 +2032,13 @@ fec_drv_remove(struct platform_device *pdev)
{
struct net_device *ndev = platform_get_drvdata(pdev);
struct fec_enet_private *fep = netdev_priv(ndev);
+ struct fec_platform_data *pdata = pdev->dev.platform_data;
platform_set_drvdata(pdev, NULL);
fec_stop(ndev);
+ if (pdata && pdata->uninit)
+ pdata->uninit();
clk_disable(fep->clk);
clk_put(fep->clk);
iounmap((void __iomem *)ndev->base_addr);