summaryrefslogtreecommitdiff
path: root/include/power
diff options
context:
space:
mode:
authorTom Rini <trini@ti.com>2014-06-05 11:15:29 -0400
committerTom Rini <trini@ti.com>2014-06-06 17:46:16 -0400
commit86db550b3864bcb3c9567fbdb67b49a244f5263e (patch)
tree14b6cafe45b6975e8f63cf5caa07b6bdebf6f076 /include/power
parent64ce2fbd6c9ebb68e274ae1b3c449e1cae86c5b6 (diff)
downloadu-boot-imx-86db550b3864bcb3c9567fbdb67b49a244f5263e.zip
u-boot-imx-86db550b3864bcb3c9567fbdb67b49a244f5263e.tar.gz
u-boot-imx-86db550b3864bcb3c9567fbdb67b49a244f5263e.tar.bz2
power: Add support for the TPS65218 PMIC
Add a driver for the TPS65218 PMIC which is used by TI AM43xx SoCs and may be used by TI AM335x SoCs. Signed-off-by: Tom Rini <trini@ti.com>
Diffstat (limited to 'include/power')
-rw-r--r--include/power/tps65218.h63
1 files changed, 63 insertions, 0 deletions
diff --git a/include/power/tps65218.h b/include/power/tps65218.h
new file mode 100644
index 0000000..67aa2f8
--- /dev/null
+++ b/include/power/tps65218.h
@@ -0,0 +1,63 @@
+/*
+ * (C) Copyright 2014
+ * Texas Instruments, <www.ti.com>
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ */
+
+#ifndef __POWER_TPS65218_H__
+#define __POWER_TPS65218_H__
+
+/* I2C chip address */
+#define TPS65218_CHIP_PM 0x24
+
+/* Registers */
+enum {
+ TPS65218_CHIPID = 0x00,
+ TPS65218_INT1,
+ TPS65218_INT2,
+ TPS65218_INT_MASK1,
+ TPS65218_INT_MASK2,
+ TPS65218_STATUS,
+ TPS65218_CONTROL,
+ TPS65218_FLAG,
+ TPS65218_PASSWORD = 0x10,
+ TPS65218_ENABLE1,
+ TPS65218_ENABLE2,
+ TPS65218_CONFIG1,
+ TPS65218_CONFIG2,
+ TPS65218_CONFIG3,
+ TPS65218_DCDC1,
+ TPS65218_DCDC2,
+ TPS65218_DCDC3,
+ TPS65218_DCDC4,
+ TPS65218_SLEW,
+ TPS65218_LDO1,
+ TPS65218_SEQ1 = 0x20,
+ TPS65218_SEQ2,
+ TPS65218_SEQ3,
+ TPS65218_SEQ4,
+ TPS65218_SEQ5,
+ TPS65218_SEQ6,
+ TPS65218_SEQ7,
+ TPS65218_PMIC_NUM_OF_REGS,
+};
+
+#define TPS65218_PROT_LEVEL_NONE 0x00
+#define TPS65218_PROT_LEVEL_1 0x01
+#define TPS65218_PROT_LEVEL_2 0x02
+
+#define TPS65218_PASSWORD_LOCK_FOR_WRITE 0x00
+#define TPS65218_PASSWORD_UNLOCK 0x7D
+
+#define TPS65218_DCDC_GO 0x80
+
+#define TPS65218_MASK_ALL_BITS 0xFF
+
+#define TPS65218_DCDC_VOLT_SEL_1100MV 0x19
+#define TPS65218_DCDC_VOLT_SEL_1330MV 0x30
+
+int tps65218_reg_write(uchar prot_level, uchar dest_reg, uchar dest_val,
+ uchar mask);
+int tps65218_voltage_update(uchar dc_cntrl_reg, uchar volt_sel);
+#endif /* __POWER_TPS65218_H__ */