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"
16 static struct regulator_consumer_supply gpio_en_3v3_consumers
[] = {
17 REGULATOR_SUPPLY("vdd33a", "smsc911x.0"),
20 struct regulator_init_data gpio_en_3v3_regulator
= {
25 .valid_ops_mask
= REGULATOR_CHANGE_STATUS
,
27 .num_consumer_supplies
= ARRAY_SIZE(gpio_en_3v3_consumers
),
28 .consumer_supplies
= gpio_en_3v3_consumers
,
34 static struct regulator_consumer_supply tps61052_vaudio_consumers
[] = {
36 * Boost converter supply to raise voltage on audio speaker, this
37 * is actually connected to three pins, VInVhfL (left amplifier)
38 * VInVhfR (right amplifier) and VIntDClassInt - all three must
39 * be connected to the same voltage.
41 REGULATOR_SUPPLY("vintdclassint", "ab8500-codec.0"),
44 struct regulator_init_data tps61052_regulator
= {
49 .valid_ops_mask
= REGULATOR_CHANGE_STATUS
,
51 .num_consumer_supplies
= ARRAY_SIZE(tps61052_vaudio_consumers
),
52 .consumer_supplies
= tps61052_vaudio_consumers
,
55 static struct regulator_consumer_supply ab8500_vaux1_consumers
[] = {
56 /* External displays, connector on board 2v5 power supply */
57 REGULATOR_SUPPLY("vaux12v5", "mcde.0"),
58 /* SFH7741 proximity sensor */
59 REGULATOR_SUPPLY("vcc", "gpio-keys.0"),
60 /* BH1780GLS ambient light sensor */
61 REGULATOR_SUPPLY("vcc", "2-0029"),
62 /* lsm303dlh accelerometer */
63 REGULATOR_SUPPLY("vdd", "3-0018"),
64 /* lsm303dlh magnetometer */
65 REGULATOR_SUPPLY("vdd", "3-001e"),
66 /* Rohm BU21013 Touchscreen devices */
67 REGULATOR_SUPPLY("avdd", "3-005c"),
68 REGULATOR_SUPPLY("avdd", "3-005d"),
69 /* Synaptics RMI4 Touchscreen device */
70 REGULATOR_SUPPLY("vdd", "3-004b"),
73 static struct regulator_consumer_supply ab8500_vaux2_consumers
[] = {
74 /* On-board eMMC power */
75 REGULATOR_SUPPLY("vmmc", "sdi4"),
76 /* AB8500 audio codec */
77 REGULATOR_SUPPLY("vcc-N2158", "ab8500-codec.0"),
80 static struct regulator_consumer_supply ab8500_vaux3_consumers
[] = {
81 /* External MMC slot power */
82 REGULATOR_SUPPLY("vmmc", "sdi0"),
85 static struct regulator_consumer_supply ab8500_vtvout_consumers
[] = {
86 /* TV-out DENC supply */
87 REGULATOR_SUPPLY("vtvout", "ab8500-denc.0"),
88 /* Internal general-purpose ADC */
89 REGULATOR_SUPPLY("vddadc", "ab8500-gpadc.0"),
92 static struct regulator_consumer_supply ab8500_vaud_consumers
[] = {
93 /* AB8500 audio-codec main supply */
94 REGULATOR_SUPPLY("vaud", "ab8500-codec.0"),
97 static struct regulator_consumer_supply ab8500_vamic1_consumers
[] = {
98 /* AB8500 audio-codec Mic1 supply */
99 REGULATOR_SUPPLY("vamic1", "ab8500-codec.0"),
102 static struct regulator_consumer_supply ab8500_vamic2_consumers
[] = {
103 /* AB8500 audio-codec Mic2 supply */
104 REGULATOR_SUPPLY("vamic2", "ab8500-codec.0"),
107 static struct regulator_consumer_supply ab8500_vdmic_consumers
[] = {
108 /* AB8500 audio-codec DMic supply */
109 REGULATOR_SUPPLY("vdmic", "ab8500-codec.0"),
112 static struct regulator_consumer_supply ab8500_vintcore_consumers
[] = {
113 /* SoC core supply, no device */
114 REGULATOR_SUPPLY("v-intcore", NULL
),
115 /* USB Transceiver */
116 REGULATOR_SUPPLY("vddulpivio18", "ab8500-usb.0"),
119 static struct regulator_consumer_supply ab8500_vana_consumers
[] = {
120 /* External displays, connector on board, 1v8 power supply */
121 REGULATOR_SUPPLY("vsmps2", "mcde.0"),
124 /* ab8500 regulator register initialization */
125 struct ab8500_regulator_reg_init
126 ab8500_regulator_reg_init
[AB8500_NUM_REGULATOR_REGISTERS
] = {
128 * VanaRequestCtrl = HP/LP depending on VxRequest
129 * VextSupply1RequestCtrl = HP/LP depending on VxRequest
131 INIT_REGULATOR_REGISTER(AB8500_REGUREQUESTCTRL2
, 0x00),
133 * VextSupply2RequestCtrl = HP/LP depending on VxRequest
134 * VextSupply3RequestCtrl = HP/LP depending on VxRequest
135 * Vaux1RequestCtrl = HP/LP depending on VxRequest
136 * Vaux2RequestCtrl = HP/LP depending on VxRequest
138 INIT_REGULATOR_REGISTER(AB8500_REGUREQUESTCTRL3
, 0x00),
140 * Vaux3RequestCtrl = HP/LP depending on VxRequest
141 * SwHPReq = Control through SWValid disabled
143 INIT_REGULATOR_REGISTER(AB8500_REGUREQUESTCTRL4
, 0x00),
145 * VanaSysClkReq1HPValid = disabled
146 * Vaux1SysClkReq1HPValid = disabled
147 * Vaux2SysClkReq1HPValid = disabled
148 * Vaux3SysClkReq1HPValid = disabled
150 INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQ1HPVALID1
, 0x00),
152 * VextSupply1SysClkReq1HPValid = disabled
153 * VextSupply2SysClkReq1HPValid = disabled
154 * VextSupply3SysClkReq1HPValid = SysClkReq1 controlled
156 INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQ1HPVALID2
, 0x40),
158 * VanaHwHPReq1Valid = disabled
159 * Vaux1HwHPreq1Valid = disabled
160 * Vaux2HwHPReq1Valid = disabled
161 * Vaux3HwHPReqValid = disabled
163 INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ1VALID1
, 0x00),
165 * VextSupply1HwHPReq1Valid = disabled
166 * VextSupply2HwHPReq1Valid = disabled
167 * VextSupply3HwHPReq1Valid = disabled
169 INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ1VALID2
, 0x00),
171 * VanaHwHPReq2Valid = disabled
172 * Vaux1HwHPReq2Valid = disabled
173 * Vaux2HwHPReq2Valid = disabled
174 * Vaux3HwHPReq2Valid = disabled
176 INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ2VALID1
, 0x00),
178 * VextSupply1HwHPReq2Valid = disabled
179 * VextSupply2HwHPReq2Valid = disabled
180 * VextSupply3HwHPReq2Valid = HWReq2 controlled
182 INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ2VALID2
, 0x04),
184 * VanaSwHPReqValid = disabled
185 * Vaux1SwHPReqValid = disabled
187 INIT_REGULATOR_REGISTER(AB8500_REGUSWHPREQVALID1
, 0x00),
189 * Vaux2SwHPReqValid = disabled
190 * Vaux3SwHPReqValid = disabled
191 * VextSupply1SwHPReqValid = disabled
192 * VextSupply2SwHPReqValid = disabled
193 * VextSupply3SwHPReqValid = disabled
195 INIT_REGULATOR_REGISTER(AB8500_REGUSWHPREQVALID2
, 0x00),
197 * SysClkReq2Valid1 = SysClkReq2 controlled
198 * SysClkReq3Valid1 = disabled
199 * SysClkReq4Valid1 = SysClkReq4 controlled
200 * SysClkReq5Valid1 = disabled
201 * SysClkReq6Valid1 = SysClkReq6 controlled
202 * SysClkReq7Valid1 = disabled
203 * SysClkReq8Valid1 = disabled
205 INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQVALID1
, 0x2a),
207 * SysClkReq2Valid2 = disabled
208 * SysClkReq3Valid2 = disabled
209 * SysClkReq4Valid2 = disabled
210 * SysClkReq5Valid2 = disabled
211 * SysClkReq6Valid2 = SysClkReq6 controlled
212 * SysClkReq7Valid2 = disabled
213 * SysClkReq8Valid2 = disabled
215 INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQVALID2
, 0x20),
217 * VTVoutEna = disabled
218 * Vintcore12Ena = disabled
219 * Vintcore12Sel = 1.25 V
220 * Vintcore12LP = inactive (HP)
221 * VTVoutLP = inactive (HP)
223 INIT_REGULATOR_REGISTER(AB8500_REGUMISC1
, 0x10),
225 * VaudioEna = disabled
226 * VdmicEna = disabled
227 * Vamic1Ena = disabled
228 * Vamic2Ena = disabled
230 INIT_REGULATOR_REGISTER(AB8500_VAUDIOSUPPLY
, 0x00),
232 * Vamic1_dzout = high-Z when Vamic1 is disabled
233 * Vamic2_dzout = high-Z when Vamic2 is disabled
235 INIT_REGULATOR_REGISTER(AB8500_REGUCTRL1VAMIC
, 0x00),
237 * VPll = Hw controlled
238 * VanaRegu = force off
240 INIT_REGULATOR_REGISTER(AB8500_VPLLVANAREGU
, 0x02),
242 * VrefDDREna = disabled
243 * VrefDDRSleepMode = inactive (no pulldown)
245 INIT_REGULATOR_REGISTER(AB8500_VREFDDR
, 0x00),
247 * VextSupply1Regu = HW control
248 * VextSupply2Regu = HW control
249 * VextSupply3Regu = HW control
250 * ExtSupply2Bypass = ExtSupply12LPn ball is 0 when Ena is 0
251 * ExtSupply3Bypass = ExtSupply3LPn ball is 0 when Ena is 0
253 INIT_REGULATOR_REGISTER(AB8500_EXTSUPPLYREGU
, 0x2a),
255 * Vaux1Regu = force HP
256 * Vaux2Regu = force off
258 INIT_REGULATOR_REGISTER(AB8500_VAUX12REGU
, 0x01),
260 * Vaux3regu = force off
262 INIT_REGULATOR_REGISTER(AB8500_VRF1VAUX3REGU
, 0x00),
266 INIT_REGULATOR_REGISTER(AB8500_VSMPS1SEL1
, 0x24),
270 INIT_REGULATOR_REGISTER(AB8500_VAUX1SEL
, 0x08),
274 INIT_REGULATOR_REGISTER(AB8500_VAUX2SEL
, 0x0d),
278 INIT_REGULATOR_REGISTER(AB8500_VRF1VAUX3SEL
, 0x07),
280 * VextSupply12LP = disabled (no LP)
282 INIT_REGULATOR_REGISTER(AB8500_REGUCTRL2SPARE
, 0x00),
284 * Vaux1Disch = short discharge time
285 * Vaux2Disch = short discharge time
286 * Vaux3Disch = short discharge time
287 * Vintcore12Disch = short discharge time
288 * VTVoutDisch = short discharge time
289 * VaudioDisch = short discharge time
291 INIT_REGULATOR_REGISTER(AB8500_REGUCTRLDISCH
, 0x00),
293 * VanaDisch = short discharge time
294 * VdmicPullDownEna = pulldown disabled when Vdmic is disabled
295 * VdmicDisch = short discharge time
297 INIT_REGULATOR_REGISTER(AB8500_REGUCTRLDISCH2
, 0x00),
300 /* AB8500 regulators */
301 struct regulator_init_data ab8500_regulators
[AB8500_NUM_REGULATORS
] = {
302 /* supplies to the display/camera */
303 [AB8500_LDO_AUX1
] = {
308 .valid_ops_mask
= REGULATOR_CHANGE_VOLTAGE
|
309 REGULATOR_CHANGE_STATUS
,
310 .boot_on
= 1, /* display is on at boot */
312 * This voltage cannot be disabled right now because
313 * it is somehow affecting the external MMC
314 * functionality, though that typically will use
319 .num_consumer_supplies
= ARRAY_SIZE(ab8500_vaux1_consumers
),
320 .consumer_supplies
= ab8500_vaux1_consumers
,
322 /* supplies to the on-board eMMC */
323 [AB8500_LDO_AUX2
] = {
328 .valid_ops_mask
= REGULATOR_CHANGE_VOLTAGE
|
329 REGULATOR_CHANGE_STATUS
,
331 .num_consumer_supplies
= ARRAY_SIZE(ab8500_vaux2_consumers
),
332 .consumer_supplies
= ab8500_vaux2_consumers
,
334 /* supply for VAUX3, supplies to SDcard slots */
335 [AB8500_LDO_AUX3
] = {
340 .valid_ops_mask
= REGULATOR_CHANGE_VOLTAGE
|
341 REGULATOR_CHANGE_STATUS
,
343 .num_consumer_supplies
= ARRAY_SIZE(ab8500_vaux3_consumers
),
344 .consumer_supplies
= ab8500_vaux3_consumers
,
346 /* supply for tvout, gpadc, TVOUT LDO */
347 [AB8500_LDO_TVOUT
] = {
350 .valid_ops_mask
= REGULATOR_CHANGE_STATUS
,
352 .num_consumer_supplies
= ARRAY_SIZE(ab8500_vtvout_consumers
),
353 .consumer_supplies
= ab8500_vtvout_consumers
,
355 /* supply for ab8500-vaudio, VAUDIO LDO */
356 [AB8500_LDO_AUDIO
] = {
359 .valid_ops_mask
= REGULATOR_CHANGE_STATUS
,
361 .num_consumer_supplies
= ARRAY_SIZE(ab8500_vaud_consumers
),
362 .consumer_supplies
= ab8500_vaud_consumers
,
364 /* supply for v-anamic1 VAMic1-LDO */
365 [AB8500_LDO_ANAMIC1
] = {
368 .valid_ops_mask
= REGULATOR_CHANGE_STATUS
,
370 .num_consumer_supplies
= ARRAY_SIZE(ab8500_vamic1_consumers
),
371 .consumer_supplies
= ab8500_vamic1_consumers
,
373 /* supply for v-amic2, VAMIC2 LDO, reuse constants for AMIC1 */
374 [AB8500_LDO_ANAMIC2
] = {
377 .valid_ops_mask
= REGULATOR_CHANGE_STATUS
,
379 .num_consumer_supplies
= ARRAY_SIZE(ab8500_vamic2_consumers
),
380 .consumer_supplies
= ab8500_vamic2_consumers
,
382 /* supply for v-dmic, VDMIC LDO */
383 [AB8500_LDO_DMIC
] = {
386 .valid_ops_mask
= REGULATOR_CHANGE_STATUS
,
388 .num_consumer_supplies
= ARRAY_SIZE(ab8500_vdmic_consumers
),
389 .consumer_supplies
= ab8500_vdmic_consumers
,
391 /* supply for v-intcore12, VINTCORE12 LDO */
392 [AB8500_LDO_INTCORE
] = {
395 .valid_ops_mask
= REGULATOR_CHANGE_STATUS
,
397 .num_consumer_supplies
= ARRAY_SIZE(ab8500_vintcore_consumers
),
398 .consumer_supplies
= ab8500_vintcore_consumers
,
400 /* supply for U8500 CSI/DSI, VANA LDO */
404 .valid_ops_mask
= REGULATOR_CHANGE_STATUS
,
406 .num_consumer_supplies
= ARRAY_SIZE(ab8500_vana_consumers
),
407 .consumer_supplies
= ab8500_vana_consumers
,