2 * Copyright (C) ST-Ericsson SA 2010
4 * License Terms: GNU General Public License v2
6 * Authors: Sundar Iyer <sundar.iyer@stericsson.com> for ST-Ericsson
7 * Bengt Jonsson <bengt.g.jonsson@stericsson.com> for ST-Ericsson
8 * Daniel Willerud <daniel.willerud@stericsson.com> for ST-Ericsson
11 #ifndef __LINUX_MFD_AB8500_REGULATOR_H
12 #define __LINUX_MFD_AB8500_REGULATOR_H
14 #include <linux/platform_device.h>
16 /* AB8500 regulators */
17 enum ab8500_regulator_id
{
28 AB8500_NUM_REGULATORS
,
31 /* AB8505 regulators */
32 enum ab8505_regulator_id
{
49 AB8505_NUM_REGULATORS
,
52 /* AB9540 regulators */
53 enum ab9540_regulator_id
{
68 AB9540_NUM_REGULATORS
,
71 /* AB8540 regulators */
72 enum ab8540_regulator_id
{
89 AB8540_NUM_REGULATORS
,
92 /* AB8500, AB8505, and AB9540 register initialization */
93 struct ab8500_regulator_reg_init
{
99 #define INIT_REGULATOR_REGISTER(_id, _mask, _value) \
106 /* AB8500 registers */
107 enum ab8500_regulator_reg
{
108 AB8500_REGUREQUESTCTRL2
,
109 AB8500_REGUREQUESTCTRL3
,
110 AB8500_REGUREQUESTCTRL4
,
111 AB8500_REGUSYSCLKREQ1HPVALID1
,
112 AB8500_REGUSYSCLKREQ1HPVALID2
,
113 AB8500_REGUHWHPREQ1VALID1
,
114 AB8500_REGUHWHPREQ1VALID2
,
115 AB8500_REGUHWHPREQ2VALID1
,
116 AB8500_REGUHWHPREQ2VALID2
,
117 AB8500_REGUSWHPREQVALID1
,
118 AB8500_REGUSWHPREQVALID2
,
119 AB8500_REGUSYSCLKREQVALID1
,
120 AB8500_REGUSYSCLKREQVALID2
,
123 AB8500_REGUCTRL1VAMIC
,
126 AB8500_EXTSUPPLYREGU
,
128 AB8500_VRF1VAUX3REGU
,
132 AB8500_REGUCTRL2SPARE
,
133 AB8500_REGUCTRLDISCH
,
134 AB8500_REGUCTRLDISCH2
,
135 AB8500_NUM_REGULATOR_REGISTERS
,
138 /* AB8505 registers */
139 enum ab8505_regulator_reg
{
140 AB8505_REGUREQUESTCTRL1
,
141 AB8505_REGUREQUESTCTRL2
,
142 AB8505_REGUREQUESTCTRL3
,
143 AB8505_REGUREQUESTCTRL4
,
144 AB8505_REGUSYSCLKREQ1HPVALID1
,
145 AB8505_REGUSYSCLKREQ1HPVALID2
,
146 AB8505_REGUHWHPREQ1VALID1
,
147 AB8505_REGUHWHPREQ1VALID2
,
148 AB8505_REGUHWHPREQ2VALID1
,
149 AB8505_REGUHWHPREQ2VALID2
,
150 AB8505_REGUSWHPREQVALID1
,
151 AB8505_REGUSWHPREQVALID2
,
152 AB8505_REGUSYSCLKREQVALID1
,
153 AB8505_REGUSYSCLKREQVALID2
,
154 AB8505_REGUVAUX4REQVALID
,
157 AB8505_REGUCTRL1VAMIC
,
160 AB8505_VSAFEREGU
, /* NOTE! PRCMU register */
162 AB8505_EXTSUPPLYREGU
,
164 AB8505_VRF1VAUX3REGU
,
171 AB8505_VSAFESEL1
, /* NOTE! PRCMU register */
172 AB8505_VSAFESEL2
, /* NOTE! PRCMU register */
173 AB8505_VSAFESEL3
, /* NOTE! PRCMU register */
180 AB8505_REGUCTRLDISCH
,
181 AB8505_REGUCTRLDISCH2
,
182 AB8505_REGUCTRLDISCH3
,
185 AB8505_NUM_REGULATOR_REGISTERS
,
188 /* AB9540 registers */
189 enum ab9540_regulator_reg
{
190 AB9540_REGUREQUESTCTRL1
,
191 AB9540_REGUREQUESTCTRL2
,
192 AB9540_REGUREQUESTCTRL3
,
193 AB9540_REGUREQUESTCTRL4
,
194 AB9540_REGUSYSCLKREQ1HPVALID1
,
195 AB9540_REGUSYSCLKREQ1HPVALID2
,
196 AB9540_REGUHWHPREQ1VALID1
,
197 AB9540_REGUHWHPREQ1VALID2
,
198 AB9540_REGUHWHPREQ2VALID1
,
199 AB9540_REGUHWHPREQ2VALID2
,
200 AB9540_REGUSWHPREQVALID1
,
201 AB9540_REGUSWHPREQVALID2
,
202 AB9540_REGUSYSCLKREQVALID1
,
203 AB9540_REGUSYSCLKREQVALID2
,
204 AB9540_REGUVAUX4REQVALID
,
207 AB9540_REGUCTRL1VAMIC
,
210 AB9540_VSMPS3REGU
, /* NOTE! PRCMU register */
212 AB9540_EXTSUPPLYREGU
,
214 AB9540_VRF1VAUX3REGU
,
221 AB9540_VSMPS3SEL1
, /* NOTE! PRCMU register */
222 AB9540_VSMPS3SEL2
, /* NOTE! PRCMU register */
226 AB9540_REGUCTRL2SPARE
,
230 AB9540_REGUCTRLDISCH
,
231 AB9540_REGUCTRLDISCH2
,
232 AB9540_REGUCTRLDISCH3
,
233 AB9540_NUM_REGULATOR_REGISTERS
,
236 /* AB8540 registers */
237 enum ab8540_regulator_reg
{
238 AB8540_REGUREQUESTCTRL1
,
239 AB8540_REGUREQUESTCTRL2
,
240 AB8540_REGUREQUESTCTRL3
,
241 AB8540_REGUREQUESTCTRL4
,
242 AB8540_REGUSYSCLKREQ1HPVALID1
,
243 AB8540_REGUSYSCLKREQ1HPVALID2
,
244 AB8540_REGUHWHPREQ1VALID1
,
245 AB8540_REGUHWHPREQ1VALID2
,
246 AB8540_REGUHWHPREQ2VALID1
,
247 AB8540_REGUHWHPREQ2VALID2
,
248 AB8540_REGUSWHPREQVALID1
,
249 AB8540_REGUSWHPREQVALID2
,
250 AB8540_REGUSYSCLKREQVALID1
,
251 AB8540_REGUSYSCLKREQVALID2
,
252 AB8540_REGUVAUX4REQVALID
,
253 AB8540_REGUVAUX5REQVALID
,
254 AB8540_REGUVAUX6REQVALID
,
255 AB8540_REGUVCLKBREQVALID
,
256 AB8540_REGUVRF1REQVALID
,
259 AB8540_REGUCTRL1VAMIC
,
266 AB8540_EXTSUPPLYREGU
,
268 AB8540_VRF1VAUX3REGU
,
280 AB8540_REGUCTRL2SPARE
,
294 AB8540_REGUCTRLDISCH
,
295 AB8540_REGUCTRLDISCH2
,
296 AB8540_REGUCTRLDISCH3
,
297 AB8540_REGUCTRLDISCH4
,
298 AB8540_VSIMSYSCLKCTRL
,
300 AB8540_NUM_REGULATOR_REGISTERS
,
303 /* AB8500 external regulators */
304 struct ab8500_ext_regulator_cfg
{
305 bool hwreq
; /* requires hw mode or high power mode */
308 enum ab8500_ext_regulator_id
{
312 AB8500_NUM_EXT_REGULATORS
,
315 /* AB8500 regulator platform data */
316 struct ab8500_regulator_platform_data
{
318 struct ab8500_regulator_reg_init
*reg_init
;
320 struct regulator_init_data
*regulator
;
321 int num_ext_regulator
;
322 struct regulator_init_data
*ext_regulator
;