diff options
Diffstat (limited to 'include/linux/i2c/twl4030.h')
-rw-r--r-- | include/linux/i2c/twl4030.h | 90 |
1 files changed, 51 insertions, 39 deletions
diff --git a/include/linux/i2c/twl4030.h b/include/linux/i2c/twl4030.h index fb604dcd38f1..8137f660a5cc 100644 --- a/include/linux/i2c/twl4030.h +++ b/include/linux/i2c/twl4030.h | |||
@@ -78,8 +78,8 @@ int twl4030_i2c_read_u8(u8 mod_no, u8 *val, u8 reg); | |||
78 | * IMPORTANT: For twl4030_i2c_write(), allocate num_bytes + 1 | 78 | * IMPORTANT: For twl4030_i2c_write(), allocate num_bytes + 1 |
79 | * for the value, and populate your data starting at offset 1. | 79 | * for the value, and populate your data starting at offset 1. |
80 | */ | 80 | */ |
81 | int twl4030_i2c_write(u8 mod_no, u8 *value, u8 reg, u8 num_bytes); | 81 | int twl4030_i2c_write(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); |
82 | int twl4030_i2c_read(u8 mod_no, u8 *value, u8 reg, u8 num_bytes); | 82 | int twl4030_i2c_read(u8 mod_no, u8 *value, u8 reg, unsigned num_bytes); |
83 | 83 | ||
84 | /*----------------------------------------------------------------------*/ | 84 | /*----------------------------------------------------------------------*/ |
85 | 85 | ||
@@ -234,6 +234,9 @@ struct twl4030_gpio_platform_data { | |||
234 | /* gpio-n should control VMMC(n+1) if BIT(n) in mmc_cd is set */ | 234 | /* gpio-n should control VMMC(n+1) if BIT(n) in mmc_cd is set */ |
235 | u8 mmc_cd; | 235 | u8 mmc_cd; |
236 | 236 | ||
237 | /* if BIT(N) is set, or VMMC(n+1) is linked, debounce GPIO-N */ | ||
238 | u32 debounce; | ||
239 | |||
237 | /* For gpio-N, bit (1 << N) in "pullups" is set if that pullup | 240 | /* For gpio-N, bit (1 << N) in "pullups" is set if that pullup |
238 | * should be enabled. Else, if that bit is set in "pulldowns", | 241 | * should be enabled. Else, if that bit is set in "pulldowns", |
239 | * that pulldown is enabled. Don't waste power by letting any | 242 | * that pulldown is enabled. Don't waste power by letting any |
@@ -278,6 +281,18 @@ struct twl4030_platform_data { | |||
278 | struct twl4030_keypad_data *keypad; | 281 | struct twl4030_keypad_data *keypad; |
279 | struct twl4030_usb_data *usb; | 282 | struct twl4030_usb_data *usb; |
280 | 283 | ||
284 | /* LDO regulators */ | ||
285 | struct regulator_init_data *vdac; | ||
286 | struct regulator_init_data *vpll1; | ||
287 | struct regulator_init_data *vpll2; | ||
288 | struct regulator_init_data *vmmc1; | ||
289 | struct regulator_init_data *vmmc2; | ||
290 | struct regulator_init_data *vsim; | ||
291 | struct regulator_init_data *vaux1; | ||
292 | struct regulator_init_data *vaux2; | ||
293 | struct regulator_init_data *vaux3; | ||
294 | struct regulator_init_data *vaux4; | ||
295 | |||
281 | /* REVISIT more to come ... _nothing_ should be hard-wired */ | 296 | /* REVISIT more to come ... _nothing_ should be hard-wired */ |
282 | }; | 297 | }; |
283 | 298 | ||
@@ -285,33 +300,6 @@ struct twl4030_platform_data { | |||
285 | 300 | ||
286 | int twl4030_sih_setup(int module); | 301 | int twl4030_sih_setup(int module); |
287 | 302 | ||
288 | /* | ||
289 | * FIXME completely stop using TWL4030_IRQ_BASE ... instead, pass the | ||
290 | * IRQ data to subsidiary devices using platform device resources. | ||
291 | */ | ||
292 | |||
293 | /* IRQ information-need base */ | ||
294 | #include <mach/irqs.h> | ||
295 | /* TWL4030 interrupts */ | ||
296 | |||
297 | /* #define TWL4030_MODIRQ_GPIO (TWL4030_IRQ_BASE + 0) */ | ||
298 | #define TWL4030_MODIRQ_KEYPAD (TWL4030_IRQ_BASE + 1) | ||
299 | #define TWL4030_MODIRQ_BCI (TWL4030_IRQ_BASE + 2) | ||
300 | #define TWL4030_MODIRQ_MADC (TWL4030_IRQ_BASE + 3) | ||
301 | /* #define TWL4030_MODIRQ_USB (TWL4030_IRQ_BASE + 4) */ | ||
302 | /* #define TWL4030_MODIRQ_PWR (TWL4030_IRQ_BASE + 5) */ | ||
303 | |||
304 | #define TWL4030_PWRIRQ_PWRBTN (TWL4030_PWR_IRQ_BASE + 0) | ||
305 | /* #define TWL4030_PWRIRQ_CHG_PRES (TWL4030_PWR_IRQ_BASE + 1) */ | ||
306 | /* #define TWL4030_PWRIRQ_USB_PRES (TWL4030_PWR_IRQ_BASE + 2) */ | ||
307 | /* #define TWL4030_PWRIRQ_RTC (TWL4030_PWR_IRQ_BASE + 3) */ | ||
308 | /* #define TWL4030_PWRIRQ_HOT_DIE (TWL4030_PWR_IRQ_BASE + 4) */ | ||
309 | /* #define TWL4030_PWRIRQ_PWROK_TIMEOUT (TWL4030_PWR_IRQ_BASE + 5) */ | ||
310 | /* #define TWL4030_PWRIRQ_MBCHG (TWL4030_PWR_IRQ_BASE + 6) */ | ||
311 | /* #define TWL4030_PWRIRQ_SC_DETECT (TWL4030_PWR_IRQ_BASE + 7) */ | ||
312 | |||
313 | /* Rest are unsued currently*/ | ||
314 | |||
315 | /* Offsets to Power Registers */ | 303 | /* Offsets to Power Registers */ |
316 | #define TWL4030_VDAC_DEV_GRP 0x3B | 304 | #define TWL4030_VDAC_DEV_GRP 0x3B |
317 | #define TWL4030_VDAC_DEDICATED 0x3E | 305 | #define TWL4030_VDAC_DEDICATED 0x3E |
@@ -322,16 +310,6 @@ int twl4030_sih_setup(int module); | |||
322 | #define TWL4030_VAUX3_DEV_GRP 0x1F | 310 | #define TWL4030_VAUX3_DEV_GRP 0x1F |
323 | #define TWL4030_VAUX3_DEDICATED 0x22 | 311 | #define TWL4030_VAUX3_DEDICATED 0x22 |
324 | 312 | ||
325 | /* TWL4030 GPIO interrupt definitions */ | ||
326 | |||
327 | #define TWL4030_GPIO_IRQ_NO(n) (TWL4030_GPIO_IRQ_BASE + (n)) | ||
328 | |||
329 | /* | ||
330 | * Exported TWL4030 GPIO APIs | ||
331 | * | ||
332 | * WARNING -- use standard GPIO and IRQ calls instead; these will vanish. | ||
333 | */ | ||
334 | int twl4030_set_gpio_debounce(int gpio, int enable); | ||
335 | 313 | ||
336 | #if defined(CONFIG_TWL4030_BCI_BATTERY) || \ | 314 | #if defined(CONFIG_TWL4030_BCI_BATTERY) || \ |
337 | defined(CONFIG_TWL4030_BCI_BATTERY_MODULE) | 315 | defined(CONFIG_TWL4030_BCI_BATTERY_MODULE) |
@@ -340,4 +318,38 @@ int twl4030_set_gpio_debounce(int gpio, int enable); | |||
340 | static inline int twl4030charger_usb_en(int enable) { return 0; } | 318 | static inline int twl4030charger_usb_en(int enable) { return 0; } |
341 | #endif | 319 | #endif |
342 | 320 | ||
321 | /*----------------------------------------------------------------------*/ | ||
322 | |||
323 | /* Linux-specific regulator identifiers ... for now, we only support | ||
324 | * the LDOs, and leave the three buck converters alone. VDD1 and VDD2 | ||
325 | * need to tie into hardware based voltage scaling (cpufreq etc), while | ||
326 | * VIO is generally fixed. | ||
327 | */ | ||
328 | |||
329 | /* EXTERNAL dc-to-dc buck converters */ | ||
330 | #define TWL4030_REG_VDD1 0 | ||
331 | #define TWL4030_REG_VDD2 1 | ||
332 | #define TWL4030_REG_VIO 2 | ||
333 | |||
334 | /* EXTERNAL LDOs */ | ||
335 | #define TWL4030_REG_VDAC 3 | ||
336 | #define TWL4030_REG_VPLL1 4 | ||
337 | #define TWL4030_REG_VPLL2 5 /* not on all chips */ | ||
338 | #define TWL4030_REG_VMMC1 6 | ||
339 | #define TWL4030_REG_VMMC2 7 /* not on all chips */ | ||
340 | #define TWL4030_REG_VSIM 8 /* not on all chips */ | ||
341 | #define TWL4030_REG_VAUX1 9 /* not on all chips */ | ||
342 | #define TWL4030_REG_VAUX2_4030 10 /* (twl4030-specific) */ | ||
343 | #define TWL4030_REG_VAUX2 11 /* (twl5030 and newer) */ | ||
344 | #define TWL4030_REG_VAUX3 12 /* not on all chips */ | ||
345 | #define TWL4030_REG_VAUX4 13 /* not on all chips */ | ||
346 | |||
347 | /* INTERNAL LDOs */ | ||
348 | #define TWL4030_REG_VINTANA1 14 | ||
349 | #define TWL4030_REG_VINTANA2 15 | ||
350 | #define TWL4030_REG_VINTDIG 16 | ||
351 | #define TWL4030_REG_VUSB1V5 17 | ||
352 | #define TWL4030_REG_VUSB1V8 18 | ||
353 | #define TWL4030_REG_VUSB3V1 19 | ||
354 | |||
343 | #endif /* End of __TWL4030_H */ | 355 | #endif /* End of __TWL4030_H */ |