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,
#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)
},
};
-#define TPS65910_SPEED 400 * 1000
+#define TPS65910_SPEED 200 * 1000
static int tps65910_i2c_read(struct tps65910 *tps65910, u8 reg,
int bytes, void *dest)
xfer[0].flags = 0;
xfer[0].len = 1;
xfer[0].buf = ®
- 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++)
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: