summaryrefslogtreecommitdiff
path: root/include/power
diff options
context:
space:
mode:
authorNikita Kiryanov <nikita@compulab.co.il>2016-02-19 19:19:46 +0200
committerTom Rini <trini@konsulko.com>2016-02-24 18:44:07 -0500
commit9bcfca123cbcf73234ba5b82e62d189d536d1ef2 (patch)
treecc05fe40069ba4b4c1f6f87ccda37414776745ff /include/power
parent5dc5a8cac7fd4965c92269451819b46bc6fe4b70 (diff)
downloadu-boot-9bcfca123cbcf73234ba5b82e62d189d536d1ef2.tar.gz
pmic: tps65218: add useful functions and defines
Add the following functions: tps65218_reg_read() for accessing redisters tps65218_toggle_fseal() for toggling the fseal bit tps65218_lock_fsea() for locking the fseal bit to 1 Add the following defines: All status register bits Cc: Tom Rini <trini@konsulko.com> Cc: Albert Aribaud <albert.u.boot@aribaud.net> Cc: Igor Grinberg <grinberg@compulab.co.il> Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il> Reviewed-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'include/power')
-rw-r--r--include/power/tps65218.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/power/tps65218.h b/include/power/tps65218.h
index 63fc7b343f..4d68faacaf 100644
--- a/include/power/tps65218.h
+++ b/include/power/tps65218.h
@@ -8,6 +8,8 @@
#ifndef __POWER_TPS65218_H__
#define __POWER_TPS65218_H__
+#include <linux/bitops.h>
+
/* I2C chip address */
#define TPS65218_CHIP_PM 0x24
@@ -60,8 +62,18 @@ enum {
#define TPS65218_DCDC_VOLT_SEL_1260MV 0x29
#define TPS65218_DCDC_VOLT_SEL_1330MV 0x30
+#define TPS65218_CC_STAT (BIT(0) | BIT(1))
+#define TPS65218_STATE (BIT(2) | BIT(3))
+#define TPS65218_PB_STATE BIT(4)
+#define TPS65218_AC_STATE BIT(5)
+#define TPS65218_EE BIT(6)
+#define TPS65218_FSEAL BIT(7)
+
+int tps65218_reg_read(uchar dest_reg, uchar *dest_val);
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);
+int tps65218_toggle_fseal(void);
+int tps65218_lock_fseal(void);
int power_tps65218_init(unsigned char bus);
#endif /* __POWER_TPS65218_H__ */