update for gpio
author沈睿汀 <srt@rock-chips.com>
Fri, 30 Apr 2010 02:52:30 +0000 (02:52 +0000)
committer黄涛 <huangtao@rock-chips.com>
Mon, 21 Jun 2010 05:34:49 +0000 (13:34 +0800)
arch/arm/mach-rk2818/board-midsdk.c
arch/arm/mach-rk2818/gpio.c
arch/arm/mach-rk2818/include/mach/gpio.h

index 97d89ccc18cc7e5fbc435a322c1988a2c46db8fc..36ef1d27cb1fb977c95d220241e3040bc1917d65 100644 (file)
 
 static struct rk2818_gpio_bank rk2818_gpioBank[] = {
                {
-               .id             = AT2818_ID_PIOA,
+               .id             = RK2818_ID_PIOA,
                .offset         = RK2818_GPIO0_BASE,
                .clock          = NULL,
        }, 
                {
-               .id             = AT2818_ID_PIOB,
+               .id             = RK2818_ID_PIOB,
                .offset         = RK2818_GPIO0_BASE,
                .clock          = NULL,
        }, 
                {
-               .id             = AT2818_ID_PIOC,
+               .id             = RK2818_ID_PIOC,
                .offset         = RK2818_GPIO0_BASE,
                .clock          = NULL,
        }, 
                {
-               .id             = AT2818_ID_PIOD,
+               .id             = RK2818_ID_PIOD,
                .offset         = RK2818_GPIO0_BASE,
                .clock          = NULL,
        },
                {
-               .id             = AT2818_ID_PIOE,
+               .id             = RK2818_ID_PIOE,
                .offset         = RK2818_GPIO1_BASE,
                .clock          = NULL,
        },
                {
-               .id             = AT2818_ID_PIOF,
+               .id             = RK2818_ID_PIOF,
                .offset         = RK2818_GPIO1_BASE,
                .clock          = NULL,
        },
                {
-               .id             = AT2818_ID_PIOG,
+               .id             = RK2818_ID_PIOG,
                .offset         = RK2818_GPIO1_BASE,
                .clock          = NULL,
        },
                {
-               .id             = AT2818_ID_PIOH,
+               .id             = RK2818_ID_PIOH,
                .offset         = RK2818_GPIO1_BASE,
                .clock          = NULL,
        }
index 920c4679be9ebf1b4bcc8b9d95e0b10705b0c2bc..6f7682c92a21bd34719dd10e60ebc3d2abff2bce 100644 (file)
@@ -518,23 +518,23 @@ static int GPIOPullUpDown(struct gpio_chip *chip, unsigned int offset, eGPIOPull
        }
        mask1 = 0x03<<(2*offset+temp);
        mask2 = GPIOPullUpDown <<(2*offset+temp);
-       if(rk2818_gpio->bank->id==AT2818_ID_PIOA || rk2818_gpio->bank->id==AT2818_ID_PIOB)
+       if(rk2818_gpio->bank->id==RK2818_ID_PIOA || rk2818_gpio->bank->id==RK2818_ID_PIOB)
        {
                
                rk2818_gpio_bitOp(pAPBRegBase,GPIO0_AB_PU_CON,mask1,0);
                rk2818_gpio_bitOp(pAPBRegBase,GPIO0_AB_PU_CON,mask2,1);
        }
-       else if(rk2818_gpio->bank->id==AT2818_ID_PIOC || rk2818_gpio->bank->id==AT2818_ID_PIOD)
+       else if(rk2818_gpio->bank->id==RK2818_ID_PIOC || rk2818_gpio->bank->id==RK2818_ID_PIOD)
        {
                rk2818_gpio_bitOp(pAPBRegBase,GPIO0_CD_PU_CON,mask1,0);
                rk2818_gpio_bitOp(pAPBRegBase,GPIO0_CD_PU_CON,mask2,1);
        }
-       else if(rk2818_gpio->bank->id==AT2818_ID_PIOE || rk2818_gpio->bank->id==AT2818_ID_PIOF)
+       else if(rk2818_gpio->bank->id==RK2818_ID_PIOE || rk2818_gpio->bank->id==RK2818_ID_PIOF)
        {
                rk2818_gpio_bitOp(pAPBRegBase,GPIO1_AB_PU_CON,mask1,0);
                rk2818_gpio_bitOp(pAPBRegBase,GPIO1_AB_PU_CON,mask2,1);
        }
-       else if(rk2818_gpio->bank->id==AT2818_ID_PIOG|| rk2818_gpio->bank->id==AT2818_ID_PIOH)
+       else if(rk2818_gpio->bank->id==RK2818_ID_PIOG|| rk2818_gpio->bank->id==RK2818_ID_PIOH)
        {
                rk2818_gpio_bitOp(pAPBRegBase,GPIO1_CD_PU_CON,mask1,0);
                rk2818_gpio_bitOp(pAPBRegBase,GPIO1_CD_PU_CON,mask2,1);
@@ -935,12 +935,12 @@ void __init rk2818_gpio_irq_setup(void)
                        set_irq_handler(pin+j, handle_simple_irq);
                        set_irq_flags(pin+j, IRQF_VALID);
                }
-               if(this->bank->id == AT2818_ID_PIOA)
+               if(this->bank->id == RK2818_ID_PIOA)
                {       
                        irq = IRQ_NR_GPIO0;
                        
                }
-               else if(this->bank->id == AT2818_ID_PIOE)
+               else if(this->bank->id == RK2818_ID_PIOE)
                {
                        irq = IRQ_NR_GPIO1;
                }
@@ -1078,11 +1078,11 @@ static int rk2818_gpiolib_to_irq(struct gpio_chip *chip,
     {
         return -1;
     }
-    if(rk2818_gpio->bank->id==AT2818_ID_PIOA)
+    if(rk2818_gpio->bank->id==RK2818_ID_PIOA)
     {
         return offset + NR_AIC_IRQS;
     }
-    else if(rk2818_gpio->bank->id==AT2818_ID_PIOE)
+    else if(rk2818_gpio->bank->id==RK2818_ID_PIOE)
     {
         return offset + NR_AIC_IRQS + NUM_GROUP;
     }
index 88f0a4cb872b23853df421a306ca2395701e2de6..914e768d157e075ea10872caac15cbdc4a06a3d2 100755 (executable)
@@ -83,14 +83,14 @@ struct rk2818_gpio_bank {
 #define        GPIO_EXT_PORTD          0x5c
 #define        GPIO_LS_SYNC                    0x60
 
-#define AT2818_ID_PIOA 0
-#define AT2818_ID_PIOB 1
-#define AT2818_ID_PIOC 2
-#define AT2818_ID_PIOD 3
-#define AT2818_ID_PIOE 4
-#define AT2818_ID_PIOF 5
-#define AT2818_ID_PIOG 6
-#define AT2818_ID_PIOH 7
+#define RK2818_ID_PIOA 0
+#define RK2818_ID_PIOB 1
+#define RK2818_ID_PIOC 2
+#define RK2818_ID_PIOD 3
+#define RK2818_ID_PIOE 4
+#define RK2818_ID_PIOF 5
+#define RK2818_ID_PIOG 6
+#define RK2818_ID_PIOH 7
 /* these pin numbers double as IRQ numbers, like RK2818xxx_ID_* values */
 
 #define        RK2818_PIN_PA0          (PIN_BASE + 0*NUM_GROUP + 0)