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_vintcore_consumers
[] = {
78 /* SoC core supply, no device */
79 REGULATOR_SUPPLY("v-intcore", NULL
),
81 REGULATOR_SUPPLY("vddulpivio18", "ab8500-usb.0"),
84 static struct regulator_consumer_supply ab8500_vana_consumers
[] = {
85 /* External displays, connector on board, 1v8 power supply */
86 REGULATOR_SUPPLY("vsmps2", "mcde.0"),
89 /* ab8500 regulator register initialization */
90 struct ab8500_regulator_reg_init
91 ab8500_regulator_reg_init
[AB8500_NUM_REGULATOR_REGISTERS
] = {
93 * VanaRequestCtrl = HP/LP depending on VxRequest
94 * VextSupply1RequestCtrl = HP/LP depending on VxRequest
96 INIT_REGULATOR_REGISTER(AB8500_REGUREQUESTCTRL2
, 0x00),
98 * VextSupply2RequestCtrl = HP/LP depending on VxRequest
99 * VextSupply3RequestCtrl = HP/LP depending on VxRequest
100 * Vaux1RequestCtrl = HP/LP depending on VxRequest
101 * Vaux2RequestCtrl = HP/LP depending on VxRequest
103 INIT_REGULATOR_REGISTER(AB8500_REGUREQUESTCTRL3
, 0x00),
105 * Vaux3RequestCtrl = HP/LP depending on VxRequest
106 * SwHPReq = Control through SWValid disabled
108 INIT_REGULATOR_REGISTER(AB8500_REGUREQUESTCTRL4
, 0x00),
110 * VanaSysClkReq1HPValid = disabled
111 * Vaux1SysClkReq1HPValid = disabled
112 * Vaux2SysClkReq1HPValid = disabled
113 * Vaux3SysClkReq1HPValid = disabled
115 INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQ1HPVALID1
, 0x00),
117 * VextSupply1SysClkReq1HPValid = disabled
118 * VextSupply2SysClkReq1HPValid = disabled
119 * VextSupply3SysClkReq1HPValid = SysClkReq1 controlled
121 INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQ1HPVALID2
, 0x40),
123 * VanaHwHPReq1Valid = disabled
124 * Vaux1HwHPreq1Valid = disabled
125 * Vaux2HwHPReq1Valid = disabled
126 * Vaux3HwHPReqValid = disabled
128 INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ1VALID1
, 0x00),
130 * VextSupply1HwHPReq1Valid = disabled
131 * VextSupply2HwHPReq1Valid = disabled
132 * VextSupply3HwHPReq1Valid = disabled
134 INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ1VALID2
, 0x00),
136 * VanaHwHPReq2Valid = disabled
137 * Vaux1HwHPReq2Valid = disabled
138 * Vaux2HwHPReq2Valid = disabled
139 * Vaux3HwHPReq2Valid = disabled
141 INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ2VALID1
, 0x00),
143 * VextSupply1HwHPReq2Valid = disabled
144 * VextSupply2HwHPReq2Valid = disabled
145 * VextSupply3HwHPReq2Valid = HWReq2 controlled
147 INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ2VALID2
, 0x04),
149 * VanaSwHPReqValid = disabled
150 * Vaux1SwHPReqValid = disabled
152 INIT_REGULATOR_REGISTER(AB8500_REGUSWHPREQVALID1
, 0x00),
154 * Vaux2SwHPReqValid = disabled
155 * Vaux3SwHPReqValid = disabled
156 * VextSupply1SwHPReqValid = disabled
157 * VextSupply2SwHPReqValid = disabled
158 * VextSupply3SwHPReqValid = disabled
160 INIT_REGULATOR_REGISTER(AB8500_REGUSWHPREQVALID2
, 0x00),
162 * SysClkReq2Valid1 = SysClkReq2 controlled
163 * SysClkReq3Valid1 = disabled
164 * SysClkReq4Valid1 = SysClkReq4 controlled
165 * SysClkReq5Valid1 = disabled
166 * SysClkReq6Valid1 = SysClkReq6 controlled
167 * SysClkReq7Valid1 = disabled
168 * SysClkReq8Valid1 = disabled
170 INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQVALID1
, 0x2a),
172 * SysClkReq2Valid2 = disabled
173 * SysClkReq3Valid2 = disabled
174 * SysClkReq4Valid2 = disabled
175 * SysClkReq5Valid2 = disabled
176 * SysClkReq6Valid2 = SysClkReq6 controlled
177 * SysClkReq7Valid2 = disabled
178 * SysClkReq8Valid2 = disabled
180 INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQVALID2
, 0x20),
182 * VTVoutEna = disabled
183 * Vintcore12Ena = disabled
184 * Vintcore12Sel = 1.25 V
185 * Vintcore12LP = inactive (HP)
186 * VTVoutLP = inactive (HP)
188 INIT_REGULATOR_REGISTER(AB8500_REGUMISC1
, 0x10),
190 * VaudioEna = disabled
191 * VdmicEna = disabled
192 * Vamic1Ena = disabled
193 * Vamic2Ena = disabled
195 INIT_REGULATOR_REGISTER(AB8500_VAUDIOSUPPLY
, 0x00),
197 * Vamic1_dzout = high-Z when Vamic1 is disabled
198 * Vamic2_dzout = high-Z when Vamic2 is disabled
200 INIT_REGULATOR_REGISTER(AB8500_REGUCTRL1VAMIC
, 0x00),
202 * VPll = Hw controlled
203 * VanaRegu = force off
205 INIT_REGULATOR_REGISTER(AB8500_VPLLVANAREGU
, 0x02),
207 * VrefDDREna = disabled
208 * VrefDDRSleepMode = inactive (no pulldown)
210 INIT_REGULATOR_REGISTER(AB8500_VREFDDR
, 0x00),
212 * VextSupply1Regu = HW control
213 * VextSupply2Regu = HW control
214 * VextSupply3Regu = HW control
215 * ExtSupply2Bypass = ExtSupply12LPn ball is 0 when Ena is 0
216 * ExtSupply3Bypass = ExtSupply3LPn ball is 0 when Ena is 0
218 INIT_REGULATOR_REGISTER(AB8500_EXTSUPPLYREGU
, 0x2a),
220 * Vaux1Regu = force HP
221 * Vaux2Regu = force off
223 INIT_REGULATOR_REGISTER(AB8500_VAUX12REGU
, 0x01),
225 * Vaux3regu = force off
227 INIT_REGULATOR_REGISTER(AB8500_VRF1VAUX3REGU
, 0x00),
231 INIT_REGULATOR_REGISTER(AB8500_VSMPS1SEL1
, 0x24),
235 INIT_REGULATOR_REGISTER(AB8500_VAUX1SEL
, 0x08),
239 INIT_REGULATOR_REGISTER(AB8500_VAUX2SEL
, 0x0d),
243 INIT_REGULATOR_REGISTER(AB8500_VRF1VAUX3SEL
, 0x07),
245 * VextSupply12LP = disabled (no LP)
247 INIT_REGULATOR_REGISTER(AB8500_REGUCTRL2SPARE
, 0x00),
249 * Vaux1Disch = short discharge time
250 * Vaux2Disch = short discharge time
251 * Vaux3Disch = short discharge time
252 * Vintcore12Disch = short discharge time
253 * VTVoutDisch = short discharge time
254 * VaudioDisch = short discharge time
256 INIT_REGULATOR_REGISTER(AB8500_REGUCTRLDISCH
, 0x00),
258 * VanaDisch = short discharge time
259 * VdmicPullDownEna = pulldown disabled when Vdmic is disabled
260 * VdmicDisch = short discharge time
262 INIT_REGULATOR_REGISTER(AB8500_REGUCTRLDISCH2
, 0x00),
265 /* AB8500 regulators */
266 struct regulator_init_data ab8500_regulators
[AB8500_NUM_REGULATORS
] = {
267 /* supplies to the display/camera */
268 [AB8500_LDO_AUX1
] = {
273 .valid_ops_mask
= REGULATOR_CHANGE_VOLTAGE
|
274 REGULATOR_CHANGE_STATUS
,
275 .boot_on
= 1, /* display is on at boot */
277 * This voltage cannot be disabled right now because
278 * it is somehow affecting the external MMC
279 * functionality, though that typically will use
284 .num_consumer_supplies
= ARRAY_SIZE(ab8500_vaux1_consumers
),
285 .consumer_supplies
= ab8500_vaux1_consumers
,
287 /* supplies to the on-board eMMC */
288 [AB8500_LDO_AUX2
] = {
293 .valid_ops_mask
= REGULATOR_CHANGE_VOLTAGE
|
294 REGULATOR_CHANGE_STATUS
,
296 .num_consumer_supplies
= ARRAY_SIZE(ab8500_vaux2_consumers
),
297 .consumer_supplies
= ab8500_vaux2_consumers
,
299 /* supply for VAUX3, supplies to SDcard slots */
300 [AB8500_LDO_AUX3
] = {
305 .valid_ops_mask
= REGULATOR_CHANGE_VOLTAGE
|
306 REGULATOR_CHANGE_STATUS
,
308 .num_consumer_supplies
= ARRAY_SIZE(ab8500_vaux3_consumers
),
309 .consumer_supplies
= ab8500_vaux3_consumers
,
311 /* supply for tvout, gpadc, TVOUT LDO */
312 [AB8500_LDO_TVOUT
] = {
315 .valid_ops_mask
= REGULATOR_CHANGE_STATUS
,
317 .num_consumer_supplies
= ARRAY_SIZE(ab8500_vtvout_consumers
),
318 .consumer_supplies
= ab8500_vtvout_consumers
,
320 /* supply for ab8500-vaudio, VAUDIO LDO */
321 [AB8500_LDO_AUDIO
] = {
324 .valid_ops_mask
= REGULATOR_CHANGE_STATUS
,
327 /* supply for v-anamic1 VAMic1-LDO */
328 [AB8500_LDO_ANAMIC1
] = {
331 .valid_ops_mask
= REGULATOR_CHANGE_STATUS
,
334 /* supply for v-amic2, VAMIC2 LDO, reuse constants for AMIC1 */
335 [AB8500_LDO_ANAMIC2
] = {
338 .valid_ops_mask
= REGULATOR_CHANGE_STATUS
,
341 /* supply for v-dmic, VDMIC LDO */
342 [AB8500_LDO_DMIC
] = {
345 .valid_ops_mask
= REGULATOR_CHANGE_STATUS
,
348 /* supply for v-intcore12, VINTCORE12 LDO */
349 [AB8500_LDO_INTCORE
] = {
352 .valid_ops_mask
= REGULATOR_CHANGE_STATUS
,
354 .num_consumer_supplies
= ARRAY_SIZE(ab8500_vintcore_consumers
),
355 .consumer_supplies
= ab8500_vintcore_consumers
,
357 /* supply for U8500 CSI/DSI, VANA LDO */
361 .valid_ops_mask
= REGULATOR_CHANGE_STATUS
,
363 .num_consumer_supplies
= ARRAY_SIZE(ab8500_vana_consumers
),
364 .consumer_supplies
= ab8500_vana_consumers
,