summaryrefslogtreecommitdiff
path: root/include/linux/i2c
diff options
context:
space:
mode:
authornagesh Penumarty <vpenumarty@nvidia.com>2011-04-11 14:59:28 +0530
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:43:01 -0800
commitf501c93f859761f4f884a374b72179f164b2742c (patch)
tree1c9fd55d4dd5db86b2d450fa3a264d530066ea54 /include/linux/i2c
parentf8c8e059b8fe4c6886b00fc38b634f880249eb6d (diff)
drivers: regulator: Adding the regulator driver
Adding the TI 6025 PMU regulator driver. Original-Change-Id: I8ad675711bbe2ae942bcc0e32b711883eae215b4 Reviewed-on: http://git-master/r/27342 Tested-by: Venkata Nageswara Penumarty <vpenumarty@nvidia.com> Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com> Original-Change-Id: Ib91f033c557bb7f4c87522ae4f5c7922a62f71f8 Rebase-Id: R690581a1fd604a9232474fc47982050691051f11
Diffstat (limited to 'include/linux/i2c')
-rw-r--r--include/linux/i2c/twl.h56
1 files changed, 55 insertions, 1 deletions
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h
index 114c0f6fc63d..bd126405f10f 100644
--- a/include/linux/i2c/twl.h
+++ b/include/linux/i2c/twl.h
@@ -82,6 +82,10 @@
#define TWL_MODULE_RTC TWL4030_MODULE_RTC
#define TWL_MODULE_PWM TWL4030_MODULE_PWM0
+#define TWL6030_MODULE_CHARGER TWL4030_MODULE_MAIN_CHARGE
+#define TWL6025_MODULE_CHARGER 0x18
+
+#define TWL6030_MODULE_GASGAUGE 0x0B
#define TWL6030_MODULE_ID0 0x0D
#define TWL6030_MODULE_ID1 0x0E
#define TWL6030_MODULE_ID2 0x0F
@@ -108,6 +112,7 @@
#define GASGAUGE_INTR_OFFSET 17
#define USBOTG_INTR_OFFSET 4
#define CHARGER_INTR_OFFSET 2
+#define GPADCSW_INTR_OFFSET 1
#define RSV_INTR_OFFSET 0
/* INT register offsets */
@@ -173,12 +178,21 @@ TWL_CLASS_IS(6030, TWL6030_CLASS_ID)
#define TWL6025_SUBCLASS BIT(4) /* TWL6025 has changed registers */
+/* So we can recover the features in other parts of twl stack */
+unsigned int twl_features(void);
+
+/* so we can get at the EPROM SMPS OFFSET/MULT stuff */
+u8 twl_get_smps_offset(void);
+u8 twl_get_smps_mult(void);
+
/*
* Read and write single 8-bit registers
*/
int twl_i2c_write_u8(u8 mod_no, u8 val, u8 reg);
int twl_i2c_read_u8(u8 mod_no, u8 *val, u8 reg);
+void twl_reg_dump(int module, int start, int end);
+
/*
* Read and write several 8-bit registers at once.
*
@@ -215,6 +229,10 @@ static inline int twl6030_mmc_card_detect(struct device *dev, int slot)
return -EIO;
}
#endif
+
+int twl6030_set_usb_charge_enable(int enable);
+int twl6030_set_usb_in_current(int currentmA);
+
/*----------------------------------------------------------------------*/
/*
@@ -556,7 +574,22 @@ struct twl4030_clock_init_data {
struct twl4030_bci_platform_data {
int *battery_tmp_tbl;
- unsigned int tblsize;
+ unsigned int battery_tmp_tblsize;
+ int *battery_volt_tbl;
+ unsigned int battery_volt_tblsize;
+ unsigned int monitoring_interval;
+
+ unsigned int max_charger_currentmA;
+ unsigned int max_charger_voltagemV;
+ unsigned int termination_currentmA;
+
+ unsigned int max_bat_voltagemV;
+ unsigned int low_bat_voltagemV;
+
+ /* twl6025 */
+ unsigned int use_hw_charger;
+ unsigned int use_eeprom_config;
+ unsigned int power_path;
};
/* TWL4030_GPIO_MAX (18) GPIOs, with interrupts */
@@ -621,6 +654,7 @@ struct twl4030_usb_data {
int (*phy_set_clock)(struct device *dev, int on);
/* suspend/resume of phy */
int (*phy_suspend)(struct device *dev, int suspend);
+ int (*board_control_power)(struct device *dev, int on);
};
struct twl4030_ins {
@@ -696,6 +730,10 @@ struct twl4030_audio_data {
struct twl4030_platform_data {
unsigned irq_base, irq_end;
+
+ /* Callback for boar regulator initialisation */
+ int (*init)(void);
+
struct twl4030_clock_init_data *clock;
struct twl4030_bci_platform_data *bci;
struct twl4030_gpio_platform_data *gpio;
@@ -822,6 +860,22 @@ static inline int twl4030charger_usb_en(int enable) { return 0; }
#define TWL6030_REG_VDAC 45
#define TWL6030_REG_VUSB 46
+/* These are renamed in 6025 but same registers */
+#define TWL6025_REG_LDO2 48
+#define TWL6025_REG_LDO4 49
+#define TWL6025_REG_LDO3 50
+#define TWL6025_REG_LDO5 51
+#define TWL6025_REG_LDO1 52
+#define TWL6025_REG_LDO7 53
+#define TWL6025_REG_LDO6 54
+#define TWL6025_REG_LDOLN 55
+#define TWL6025_REG_LDOUSB 56
+
+/* 6025 DCDC supplies */
+#define TWL6025_REG_SMPS3 57
+#define TWL6025_REG_SMPS4 58
+#define TWL6025_REG_VIO 59
+
/* INTERNAL LDOs */
#define TWL6030_REG_VRTC 47
#define TWL6030_REG_CLK32KG 48