summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorRanjani Vaidyanathan <ra5478@freescale.com>2013-07-09 16:13:48 -0500
committerRanjani Vaidyanathan <ra5478@freescale.com>2013-07-12 10:44:22 -0500
commit9e268cc3e4386f1a5a31a62f7207e5a9b8420124 (patch)
treee1ddcf86adbb1d63ba794b73b8fdc19a5e88f36d /drivers/net
parent40e02d9761dc6111363d74166d030e24f86b19cd (diff)
ENGR00262502-2 [MX6Q/MX6DLS]Add commandline option to route enet irq to gpio
Add a command line option to route the ENET interrupts to the GPIO_1_6. To route the ENET interrupts to GPIO_6 add "enet_gpio_6" to the kernel command line. Also remove the CONFIG option (MX6_ENET_IRQ_TO_GPIO). This commit should be applied on top of following commits: 72c86f0b9a953e91bb1ed31021b71f337050bc28 808863866d2c17aeb3e70a7fcd094bd96db4b601 bae4d40849f3acdd9663f5a0857c9415ed7e6d5d Signed-off-by: Ranjani Vaidyanathan <ra5478@freescale.com>
Diffstat (limited to 'drivers/net')
-rwxr-xr-xdrivers/net/fec.c63
1 files changed, 32 insertions, 31 deletions
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index 2132bad2bb4e..1b646ed9e5c5 100755
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -1867,32 +1867,33 @@ 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);
- if (i && irq < 0)
- break;
- ret = request_irq(irq, fec_enet_interrupt, IRQF_DISABLED, pdev->name, ndev);
- if (ret) {
- while (--i >= 0) {
- irq = platform_get_irq(pdev, i);
- free_irq(irq, ndev);
- }
+ if (pdata->gpio_irq < 0) {
+ 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);
+ if (i && irq < 0)
+ break;
+ ret = request_irq(irq, fec_enet_interrupt,
+ IRQF_DISABLED, pdev->name, ndev);
+ if (ret) {
+ while (--i >= 0) {
+ irq = platform_get_irq(pdev, i);
+ free_irq(irq, ndev);
+ }
+ goto failed_irq;
+ }
}
}
-#endif
fep->clk = clk_get(&pdev->dev, "fec_clk");
if (IS_ERR(fep->clk)) {
@@ -1943,15 +1944,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);
+ if (pdata->gpio_irq < 0)
+ 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: