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 /* Main display, u8500 R3 uib */
57 REGULATOR_SUPPLY("vddi", "mcde_disp_sony_acx424akp.0"),
58 /* Main display, u8500 uib and ST uib */
59 REGULATOR_SUPPLY("vdd1", "samsung_s6d16d0.0"),
60 /* Secondary display, ST uib */
61 REGULATOR_SUPPLY("vdd1", "samsung_s6d16d0.1"),
62 /* SFH7741 proximity sensor */
63 REGULATOR_SUPPLY("vcc", "gpio-keys.0"),
64 /* BH1780GLS ambient light sensor */
65 REGULATOR_SUPPLY("vcc", "2-0029"),
66 /* lsm303dlh accelerometer */
67 REGULATOR_SUPPLY("vdd", "3-0018"),
68 /* lsm303dlh magnetometer */
69 REGULATOR_SUPPLY("vdd", "3-001e"),
70 /* Rohm BU21013 Touchscreen devices */
71 REGULATOR_SUPPLY("avdd", "3-005c"),
72 REGULATOR_SUPPLY("avdd", "3-005d"),
73 /* Synaptics RMI4 Touchscreen device */
74 REGULATOR_SUPPLY("vdd", "3-004b"),
75 /* L3G4200D Gyroscope device */
76 REGULATOR_SUPPLY("vdd", "2-0068"),
77 /* Ambient light sensor device */
78 REGULATOR_SUPPLY("vdd", "3-0029"),
79 /* Pressure sensor device */
80 REGULATOR_SUPPLY("vdd", "2-005c"),
81 /* Cypress TrueTouch Touchscreen device */
82 REGULATOR_SUPPLY("vcpin", "spi8.0"),
84 REGULATOR_SUPPLY("vaux12v5", "mmio_camera"),
87 static struct regulator_consumer_supply ab8500_vaux2_consumers[] = {
88 /* On-board eMMC power */
89 REGULATOR_SUPPLY("vmmc", "sdi4"),
90 /* AB8500 audio codec */
91 REGULATOR_SUPPLY("vcc-N2158", "ab8500-codec.0"),
94 static struct regulator_consumer_supply ab8500_vaux3_consumers[] = {
95 /* External MMC slot power */
96 REGULATOR_SUPPLY("vmmc", "sdi0"),
99 static struct regulator_consumer_supply ab8500_vtvout_consumers[] = {
100 /* TV-out DENC supply */
101 REGULATOR_SUPPLY("vtvout", "ab8500-denc.0"),
102 /* Internal general-purpose ADC */
103 REGULATOR_SUPPLY("vddadc", "ab8500-gpadc.0"),
106 static struct regulator_consumer_supply ab8500_vaud_consumers[] = {
107 /* AB8500 audio-codec main supply */
108 REGULATOR_SUPPLY("vaud", "ab8500-codec.0"),
111 static struct regulator_consumer_supply ab8500_vamic1_consumers[] = {
112 /* AB8500 audio-codec Mic1 supply */
113 REGULATOR_SUPPLY("vamic1", "ab8500-codec.0"),
116 static struct regulator_consumer_supply ab8500_vamic2_consumers[] = {
117 /* AB8500 audio-codec Mic2 supply */
118 REGULATOR_SUPPLY("vamic2", "ab8500-codec.0"),
121 static struct regulator_consumer_supply ab8500_vdmic_consumers[] = {
122 /* AB8500 audio-codec DMic supply */
123 REGULATOR_SUPPLY("vdmic", "ab8500-codec.0"),
126 static struct regulator_consumer_supply ab8500_vintcore_consumers[] = {
127 /* SoC core supply, no device */
128 REGULATOR_SUPPLY("v-intcore", NULL),
129 /* USB Transceiver */
130 REGULATOR_SUPPLY("vddulpivio18", "ab8500-usb.0"),
133 static struct regulator_consumer_supply ab8500_vana_consumers[] = {
134 /* External displays, connector on board, 1v8 power supply */
135 REGULATOR_SUPPLY("vsmps2", "mcde.0"),
138 /* ab8500 regulator register initialization */
139 static struct ab8500_regulator_reg_init ab8500_reg_init[] = {
141 * VanaRequestCtrl = HP/LP depending on VxRequest
142 * VextSupply1RequestCtrl = HP/LP depending on VxRequest
144 INIT_REGULATOR_REGISTER(AB8500_REGUREQUESTCTRL2, 0xf0, 0x00),
146 * VextSupply2RequestCtrl = HP/LP depending on VxRequest
147 * VextSupply3RequestCtrl = HP/LP depending on VxRequest
148 * Vaux1RequestCtrl = HP/LP depending on VxRequest
149 * Vaux2RequestCtrl = HP/LP depending on VxRequest
151 INIT_REGULATOR_REGISTER(AB8500_REGUREQUESTCTRL3, 0xff, 0x00),
153 * Vaux3RequestCtrl = HP/LP depending on VxRequest
154 * SwHPReq = Control through SWValid disabled
156 INIT_REGULATOR_REGISTER(AB8500_REGUREQUESTCTRL4, 0x07, 0x00),
158 * VanaSysClkReq1HPValid = disabled
159 * Vaux1SysClkReq1HPValid = disabled
160 * Vaux2SysClkReq1HPValid = disabled
161 * Vaux3SysClkReq1HPValid = disabled
163 INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQ1HPVALID1, 0xe8, 0x00),
165 * VextSupply1SysClkReq1HPValid = disabled
166 * VextSupply2SysClkReq1HPValid = disabled
167 * VextSupply3SysClkReq1HPValid = SysClkReq1 controlled
169 INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQ1HPVALID2, 0x70, 0x40),
171 * VanaHwHPReq1Valid = disabled
172 * Vaux1HwHPreq1Valid = disabled
173 * Vaux2HwHPReq1Valid = disabled
174 * Vaux3HwHPReqValid = disabled
176 INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ1VALID1, 0xe8, 0x00),
178 * VextSupply1HwHPReq1Valid = disabled
179 * VextSupply2HwHPReq1Valid = disabled
180 * VextSupply3HwHPReq1Valid = disabled
182 INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ1VALID2, 0x07, 0x00),
184 * VanaHwHPReq2Valid = disabled
185 * Vaux1HwHPReq2Valid = disabled
186 * Vaux2HwHPReq2Valid = disabled
187 * Vaux3HwHPReq2Valid = disabled
189 INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ2VALID1, 0xe8, 0x00),
191 * VextSupply1HwHPReq2Valid = disabled
192 * VextSupply2HwHPReq2Valid = disabled
193 * VextSupply3HwHPReq2Valid = HWReq2 controlled
195 INIT_REGULATOR_REGISTER(AB8500_REGUHWHPREQ2VALID2, 0x07, 0x04),
197 * VanaSwHPReqValid = disabled
198 * Vaux1SwHPReqValid = disabled
200 INIT_REGULATOR_REGISTER(AB8500_REGUSWHPREQVALID1, 0xa0, 0x00),
202 * Vaux2SwHPReqValid = disabled
203 * Vaux3SwHPReqValid = disabled
204 * VextSupply1SwHPReqValid = disabled
205 * VextSupply2SwHPReqValid = disabled
206 * VextSupply3SwHPReqValid = disabled
208 INIT_REGULATOR_REGISTER(AB8500_REGUSWHPREQVALID2, 0x1f, 0x00),
210 * SysClkReq2Valid1 = SysClkReq2 controlled
211 * SysClkReq3Valid1 = disabled
212 * SysClkReq4Valid1 = SysClkReq4 controlled
213 * SysClkReq5Valid1 = disabled
214 * SysClkReq6Valid1 = SysClkReq6 controlled
215 * SysClkReq7Valid1 = disabled
216 * SysClkReq8Valid1 = disabled
218 INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQVALID1, 0xfe, 0x2a),
220 * SysClkReq2Valid2 = disabled
221 * SysClkReq3Valid2 = disabled
222 * SysClkReq4Valid2 = disabled
223 * SysClkReq5Valid2 = disabled
224 * SysClkReq6Valid2 = SysClkReq6 controlled
225 * SysClkReq7Valid2 = disabled
226 * SysClkReq8Valid2 = disabled
228 INIT_REGULATOR_REGISTER(AB8500_REGUSYSCLKREQVALID2, 0xfe, 0x20),
230 * VTVoutEna = disabled
231 * Vintcore12Ena = disabled
232 * Vintcore12Sel = 1.25 V
233 * Vintcore12LP = inactive (HP)
234 * VTVoutLP = inactive (HP)
236 INIT_REGULATOR_REGISTER(AB8500_REGUMISC1, 0xfe, 0x10),
238 * VaudioEna = disabled
239 * VdmicEna = disabled
240 * Vamic1Ena = disabled
241 * Vamic2Ena = disabled
243 INIT_REGULATOR_REGISTER(AB8500_VAUDIOSUPPLY, 0x1e, 0x00),
245 * Vamic1_dzout = high-Z when Vamic1 is disabled
246 * Vamic2_dzout = high-Z when Vamic2 is disabled
248 INIT_REGULATOR_REGISTER(AB8500_REGUCTRL1VAMIC, 0x03, 0x00),
250 * VPll = Hw controlled (NOTE! PRCMU bits)
251 * VanaRegu = force off
253 INIT_REGULATOR_REGISTER(AB8500_VPLLVANAREGU, 0x0f, 0x02),
255 * VrefDDREna = disabled
256 * VrefDDRSleepMode = inactive (no pulldown)
258 INIT_REGULATOR_REGISTER(AB8500_VREFDDR, 0x03, 0x00),
260 * VextSupply1Regu = HW control
261 * VextSupply2Regu = HW control
262 * VextSupply3Regu = HW control
263 * ExtSupply2Bypass = ExtSupply12LPn ball is 0 when Ena is 0
264 * ExtSupply3Bypass = ExtSupply3LPn ball is 0 when Ena is 0
266 INIT_REGULATOR_REGISTER(AB8500_EXTSUPPLYREGU, 0xff, 0x1a),
268 * Vaux1Regu = force HP
269 * Vaux2Regu = force off
271 INIT_REGULATOR_REGISTER(AB8500_VAUX12REGU, 0x0f, 0x01),
273 * Vaux3Regu = force off
275 INIT_REGULATOR_REGISTER(AB8500_VRF1VAUX3REGU, 0x03, 0x00),
279 INIT_REGULATOR_REGISTER(AB8500_VAUX1SEL, 0x0f, 0x08),
283 INIT_REGULATOR_REGISTER(AB8500_VAUX2SEL, 0x0f, 0x0d),
287 INIT_REGULATOR_REGISTER(AB8500_VRF1VAUX3SEL, 0x07, 0x07),
289 * VextSupply12LP = disabled (no LP)
291 INIT_REGULATOR_REGISTER(AB8500_REGUCTRL2SPARE, 0x01, 0x00),
293 * Vaux1Disch = short discharge time
294 * Vaux2Disch = short discharge time
295 * Vaux3Disch = short discharge time
296 * Vintcore12Disch = short discharge time
297 * VTVoutDisch = short discharge time
298 * VaudioDisch = short discharge time
300 INIT_REGULATOR_REGISTER(AB8500_REGUCTRLDISCH, 0xfc, 0x00),
302 * VanaDisch = short discharge time
303 * VdmicPullDownEna = pulldown disabled when Vdmic is disabled
304 * VdmicDisch = short discharge time
306 INIT_REGULATOR_REGISTER(AB8500_REGUCTRLDISCH2, 0x16, 0x00),
309 /* AB8500 regulators */
310 static struct regulator_init_data ab8500_regulators[AB8500_NUM_REGULATORS] = {
311 /* supplies to the display/camera */
312 [AB8500_LDO_AUX1] = {
317 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
318 REGULATOR_CHANGE_STATUS,
319 .boot_on = 1, /* display is on at boot */
321 * This voltage cannot be disabled right now because
322 * it is somehow affecting the external MMC
323 * functionality, though that typically will use
328 .num_consumer_supplies = ARRAY_SIZE(ab8500_vaux1_consumers),
329 .consumer_supplies = ab8500_vaux1_consumers,
331 /* supplies to the on-board eMMC */
332 [AB8500_LDO_AUX2] = {
337 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
338 REGULATOR_CHANGE_STATUS,
340 .num_consumer_supplies = ARRAY_SIZE(ab8500_vaux2_consumers),
341 .consumer_supplies = ab8500_vaux2_consumers,
343 /* supply for VAUX3, supplies to SDcard slots */
344 [AB8500_LDO_AUX3] = {
349 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
350 REGULATOR_CHANGE_STATUS,
352 .num_consumer_supplies = ARRAY_SIZE(ab8500_vaux3_consumers),
353 .consumer_supplies = ab8500_vaux3_consumers,
355 /* supply for tvout, gpadc, TVOUT LDO */
356 [AB8500_LDO_TVOUT] = {
359 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
361 .num_consumer_supplies = ARRAY_SIZE(ab8500_vtvout_consumers),
362 .consumer_supplies = ab8500_vtvout_consumers,
364 /* supply for ab8500-vaudio, VAUDIO LDO */
365 [AB8500_LDO_AUDIO] = {
368 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
370 .num_consumer_supplies = ARRAY_SIZE(ab8500_vaud_consumers),
371 .consumer_supplies = ab8500_vaud_consumers,
373 /* supply for v-anamic1 VAMic1-LDO */
374 [AB8500_LDO_ANAMIC1] = {
377 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
379 .num_consumer_supplies = ARRAY_SIZE(ab8500_vamic1_consumers),
380 .consumer_supplies = ab8500_vamic1_consumers,
382 /* supply for v-amic2, VAMIC2 LDO, reuse constants for AMIC1 */
383 [AB8500_LDO_ANAMIC2] = {
386 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
388 .num_consumer_supplies = ARRAY_SIZE(ab8500_vamic2_consumers),
389 .consumer_supplies = ab8500_vamic2_consumers,
391 /* supply for v-dmic, VDMIC LDO */
392 [AB8500_LDO_DMIC] = {
395 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
397 .num_consumer_supplies = ARRAY_SIZE(ab8500_vdmic_consumers),
398 .consumer_supplies = ab8500_vdmic_consumers,
400 /* supply for v-intcore12, VINTCORE12 LDO */
401 [AB8500_LDO_INTCORE] = {
404 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
406 .num_consumer_supplies = ARRAY_SIZE(ab8500_vintcore_consumers),
407 .consumer_supplies = ab8500_vintcore_consumers,
409 /* supply for U8500 CSI/DSI, VANA LDO */
413 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
415 .num_consumer_supplies = ARRAY_SIZE(ab8500_vana_consumers),
416 .consumer_supplies = ab8500_vana_consumers,
420 struct ab8500_regulator_platform_data ab8500_regulator_plat_data = {
421 .reg_init = ab8500_reg_init,
422 .num_reg_init = ARRAY_SIZE(ab8500_reg_init),
423 .regulator = ab8500_regulators,
424 .num_regulator = ARRAY_SIZE(ab8500_regulators),