soc/mediatek/mt8196: Initialize SSPM
[coreboot2.git] / src / drivers / maxim / max77686 / max77686.h
blobf5b85c0acfa04bace2ca1831e758d1d4ce359387
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 #ifndef __MAX77686_H_
4 #define __MAX77686_H_
6 enum max77686_regnum {
7 PMIC_BUCK1 = 0,
8 PMIC_BUCK2,
9 PMIC_BUCK3,
10 PMIC_BUCK4,
11 PMIC_BUCK5,
12 PMIC_BUCK6,
13 PMIC_BUCK7,
14 PMIC_BUCK8,
15 PMIC_BUCK9,
16 PMIC_LDO1,
17 PMIC_LDO2,
18 PMIC_LDO3,
19 PMIC_LDO4,
20 PMIC_LDO5,
21 PMIC_LDO6,
22 PMIC_LDO7,
23 PMIC_LDO8,
24 PMIC_LDO9,
25 PMIC_LDO10,
26 PMIC_LDO11,
27 PMIC_LDO12,
28 PMIC_LDO13,
29 PMIC_LDO14,
30 PMIC_LDO15,
31 PMIC_LDO16,
32 PMIC_LDO17,
33 PMIC_LDO18,
34 PMIC_LDO19,
35 PMIC_LDO20,
36 PMIC_LDO21,
37 PMIC_LDO22,
38 PMIC_LDO23,
39 PMIC_LDO24,
40 PMIC_LDO25,
41 PMIC_LDO26,
42 PMIC_EN32KHZ_CP,
45 /**
46 * struct max77686_para - max77686 register parameters
47 * @param vol_addr i2c address of the given buck/ldo register
48 * @param vol_bitpos bit position to be set or clear within register
49 * @param vol_bitmask bit mask value
50 * @param reg_enaddr control register address, which enable the given
51 * buck/ldo.
52 * @param reg_enbitpos bit position to be enabled
53 * @param reg_enbiton value to be written to buck/ldo to make it ON
54 * @param reg_enbitoff value to be written to buck/ldo to make it OFF
55 * @param vol_min minimum voltage level supported by given buck/ldo
56 * @param vol_div voltage division value of given buck/ldo
58 struct max77686_para {
59 u8 vol_addr;
60 u8 vol_bitpos;
61 u8 vol_bitmask;
62 u8 reg_enaddr;
63 u8 reg_enbitpos;
64 u8 reg_enbitmask;
65 u8 reg_enbiton;
66 u8 reg_enbitoff;
67 u16 vol_min;
68 u16 vol_div;
71 /* I2C device address for pmic max77686 */
72 #define MAX77686_I2C_ADDR (0x12 >> 1)
74 enum {
75 REG_DISABLE = 0,
76 REG_ENABLE
79 enum {
80 MAX77686_MV = 0, /* millivolt */
81 MAX77686_UV /* microvolt */
84 /**
85 * This function enables the 32KHz coprocessor clock.
87 * @param bus i2c bus
89 * Return 0 if ok, else -1
91 int max77686_enable_32khz_cp(unsigned int bus);
93 /**
94 * Set the required voltage level of pmic
96 * @param bus i2c bus
97 * @param reg register number of buck/ldo to be set
98 * @param volt voltage level to be set
99 * @param enable enable or disable bit
100 * @param volt_units MAX77686_MV or MAX77686_UV, unit of the
101 * voltage parameters
103 * @return Return 0 if ok, else -1
105 int max77686_volsetting(unsigned int bus, enum max77686_regnum reg,
106 unsigned int volt, int enable, int volt_units);
109 * Disable charging of the RTC backup battery
111 * @param bus i2c bus
113 * @return Return 0 if ok, else -1
115 int max77686_disable_backup_batt(unsigned int bus);
117 #endif /* __MAX77686_H_ */