2 * Copyright (C) ST-Ericsson SA 2010
4 * License Terms: GNU General Public License v2
6 * Authors: Sundar Iyer <sundar.iyer@stericsson.com>
7 * Bengt Jonsson <bengt.g.jonsson@stericsson.com>
9 * MOP500 board specific initialization for regulators
11 #include <linux/kernel.h>
12 #include <linux/regulator/machine.h>
13 #include <linux/regulator/ab8500.h>
14 #include "board-mop500-regulators.h"
19 static struct regulator_consumer_supply tps61052_vaudio_consumers
[] = {
21 * Boost converter supply to raise voltage on audio speaker, this
22 * is actually connected to three pins, VInVhfL (left amplifier)
23 * VInVhfR (right amplifier) and VIntDClassInt - all three must
24 * be connected to the same voltage.
26 REGULATOR_SUPPLY("vintdclassint", "ab8500-codec.0"),
29 struct regulator_init_data tps61052_regulator
= {
34 .valid_ops_mask
= REGULATOR_CHANGE_STATUS
,
36 .num_consumer_supplies
= ARRAY_SIZE(tps61052_vaudio_consumers
),
37 .consumer_supplies
= tps61052_vaudio_consumers
,
40 static struct regulator_consumer_supply ab8500_vaux1_consumers
[] = {
41 /* External displays, connector on board 2v5 power supply */
42 REGULATOR_SUPPLY("vaux12v5", "mcde.0"),
43 /* SFH7741 proximity sensor */
44 REGULATOR_SUPPLY("vcc", "gpio-keys.0"),
45 /* BH1780GLS ambient light sensor */
46 REGULATOR_SUPPLY("vcc", "2-0029"),
47 /* lsm303dlh accelerometer */
48 REGULATOR_SUPPLY("vdd", "3-0018"),
49 /* lsm303dlh magnetometer */
50 REGULATOR_SUPPLY("vdd", "3-001e"),
51 /* Rohm BU21013 Touchscreen devices */
52 REGULATOR_SUPPLY("avdd", "3-005c"),
53 REGULATOR_SUPPLY("avdd", "3-005d"),
54 /* Synaptics RMI4 Touchscreen device */
55 REGULATOR_SUPPLY("vdd", "3-004b"),
58 static struct regulator_consumer_supply ab8500_vaux2_consumers
[] = {
59 /* On-board eMMC power */
60 REGULATOR_SUPPLY("vmmc", "sdi4"),
61 /* AB8500 audio codec */
62 REGULATOR_SUPPLY("vcc-N2158", "ab8500-codec.0"),
65 static struct regulator_consumer_supply ab8500_vaux3_consumers
[] = {
66 /* External MMC slot power */
67 REGULATOR_SUPPLY("vmmc", "sdi0"),
70 static struct regulator_consumer_supply ab8500_vtvout_consumers
[] = {
71 /* TV-out DENC supply */
72 REGULATOR_SUPPLY("vtvout", "ab8500-denc.0"),
73 /* Internal general-purpose ADC */
74 REGULATOR_SUPPLY("vddadc", "ab8500-gpadc.0"),
77 static struct regulator_consumer_supply ab8500_vaud_consumers
[] = {
78 /* AB8500 audio-codec main supply */
79 REGULATOR_SUPPLY("vaud", "ab8500-codec.0"),
82 static struct regulator_consumer_supply ab8500_vamic1_consumers
[] = {
83 /* AB8500 audio-codec Mic1 supply */
84 REGULATOR_SUPPLY("vamic1", "ab8500-codec.0"),
87 static struct regulator_consumer_supply ab8500_vamic2_consumers
[] = {
88 /* AB8500 audio-codec Mic2 supply */
89 REGULATOR_SUPPLY("vamic2", "ab8500-codec.0"),
92 static struct regulator_consumer_supply ab8500_vdmic_consumers
[] = {
93 /* AB8500 audio-codec DMic supply */
94 REGULATOR_SUPPLY("vdmic", "ab8500-codec.0"),
97 static struct regulator_consumer_supply ab8500_vintcore_consumers
[] = {
98 /* SoC core supply, no device */
99 REGULATOR_SUPPLY("v-intcore", NULL
),
100 /* USB Transceiver */
101 REGULATOR_SUPPLY("vddulpivio18", "ab8500-usb.0"),
104 static struct regulator_consumer_supply ab8500_vana_consumers
[] = {
105 /* External displays, connector on board, 1v8 power supply */
106 REGULATOR_SUPPLY("vsmps2", "mcde.0"),
109 /* ab8500 regulator register initialization */
110 struct ab8500_regulator_reg_init
111 ab8500_regulator_reg_init
[AB8500_NUM_REGULATOR_REGISTERS
] = {
113 * VanaRequestCtrl = HP/LP depending on VxRequest
114 * VextSupply1RequestCtrl = HP/LP depending on VxRequest
116 INIT_REGULATOR_REGISTER(AB8500_REGUREQUESTCTRL2
, 0x00),
118 * VextSupply2RequestCtrl = HP/LP depending on VxRequest
119 * VextSupply3RequestCtrl = HP/LP depending on VxRequest
120 * Vaux1RequestCtrl = HP/LP depending on VxRequest
121 * Vaux2RequestCtrl = HP/LP depending on VxRequest
123 INIT_REGULATOR_REGISTER(AB8500_REGUREQUESTCTRL3
, 0x00),
125 * Vaux3RequestCtrl = HP/LP depending on VxRequest
126 * SwHPReq = Control through SWValid disabled
128 INIT_REGULATOR_REGISTER(AB8500_REGUREQUESTCTRL4
, 0x00),
130 * VanaSysClkReq1HPValid = disabled
131 * Vaux1SysClkReq1HPValid = disabled
132 * Vaux2SysClkReq1HPValid = disabled
133 * Vaux3SysClkReq1HPValid = disabled
135 INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQ1HPVALID1
, 0x00),
137 * VextSupply1SysClkReq1HPValid = disabled
138 * VextSupply2SysClkReq1HPValid = disabled
139 * VextSupply3SysClkReq1HPValid = SysClkReq1 controlled
141 INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQ1HPVALID2
, 0x40),
143 * VanaHwHPReq1Valid = disabled
144 * Vaux1HwHPreq1Valid = disabled
145 * Vaux2HwHPReq1Valid = disabled
146 * Vaux3HwHPReqValid = disabled
148 INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ1VALID1
, 0x00),
150 * VextSupply1HwHPReq1Valid = disabled
151 * VextSupply2HwHPReq1Valid = disabled
152 * VextSupply3HwHPReq1Valid = disabled
154 INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ1VALID2
, 0x00),
156 * VanaHwHPReq2Valid = disabled
157 * Vaux1HwHPReq2Valid = disabled
158 * Vaux2HwHPReq2Valid = disabled
159 * Vaux3HwHPReq2Valid = disabled
161 INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ2VALID1
, 0x00),
163 * VextSupply1HwHPReq2Valid = disabled
164 * VextSupply2HwHPReq2Valid = disabled
165 * VextSupply3HwHPReq2Valid = HWReq2 controlled
167 INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ2VALID2
, 0x04),
169 * VanaSwHPReqValid = disabled
170 * Vaux1SwHPReqValid = disabled
172 INIT_REGULATOR_REGISTER(AB8500_REGUSWHPREQVALID1
, 0x00),
174 * Vaux2SwHPReqValid = disabled
175 * Vaux3SwHPReqValid = disabled
176 * VextSupply1SwHPReqValid = disabled
177 * VextSupply2SwHPReqValid = disabled
178 * VextSupply3SwHPReqValid = disabled
180 INIT_REGULATOR_REGISTER(AB8500_REGUSWHPREQVALID2
, 0x00),
182 * SysClkReq2Valid1 = SysClkReq2 controlled
183 * SysClkReq3Valid1 = disabled
184 * SysClkReq4Valid1 = SysClkReq4 controlled
185 * SysClkReq5Valid1 = disabled
186 * SysClkReq6Valid1 = SysClkReq6 controlled
187 * SysClkReq7Valid1 = disabled
188 * SysClkReq8Valid1 = disabled
190 INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQVALID1
, 0x2a),
192 * SysClkReq2Valid2 = disabled
193 * SysClkReq3Valid2 = disabled
194 * SysClkReq4Valid2 = disabled
195 * SysClkReq5Valid2 = disabled
196 * SysClkReq6Valid2 = SysClkReq6 controlled
197 * SysClkReq7Valid2 = disabled
198 * SysClkReq8Valid2 = disabled
200 INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQVALID2
, 0x20),
202 * VTVoutEna = disabled
203 * Vintcore12Ena = disabled
204 * Vintcore12Sel = 1.25 V
205 * Vintcore12LP = inactive (HP)
206 * VTVoutLP = inactive (HP)
208 INIT_REGULATOR_REGISTER(AB8500_REGUMISC1
, 0x10),
210 * VaudioEna = disabled
211 * VdmicEna = disabled
212 * Vamic1Ena = disabled
213 * Vamic2Ena = disabled
215 INIT_REGULATOR_REGISTER(AB8500_VAUDIOSUPPLY
, 0x00),
217 * Vamic1_dzout = high-Z when Vamic1 is disabled
218 * Vamic2_dzout = high-Z when Vamic2 is disabled
220 INIT_REGULATOR_REGISTER(AB8500_REGUCTRL1VAMIC
, 0x00),
222 * VPll = Hw controlled
223 * VanaRegu = force off
225 INIT_REGULATOR_REGISTER(AB8500_VPLLVANAREGU
, 0x02),
227 * VrefDDREna = disabled
228 * VrefDDRSleepMode = inactive (no pulldown)
230 INIT_REGULATOR_REGISTER(AB8500_VREFDDR
, 0x00),
232 * VextSupply1Regu = HW control
233 * VextSupply2Regu = HW control
234 * VextSupply3Regu = HW control
235 * ExtSupply2Bypass = ExtSupply12LPn ball is 0 when Ena is 0
236 * ExtSupply3Bypass = ExtSupply3LPn ball is 0 when Ena is 0
238 INIT_REGULATOR_REGISTER(AB8500_EXTSUPPLYREGU
, 0x2a),
240 * Vaux1Regu = force HP
241 * Vaux2Regu = force off
243 INIT_REGULATOR_REGISTER(AB8500_VAUX12REGU
, 0x01),
245 * Vaux3regu = force off
247 INIT_REGULATOR_REGISTER(AB8500_VRF1VAUX3REGU
, 0x00),
251 INIT_REGULATOR_REGISTER(AB8500_VSMPS1SEL1
, 0x24),
255 INIT_REGULATOR_REGISTER(AB8500_VAUX1SEL
, 0x08),
259 INIT_REGULATOR_REGISTER(AB8500_VAUX2SEL
, 0x0d),
263 INIT_REGULATOR_REGISTER(AB8500_VRF1VAUX3SEL
, 0x07),
265 * VextSupply12LP = disabled (no LP)
267 INIT_REGULATOR_REGISTER(AB8500_REGUCTRL2SPARE
, 0x00),
269 * Vaux1Disch = short discharge time
270 * Vaux2Disch = short discharge time
271 * Vaux3Disch = short discharge time
272 * Vintcore12Disch = short discharge time
273 * VTVoutDisch = short discharge time
274 * VaudioDisch = short discharge time
276 INIT_REGULATOR_REGISTER(AB8500_REGUCTRLDISCH
, 0x00),
278 * VanaDisch = short discharge time
279 * VdmicPullDownEna = pulldown disabled when Vdmic is disabled
280 * VdmicDisch = short discharge time
282 INIT_REGULATOR_REGISTER(AB8500_REGUCTRLDISCH2
, 0x00),
285 /* AB8500 regulators */
286 struct regulator_init_data ab8500_regulators
[AB8500_NUM_REGULATORS
] = {
287 /* supplies to the display/camera */
288 [AB8500_LDO_AUX1
] = {
293 .valid_ops_mask
= REGULATOR_CHANGE_VOLTAGE
|
294 REGULATOR_CHANGE_STATUS
,
295 .boot_on
= 1, /* display is on at boot */
297 * This voltage cannot be disabled right now because
298 * it is somehow affecting the external MMC
299 * functionality, though that typically will use
304 .num_consumer_supplies
= ARRAY_SIZE(ab8500_vaux1_consumers
),
305 .consumer_supplies
= ab8500_vaux1_consumers
,
307 /* supplies to the on-board eMMC */
308 [AB8500_LDO_AUX2
] = {
313 .valid_ops_mask
= REGULATOR_CHANGE_VOLTAGE
|
314 REGULATOR_CHANGE_STATUS
,
316 .num_consumer_supplies
= ARRAY_SIZE(ab8500_vaux2_consumers
),
317 .consumer_supplies
= ab8500_vaux2_consumers
,
319 /* supply for VAUX3, supplies to SDcard slots */
320 [AB8500_LDO_AUX3
] = {
325 .valid_ops_mask
= REGULATOR_CHANGE_VOLTAGE
|
326 REGULATOR_CHANGE_STATUS
,
328 .num_consumer_supplies
= ARRAY_SIZE(ab8500_vaux3_consumers
),
329 .consumer_supplies
= ab8500_vaux3_consumers
,
331 /* supply for tvout, gpadc, TVOUT LDO */
332 [AB8500_LDO_TVOUT
] = {
335 .valid_ops_mask
= REGULATOR_CHANGE_STATUS
,
337 .num_consumer_supplies
= ARRAY_SIZE(ab8500_vtvout_consumers
),
338 .consumer_supplies
= ab8500_vtvout_consumers
,
340 /* supply for ab8500-vaudio, VAUDIO LDO */
341 [AB8500_LDO_AUDIO
] = {
344 .valid_ops_mask
= REGULATOR_CHANGE_STATUS
,
346 .num_consumer_supplies
= ARRAY_SIZE(ab8500_vaud_consumers
),
347 .consumer_supplies
= ab8500_vaud_consumers
,
349 /* supply for v-anamic1 VAMic1-LDO */
350 [AB8500_LDO_ANAMIC1
] = {
353 .valid_ops_mask
= REGULATOR_CHANGE_STATUS
,
355 .num_consumer_supplies
= ARRAY_SIZE(ab8500_vamic1_consumers
),
356 .consumer_supplies
= ab8500_vamic1_consumers
,
358 /* supply for v-amic2, VAMIC2 LDO, reuse constants for AMIC1 */
359 [AB8500_LDO_ANAMIC2
] = {
362 .valid_ops_mask
= REGULATOR_CHANGE_STATUS
,
364 .num_consumer_supplies
= ARRAY_SIZE(ab8500_vamic2_consumers
),
365 .consumer_supplies
= ab8500_vamic2_consumers
,
367 /* supply for v-dmic, VDMIC LDO */
368 [AB8500_LDO_DMIC
] = {
371 .valid_ops_mask
= REGULATOR_CHANGE_STATUS
,
373 .num_consumer_supplies
= ARRAY_SIZE(ab8500_vdmic_consumers
),
374 .consumer_supplies
= ab8500_vdmic_consumers
,
376 /* supply for v-intcore12, VINTCORE12 LDO */
377 [AB8500_LDO_INTCORE
] = {
380 .valid_ops_mask
= REGULATOR_CHANGE_STATUS
,
382 .num_consumer_supplies
= ARRAY_SIZE(ab8500_vintcore_consumers
),
383 .consumer_supplies
= ab8500_vintcore_consumers
,
385 /* supply for U8500 CSI/DSI, VANA LDO */
389 .valid_ops_mask
= REGULATOR_CHANGE_STATUS
,
391 .num_consumer_supplies
= ARRAY_SIZE(ab8500_vana_consumers
),
392 .consumer_supplies
= ab8500_vana_consumers
,