summaryrefslogtreecommitdiff
path: root/include/twl6030.h
diff options
context:
space:
mode:
authorOleg Kosheliev <oleg.kosheliev@ti.com>2013-10-08 15:49:55 +0300
committerTom Rini <trini@ti.com>2013-12-04 08:11:28 -0500
commitfc8895035b0d00d22d4edc6b327cb1805baa5872 (patch)
tree2a3d437aedabded5b409f7de2f427a028e4a2661 /include/twl6030.h
parent87b94a43d69ec0760b94f2753b7cafc6cb14b034 (diff)
downloadu-boot-imx-fc8895035b0d00d22d4edc6b327cb1805baa5872.zip
u-boot-imx-fc8895035b0d00d22d4edc6b327cb1805baa5872.tar.gz
u-boot-imx-fc8895035b0d00d22d4edc6b327cb1805baa5872.tar.bz2
ARMV7: OMAP4: Add struct for twl603x data
The data struct is used to support different PMIC chip types. It contains the chip type and the data (e.g. registers addresses, adc multiplier) which is different for twl6030 and twl6032. Replaced some hardcoded values with the structure vars. Based on Balaji T K <balajitk@ti.com> patches for TI u-boot. Signed-off-by: Oleg Kosheliev <oleg.kosheliev@ti.com>
Diffstat (limited to 'include/twl6030.h')
-rw-r--r--include/twl6030.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/include/twl6030.h b/include/twl6030.h
index b4035ba..9399737 100644
--- a/include/twl6030.h
+++ b/include/twl6030.h
@@ -113,6 +113,24 @@
#define GPCH0_LSB 0x57
#define GPCH0_MSB 0x58
+#define TWL6030_VBAT_MULT 40 * 1000
+
+#define TWL6030_VBAT_SHIFT (10 + 3)
+
+enum twl603x_chip_type{
+ chip_TWL6030,
+ chip_TWL603X_cnt
+};
+
+struct twl6030_data{
+ u8 chip_type;
+ u8 adc_rbase;
+ u8 adc_ctrl;
+ u8 adc_enable;
+ int vbat_mult;
+ int vbat_shift;
+};
+
/* Functions to read and write from TWL6030 */
static inline int twl6030_i2c_write_u8(u8 chip_no, u8 reg, u8 val)
{