Remove un-needed i2c.h include
[coreboot.git] / src / drivers / power / max77686.h
blob345471eb21b4d4247baa133facfbd084fc5aeba4
1 /*
2 * Copyright (C) 2012 Samsung Electronics
3 * Alim Akhtar <alim.akhtar@samsung.com>
5 * See file CREDITS for list of people who contributed to this
6 * project.
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21 * MA 02111-1307 USA
24 #ifndef __MAX77686_H_
25 #define __MAX77686_H_
27 enum max77686_regnum {
28 PMIC_BUCK1 = 0,
29 PMIC_BUCK2,
30 PMIC_BUCK3,
31 PMIC_BUCK4,
32 PMIC_BUCK5,
33 PMIC_BUCK6,
34 PMIC_BUCK7,
35 PMIC_BUCK8,
36 PMIC_BUCK9,
37 PMIC_LDO1,
38 PMIC_LDO2,
39 PMIC_LDO3,
40 PMIC_LDO4,
41 PMIC_LDO5,
42 PMIC_LDO6,
43 PMIC_LDO7,
44 PMIC_LDO8,
45 PMIC_LDO9,
46 PMIC_LDO10,
47 PMIC_LDO11,
48 PMIC_LDO12,
49 PMIC_LDO13,
50 PMIC_LDO14,
51 PMIC_LDO15,
52 PMIC_LDO16,
53 PMIC_LDO17,
54 PMIC_LDO18,
55 PMIC_LDO19,
56 PMIC_LDO20,
57 PMIC_LDO21,
58 PMIC_LDO22,
59 PMIC_LDO23,
60 PMIC_LDO24,
61 PMIC_LDO25,
62 PMIC_LDO26,
63 PMIC_EN32KHZ_CP,
66 /**
67 * struct max77686_para - max77686 register parameters
68 * @param vol_addr i2c address of the given buck/ldo register
69 * @param vol_bitpos bit position to be set or clear within register
70 * @param vol_bitmask bit mask value
71 * @param reg_enaddr control register address, which enable the given
72 * given buck/ldo.
73 * @param reg_enbitpos bit position to be enabled
74 * @param reg_enbiton value to be written to buck/ldo to make it ON
75 * @param reg_enbitoff value to be written to buck/ldo to make it OFF
76 * @param vol_min minimum voltage level supported by given buck/ldo
77 * @param vol_div voltage division value of given buck/ldo
79 struct max77686_para {
80 enum max77686_regnum regnum;
81 u8 vol_addr;
82 u8 vol_bitpos;
83 u8 vol_bitmask;
84 u8 reg_enaddr;
85 u8 reg_enbitpos;
86 u8 reg_enbitmask;
87 u8 reg_enbiton;
88 u8 reg_enbitoff;
89 u32 vol_min;
90 u32 vol_div;
93 /* I2C device address for pmic max77686 */
94 #define MAX77686_I2C_ADDR (0x12 >> 1)
96 enum {
97 REG_DISABLE = 0,
98 REG_ENABLE
101 enum {
102 MAX77686_MV = 0, /* mili volt */
103 MAX77686_UV /* micro volt */
107 * This function enables the 32KHz coprocessor clock.
109 * Return 0 if ok, else -1
111 int max77686_enable_32khz_cp(void);
114 * Set the required voltage level of pmic
116 * @param reg register number of buck/ldo to be set
117 * @param volt voltage level to be set
118 * @param enable enable or disable bit
119 * @param volt_units MAX77686_MV or MAX77686_UV, unit of the
120 * voltage parameters
122 * @return Return 0 if ok, else -1
124 int max77686_volsetting(enum max77686_regnum reg, unsigned int volt,
125 int enable, int volt_units);
128 * Disable charging of the RTC backup battery
130 * @return Return 0 if ok, else -1
132 int max77686_disable_backup_batt(void);
134 #endif /* __MAX77686_PMIC_H_ */