phonepad:modify tps65910 gpio base
authorlw <lw@rock-chips.com>
Fri, 3 Aug 2012 08:57:12 +0000 (16:57 +0800)
committerlw <lw@rock-chips.com>
Fri, 3 Aug 2012 08:57:12 +0000 (16:57 +0800)
arch/arm/mach-rk30/board-rk30-sdk-tps65910.c
arch/arm/mach-rk30/include/mach/gpio.h
drivers/mfd/tps65910.c

index 69e4afa8f076261b3ffa4d753808c9af0aa5a6d8..b6d4c27d246b0167e77f734d9452c7c9d0a2cc8f 100755 (executable)
@@ -600,6 +600,7 @@ void __sramfunc board_pmu_tps65910_resume(void)
 static struct tps65910_board tps65910_data = {
        .irq    = (unsigned)TPS65910_HOST_IRQ,          
        .irq_base = NR_GIC_IRQS + NR_GPIO_IRQS,
+       .gpio_base = TPS65910_GPIO_EXPANDER_BASE,
        
        .pre_init = tps65910_pre_init,
        .post_init = tps65910_post_init,
index 29463c9346e0be30fb078df44f7233799cabcf8a..24660c3713cd3ab192075745247269c78e8fea63 100755 (executable)
 #else
 #define TCA6424_TOTOL_GPIO_NUM 0
 #define TCA6424_TOTOL_GPIO_IRQ_NUM     0
+#define TCA6424_GPIO_EXPANDER_BASE     GPIO_EXPANDER_BASE
 #endif
 
 #if defined(CONFIG_GPIO_WM831X)
 #define WM831X_TOTOL_GPIO_NUM          12
-#define WM831X_GPIO_EXPANDER_BASE      (GPIO_EXPANDER_BASE+TCA6424_TOTOL_GPIO_NUM)
+#define WM831X_GPIO_EXPANDER_BASE      (TCA6424_GPIO_EXPANDER_BASE+TCA6424_TOTOL_GPIO_NUM)
 #else
 #define WM831X_TOTOL_GPIO_NUM  0
-#define WM831X_GPIO_EXPANDER_BASE      (GPIO_EXPANDER_BASE+TCA6424_TOTOL_GPIO_NUM)
+#define WM831X_GPIO_EXPANDER_BASE      (TCA6424_GPIO_EXPANDER_BASE+TCA6424_TOTOL_GPIO_NUM)
 #endif
 
 #if defined (CONFIG_GPIO_WM8994)
 #define CONFIG_GPIO_WM8994_NUM 11
-#define WM8994_GPIO_EXPANDER_BASE (GPIO_EXPANDER_BASE+WM831X_TOTOL_GPIO_NUM)
+#define WM8994_GPIO_EXPANDER_BASE (WM831X_GPIO_EXPANDER_BASE+WM831X_TOTOL_GPIO_NUM)
 #else
 #define CONFIG_GPIO_WM8994_NUM 0
+#define WM8994_GPIO_EXPANDER_BASE (WM831X_GPIO_EXPANDER_BASE+WM831X_TOTOL_GPIO_NUM)
 #endif
 
+#if defined (CONFIG_GPIO_TPS65910)
+#define CONFIG_GPIO_TPS65910_NUM 9
+#define TPS65910_GPIO_EXPANDER_BASE (WM8994_GPIO_EXPANDER_BASE+CONFIG_GPIO_WM8994_NUM)
+#else
+#define CONFIG_GPIO_TPS65910_NUM 0
+#define TPS65910_GPIO_EXPANDER_BASE (WM8994_GPIO_EXPANDER_BASE+CONFIG_GPIO_WM8994_NUM)
+#endif
+
+
 //¶¨ÒåGPIOµÄPIN¿Ú×î´óÊýÄ¿¡£CONFIG_SPI_FPGA_GPIO_NUM±íʾFPGAµÄPIN½ÅÊý¡£
 #define ARCH_NR_GPIOS  (PIN_BASE + RK30_TOTOL_GPIO_NUM + TCA6424_TOTOL_GPIO_NUM + WM831X_TOTOL_GPIO_NUM + CONFIG_SPI_FPGA_GPIO_NUM+CONFIG_GPIO_WM8994_NUM)
 
index dd7813012b433796621eda9eedfbbbf3745a671a..42f1bd58afd6d5afcab87f18ae57d81cb99e2120 100755 (executable)
@@ -36,7 +36,7 @@ static struct mfd_cell tps65910s[] = {
        },
 };
 
-#define TPS65910_SPEED         400 * 1000
+#define TPS65910_SPEED         200 * 1000
 
 static int tps65910_i2c_read(struct tps65910 *tps65910, u8 reg,
                                  int bytes, void *dest)
@@ -51,14 +51,14 @@ static int tps65910_i2c_read(struct tps65910 *tps65910, u8 reg,
        xfer[0].flags = 0;
        xfer[0].len = 1;
        xfer[0].buf = &reg;
-       xfer[0].scl_rate = 200*1000;
+       xfer[0].scl_rate = TPS65910_SPEED;
 
        /* Read data */
        xfer[1].addr = i2c->addr;
        xfer[1].flags = I2C_M_RD;
        xfer[1].len = bytes;
        xfer[1].buf = dest;
-       xfer[1].scl_rate = 200*1000;
+       xfer[1].scl_rate = TPS65910_SPEED;
 
        ret = i2c_transfer(i2c->adapter, xfer, 2);
        //for(i=0;i<bytes;i++)
@@ -292,7 +292,7 @@ static int tps65910_i2c_probe(struct i2c_client *i2c,
                        goto err;
                }
        }
-       printk("%s:irq=%d,irq_base=%d\n",__func__,init_data->irq,init_data->irq_base);
+       printk("%s:irq=%d,irq_base=%d,gpio_base=%d\n",__func__,init_data->irq,init_data->irq_base,pmic_plat_data->gpio_base);
        return ret;
 
 err: