diff options
author | guoyin.chen <guoyin.chen@freescale.com> | 2013-04-17 13:17:30 +0800 |
---|---|---|
committer | guoyin.chen <guoyin.chen@freescale.com> | 2013-04-17 13:17:30 +0800 |
commit | 3b9608406bb699de5ff02760c745e62212b4c280 (patch) | |
tree | 1cedd6fff5d0c2f512cee15f74fb9dc867b7e328 /drivers/net/fec.c | |
parent | bc275dcec0026997a8a8b685ce65c6f766ff38ce (diff) | |
parent | 556681e28fda1c92eb2178306904a7df87f37449 (diff) |
Merge remote-tracking branch 'fsl-linux-sdk/imx_3.0.35_4.0.0' into imx_3.0.35_androidjb4.2.2_1.0.0-ga
Diffstat (limited to 'drivers/net/fec.c')
-rwxr-xr-x | drivers/net/fec.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/net/fec.c b/drivers/net/fec.c index 69e4a57ed51b..ebb09eb9a6f2 100755 --- a/drivers/net/fec.c +++ b/drivers/net/fec.c @@ -27,6 +27,7 @@ #include <linux/string.h> #include <linux/ptrace.h> #include <linux/errno.h> +#include <linux/gpio.h> #include <linux/ioport.h> #include <linux/slab.h> #include <linux/interrupt.h> @@ -1872,6 +1873,17 @@ fec_probe(struct platform_device *pdev) if (pdata) fep->phy_interface = pdata->phy; +#ifdef CONFIG_MX6_ENET_IRQ_TO_GPIO + gpio_request(pdata->gpio_irq, "gpio_enet_irq"); + gpio_direction_input(pdata->gpio_irq); + + irq = gpio_to_irq(pdata->gpio_irq); + ret = request_irq(irq, fec_enet_interrupt, + IRQF_TRIGGER_RISING, + pdev->name, ndev); + if (ret) + goto failed_irq; +#else /* This device has up to three irqs on some platforms */ for (i = 0; i < 3; i++) { irq = platform_get_irq(pdev, i); @@ -1886,6 +1898,7 @@ fec_probe(struct platform_device *pdev) goto failed_irq; } } +#endif fep->clk = clk_get(&pdev->dev, "fec_clk"); if (IS_ERR(fep->clk)) { @@ -1936,11 +1949,15 @@ failed_init: clk_disable(fep->clk); clk_put(fep->clk); failed_clk: +#ifdef CONFIG_MX6_ENET_IRQ_TO_GPIO + free_irq(irq, ndev); +#else for (i = 0; i < 3; i++) { irq = platform_get_irq(pdev, i); if (irq > 0) free_irq(irq, ndev); } +#endif failed_irq: iounmap(fep->hwp); failed_ioremap: |