static struct twl6030_data *twl;
static struct twl6030_data twl6030_info = {
.chip_type = chip_TWL6030,
.adc_enable = CTRL_P2_SP2,
.vbat_mult = TWL6030_VBAT_MULT,
.vbat_shift = TWL6030_VBAT_SHIFT,
static struct twl6030_data twl6032_info = {
.chip_type = chip_TWL6032,
.adc_rbase = TWL6032_GPCH0_LSB,
.adc_ctrl = TWL6032_CTRL_P1,
.adc_enable = CTRL_P1_SP1,
.vbat_mult = TWL6032_VBAT_MULT,
.vbat_shift = TWL6032_VBAT_SHIFT,
static int twl6030_gpadc_read_channel(u8 channel_no)
ret = twl6030_i2c_read_u8(TWL6030_CHIP_ADC,
twl->adc_rbase + channel_no * 2, &lsb);
ret = twl6030_i2c_read_u8(TWL6030_CHIP_ADC,
twl->adc_rbase + 1 + channel_no * 2, &msb);
static int twl6030_gpadc_sw2_trigger(void)
ret = twl6030_i2c_write_u8(TWL6030_CHIP_ADC,
twl->adc_ctrl, twl->adc_enable);
while (!((val & CTRL_P2_EOCP2) && (!(val & CTRL_P2_BUSY)))) {