3 * Texas Instruments, <www.ti.com>
5 * SPDX-License-Identifier: GPL-2.0+
8 #ifndef __POWER_TPS65218_H__
9 #define __POWER_TPS65218_H__
11 #include <linux/bitops.h>
13 /* I2C chip address */
14 #define TPS65218_CHIP_PM 0x24
18 TPS65218_CHIPID = 0x00,
26 TPS65218_PASSWORD = 0x10,
45 TPS65218_PMIC_NUM_OF_REGS,
48 #define TPS65218_PROT_LEVEL_NONE 0x00
49 #define TPS65218_PROT_LEVEL_1 0x01
50 #define TPS65218_PROT_LEVEL_2 0x02
52 #define TPS65218_PASSWORD_LOCK_FOR_WRITE 0x00
53 #define TPS65218_PASSWORD_UNLOCK 0x7D
55 #define TPS65218_DCDC_GO 0x80
57 #define TPS65218_MASK_ALL_BITS 0xFF
59 #define TPS65218_DCDC_VOLT_SEL_0950MV 0x0a
60 #define TPS65218_DCDC_VOLT_SEL_1100MV 0x19
61 #define TPS65218_DCDC_VOLT_SEL_1200MV 0x23
62 #define TPS65218_DCDC_VOLT_SEL_1260MV 0x29
63 #define TPS65218_DCDC_VOLT_SEL_1330MV 0x30
65 #define TPS65218_CC_STAT (BIT(0) | BIT(1))
66 #define TPS65218_STATE (BIT(2) | BIT(3))
67 #define TPS65218_PB_STATE BIT(4)
68 #define TPS65218_AC_STATE BIT(5)
69 #define TPS65218_EE BIT(6)
70 #define TPS65218_FSEAL BIT(7)
72 int tps65218_reg_read(uchar dest_reg, uchar *dest_val);
73 int tps65218_reg_write(uchar prot_level, uchar dest_reg, uchar dest_val,
75 int tps65218_voltage_update(uchar dc_cntrl_reg, uchar volt_sel);
76 int tps65218_toggle_fseal(void);
77 int tps65218_lock_fseal(void);
78 int power_tps65218_init(unsigned char bus);
79 #endif /* __POWER_TPS65218_H__ */