4 * Copyright (c) 2014 Samsung Electronics Co., Ltd
5 * http://www.samsung.com
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2 of the License, or (at your
10 * option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
19 #ifndef __LINUX_MFD_S2MPU02_H
20 #define __LINUX_MFD_S2MPU02_H
22 /* S2MPU02 registers */
100 S2MPU02_REG_LDODSCH2
,
101 S2MPU02_REG_LDODSCH3
,
102 S2MPU02_REG_LDODSCH4
,
112 /* S2MPU02 regulator ids */
113 enum S2MPU02_regulators
{
150 S2MPU02_REGULATOR_MAX
,
153 /* Regulator constraints for BUCKx */
154 #define S2MPU02_BUCK1234_MIN_600MV 600000
155 #define S2MPU02_BUCK5_MIN_1081_25MV 1081250
156 #define S2MPU02_BUCK6_MIN_1700MV 1700000
157 #define S2MPU02_BUCK7_MIN_900MV 900000
159 #define S2MPU02_BUCK1234_STEP_6_25MV 6250
160 #define S2MPU02_BUCK5_STEP_6_25MV 6250
161 #define S2MPU02_BUCK6_STEP_2_50MV 2500
162 #define S2MPU02_BUCK7_STEP_6_25MV 6250
164 #define S2MPU02_BUCK1234_START_SEL 0x00
165 #define S2MPU02_BUCK5_START_SEL 0x4D
166 #define S2MPU02_BUCK6_START_SEL 0x28
167 #define S2MPU02_BUCK7_START_SEL 0x30
169 #define S2MPU02_BUCK_RAMP_DELAY 12500
171 /* Regulator constraints for different types of LDOx */
172 #define S2MPU02_LDO_MIN_900MV 900000
173 #define S2MPU02_LDO_MIN_1050MV 1050000
174 #define S2MPU02_LDO_MIN_1600MV 1600000
175 #define S2MPU02_LDO_STEP_12_5MV 12500
176 #define S2MPU02_LDO_STEP_25MV 25000
177 #define S2MPU02_LDO_STEP_50MV 50000
179 #define S2MPU02_LDO_GROUP1_START_SEL 0x8
180 #define S2MPU02_LDO_GROUP2_START_SEL 0xA
181 #define S2MPU02_LDO_GROUP3_START_SEL 0x10
183 #define S2MPU02_LDO_VSEL_MASK 0x3F
184 #define S2MPU02_BUCK_VSEL_MASK 0xFF
185 #define S2MPU02_ENABLE_MASK (0x03 << S2MPU02_ENABLE_SHIFT)
186 #define S2MPU02_ENABLE_SHIFT 6
188 /* On/Off controlled by PWREN */
189 #define S2MPU02_ENABLE_SUSPEND (0x01 << S2MPU02_ENABLE_SHIFT)
190 #define S2MPU02_DISABLE_SUSPEND (0x11 << S2MPU02_ENABLE_SHIFT)
191 #define S2MPU02_LDO_N_VOLTAGES (S2MPU02_LDO_VSEL_MASK + 1)
192 #define S2MPU02_BUCK_N_VOLTAGES (S2MPU02_BUCK_VSEL_MASK + 1)
194 /* RAMP delay for BUCK1234*/
195 #define S2MPU02_BUCK1_RAMP_SHIFT 6
196 #define S2MPU02_BUCK2_RAMP_SHIFT 4
197 #define S2MPU02_BUCK3_RAMP_SHIFT 2
198 #define S2MPU02_BUCK4_RAMP_SHIFT 0
199 #define S2MPU02_BUCK1234_RAMP_MASK 0x3
201 #endif /* __LINUX_MFD_S2MPU02_H */