updata enc28j60 net
author林辉辉 <lhh@rock-chips.com>
Fri, 14 May 2010 09:26:25 +0000 (09:26 +0000)
committer黄涛 <huangtao@rock-chips.com>
Mon, 21 Jun 2010 05:34:54 +0000 (13:34 +0800)
drivers/net/enc28j60.c

index 66813c91a720d7b7b8be884ddbba07e2f65cce85..2fb3db98ad694fb3a3f447ce5d0457606a8b797f 100644 (file)
 #include <linux/skbuff.h>
 #include <linux/delay.h>
 #include <linux/spi/spi.h>
+#include <mach/gpio.h>
 
 #include "enc28j60_hw.h"
 
+#define MAC_INT_PORT   RK2818_PIN_PE2
 #define DRV_NAME       "enc28j60"
 #define DRV_VERSION    "1.01"
 
@@ -1548,7 +1550,10 @@ static int __devinit enc28j60_probe(struct spi_device *spi)
        struct net_device *dev;
        struct enc28j60_net *priv;
        int ret = 0;
-
+       unsigned long req_flags = IRQF_TRIGGER_FALLING;
+       int gpioToIrq = gpio_to_irq (MAC_INT_PORT);
+       
+       gpio_request(MAC_INT_PORT, "DRV_NAME");
        if (netif_msg_drv(&debug))
                dev_info(&spi->dev, DRV_NAME " Ethernet driver %s loaded\n",
                        DRV_VERSION);
@@ -1587,7 +1592,13 @@ static int __devinit enc28j60_probe(struct spi_device *spi)
        /* Board setup must set the relevant edge trigger type;
         * level triggers won't currently work.
         */
-       ret = request_irq(spi->irq, enc28j60_irq, 0, DRV_NAME, priv);
+       gpio_pull_updown(MAC_INT_PORT, GPIOPullUp);     
+       if(gpioToIrq != -1)
+               ret = request_irq(gpioToIrq, enc28j60_irq,req_flags, "DRV_NAME", priv);
+       else
+               ret = -1;
+               
+       ///ret = request_irq(spi->irq, enc28j60_irq, 0, DRV_NAME, priv);
        if (ret < 0) {
                if (netif_msg_probe(priv))
                        dev_err(&spi->dev, DRV_NAME ": request irq %d failed "