xref: /aosp_15_r20/external/coreboot/src/soc/mediatek/common/include/soc/tps65132s.h (revision b9411a12aaaa7e1e6a6fb7c5e057f44ee179a49c)
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #ifndef __SOC_MEDIATEK_TPS65132S_H__
4 #define __SOC_MEDIATEK_TPS65132S_H__
5 
6 #include <commonlib/bsd/cb_err.h>
7 #include <gpio.h>
8 
9 /* TPS65132S I2C slave address */
10 #define PMIC_TPS65132_SLAVE	0x3E
11 
12 /* TPS65132 register address */
13 #define PMIC_TPS65132_VPOS	0x00
14 #define PMIC_TPS65132_VNEG	0x01
15 #define PMIC_TPS65132_DLYX	0x02
16 /* Sequencing at startup and shutdown Field */
17 #define PMIC_TPS65132_ASSDD	0x03
18 #define PMIC_TPS65132_CONTROL	0xFF
19 
20 struct tps65132s_reg_setting {
21 	u8 addr;
22 	u8 val;
23 	u8 mask;
24 };
25 
26 struct tps65132s_cfg {
27 	uint32_t i2c_bus;
28 	gpio_t en;
29 	gpio_t sync;
30 	const struct tps65132s_reg_setting *settings;
31 	uint32_t setting_counts;
32 };
33 
34 enum cb_err tps65132s_setup(const struct tps65132s_cfg *cfg);
35 
36 #endif /* __SOC_MEDIATEK_TPS65132S_H__ */
37