blob: 3f5eaccf6d8f464be777c9c7b75a99a2d95e90bc [file] [log] [blame]
Peter Ujfalusia53b8e32011-06-04 08:16:41 +03001/*
2 * twl-common.c
3 *
4 * Copyright (C) 2011 Texas Instruments, Inc..
5 * Author: Peter Ujfalusi <peter.ujfalusi@ti.com>
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * version 2 as published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
19 * 02110-1301 USA
20 *
21 */
22
23#include <linux/i2c.h>
24#include <linux/i2c/twl.h>
25#include <linux/gpio.h>
Peter Ujfalusib22f9542011-06-07 10:26:46 +030026#include <linux/regulator/machine.h>
27#include <linux/regulator/fixed.h>
Peter Ujfalusia53b8e32011-06-04 08:16:41 +030028
29#include <plat/i2c.h>
Peter Ujfalusib22f9542011-06-07 10:26:46 +030030#include <plat/usb.h>
Peter Ujfalusia53b8e32011-06-04 08:16:41 +030031
Tony Lindgrendbc04162012-08-31 10:59:07 -070032#include "soc.h"
Peter Ujfalusia53b8e32011-06-04 08:16:41 +030033#include "twl-common.h"
Kevin Hilman46232a32011-11-23 14:43:01 -080034#include "pm.h"
Tero Kristo49c008e2012-02-20 12:26:08 +020035#include "voltage.h"
Kevin Hilman5941b812012-06-28 10:01:32 -070036#include "mux.h"
Peter Ujfalusia53b8e32011-06-04 08:16:41 +030037
38static struct i2c_board_info __initdata pmic_i2c_board_info = {
39 .addr = 0x48,
40 .flags = I2C_CLIENT_WAKE,
41};
42
Peter Ujfalusida0085f2012-06-21 01:36:02 -070043#if defined(CONFIG_ARCH_OMAP3) || defined(CONFIG_ARCH_OMAP4)
Tero Kristo49c008e2012-02-20 12:26:08 +020044static int twl_set_voltage(void *data, int target_uV)
45{
46 struct voltagedomain *voltdm = (struct voltagedomain *)data;
47 return voltdm_scale(voltdm, target_uV);
48}
49
50static int twl_get_voltage(void *data)
51{
52 struct voltagedomain *voltdm = (struct voltagedomain *)data;
53 return voltdm_get_voltage(voltdm);
54}
Peter Ujfalusida0085f2012-06-21 01:36:02 -070055#endif
Tero Kristo49c008e2012-02-20 12:26:08 +020056
Peter Ujfalusia53b8e32011-06-04 08:16:41 +030057void __init omap_pmic_init(int bus, u32 clkrate,
58 const char *pmic_type, int pmic_irq,
59 struct twl4030_platform_data *pmic_data)
60{
Kevin Hilman265a2bc2012-07-16 16:56:15 -070061 omap_mux_init_signal("sys_nirq", OMAP_PIN_INPUT_PULLUP | OMAP_PIN_OFF_WAKEUPENABLE);
Peter Ujfalusia53b8e32011-06-04 08:16:41 +030062 strncpy(pmic_i2c_board_info.type, pmic_type,
63 sizeof(pmic_i2c_board_info.type));
64 pmic_i2c_board_info.irq = pmic_irq;
65 pmic_i2c_board_info.platform_data = pmic_data;
66
67 omap_register_i2c_bus(bus, clkrate, &pmic_i2c_board_info, 1);
68}
Peter Ujfalusib22f9542011-06-07 10:26:46 +030069
Peter Ujfalusi8eaeb932012-04-03 11:56:51 +030070void __init omap4_pmic_init(const char *pmic_type,
71 struct twl4030_platform_data *pmic_data,
Peter Ujfalusi9495d1e2012-09-24 12:24:48 +030072 struct i2c_board_info *devices, int nr_devices)
Peter Ujfalusi8eaeb932012-04-03 11:56:51 +030073{
74 /* PMIC part*/
Kevin Hilman5941b812012-06-28 10:01:32 -070075 omap_mux_init_signal("sys_nirq1", OMAP_PIN_INPUT_PULLUP | OMAP_PIN_OFF_WAKEUPENABLE);
Peter Ujfalusi9495d1e2012-09-24 12:24:48 +030076 omap_pmic_init(1, 400, pmic_type, 7 + OMAP44XX_IRQ_GIC_START, pmic_data);
Peter Ujfalusi8eaeb932012-04-03 11:56:51 +030077
Peter Ujfalusi9495d1e2012-09-24 12:24:48 +030078 /* Register additional devices on i2c1 bus if needed */
79 if (devices)
80 i2c_register_board_info(1, devices, nr_devices);
Peter Ujfalusi8eaeb932012-04-03 11:56:51 +030081}
82
Kevin Hilman46232a32011-11-23 14:43:01 -080083void __init omap_pmic_late_init(void)
84{
Peter Ujfalusi9495d1e2012-09-24 12:24:48 +030085 /* Init the OMAP TWL parameters (if PMIC has been registerd) */
86 if (!pmic_i2c_board_info.irq)
87 return;
88
89 omap3_twl_init();
90 omap4_twl_init();
Kevin Hilman46232a32011-11-23 14:43:01 -080091}
92
Peter Ujfalusid12d1fc2011-08-09 15:36:50 +030093#if defined(CONFIG_ARCH_OMAP3)
Peter Ujfalusi827ed9a2011-06-07 10:28:54 +030094static struct twl4030_usb_data omap3_usb_pdata = {
95 .usb_mode = T2_USB_MODE_ULPI,
96};
97
98static int omap3_batt_table[] = {
99/* 0 C */
10030800, 29500, 28300, 27100,
10126000, 24900, 23900, 22900, 22000, 21100, 20300, 19400, 18700, 17900,
10217200, 16500, 15900, 15300, 14700, 14100, 13600, 13100, 12600, 12100,
10311600, 11200, 10800, 10400, 10000, 9630, 9280, 8950, 8620, 8310,
1048020, 7730, 7460, 7200, 6950, 6710, 6470, 6250, 6040, 5830,
1055640, 5450, 5260, 5090, 4920, 4760, 4600, 4450, 4310, 4170,
1064040, 3910, 3790, 3670, 3550
107};
108
109static struct twl4030_bci_platform_data omap3_bci_pdata = {
110 .battery_tmp_tbl = omap3_batt_table,
111 .tblsize = ARRAY_SIZE(omap3_batt_table),
112};
113
114static struct twl4030_madc_platform_data omap3_madc_pdata = {
115 .irq_line = 1,
116};
117
Peter Ujfalusi4ae6df52011-05-31 15:21:13 +0300118static struct twl4030_codec_data omap3_codec;
Peter Ujfalusi827ed9a2011-06-07 10:28:54 +0300119
Peter Ujfalusi4ae6df52011-05-31 15:21:13 +0300120static struct twl4030_audio_data omap3_audio_pdata = {
Peter Ujfalusi827ed9a2011-06-07 10:28:54 +0300121 .audio_mclk = 26000000,
Peter Ujfalusi4ae6df52011-05-31 15:21:13 +0300122 .codec = &omap3_codec,
Peter Ujfalusi827ed9a2011-06-07 10:28:54 +0300123};
124
Peter Ujfalusib252b0e2011-06-07 11:38:24 +0300125static struct regulator_consumer_supply omap3_vdda_dac_supplies[] = {
126 REGULATOR_SUPPLY("vdda_dac", "omapdss_venc"),
127};
128
129static struct regulator_init_data omap3_vdac_idata = {
130 .constraints = {
131 .min_uV = 1800000,
132 .max_uV = 1800000,
133 .valid_modes_mask = REGULATOR_MODE_NORMAL
134 | REGULATOR_MODE_STANDBY,
135 .valid_ops_mask = REGULATOR_CHANGE_MODE
136 | REGULATOR_CHANGE_STATUS,
137 },
138 .num_consumer_supplies = ARRAY_SIZE(omap3_vdda_dac_supplies),
139 .consumer_supplies = omap3_vdda_dac_supplies,
140};
141
142static struct regulator_consumer_supply omap3_vpll2_supplies[] = {
143 REGULATOR_SUPPLY("vdds_dsi", "omapdss"),
Tomi Valkeinen7c68dd92011-08-03 14:00:57 +0300144 REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi.0"),
Peter Ujfalusib252b0e2011-06-07 11:38:24 +0300145};
146
147static struct regulator_init_data omap3_vpll2_idata = {
148 .constraints = {
149 .min_uV = 1800000,
150 .max_uV = 1800000,
151 .valid_modes_mask = REGULATOR_MODE_NORMAL
152 | REGULATOR_MODE_STANDBY,
153 .valid_ops_mask = REGULATOR_CHANGE_MODE
154 | REGULATOR_CHANGE_STATUS,
155 },
156 .num_consumer_supplies = ARRAY_SIZE(omap3_vpll2_supplies),
157 .consumer_supplies = omap3_vpll2_supplies,
158};
159
Tero Kristo23e22a52012-02-20 12:26:07 +0200160static struct regulator_consumer_supply omap3_vdd1_supply[] = {
Kevin Hilman24d7b402012-09-06 14:03:08 -0700161 REGULATOR_SUPPLY("vcc", "cpu0"),
Tero Kristo23e22a52012-02-20 12:26:07 +0200162};
163
164static struct regulator_consumer_supply omap3_vdd2_supply[] = {
165 REGULATOR_SUPPLY("vcc", "l3_main.0"),
166};
167
168static struct regulator_init_data omap3_vdd1 = {
169 .constraints = {
170 .name = "vdd_mpu_iva",
171 .min_uV = 600000,
172 .max_uV = 1450000,
173 .valid_modes_mask = REGULATOR_MODE_NORMAL,
174 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
175 },
176 .num_consumer_supplies = ARRAY_SIZE(omap3_vdd1_supply),
177 .consumer_supplies = omap3_vdd1_supply,
178};
179
180static struct regulator_init_data omap3_vdd2 = {
181 .constraints = {
182 .name = "vdd_core",
183 .min_uV = 600000,
184 .max_uV = 1450000,
185 .valid_modes_mask = REGULATOR_MODE_NORMAL,
186 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
187 },
188 .num_consumer_supplies = ARRAY_SIZE(omap3_vdd2_supply),
189 .consumer_supplies = omap3_vdd2_supply,
190};
191
Tero Kristo49c008e2012-02-20 12:26:08 +0200192static struct twl_regulator_driver_data omap3_vdd1_drvdata = {
193 .get_voltage = twl_get_voltage,
194 .set_voltage = twl_set_voltage,
195};
196
197static struct twl_regulator_driver_data omap3_vdd2_drvdata = {
198 .get_voltage = twl_get_voltage,
199 .set_voltage = twl_set_voltage,
200};
201
Peter Ujfalusid12d1fc2011-08-09 15:36:50 +0300202void __init omap3_pmic_get_config(struct twl4030_platform_data *pmic_data,
203 u32 pdata_flags, u32 regulators_flags)
204{
Tero Kristo49c008e2012-02-20 12:26:08 +0200205 if (!pmic_data->vdd1) {
206 omap3_vdd1.driver_data = &omap3_vdd1_drvdata;
207 omap3_vdd1_drvdata.data = voltdm_lookup("mpu_iva");
Tero Kristo23e22a52012-02-20 12:26:07 +0200208 pmic_data->vdd1 = &omap3_vdd1;
Tero Kristo49c008e2012-02-20 12:26:08 +0200209 }
210 if (!pmic_data->vdd2) {
211 omap3_vdd2.driver_data = &omap3_vdd2_drvdata;
212 omap3_vdd2_drvdata.data = voltdm_lookup("core");
Tero Kristo23e22a52012-02-20 12:26:07 +0200213 pmic_data->vdd2 = &omap3_vdd2;
Tero Kristo49c008e2012-02-20 12:26:08 +0200214 }
Peter Ujfalusid12d1fc2011-08-09 15:36:50 +0300215
216 /* Common platform data configurations */
217 if (pdata_flags & TWL_COMMON_PDATA_USB && !pmic_data->usb)
218 pmic_data->usb = &omap3_usb_pdata;
219
220 if (pdata_flags & TWL_COMMON_PDATA_BCI && !pmic_data->bci)
221 pmic_data->bci = &omap3_bci_pdata;
222
223 if (pdata_flags & TWL_COMMON_PDATA_MADC && !pmic_data->madc)
224 pmic_data->madc = &omap3_madc_pdata;
225
226 if (pdata_flags & TWL_COMMON_PDATA_AUDIO && !pmic_data->audio)
227 pmic_data->audio = &omap3_audio_pdata;
228
229 /* Common regulator configurations */
230 if (regulators_flags & TWL_COMMON_REGULATOR_VDAC && !pmic_data->vdac)
231 pmic_data->vdac = &omap3_vdac_idata;
232
233 if (regulators_flags & TWL_COMMON_REGULATOR_VPLL2 && !pmic_data->vpll2)
234 pmic_data->vpll2 = &omap3_vpll2_idata;
235}
236#endif /* CONFIG_ARCH_OMAP3 */
237
238#if defined(CONFIG_ARCH_OMAP4)
239static struct twl4030_usb_data omap4_usb_pdata = {
Peter Ujfalusid12d1fc2011-08-09 15:36:50 +0300240};
241
Peter Ujfalusib22f9542011-06-07 10:26:46 +0300242static struct regulator_init_data omap4_vdac_idata = {
243 .constraints = {
244 .min_uV = 1800000,
245 .max_uV = 1800000,
246 .valid_modes_mask = REGULATOR_MODE_NORMAL
247 | REGULATOR_MODE_STANDBY,
248 .valid_ops_mask = REGULATOR_CHANGE_MODE
249 | REGULATOR_CHANGE_STATUS,
250 },
Peter Ujfalusifde01902012-05-09 14:19:16 -0700251 .supply_regulator = "V2V1",
Peter Ujfalusib22f9542011-06-07 10:26:46 +0300252};
253
254static struct regulator_init_data omap4_vaux2_idata = {
255 .constraints = {
256 .min_uV = 1200000,
257 .max_uV = 2800000,
258 .apply_uV = true,
259 .valid_modes_mask = REGULATOR_MODE_NORMAL
260 | REGULATOR_MODE_STANDBY,
261 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
262 | REGULATOR_CHANGE_MODE
263 | REGULATOR_CHANGE_STATUS,
264 },
265};
266
267static struct regulator_init_data omap4_vaux3_idata = {
268 .constraints = {
269 .min_uV = 1000000,
270 .max_uV = 3000000,
271 .apply_uV = true,
272 .valid_modes_mask = REGULATOR_MODE_NORMAL
273 | REGULATOR_MODE_STANDBY,
274 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
275 | REGULATOR_CHANGE_MODE
276 | REGULATOR_CHANGE_STATUS,
277 },
278};
279
280static struct regulator_consumer_supply omap4_vmmc_supply[] = {
281 REGULATOR_SUPPLY("vmmc", "omap_hsmmc.0"),
282};
283
284/* VMMC1 for MMC1 card */
285static struct regulator_init_data omap4_vmmc_idata = {
286 .constraints = {
287 .min_uV = 1200000,
288 .max_uV = 3000000,
289 .apply_uV = true,
290 .valid_modes_mask = REGULATOR_MODE_NORMAL
291 | REGULATOR_MODE_STANDBY,
292 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
293 | REGULATOR_CHANGE_MODE
294 | REGULATOR_CHANGE_STATUS,
295 },
296 .num_consumer_supplies = ARRAY_SIZE(omap4_vmmc_supply),
297 .consumer_supplies = omap4_vmmc_supply,
298};
299
300static struct regulator_init_data omap4_vpp_idata = {
301 .constraints = {
302 .min_uV = 1800000,
303 .max_uV = 2500000,
304 .apply_uV = true,
305 .valid_modes_mask = REGULATOR_MODE_NORMAL
306 | REGULATOR_MODE_STANDBY,
307 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE
308 | REGULATOR_CHANGE_MODE
309 | REGULATOR_CHANGE_STATUS,
310 },
311};
312
313static struct regulator_init_data omap4_vana_idata = {
314 .constraints = {
315 .min_uV = 2100000,
316 .max_uV = 2100000,
317 .valid_modes_mask = REGULATOR_MODE_NORMAL
318 | REGULATOR_MODE_STANDBY,
319 .valid_ops_mask = REGULATOR_CHANGE_MODE
320 | REGULATOR_CHANGE_STATUS,
321 },
322};
323
Tomi Valkeinen4e6a0ab2011-08-03 14:13:52 +0300324static struct regulator_consumer_supply omap4_vcxio_supply[] = {
325 REGULATOR_SUPPLY("vdds_dsi", "omapdss_dss"),
326 REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi.0"),
327 REGULATOR_SUPPLY("vdds_dsi", "omapdss_dsi.1"),
328};
329
Peter Ujfalusib22f9542011-06-07 10:26:46 +0300330static struct regulator_init_data omap4_vcxio_idata = {
331 .constraints = {
332 .min_uV = 1800000,
333 .max_uV = 1800000,
334 .valid_modes_mask = REGULATOR_MODE_NORMAL
335 | REGULATOR_MODE_STANDBY,
336 .valid_ops_mask = REGULATOR_CHANGE_MODE
337 | REGULATOR_CHANGE_STATUS,
Tomi Valkeinen4e6a0ab2011-08-03 14:13:52 +0300338 .always_on = true,
Peter Ujfalusib22f9542011-06-07 10:26:46 +0300339 },
Tomi Valkeinen4e6a0ab2011-08-03 14:13:52 +0300340 .num_consumer_supplies = ARRAY_SIZE(omap4_vcxio_supply),
341 .consumer_supplies = omap4_vcxio_supply,
Peter Ujfalusifde01902012-05-09 14:19:16 -0700342 .supply_regulator = "V2V1",
Peter Ujfalusib22f9542011-06-07 10:26:46 +0300343};
344
345static struct regulator_init_data omap4_vusb_idata = {
346 .constraints = {
347 .min_uV = 3300000,
348 .max_uV = 3300000,
Peter Ujfalusib22f9542011-06-07 10:26:46 +0300349 .valid_modes_mask = REGULATOR_MODE_NORMAL
350 | REGULATOR_MODE_STANDBY,
351 .valid_ops_mask = REGULATOR_CHANGE_MODE
352 | REGULATOR_CHANGE_STATUS,
353 },
354};
355
356static struct regulator_init_data omap4_clk32kg_idata = {
357 .constraints = {
358 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
359 },
360};
361
Tero Kristoe160dda2012-02-22 12:40:40 +0200362static struct regulator_consumer_supply omap4_vdd1_supply[] = {
363 REGULATOR_SUPPLY("vcc", "mpu.0"),
364};
365
366static struct regulator_consumer_supply omap4_vdd2_supply[] = {
367 REGULATOR_SUPPLY("vcc", "iva.0"),
368};
369
370static struct regulator_consumer_supply omap4_vdd3_supply[] = {
371 REGULATOR_SUPPLY("vcc", "l3_main.0"),
372};
373
374static struct regulator_init_data omap4_vdd1 = {
375 .constraints = {
376 .name = "vdd_mpu",
377 .min_uV = 500000,
378 .max_uV = 1500000,
379 .valid_modes_mask = REGULATOR_MODE_NORMAL,
380 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
381 },
382 .num_consumer_supplies = ARRAY_SIZE(omap4_vdd1_supply),
383 .consumer_supplies = omap4_vdd1_supply,
384};
385
386static struct regulator_init_data omap4_vdd2 = {
387 .constraints = {
388 .name = "vdd_iva",
389 .min_uV = 500000,
390 .max_uV = 1500000,
391 .valid_modes_mask = REGULATOR_MODE_NORMAL,
392 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
393 },
394 .num_consumer_supplies = ARRAY_SIZE(omap4_vdd2_supply),
395 .consumer_supplies = omap4_vdd2_supply,
396};
397
398static struct regulator_init_data omap4_vdd3 = {
399 .constraints = {
400 .name = "vdd_core",
401 .min_uV = 500000,
402 .max_uV = 1500000,
403 .valid_modes_mask = REGULATOR_MODE_NORMAL,
404 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
405 },
406 .num_consumer_supplies = ARRAY_SIZE(omap4_vdd3_supply),
407 .consumer_supplies = omap4_vdd3_supply,
408};
409
410
411static struct twl_regulator_driver_data omap4_vdd1_drvdata = {
412 .get_voltage = twl_get_voltage,
413 .set_voltage = twl_set_voltage,
414};
415
416static struct twl_regulator_driver_data omap4_vdd2_drvdata = {
417 .get_voltage = twl_get_voltage,
418 .set_voltage = twl_set_voltage,
419};
420
421static struct twl_regulator_driver_data omap4_vdd3_drvdata = {
422 .get_voltage = twl_get_voltage,
423 .set_voltage = twl_set_voltage,
424};
425
Peter Ujfalusifde01902012-05-09 14:19:16 -0700426static struct regulator_consumer_supply omap4_v1v8_supply[] = {
427 REGULATOR_SUPPLY("vio", "1-004b"),
428};
429
430static struct regulator_init_data omap4_v1v8_idata = {
431 .constraints = {
432 .min_uV = 1800000,
433 .max_uV = 1800000,
434 .valid_modes_mask = REGULATOR_MODE_NORMAL
435 | REGULATOR_MODE_STANDBY,
436 .valid_ops_mask = REGULATOR_CHANGE_MODE
437 | REGULATOR_CHANGE_STATUS,
438 .always_on = true,
439 },
440 .num_consumer_supplies = ARRAY_SIZE(omap4_v1v8_supply),
441 .consumer_supplies = omap4_v1v8_supply,
442};
443
444static struct regulator_consumer_supply omap4_v2v1_supply[] = {
445 REGULATOR_SUPPLY("v2v1", "1-004b"),
446};
447
448static struct regulator_init_data omap4_v2v1_idata = {
449 .constraints = {
450 .min_uV = 2100000,
451 .max_uV = 2100000,
452 .valid_modes_mask = REGULATOR_MODE_NORMAL
453 | REGULATOR_MODE_STANDBY,
454 .valid_ops_mask = REGULATOR_CHANGE_MODE
455 | REGULATOR_CHANGE_STATUS,
456 },
457 .num_consumer_supplies = ARRAY_SIZE(omap4_v2v1_supply),
458 .consumer_supplies = omap4_v2v1_supply,
459};
460
Peter Ujfalusib22f9542011-06-07 10:26:46 +0300461void __init omap4_pmic_get_config(struct twl4030_platform_data *pmic_data,
462 u32 pdata_flags, u32 regulators_flags)
463{
Tero Kristoe160dda2012-02-22 12:40:40 +0200464 if (!pmic_data->vdd1) {
465 omap4_vdd1.driver_data = &omap4_vdd1_drvdata;
466 omap4_vdd1_drvdata.data = voltdm_lookup("mpu");
467 pmic_data->vdd1 = &omap4_vdd1;
468 }
469
470 if (!pmic_data->vdd2) {
471 omap4_vdd2.driver_data = &omap4_vdd2_drvdata;
472 omap4_vdd2_drvdata.data = voltdm_lookup("iva");
473 pmic_data->vdd2 = &omap4_vdd2;
474 }
475
476 if (!pmic_data->vdd3) {
477 omap4_vdd3.driver_data = &omap4_vdd3_drvdata;
478 omap4_vdd3_drvdata.data = voltdm_lookup("core");
479 pmic_data->vdd3 = &omap4_vdd3;
480 }
481
Peter Ujfalusib22f9542011-06-07 10:26:46 +0300482 /* Common platform data configurations */
483 if (pdata_flags & TWL_COMMON_PDATA_USB && !pmic_data->usb)
484 pmic_data->usb = &omap4_usb_pdata;
485
486 /* Common regulator configurations */
487 if (regulators_flags & TWL_COMMON_REGULATOR_VDAC && !pmic_data->vdac)
488 pmic_data->vdac = &omap4_vdac_idata;
489
490 if (regulators_flags & TWL_COMMON_REGULATOR_VAUX2 && !pmic_data->vaux2)
491 pmic_data->vaux2 = &omap4_vaux2_idata;
492
493 if (regulators_flags & TWL_COMMON_REGULATOR_VAUX3 && !pmic_data->vaux3)
494 pmic_data->vaux3 = &omap4_vaux3_idata;
495
496 if (regulators_flags & TWL_COMMON_REGULATOR_VMMC && !pmic_data->vmmc)
497 pmic_data->vmmc = &omap4_vmmc_idata;
498
499 if (regulators_flags & TWL_COMMON_REGULATOR_VPP && !pmic_data->vpp)
500 pmic_data->vpp = &omap4_vpp_idata;
501
502 if (regulators_flags & TWL_COMMON_REGULATOR_VANA && !pmic_data->vana)
503 pmic_data->vana = &omap4_vana_idata;
504
505 if (regulators_flags & TWL_COMMON_REGULATOR_VCXIO && !pmic_data->vcxio)
506 pmic_data->vcxio = &omap4_vcxio_idata;
507
508 if (regulators_flags & TWL_COMMON_REGULATOR_VUSB && !pmic_data->vusb)
509 pmic_data->vusb = &omap4_vusb_idata;
510
511 if (regulators_flags & TWL_COMMON_REGULATOR_CLK32KG &&
512 !pmic_data->clk32kg)
513 pmic_data->clk32kg = &omap4_clk32kg_idata;
Peter Ujfalusifde01902012-05-09 14:19:16 -0700514
515 if (regulators_flags & TWL_COMMON_REGULATOR_V1V8 && !pmic_data->v1v8)
516 pmic_data->v1v8 = &omap4_v1v8_idata;
517
518 if (regulators_flags & TWL_COMMON_REGULATOR_V2V1 && !pmic_data->v2v1)
519 pmic_data->v2v1 = &omap4_v2v1_idata;
Peter Ujfalusib22f9542011-06-07 10:26:46 +0300520}
Peter Ujfalusid12d1fc2011-08-09 15:36:50 +0300521#endif /* CONFIG_ARCH_OMAP4 */