coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
max77686.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
3 #ifndef __MAX77686_H_
4 #define __MAX77686_H_
5 
7  PMIC_BUCK1 = 0,
43 };
44 
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
57  */
58 struct max77686_para {
69 };
70 
71 /* I2C device address for pmic max77686 */
72 #define MAX77686_I2C_ADDR (0x12 >> 1)
73 
74 enum {
77 };
78 
79 enum {
80  MAX77686_MV = 0, /* mili volt */
81  MAX77686_UV /* micro volt */
82 };
83 
84 /**
85  * This function enables the 32KHz coprocessor clock.
86  *
87  * @param bus i2c bus
88  *
89  * Return 0 if ok, else -1
90  */
91 int max77686_enable_32khz_cp(unsigned int bus);
92 
93 /**
94  * Set the required voltage level of pmic
95  *
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
102  *
103  * @return Return 0 if ok, else -1
104  */
105 int max77686_volsetting(unsigned int bus, enum max77686_regnum reg,
106  unsigned int volt, int enable, int volt_units);
107 
108 /**
109  * Disable charging of the RTC backup battery
110  *
111  * @param bus i2c bus
112  *
113  * @return Return 0 if ok, else -1
114  */
115 int max77686_disable_backup_batt(unsigned int bus);
116 
117 #endif /* __MAX77686_H_ */
max77686_regnum
Definition: max77686.h:6
@ PMIC_LDO18
Definition: max77686.h:33
@ PMIC_BUCK4
Definition: max77686.h:10
@ PMIC_BUCK3
Definition: max77686.h:9
@ PMIC_LDO4
Definition: max77686.h:19
@ PMIC_LDO25
Definition: max77686.h:40
@ PMIC_LDO11
Definition: max77686.h:26
@ PMIC_EN32KHZ_CP
Definition: max77686.h:42
@ PMIC_BUCK8
Definition: max77686.h:14
@ PMIC_LDO8
Definition: max77686.h:23
@ PMIC_LDO15
Definition: max77686.h:30
@ PMIC_LDO3
Definition: max77686.h:18
@ PMIC_BUCK6
Definition: max77686.h:12
@ PMIC_BUCK1
Definition: max77686.h:7
@ PMIC_LDO22
Definition: max77686.h:37
@ PMIC_LDO23
Definition: max77686.h:38
@ PMIC_LDO1
Definition: max77686.h:16
@ PMIC_LDO2
Definition: max77686.h:17
@ PMIC_LDO7
Definition: max77686.h:22
@ PMIC_LDO20
Definition: max77686.h:35
@ PMIC_BUCK9
Definition: max77686.h:15
@ PMIC_LDO13
Definition: max77686.h:28
@ PMIC_LDO9
Definition: max77686.h:24
@ PMIC_LDO16
Definition: max77686.h:31
@ PMIC_LDO19
Definition: max77686.h:34
@ PMIC_LDO5
Definition: max77686.h:20
@ PMIC_LDO14
Definition: max77686.h:29
@ PMIC_BUCK5
Definition: max77686.h:11
@ PMIC_BUCK2
Definition: max77686.h:8
@ PMIC_LDO10
Definition: max77686.h:25
@ PMIC_LDO26
Definition: max77686.h:41
@ PMIC_LDO12
Definition: max77686.h:27
@ PMIC_LDO17
Definition: max77686.h:32
@ PMIC_LDO6
Definition: max77686.h:21
@ PMIC_BUCK7
Definition: max77686.h:13
@ PMIC_LDO24
Definition: max77686.h:39
@ PMIC_LDO21
Definition: max77686.h:36
@ MAX77686_UV
Definition: max77686.h:81
@ MAX77686_MV
Definition: max77686.h:80
@ REG_ENABLE
Definition: max77686.h:76
@ REG_DISABLE
Definition: max77686.h:75
int max77686_volsetting(unsigned int bus, enum max77686_regnum reg, unsigned int volt, int enable, int volt_units)
Set the required voltage level of pmic.
Definition: max77686.c:136
int max77686_disable_backup_batt(unsigned int bus)
Disable charging of the RTC backup battery.
Definition: max77686.c:190
int max77686_enable_32khz_cp(unsigned int bus)
This function enables the 32KHz coprocessor clock.
Definition: max77686.c:185
uint16_t u16
Definition: stdint.h:48
uint8_t u8
Definition: stdint.h:45
Definition: device.h:76
struct max77686_para - max77686 register parameters
Definition: max77686.h:58
u8 reg_enbitoff
Definition: max77686.h:66
u8 reg_enbitpos
Definition: max77686.h:63
u8 reg_enbitmask
Definition: max77686.h:64
u8 vol_bitmask
Definition: max77686.h:61
u8 reg_enbiton
Definition: max77686.h:65