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
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
,
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
{
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
;
69
};
70
71
/* I2C device address for pmic max77686 */
72
#define MAX77686_I2C_ADDR (0x12 >> 1)
73
74
enum
{
75
REG_DISABLE
= 0,
76
REG_ENABLE
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
max77686_regnum
Definition:
max77686.h:6
PMIC_LDO18
@ PMIC_LDO18
Definition:
max77686.h:33
PMIC_BUCK4
@ PMIC_BUCK4
Definition:
max77686.h:10
PMIC_BUCK3
@ PMIC_BUCK3
Definition:
max77686.h:9
PMIC_LDO4
@ PMIC_LDO4
Definition:
max77686.h:19
PMIC_LDO25
@ PMIC_LDO25
Definition:
max77686.h:40
PMIC_LDO11
@ PMIC_LDO11
Definition:
max77686.h:26
PMIC_EN32KHZ_CP
@ PMIC_EN32KHZ_CP
Definition:
max77686.h:42
PMIC_BUCK8
@ PMIC_BUCK8
Definition:
max77686.h:14
PMIC_LDO8
@ PMIC_LDO8
Definition:
max77686.h:23
PMIC_LDO15
@ PMIC_LDO15
Definition:
max77686.h:30
PMIC_LDO3
@ PMIC_LDO3
Definition:
max77686.h:18
PMIC_BUCK6
@ PMIC_BUCK6
Definition:
max77686.h:12
PMIC_BUCK1
@ PMIC_BUCK1
Definition:
max77686.h:7
PMIC_LDO22
@ PMIC_LDO22
Definition:
max77686.h:37
PMIC_LDO23
@ PMIC_LDO23
Definition:
max77686.h:38
PMIC_LDO1
@ PMIC_LDO1
Definition:
max77686.h:16
PMIC_LDO2
@ PMIC_LDO2
Definition:
max77686.h:17
PMIC_LDO7
@ PMIC_LDO7
Definition:
max77686.h:22
PMIC_LDO20
@ PMIC_LDO20
Definition:
max77686.h:35
PMIC_BUCK9
@ PMIC_BUCK9
Definition:
max77686.h:15
PMIC_LDO13
@ PMIC_LDO13
Definition:
max77686.h:28
PMIC_LDO9
@ PMIC_LDO9
Definition:
max77686.h:24
PMIC_LDO16
@ PMIC_LDO16
Definition:
max77686.h:31
PMIC_LDO19
@ PMIC_LDO19
Definition:
max77686.h:34
PMIC_LDO5
@ PMIC_LDO5
Definition:
max77686.h:20
PMIC_LDO14
@ PMIC_LDO14
Definition:
max77686.h:29
PMIC_BUCK5
@ PMIC_BUCK5
Definition:
max77686.h:11
PMIC_BUCK2
@ PMIC_BUCK2
Definition:
max77686.h:8
PMIC_LDO10
@ PMIC_LDO10
Definition:
max77686.h:25
PMIC_LDO26
@ PMIC_LDO26
Definition:
max77686.h:41
PMIC_LDO12
@ PMIC_LDO12
Definition:
max77686.h:27
PMIC_LDO17
@ PMIC_LDO17
Definition:
max77686.h:32
PMIC_LDO6
@ PMIC_LDO6
Definition:
max77686.h:21
PMIC_BUCK7
@ PMIC_BUCK7
Definition:
max77686.h:13
PMIC_LDO24
@ PMIC_LDO24
Definition:
max77686.h:39
PMIC_LDO21
@ PMIC_LDO21
Definition:
max77686.h:36
MAX77686_UV
@ MAX77686_UV
Definition:
max77686.h:81
MAX77686_MV
@ MAX77686_MV
Definition:
max77686.h:80
REG_ENABLE
@ REG_ENABLE
Definition:
max77686.h:76
REG_DISABLE
@ REG_DISABLE
Definition:
max77686.h:75
max77686_volsetting
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
max77686_disable_backup_batt
int max77686_disable_backup_batt(unsigned int bus)
Disable charging of the RTC backup battery.
Definition:
max77686.c:190
max77686_enable_32khz_cp
int max77686_enable_32khz_cp(unsigned int bus)
This function enables the 32KHz coprocessor clock.
Definition:
max77686.c:185
u16
uint16_t u16
Definition:
stdint.h:48
u8
uint8_t u8
Definition:
stdint.h:45
bus
Definition:
device.h:76
max77686_para
struct max77686_para - max77686 register parameters
Definition:
max77686.h:58
max77686_para::reg_enbitoff
u8 reg_enbitoff
Definition:
max77686.h:66
max77686_para::vol_div
u16 vol_div
Definition:
max77686.h:68
max77686_para::vol_bitpos
u8 vol_bitpos
Definition:
max77686.h:60
max77686_para::reg_enbitpos
u8 reg_enbitpos
Definition:
max77686.h:63
max77686_para::reg_enbitmask
u8 reg_enbitmask
Definition:
max77686.h:64
max77686_para::reg_enaddr
u8 reg_enaddr
Definition:
max77686.h:62
max77686_para::vol_addr
u8 vol_addr
Definition:
max77686.h:59
max77686_para::vol_bitmask
u8 vol_bitmask
Definition:
max77686.h:61
max77686_para::vol_min
u16 vol_min
Definition:
max77686.h:67
max77686_para::reg_enbiton
u8 reg_enbiton
Definition:
max77686.h:65
src
drivers
maxim
max77686
max77686.h
Generated by
1.9.1