upload tizen1.0 source
[kernel/linux-2.6.36.git] / arch / arm / mach-s5pv310 / max8997-slp7.c
1 /*
2  * linux/arch/arm/mach-s5pv310/max8997-slp7.c
3  *
4  * Copyright (c) 2011 Samsung Electronics Co., Ltd.
5  * MyungJoo Ham <myungjoo.ham@samsung.com>
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License version 2 as
9  * published by the Free Software Foundation.
10  *
11  * MAX8997 Setting for SLP7 Board
12  */
13
14 #include <linux/mfd/max8997.h>
15 #include <linux/regulator/machine.h>
16
17 #include <mach/gpio.h>
18 #include <mach/irqs.h>
19
20 #include <plat/gpio-cfg.h>
21
22 void __init slp7_pmic_init(void)
23 {
24         int gpio;
25
26         /* TODO: SET1, SET2, SET3, AP_PMIC_IRQ< ... */
27         gpio = S5PV310_GPX0(7);
28         gpio_request(gpio, "AP_PMIC_IRQ");
29         s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(0xf));
30         s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
31 }
32
33 static struct regulator_consumer_supply slp7_max8997_ldo1_consumer[] = {
34         REGULATOR_SUPPLY("vadc", NULL),
35 };
36 static struct regulator_consumer_supply slp7_max8997_ldo2_consumer[] = {
37         REGULATOR_SUPPLY("vdd_alive", "s5pc210"), /* FIXME: device name */
38 };
39 static struct regulator_consumer_supply slp7_max8997_ldo3_consumer[] = {
40         REGULATOR_SUPPLY("vusb_a", NULL),       /* TODO: DEV NAME? */
41         REGULATOR_SUPPLY("vmipi_1.1v", NULL),   /* obsolete */
42         REGULATOR_SUPPLY("vdd11", "mipi"), /* FIXME: device name */
43 };
44 static struct regulator_consumer_supply slp7_max8997_ldo4_consumer[] = {
45         REGULATOR_SUPPLY("vmipi_1.8V", NULL), /* obsolete */
46         REGULATOR_SUPPLY("vdd18", "mipi"), /* FIXME: device name */
47         REGULATOR_SUPPLY("mipi_csi", "s5p-mipi-csis.0"), /* FIXME: device name */
48 };
49 static struct regulator_consumer_supply slp7_max8997_ldo5_consumer[] = {
50         REGULATOR_SUPPLY("vhsic", NULL), /* obsolete? */
51         REGULATOR_SUPPLY("vdd12_uhost", "s5pc210"), /* FIXME: device name */
52 };
53 static struct regulator_consumer_supply slp7_max8997_ldo6_consumer[] = {
54         /* FIXME: add Audio Codec, MAX8903 Switching Charger */
55         REGULATOR_SUPPLY("vcc_1.8v", "platform-lcd"),
56 };
57 static struct regulator_consumer_supply slp7_max8997_ldo7_consumer[] = {
58         /* pin "11" of HDC803 */
59         /* pin "10" of HDC803 */
60         REGULATOR_SUPPLY("dig_18", "0-001f"),
61 };
62 static struct regulator_consumer_supply slp7_max8997_ldo8_consumer[] = {
63         REGULATOR_SUPPLY("vusb_d", NULL), /* TODO: DEV NAME? */
64         REGULATOR_SUPPLY("vdac", NULL), /* TODO: DEV NAME? */
65 };
66 static struct regulator_consumer_supply slp7_max8997_ldo9_consumer[] = {
67         REGULATOR_SUPPLY("vcc_2.8v_pda", NULL), /* FIXME: update name */
68 };
69 static struct regulator_consumer_supply slp7_max8997_ldo10_consumer[] = {
70         REGULATOR_SUPPLY("vpll", NULL), /* obsolete? */
71         REGULATOR_SUPPLY("vdd11_pll", "s5pc210"), /* FIXME: device name */
72 };
73 static struct regulator_consumer_supply slp7_max8997_ldo11_consumer[] = {
74         /* FIXME: "vcc" pin of U804 SN75LVDS83BZQLR (LVDS Transmitter) */
75         REGULATOR_SUPPLY("lvds_3.3v", "platform-lcd"),
76 };
77 static struct regulator_consumer_supply slp7_max8997_ldo12_consumer[] = {
78         /* FIXME: pin "7" of HDC802: AXE430124AW1, "1.3M_CAM & LUME CONN" */
79         REGULATOR_SUPPLY("vddio", "6-003c"),    /* TODO: double check the name */
80 };
81 static struct regulator_consumer_supply slp7_max8997_ldo13_consumer[] = {
82         REGULATOR_SUPPLY("vmmc", "s3c-sdhci.2"),
83 };
84 static struct regulator_consumer_supply slp7_max8997_ldo14_consumer[] = {
85         REGULATOR_SUPPLY("inmotor", "max8997-haptic"),
86 };
87 static struct regulator_consumer_supply slp7_max8997_ldo15_consumer[] = {
88         REGULATOR_SUPPLY("avdd", "3-004a"), /* Touch Screen's AVDD */
89 };
90 static struct regulator_consumer_supply slp7_max8997_ldo16_consumer[] = {
91         /* FIXME: pin "8" of HDC803: FH26-31S-0.3SHBW(21), "8M_ISP" */
92         REGULATOR_SUPPLY("d_sensor", "0-001f"), /* Touch Screen's AVDD */
93 };
94 static struct regulator_consumer_supply slp7_max8997_ldo18_consumer[] = {
95         REGULATOR_SUPPLY("vdd", "3-004a"), /* Touch Screen's VDD and I2C */
96 };
97 static struct regulator_consumer_supply slp7_max8997_ldo21_consumer[] = {
98         /* "Memory I/O Power" */
99 };
100
101 static struct regulator_consumer_supply slp7_max8997_buck1_consumer[] = {
102         REGULATOR_SUPPLY("vdd_arm", NULL),
103 };
104 static struct regulator_consumer_supply slp7_max8997_buck2_consumer[] = {
105         REGULATOR_SUPPLY("vdd_int", NULL),
106 };
107 static struct regulator_consumer_supply slp7_max8997_buck3_consumer[] = {
108         REGULATOR_SUPPLY("vg3d", "mali_dev.0"),
109 };
110 static struct regulator_consumer_supply slp7_max8997_buck4_consumer[] = {
111         /* FIXME: pin "12", "13", "14" of HDC803 */
112         REGULATOR_SUPPLY("core", "0-001f"),
113 };
114 static struct regulator_consumer_supply slp7_max8997_buck5_consumer[] = {
115         REGULATOR_SUPPLY("vdd_mem", NULL), /* LPDDR's Core Power */
116 };
117 static struct regulator_consumer_supply slp7_max8997_buck6_consumer[] = {
118         REGULATOR_SUPPLY("dig_28", "0-001f"), /* FIXME: pin "7" of HDC803 */
119 };
120 static struct regulator_consumer_supply slp7_max8997_buck7_consumer[] = {
121         /* CAM POWER */
122         /* LDO INL. */
123         REGULATOR_SUPPLY("vcc_sub_2.0v", "0-003c"),     /* TODO: double check the name */
124 };
125
126 static struct regulator_consumer_supply slp7_max8997_esafeout1_consumer[] = {
127         REGULATOR_SUPPLY("usb_vbus_ap_5v", NULL), /* obsolete. FIXME name? */
128 };
129 static struct regulator_consumer_supply slp7_max8997_esafeout2_consumer[] = {
130         REGULATOR_SUPPLY("usb_vbus_cp_5v", NULL), /* obsolete. FIXME name? */
131 };
132
133 static struct regulator_consumer_supply slp7_max8997_charger_consumer[] = {
134         REGULATOR_SUPPLY("vinchg1", "charger-manager.0"),
135 };
136 static struct regulator_consumer_supply slp7_max8997_charger_topoff_consumer[] = {
137         REGULATOR_SUPPLY("vinchg_stop", NULL), 
138 };
139
140 static struct regulator_consumer_supply slp7_max8997_32khz_ap_consumer[] = {
141         REGULATOR_SUPPLY("gps_clk", NULL),
142         REGULATOR_SUPPLY("bt_clk", NULL),
143         REGULATOR_SUPPLY("wifi_clk", NULL),
144 };
145
146 static struct regulator_init_data slp7_max8997_ldo1_data = {
147         .constraints    = {
148                 .name           = "VADC_3.3V_C210",
149                 .min_uV         = 3300000,
150                 .max_uV         = 3300000,
151                 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
152                 .apply_uV       = 1,
153                 .state_mem      = {
154                         .enabled        = 0,
155                         .disabled       = 1,
156                 },
157         },
158         .num_consumer_supplies  = ARRAY_SIZE(slp7_max8997_ldo1_consumer),
159         .consumer_supplies      = slp7_max8997_ldo1_consumer,
160 };
161
162 static struct regulator_init_data slp7_max8997_ldo2_data = {
163         .constraints    = {
164                 .name           = "VALIVE_1.1V_C210",
165                 .min_uV         = 1100000,
166                 .max_uV         = 1100000,
167                 .apply_uV       = 1,
168                 .always_on      = 1,
169                 .state_mem      = {
170                         .enabled        = 1,
171                         .disabled       = 0,
172                 },
173         },
174         .num_consumer_supplies  = ARRAY_SIZE(slp7_max8997_ldo2_consumer),
175         .consumer_supplies      = slp7_max8997_ldo2_consumer,
176 };
177
178 static struct regulator_init_data slp7_max8997_ldo3_data = {
179         .constraints    = {
180                 .name           = "VUSB_1.1V_C210",
181                 .min_uV         = 1100000,
182                 .max_uV         = 1100000,
183                 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
184                 .apply_uV       = 1,
185                 .state_mem      = {
186                         .enabled        = 0,
187                         .disabled       = 1,
188                 },
189         },
190         .num_consumer_supplies  = ARRAY_SIZE(slp7_max8997_ldo3_consumer),
191         .consumer_supplies      = slp7_max8997_ldo3_consumer,
192 };
193
194 static struct regulator_init_data slp7_max8997_ldo4_data = {
195         .constraints    = {
196                 .name           = "VMIPI_1.8V",
197                 .min_uV         = 1800000,
198                 .max_uV         = 1800000,
199                 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
200                 .apply_uV       = 1,
201                 .state_mem      = {
202                         .enabled        = 0,
203                         .disabled       = 1,
204                 },
205         },
206         .num_consumer_supplies  = ARRAY_SIZE(slp7_max8997_ldo4_consumer),
207         .consumer_supplies      = slp7_max8997_ldo4_consumer,
208 };
209
210 static struct regulator_init_data slp7_max8997_ldo5_data = {
211         .constraints    = {
212                 .name           = "VHSIC_1.2V_C210",
213                 .min_uV         = 1200000,
214                 .max_uV         = 1200000,
215                 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
216                 .apply_uV       = 1,
217                 .state_mem      = {
218                         .enabled        = 0,
219                         .disabled       = 1,
220                 },
221         },
222         .num_consumer_supplies  = ARRAY_SIZE(slp7_max8997_ldo5_consumer),
223         .consumer_supplies      = slp7_max8997_ldo5_consumer,
224 };
225
226 static struct regulator_init_data slp7_max8997_ldo6_data = {
227         .constraints    = {
228                 .name           = "VCC_1.8V_PDA",
229                 .min_uV         = 1800000,
230                 .max_uV         = 1800000,
231                 .apply_uV       = 1,
232                 .always_on      = 1,
233                 .state_mem      = {
234                         .enabled        = 1,
235                         .disabled       = 0,
236                 },
237         },
238         .num_consumer_supplies  = ARRAY_SIZE(slp7_max8997_ldo6_consumer),
239         .consumer_supplies      = slp7_max8997_ldo6_consumer,
240 };
241
242 static struct regulator_init_data slp7_max8997_ldo7_data = {
243         .constraints    = {
244                 .name           = "CAM_ISP_1.8V",
245                 .min_uV         = 1800000,
246                 .max_uV         = 1800000,
247                 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
248                 .apply_uV       = 1,
249                 .state_mem      = {
250                         .enabled        = 0,
251                         .disabled       = 1,
252                 },
253         },
254         .num_consumer_supplies  = ARRAY_SIZE(slp7_max8997_ldo7_consumer),
255         .consumer_supplies      = slp7_max8997_ldo7_consumer,
256 };
257
258 static struct regulator_init_data slp7_max8997_ldo8_data = {
259         .constraints    = {
260                 .name           = "VUSB/VDAC_3.3V_C210",
261                 .min_uV         = 3300000,
262                 .max_uV         = 3300000,
263                 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
264                 .apply_uV       = 1,
265                 .state_mem      = {
266                         .enabled = 0,
267                         .disabled = 1,
268                 },
269         },
270         .num_consumer_supplies  = ARRAY_SIZE(slp7_max8997_ldo8_consumer),
271         .consumer_supplies      = slp7_max8997_ldo8_consumer,
272 };
273
274 static struct regulator_init_data slp7_max8997_ldo9_data = {
275         .constraints    = {
276                 .name           = "VCC_2.8V_PDA",
277                 .min_uV         = 2800000,
278                 .max_uV         = 2800000,
279                 .apply_uV       = 1,
280                 .always_on      = 1,
281                 .state_mem      = {
282                         .enabled        = 1,
283                         .disabled       = 0,
284                 },
285         },
286         .num_consumer_supplies  = ARRAY_SIZE(slp7_max8997_ldo9_consumer),
287         .consumer_supplies      = slp7_max8997_ldo9_consumer,
288 };
289
290 static struct regulator_init_data slp7_max8997_ldo10_data = {
291         .constraints    = {
292                 .name           = "VPLL_1.1V_C210",
293                 .min_uV         = 1100000,
294                 .max_uV         = 1100000,
295                 .apply_uV       = 1,
296                 .always_on      = 1,
297                 .state_mem      = {
298                         .enabled        = 0,
299                         .disabled       = 1,
300                 },
301         },
302         .num_consumer_supplies  = ARRAY_SIZE(slp7_max8997_ldo10_consumer),
303         .consumer_supplies      = slp7_max8997_ldo10_consumer,
304 };
305
306 static struct regulator_init_data slp7_max8997_ldo11_data = {
307         .constraints    = {
308                 .name           = "LVDS_VDD3.3V",
309                 .min_uV         = 3300000,
310                 .max_uV         = 3300000,
311                 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
312                 .apply_uV       = 1,
313                 .boot_on        = 1,
314                 .state_mem      = {
315                         .enabled        = 0,
316                         .disabled       = 1,
317                 },
318         },
319         .num_consumer_supplies  = ARRAY_SIZE(slp7_max8997_ldo11_consumer),
320         .consumer_supplies      = slp7_max8997_ldo11_consumer,
321 };
322
323 static struct regulator_init_data slp7_max8997_ldo12_data = {
324         .constraints    = {
325                 .name           = "VT_CAM_1.8V",
326                 .min_uV         = 1800000,
327                 .max_uV         = 1800000,
328                 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
329                 .apply_uV       = 1,
330                 .state_mem      = {
331                         .enabled = 0,
332                         .disabled = 1,
333                 },
334         },
335         .num_consumer_supplies  = ARRAY_SIZE(slp7_max8997_ldo12_consumer),
336         .consumer_supplies      = slp7_max8997_ldo12_consumer,
337 };
338
339 static struct regulator_init_data slp7_max8997_ldo13_data = {
340         .constraints    = {
341                 .name           = "VTF_2.8V",
342                 .min_uV         = 2800000,
343                 .max_uV         = 2800000,
344                 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
345                 .apply_uV       = 1,
346                 .state_mem      = {
347                         .enabled = 0,
348                         .disabled = 1,
349                 },
350         },
351         .num_consumer_supplies  = ARRAY_SIZE(slp7_max8997_ldo13_consumer),
352         .consumer_supplies      = slp7_max8997_ldo13_consumer,
353 };
354
355 static struct regulator_init_data slp7_max8997_ldo14_data = {
356         .constraints    = {
357                 .name           = "VCC_3.0V_MOTOR",
358                 .min_uV         = 3000000,
359                 .max_uV         = 3000000,
360                 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
361                 .apply_uV       = 1,
362                 .state_mem      = {
363                         .enabled        = 0,
364                         .disabled       = 1,
365                 },
366         },
367         .num_consumer_supplies  = ARRAY_SIZE(slp7_max8997_ldo14_consumer),
368         .consumer_supplies      = slp7_max8997_ldo14_consumer,
369 };
370
371 static struct regulator_init_data slp7_max8997_ldo15_data = {
372         .constraints    = {
373                 .name           = "VTOUCH_ADVV2.8V",
374                 .min_uV         = 2800000,
375                 .max_uV         = 2800000,
376                 .apply_uV       = 1,
377                 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
378                 .state_mem      = {
379                         .enabled        = 0,
380                         .disabled       = 1,
381                 },
382         },
383         .num_consumer_supplies  = ARRAY_SIZE(slp7_max8997_ldo15_consumer),
384         .consumer_supplies      = slp7_max8997_ldo15_consumer,
385 };
386
387 static struct regulator_init_data slp7_max8997_ldo16_data = {
388         .constraints    = {
389                 .name           = "CAM_SENSOR_IO_1.8V",
390                 .min_uV         = 1800000,
391                 .max_uV         = 1800000,
392                 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
393                 .apply_uV       = 1,
394                 .state_mem      = {
395                         .enabled        = 0,
396                         .disabled       = 1,
397                 },
398         },
399         .num_consumer_supplies  = ARRAY_SIZE(slp7_max8997_ldo16_consumer),
400         .consumer_supplies      = slp7_max8997_ldo16_consumer,
401 };
402
403 static struct regulator_init_data slp7_max8997_ldo18_data = {
404         .constraints    = {
405                 .name           = "VTOUCH_VDD2.8V",
406                 .min_uV         = 2800000,
407                 .max_uV         = 2800000,
408                 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
409                 .apply_uV       = 1,
410                 .state_mem      = {
411                         .enabled        = 0,
412                         .disabled       = 1,
413                 },
414         },
415         .num_consumer_supplies  = ARRAY_SIZE(slp7_max8997_ldo18_consumer),
416         .consumer_supplies      = slp7_max8997_ldo18_consumer,
417 };
418
419 static struct regulator_init_data slp7_max8997_ldo21_data = {
420         .constraints    = {
421                 .name           = "VDDQ_M1M2_1.2V",
422                 .min_uV         = 1200000,
423                 .max_uV         = 1200000,
424                 .apply_uV       = 1,
425                 .always_on      = 1,
426                 .state_mem      = {
427                         .enabled        = 0,
428                         .disabled       = 1,
429                 },
430         },
431         .num_consumer_supplies  = ARRAY_SIZE(slp7_max8997_ldo21_consumer),
432         .consumer_supplies      = slp7_max8997_ldo21_consumer,
433 };
434
435 static struct regulator_init_data slp7_max8997_buck1_data = {
436         .constraints    = {
437                 .name           = "VARM_1.2V_C210",
438                 .min_uV         = 900000,
439                 .max_uV         = 1350000,
440                 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
441                 .always_on      = 1,
442                 .state_mem      = {
443                         .enabled = 0,
444                         .disabled = 1,
445                 },
446         },
447         .num_consumer_supplies = ARRAY_SIZE(slp7_max8997_buck1_consumer),
448         .consumer_supplies = slp7_max8997_buck1_consumer,
449 };
450
451 static struct regulator_init_data slp7_max8997_buck2_data = {
452         .constraints    = {
453                 .name           = "VINT_1.1V_C210",
454                 .min_uV         = 900000,
455                 .max_uV         = 1100000,
456                 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
457                 .always_on      = 1,
458                 .state_mem      = {
459                         .enabled = 0,
460                         .disabled = 1,
461                 },
462         },
463         .num_consumer_supplies = ARRAY_SIZE(slp7_max8997_buck2_consumer),
464         .consumer_supplies = slp7_max8997_buck2_consumer,
465 };
466
467 static struct regulator_init_data slp7_max8997_buck3_data = {
468         .constraints    = {
469                 .name           = "VG3D_1.1V_C210",
470                 .min_uV         = 900000,
471                 .max_uV         = 1100000,
472                 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
473                         REGULATOR_CHANGE_STATUS,
474                 .state_mem      = {
475                         .enabled = 0,
476                         .disabled = 1,
477                 },
478         },
479         .num_consumer_supplies = ARRAY_SIZE(slp7_max8997_buck3_consumer),
480         .consumer_supplies = slp7_max8997_buck3_consumer,
481 };
482
483 static struct regulator_init_data slp7_max8997_buck4_data = {
484         .constraints    = {
485                 .name           = "CAM_ISP_CORE_1.2V",
486                 .min_uV         = 1200000,
487                 .max_uV         = 1200000,
488                 .apply_uV       = 1,
489                 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
490                 .state_mem      = {
491                         .enabled = 0,
492                         .disabled = 1,
493                 },
494         },
495         .num_consumer_supplies = ARRAY_SIZE(slp7_max8997_buck4_consumer),
496         .consumer_supplies = slp7_max8997_buck4_consumer,
497 };
498
499 static struct regulator_init_data slp7_max8997_buck5_data = {
500         .constraints    = {
501                 .name           = "VMEM_1.2V_C210",
502                 .min_uV         = 1200000,
503                 .max_uV         = 1200000,
504                 .apply_uV       = 1,
505                 .always_on      = 1,
506                 .state_mem      = {
507                         .enabled = 1,
508                         .disabled = 0,
509                 },
510         },
511         .num_consumer_supplies = ARRAY_SIZE(slp7_max8997_buck5_consumer),
512         .consumer_supplies = slp7_max8997_buck5_consumer,
513 };
514
515 static struct regulator_init_data slp7_max8997_buck6_data = {
516         .constraints    = {
517                 .name           = "CAM_AF_2.8V",
518                 .min_uV         = 2800000,
519                 .max_uV         = 2800000,
520                 .apply_uV       = 1,
521                 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
522                 .state_mem      = {
523                         .enabled = 0,
524                         .disabled = 1,
525                 },
526         },
527         .num_consumer_supplies = ARRAY_SIZE(slp7_max8997_buck6_consumer),
528         .consumer_supplies = slp7_max8997_buck6_consumer,
529 };
530
531 static struct regulator_init_data slp7_max8997_buck7_data = {
532         .constraints    = {
533                 .name           = "VCC_SUB_2.0V",
534                 .min_uV         = 2000000,
535                 .max_uV         = 2000000,
536                 .apply_uV       = 1,
537                 .always_on      = 1,
538                 .state_mem      = {
539                         .enabled = 1,
540                         .disabled = 0,
541                 },
542         },
543         .num_consumer_supplies = ARRAY_SIZE(slp7_max8997_buck7_consumer),
544         .consumer_supplies = slp7_max8997_buck7_consumer,
545 };
546
547 static struct regulator_init_data slp7_max8997_32khz_ap_data = {
548         .constraints    = {
549                 .name           = "32KHz AP",
550                 .always_on      = 1,
551                 .state_mem      = {
552                         .enabled = 1,
553                         .disabled = 0,
554                 },
555         },
556         .num_consumer_supplies = ARRAY_SIZE(slp7_max8997_32khz_ap_consumer),
557         .consumer_supplies = slp7_max8997_32khz_ap_consumer,
558 };
559
560 static struct regulator_init_data slp7_max8997_32khz_cp_data = {
561         .constraints    = {
562                 .name           = "32KHz CP",
563                 .state_mem      = {
564                         .enabled = 0,
565                         .disabled = 1,
566                 },
567         },
568 };
569
570 static struct regulator_init_data slp7_max8997_vichg_data = {
571         .constraints    = {
572                 .name           = "VICHG",
573                 .state_mem      = {
574                         .enabled = 0,
575                         .disabled = 1,
576                 },
577         },
578 };
579
580 /* FIMXE implement the buck enable at UDC drivers */
581 static struct regulator_init_data slp7_max8997_esafeout1_data = {
582         .constraints    = {
583                 .name           = "SAFEOUT1",
584                 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
585                 .state_mem      = {
586                         .enabled = 0,
587                         .disabled = 1,
588                 },
589         },
590         .num_consumer_supplies  = ARRAY_SIZE(slp7_max8997_esafeout1_consumer),
591         .consumer_supplies      = slp7_max8997_esafeout1_consumer,
592 };
593
594 static struct regulator_init_data slp7_max8997_esafeout2_data = {
595         .constraints    = {
596                 .name           = "SAFEOUT2",
597                 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
598                 .state_mem      = {
599                         .enabled = 0,
600                         .disabled = 1,
601                 },
602         },
603         .num_consumer_supplies  = ARRAY_SIZE(slp7_max8997_esafeout2_consumer),
604         .consumer_supplies      = slp7_max8997_esafeout2_consumer,
605 };
606
607 static struct regulator_init_data slp7_max8997_charger_cv_data = {
608         .constraints    = {
609                 .name           = "CHARGER_CV",
610                 .min_uV         = 4200000,
611                 .max_uV         = 4200000,
612                 .apply_uV       = 1,
613         },
614 };
615
616 static struct regulator_init_data slp7_max8997_charger_data = {
617         .constraints    = {
618                 .name           = "CHARGER",
619                 .min_uA         = 200000,
620                 .max_uA         = 950000,
621                 .boot_on        = 1,
622                 .valid_ops_mask = REGULATOR_CHANGE_STATUS |
623                                 REGULATOR_CHANGE_CURRENT,
624         },
625         .num_consumer_supplies  = ARRAY_SIZE(slp7_max8997_charger_consumer),
626         .consumer_supplies      = slp7_max8997_charger_consumer,
627 };
628
629 static struct regulator_init_data slp7_max8997_charger_topoff_data = {
630         .constraints    = {
631                 .name           = "CHARGER TOPOFF",
632                 .min_uA         = 50000,
633                 .max_uA         = 200000,
634                 .valid_ops_mask = REGULATOR_CHANGE_CURRENT,
635         },
636         .num_consumer_supplies  = ARRAY_SIZE(slp7_max8997_charger_topoff_consumer),
637         .consumer_supplies      = slp7_max8997_charger_topoff_consumer,
638 };
639
640 static struct max8997_regulator_data slp7_max8997_regulators[] = {
641         { MAX8997_LDO1, &slp7_max8997_ldo1_data },
642         { MAX8997_LDO2, &slp7_max8997_ldo2_data },
643         { MAX8997_LDO3, &slp7_max8997_ldo3_data },
644         { MAX8997_LDO4, &slp7_max8997_ldo4_data },
645         { MAX8997_LDO5, &slp7_max8997_ldo5_data },
646         { MAX8997_LDO6, &slp7_max8997_ldo6_data },
647         { MAX8997_LDO7, &slp7_max8997_ldo7_data },
648         { MAX8997_LDO8, &slp7_max8997_ldo8_data },
649         { MAX8997_LDO9, &slp7_max8997_ldo9_data },
650         { MAX8997_LDO10, &slp7_max8997_ldo10_data },
651         { MAX8997_LDO11, &slp7_max8997_ldo11_data },
652         { MAX8997_LDO12, &slp7_max8997_ldo12_data },
653         { MAX8997_LDO13, &slp7_max8997_ldo13_data },
654         { MAX8997_LDO14, &slp7_max8997_ldo14_data },
655         { MAX8997_LDO15, &slp7_max8997_ldo15_data },
656         { MAX8997_LDO16, &slp7_max8997_ldo16_data },
657
658         { MAX8997_LDO18, &slp7_max8997_ldo18_data },
659         { MAX8997_LDO21, &slp7_max8997_ldo21_data },
660
661         { MAX8997_BUCK1, &slp7_max8997_buck1_data },
662         { MAX8997_BUCK2, &slp7_max8997_buck2_data },
663         { MAX8997_BUCK3, &slp7_max8997_buck3_data },
664         { MAX8997_BUCK4, &slp7_max8997_buck4_data },
665         { MAX8997_BUCK5, &slp7_max8997_buck5_data },
666         { MAX8997_BUCK6, &slp7_max8997_buck6_data },
667         { MAX8997_BUCK7, &slp7_max8997_buck7_data },
668
669         { MAX8997_EN32KHZ_AP, &slp7_max8997_32khz_ap_data },
670         { MAX8997_EN32KHZ_CP, &slp7_max8997_32khz_cp_data },
671
672         { MAX8997_ENVICHG, &slp7_max8997_vichg_data },
673         { MAX8997_ESAFEOUT1, &slp7_max8997_esafeout1_data },
674         { MAX8997_ESAFEOUT2, &slp7_max8997_esafeout2_data },
675         { MAX8997_CHARGER_CV, &slp7_max8997_charger_cv_data },
676         { MAX8997_CHARGER, &slp7_max8997_charger_data },
677         { MAX8997_CHARGER_TOPOFF, &slp7_max8997_charger_topoff_data },
678 };
679
680 extern struct max8997_muic_platform_data slp7_muic_pdata;
681 extern struct max8997_haptic_platform_data slp7_haptic_pdata;
682
683 struct max8997_platform_data slp7_max8997_pdata = {
684         .irq_base               = IRQ_PMIC_BASE,
685         .ono                    = 0,
686         .wakeup                 = 1,
687
688         .num_regulators         = ARRAY_SIZE(slp7_max8997_regulators),
689         .regulators             = slp7_max8997_regulators,
690
691         .buck125_gpios = { S5PV310_GPX0(5), S5PV310_GPX0(6), S5PV310_GPL0(0) },
692         .buck125_default_idx = 0,
693         .buck1_gpiodvs = false,
694         .buck2_gpiodvs = true,
695         .buck5_gpiodvs = false,
696
697         .buck1_voltage[0] = 1350000, /* 1.35V */
698         .buck1_voltage[1] = 1300000, /* 1.3V */
699         .buck1_voltage[2] = 1250000, /* 1.25V */
700         .buck1_voltage[3] = 1200000, /* 1.2V */
701         .buck1_voltage[4] = 1150000, /* 1.15V */
702         .buck1_voltage[5] = 1100000, /* 1.1V */
703         .buck1_voltage[6] = 1000000, /* 1.0V */ /* No room for 1.05V */
704         .buck1_voltage[7] = 950000, /* 0.95V */
705
706         .buck2_voltage[0] = 1100000, /* 1.1V */
707         .buck2_voltage[1] = 1000000, /* 1.0V */
708         .buck2_voltage[2] = 950000, /* 0.95V */
709         .buck2_voltage[3] = 900000, /* 0.9V */
710         .buck2_voltage[4] = 1100000, /* 1.1V */
711         .buck2_voltage[5] = 1000000, /* 1.0V */
712         .buck2_voltage[6] = 950000, /* 0.95V */
713         .buck2_voltage[7] = 900000, /* 0.9V */
714
715         .buck5_voltage[0] = 1200000, /* 1.2V */
716         .buck5_voltage[1] = 1200000, /* 1.2V */
717         .buck5_voltage[2] = 1200000, /* 1.2V */
718         .buck5_voltage[3] = 1200000, /* 1.2V */
719         .buck5_voltage[4] = 1200000, /* 1.2V */
720         .buck5_voltage[5] = 1200000, /* 1.2V */
721         .buck5_voltage[6] = 1200000, /* 1.2V */
722         .buck5_voltage[7] = 1200000, /* 1.2V */
723
724         /* CHARGER */
725         .eoc_mA                 = 50,
726         .eoc_ratio              = 0,    /* TODO: change after ratio is implemented */
727         .vichg_adc_get_uV       = NULL, /* TODO: Need to fill this in */
728         .timeout                = 5,
729
730         /* haptic */
731         .haptic_pdata   = &slp7_haptic_pdata,
732
733         /* muic */
734         .muic_pdata     = &slp7_muic_pdata,
735
736         /* RTC */
737         .delay          = true,
738 };