upload tizen1.0 source
[kernel/linux-2.6.36.git] / arch / arm / mach-s5pv310 / max8997-p8.c
1 /*
2  * linux/arch/arm/mach-s5pv310/max8997-p8.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 U1 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 p8_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 p8_max8997_ldo1_consumer[] = {
34         REGULATOR_SUPPLY("vadc", NULL),
35         REGULATOR_SUPPLY("vadc", "s5p-charger"),
36 };
37 static struct regulator_consumer_supply p8_max8997_ldo2_consumer[] = {
38         REGULATOR_SUPPLY("vdd_alive", "s5pc210"), /* FIXME: device name */
39 };
40 static struct regulator_consumer_supply p8_max8997_ldo3_consumer[] = {
41         REGULATOR_SUPPLY("vusb_a", NULL),       /* TODO: DEV NAME? */
42         REGULATOR_SUPPLY("mipi_1.1v_c210", "s5p-mipi-dsim.0"),  /* obsolete */
43         REGULATOR_SUPPLY("vdd11_mipi", "s3c-csis.0"),
44         REGULATOR_SUPPLY("vdd11_mipi", "s3c-csis.1"),
45 };
46 static struct regulator_consumer_supply p8_max8997_ldo4_consumer[] = {
47         REGULATOR_SUPPLY("vmipi_1.8v", "s5p-mipi-dsim.0"), /* obsolete */
48         REGULATOR_SUPPLY("vdd18_mipi", "s3c-csis.0"),
49         REGULATOR_SUPPLY("vdd18_mipi", "s3c-csis.1"),
50 };
51 static struct regulator_consumer_supply p8_max8997_ldo5_consumer[] = {
52         REGULATOR_SUPPLY("vhsic", NULL), /* obsolete? 8*/
53         REGULATOR_SUPPLY("vdd12_uhost", "s5pc210"), /* FIXME: device name */
54 };
55 static struct regulator_consumer_supply p8_max8997_ldo6_consumer[] = {
56         REGULATOR_SUPPLY("vcc_1.8v", "ld9040"),
57         REGULATOR_SUPPLY("v_gps_1.8v", "gsd4t"),
58 };
59 static struct regulator_consumer_supply p8_max8997_ldo7_consumer[] = {
60         REGULATOR_SUPPLY("dig_18", "0-001f"),
61         REGULATOR_SUPPLY("dig_vt_18", "17-002d"),
62 };
63 static struct regulator_consumer_supply p8_max8997_ldo8_consumer[] = {
64         REGULATOR_SUPPLY("vusb_d", NULL), /* TODO: DEV NAME? */
65         REGULATOR_SUPPLY("vdac", NULL), /* TODO: DEV NAME? */
66 };
67 static struct regulator_consumer_supply p8_max8997_ldo9_consumer[] = {
68         REGULATOR_SUPPLY("vcc_2.8v_pda", NULL), /* FIXME: update name */
69 };
70 static struct regulator_consumer_supply p8_max8997_ldo10_consumer[] = {
71         REGULATOR_SUPPLY("vpll", NULL), /* obsolete? */
72         REGULATOR_SUPPLY("vdd11_pll", "s5pc210"), /* FIXME: device name */
73 };
74 static struct regulator_consumer_supply p8_max8997_ldo11_consumer[] = {
75         REGULATOR_SUPPLY("touch_2.8v", NULL),
76 };
77 static struct regulator_consumer_supply p8_max8997_ldo12_consumer[] = {
78         REGULATOR_SUPPLY("vt_cam_18", "17-002d"),       /* TODO: double check the name */
79 };
80 static struct regulator_consumer_supply p8_max8997_ldo13_consumer[] = {
81         REGULATOR_SUPPLY("vcc_3.0v_lcd", "s6e8aa0"),
82 };
83 static struct regulator_consumer_supply p8_max8997_ldo14_consumer[] = {
84         REGULATOR_SUPPLY("inmotor", "max8997-haptic"),
85 };
86 static struct regulator_consumer_supply p8_max8997_ldo15_consumer[] = {
87         REGULATOR_SUPPLY("vlcd_2.2v", "s6e8aa0"),       /* FIXME: dev name of motor */
88 };
89 static struct regulator_consumer_supply p8_max8997_ldo16_consumer[] = {
90         REGULATOR_SUPPLY("d_sensor", "0-001f"),
91 };
92 static struct regulator_consumer_supply p8_max8997_ldo17_consumer[] = {
93         REGULATOR_SUPPLY("vmmc", "s3c-sdhci.2"),
94 };
95 static struct regulator_consumer_supply p8_max8997_ldo18_consumer[] = {
96         REGULATOR_SUPPLY("touch_led_3.3v", NULL),
97 };
98 static struct regulator_consumer_supply p8_max8997_ldo21_consumer[] = {
99         /* "Memory I/O Power" */
100 };
101
102 static struct regulator_consumer_supply p8_max8997_buck1_consumer[] = {
103         REGULATOR_SUPPLY("vdd_arm", NULL),
104 };
105 static struct regulator_consumer_supply p8_max8997_buck2_consumer[] = {
106         REGULATOR_SUPPLY("vdd_int", NULL),
107 };
108 static struct regulator_consumer_supply p8_max8997_buck3_consumer[] = {
109         REGULATOR_SUPPLY("vg3d", "mali_dev.0"),
110 };
111 static struct regulator_consumer_supply p8_max8997_buck4_consumer[] = {
112         REGULATOR_SUPPLY("core", "0-001f"),
113 };
114 static struct regulator_consumer_supply p8_max8997_buck5_consumer[] = {
115         REGULATOR_SUPPLY("vdd_mem", NULL), /* LPDDR's Core Power */
116 };
117 static struct regulator_consumer_supply p8_max8997_buck6_consumer[] = {
118         REGULATOR_SUPPLY("dig_28", "0-001f"),
119         REGULATOR_SUPPLY("flash_en", "0-001f"), /* Actual SET/EN of FLASH */
120         REGULATOR_SUPPLY("flash_set", "0-001f"),        /* Dummy of FLASH */
121 };
122 static struct regulator_consumer_supply p8_max8997_buck7_consumer[] = {
123         REGULATOR_SUPPLY("vcc_sub_2.0v", "0-003c"),     /* TODO: double check the name */
124 };
125
126 static struct regulator_consumer_supply p8_max8997_esafeout1_consumer[] = {
127         REGULATOR_SUPPLY("usb_vbus_ap_5v", NULL), /* obsolete. FIXME name? */
128 };
129 static struct regulator_consumer_supply p8_max8997_esafeout2_consumer[] = {
130         REGULATOR_SUPPLY("usb_vbus_cp_5v", NULL), /* obsolete. FIXME name? */
131 };
132 #ifdef CONFIG_CHARGERCTRL_MAX8997
133 static struct regulator_consumer_supply p8_max8997_charger_consumer[] = {
134         REGULATOR_SUPPLY("vinchg1", "charger-manager.0"),
135 };
136 static struct regulator_consumer_supply p8_max8997_charger_topoff_consumer[] = {
137         REGULATOR_SUPPLY("vinchg_stop", NULL),
138 };
139 #endif
140 static struct regulator_consumer_supply p8_max8997_32khz_ap_consumer[] = {
141         REGULATOR_SUPPLY("gps_clk", "gsd4t"),
142         REGULATOR_SUPPLY("bt_clk", NULL),
143         REGULATOR_SUPPLY("wifi_clk", NULL),
144 };
145 static struct regulator_init_data p8_max8997_ldo1_data = {
146         .constraints    = {
147                 .name           = "VADC_3.3V_C210",
148                 .min_uV         = 3300000,
149                 .max_uV         = 3300000,
150                 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
151                 .apply_uV       = 1,
152                 .state_mem      = {
153                         .enabled        = 0,
154                         .disabled       = 1,
155                 },
156         },
157         .num_consumer_supplies  = ARRAY_SIZE(p8_max8997_ldo1_consumer),
158         .consumer_supplies      = p8_max8997_ldo1_consumer,
159 };
160
161 static struct regulator_init_data p8_max8997_ldo2_data = {
162         .constraints    = {
163                 .name           = "VALIVE_1.1V_C210",
164                 .min_uV         = 1100000,
165                 .max_uV         = 1100000,
166                 .apply_uV       = 1,
167                 .always_on      = 1,
168                 .state_mem      = {
169                         .enabled        = 1,
170                         .disabled       = 0,
171                 },
172         },
173         .num_consumer_supplies  = ARRAY_SIZE(p8_max8997_ldo2_consumer),
174         .consumer_supplies      = p8_max8997_ldo2_consumer,
175 };
176
177 static struct regulator_init_data p8_max8997_ldo3_data = {
178         .constraints    = {
179                 .name           = "VUSB/MIPI_1.1V_C210",
180                 .min_uV         = 1100000,
181                 .max_uV         = 1100000,
182                 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
183                 .apply_uV       = 1,
184                 .boot_on        = 1,
185                 .state_mem      = {
186                         .enabled        = 0,
187                         .disabled       = 1,
188                 },
189         },
190         .num_consumer_supplies  = ARRAY_SIZE(p8_max8997_ldo3_consumer),
191         .consumer_supplies      = p8_max8997_ldo3_consumer,
192 };
193
194 static struct regulator_init_data p8_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                 .boot_on        = 1,
202                 .state_mem      = {
203                         .enabled        = 0,
204                         .disabled       = 1,
205                 },
206         },
207         .num_consumer_supplies  = ARRAY_SIZE(p8_max8997_ldo4_consumer),
208         .consumer_supplies      = p8_max8997_ldo4_consumer,
209 };
210
211 static struct regulator_init_data p8_max8997_ldo5_data = {
212         .constraints    = {
213                 .name           = "VHSIC_1.2V_C210",
214                 .min_uV         = 1200000,
215                 .max_uV         = 1200000,
216                 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
217                 .apply_uV       = 1,
218                 .state_mem      = {
219                         .enabled        = 0,
220                         .disabled       = 1,
221                 },
222         },
223         .num_consumer_supplies  = ARRAY_SIZE(p8_max8997_ldo5_consumer),
224         .consumer_supplies      = p8_max8997_ldo5_consumer,
225 };
226
227 static struct regulator_init_data p8_max8997_ldo6_data = {
228         .constraints    = {
229                 .name           = "VCC_1.8V_PDA",
230                 .min_uV         = 1800000,
231                 .max_uV         = 1800000,
232                 .apply_uV       = 1,
233                 .always_on      = 1,
234                 .state_mem      = {
235                         .enabled        = 1,
236                         .disabled       = 0,
237                 },
238         },
239         .num_consumer_supplies  = ARRAY_SIZE(p8_max8997_ldo6_consumer),
240         .consumer_supplies      = p8_max8997_ldo6_consumer,
241 };
242
243 static struct regulator_init_data p8_max8997_ldo7_data = {
244         .constraints    = {
245                 .name           = "CAM_ISP_1.8V",
246                 .min_uV         = 1800000,
247                 .max_uV         = 1800000,
248                 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
249                 .apply_uV       = 1,
250                 .state_mem      = {
251                         .enabled        = 0,
252                         .disabled       = 1,
253                 },
254         },
255         .num_consumer_supplies  = ARRAY_SIZE(p8_max8997_ldo7_consumer),
256         .consumer_supplies      = p8_max8997_ldo7_consumer,
257 };
258
259 static struct regulator_init_data p8_max8997_ldo8_data = {
260         .constraints    = {
261                 .name           = "VUSB/VDAC_3.3V_C210",
262                 .min_uV         = 3300000,
263                 .max_uV         = 3300000,
264                 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
265                 .apply_uV       = 1,
266                 .state_mem      = {
267                         .enabled        = 0,
268                         .disabled       = 1,
269                 },
270         },
271         .num_consumer_supplies  = ARRAY_SIZE(p8_max8997_ldo8_consumer),
272         .consumer_supplies      = p8_max8997_ldo8_consumer,
273 };
274
275 static struct regulator_init_data p8_max8997_ldo9_data = {
276         .constraints    = {
277                 .name           = "VCC_2.8V_PDA",
278                 .min_uV         = 2800000,
279                 .max_uV         = 2800000,
280                 .apply_uV       = 1,
281                 .always_on      = 1,
282                 .state_mem      = {
283                         .enabled        = 1,
284                         .disabled       = 0,
285                 },
286         },
287         .num_consumer_supplies  = ARRAY_SIZE(p8_max8997_ldo9_consumer),
288         .consumer_supplies      = p8_max8997_ldo9_consumer,
289 };
290
291 static struct regulator_init_data p8_max8997_ldo10_data = {
292         .constraints    = {
293                 .name           = "VPLL_1.1V_C210",
294                 .min_uV         = 1100000,
295                 .max_uV         = 1100000,
296                 .apply_uV       = 1,
297                 .always_on      = 1,
298                 .state_mem      = {
299                         .enabled        = 0,
300                         .disabled       = 1,
301                 },
302         },
303         .num_consumer_supplies  = ARRAY_SIZE(p8_max8997_ldo10_consumer),
304         .consumer_supplies      = p8_max8997_ldo10_consumer,
305 };
306
307 static struct regulator_init_data p8_max8997_ldo11_data = {
308         .constraints    = {
309                 .name           = "TOUCH_2.8V",
310                 .min_uV         = 2800000,
311                 .max_uV         = 2800000,
312                 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
313                 .apply_uV       = 1,
314                 .state_mem      = {
315                         .enabled        = 0,
316                         .disabled       = 1,
317                 },
318         },
319         .num_consumer_supplies  = ARRAY_SIZE(p8_max8997_ldo11_consumer),
320         .consumer_supplies      = p8_max8997_ldo11_consumer,
321 };
322
323 static struct regulator_init_data p8_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(p8_max8997_ldo12_consumer),
336         .consumer_supplies      = p8_max8997_ldo12_consumer,
337 };
338
339 static struct regulator_init_data p8_max8997_ldo13_data = {
340         .constraints    = {
341                 .name           = "VCC_3.0V_LCD",
342                 .min_uV         = 3000000,
343                 .max_uV         = 3000000,
344                 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
345                 .apply_uV       = 1,
346                 .boot_on        = 1,
347                 .state_mem      = {
348                         .enabled        = 0,
349                         .disabled       = 1,
350                 },
351         },
352         .num_consumer_supplies  = ARRAY_SIZE(p8_max8997_ldo13_consumer),
353         .consumer_supplies      = p8_max8997_ldo13_consumer,
354 };
355
356 static struct regulator_init_data p8_max8997_ldo14_data = {
357         .constraints    = {
358                 .name           = "VCC_3.0V_MOTOR",
359                 .min_uV         = 3000000,
360                 .max_uV         = 3000000,
361                 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
362                 .apply_uV       = 1,
363                 .state_mem      = {
364                         .enabled        = 0,
365                         .disabled       = 1,
366                 },
367         },
368         .num_consumer_supplies  = ARRAY_SIZE(p8_max8997_ldo14_consumer),
369         .consumer_supplies      = p8_max8997_ldo14_consumer,
370 };
371
372 static struct regulator_init_data p8_max8997_ldo15_data = {
373         .constraints    = {
374                 .name           = "VLCD_2.2V",
375                 .min_uV         = 2200000,
376                 .max_uV         = 2200000,
377                 .apply_uV       = 1,
378                 .boot_on        = 1,
379                 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
380                 .state_mem      = {
381                         .enabled        = 0,
382                         .disabled       = 1,
383                 },
384         },
385         .num_consumer_supplies  = ARRAY_SIZE(p8_max8997_ldo15_consumer),
386         .consumer_supplies      = p8_max8997_ldo15_consumer,
387 };
388
389 static struct regulator_init_data p8_max8997_ldo16_data = {
390         .constraints    = {
391                 .name           = "CAM_SENSOR_IO_1.8V",
392                 .min_uV         = 1800000,
393                 .max_uV         = 1800000,
394                 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
395                 .apply_uV       = 1,
396                 .state_mem      = {
397                         .enabled        = 0,
398                         .disabled       = 1,
399                 },
400         },
401         .num_consumer_supplies  = ARRAY_SIZE(p8_max8997_ldo16_consumer),
402         .consumer_supplies      = p8_max8997_ldo16_consumer,
403 };
404
405 static struct regulator_init_data p8_max8997_ldo17_data = {
406         .constraints    = {
407                 .name           = "VTF_2.8V",
408                 .min_uV         = 2800000,
409                 .max_uV         = 2800000,
410                 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
411                 .apply_uV       = 1,
412                 .state_mem      = {
413                         .enabled        = 0,
414                         .disabled       = 1,
415                 },
416         },
417         .num_consumer_supplies  = ARRAY_SIZE(p8_max8997_ldo17_consumer),
418         .consumer_supplies      = p8_max8997_ldo17_consumer,
419 };
420
421 static struct regulator_init_data p8_max8997_ldo18_data = {
422         .constraints    = {
423                 .name           = "TOUCH_LED_3.3V",
424                 .min_uV         = 3300000,
425                 .max_uV         = 3300000,
426                 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
427                 .apply_uV       = 1,
428                 .state_mem      = {
429                         .enabled        = 0,
430                         .disabled       = 1,
431                 },
432         },
433         .num_consumer_supplies  = ARRAY_SIZE(p8_max8997_ldo18_consumer),
434         .consumer_supplies      = p8_max8997_ldo18_consumer,
435 };
436
437 static struct regulator_init_data p8_max8997_ldo21_data = {
438         .constraints    = {
439                 .name           = "VDDQ_M1M2_1.2V",
440                 .min_uV         = 1200000,
441                 .max_uV         = 1200000,
442                 .apply_uV       = 1,
443                 .always_on      = 1,
444                 .state_mem      = {
445                         .enabled        = 0,
446                         .disabled       = 1,
447                 },
448         },
449         .num_consumer_supplies  = ARRAY_SIZE(p8_max8997_ldo21_consumer),
450         .consumer_supplies      = p8_max8997_ldo21_consumer,
451 };
452
453 static struct regulator_init_data p8_max8997_buck1_data = {
454         .constraints    = {
455                 .name           = "VARM_1.2V_C210",
456                 .min_uV         = 900000,
457                 .max_uV         = 1350000,
458                 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
459                 .always_on      = 1,
460                 .state_mem      = {
461                         .enabled = 0,
462                         .disabled       = 1,
463                 },
464         },
465         .num_consumer_supplies = ARRAY_SIZE(p8_max8997_buck1_consumer),
466         .consumer_supplies = p8_max8997_buck1_consumer,
467 };
468
469 static struct regulator_init_data p8_max8997_buck2_data = {
470         .constraints    = {
471                 .name           = "VINT_1.1V_C210",
472                 .min_uV         = 900000,
473                 .max_uV         = 1100000,
474                 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
475                 .always_on      = 1,
476                 .state_mem      = {
477                         .enabled = 0,
478                         .disabled       = 1,
479                 },
480         },
481         .num_consumer_supplies = ARRAY_SIZE(p8_max8997_buck2_consumer),
482         .consumer_supplies = p8_max8997_buck2_consumer,
483 };
484
485 static struct regulator_init_data p8_max8997_buck3_data = {
486         .constraints    = {
487                 .name           = "VG3D_1.1V_C210",
488                 .min_uV         = 900000,
489                 .max_uV         = 1100000,
490                 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
491                         REGULATOR_CHANGE_STATUS,
492                 .state_mem      = {
493                         .enabled        = 0,
494                         .disabled       = 1,
495                 },
496         },
497         .num_consumer_supplies = ARRAY_SIZE(p8_max8997_buck3_consumer),
498         .consumer_supplies = p8_max8997_buck3_consumer,
499 };
500
501 static struct regulator_init_data p8_max8997_buck4_data = {
502         .constraints    = {
503                 .name           = "CAM_ISP_CORE_1.2V",
504                 .min_uV         = 1200000,
505                 .max_uV         = 1200000,
506                 .apply_uV       = 1,
507                 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
508                 .state_mem      = {
509                         .enabled        = 0,
510                         .disabled       = 1,
511                 },
512         },
513         .num_consumer_supplies = ARRAY_SIZE(p8_max8997_buck4_consumer),
514         .consumer_supplies = p8_max8997_buck4_consumer,
515 };
516
517 static struct regulator_init_data p8_max8997_buck5_data = {
518         .constraints    = {
519                 .name           = "VMEM_1.2V_C210",
520                 .min_uV         = 1200000,
521                 .max_uV         = 1200000,
522                 .apply_uV       = 1,
523                 .always_on      = 1,
524                 .state_mem      = {
525                         .enabled        = 1,
526                         .disabled       = 0,
527                 },
528         },
529         .num_consumer_supplies = ARRAY_SIZE(p8_max8997_buck5_consumer),
530         .consumer_supplies = p8_max8997_buck5_consumer,
531 };
532
533 static struct regulator_init_data p8_max8997_buck6_data = {
534         .constraints    = {
535                 .name           = "V_BAT",
536                 .min_uV         = 2800000,
537                 .max_uV         = 2800000,
538                 .apply_uV       = 1,
539                 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
540                 .state_mem      = {
541                         .enabled        = 0,
542                         .disabled       = 1,
543                 },
544         },
545         .num_consumer_supplies = ARRAY_SIZE(p8_max8997_buck6_consumer),
546         .consumer_supplies = p8_max8997_buck6_consumer,
547 };
548
549 static struct regulator_init_data p8_max8997_buck7_data = {
550         .constraints    = {
551                 .name           = "VCC_SUB_2.0V",
552                 .min_uV         = 2000000,
553                 .max_uV         = 2000000,
554                 .apply_uV       = 1,
555                 .always_on      = 1,
556                 .state_mem      = {
557                         .enabled        = 1,
558                         .disabled       = 0,
559                 },
560         },
561         .num_consumer_supplies = ARRAY_SIZE(p8_max8997_buck7_consumer),
562         .consumer_supplies = p8_max8997_buck7_consumer,
563 };
564
565 static struct regulator_init_data p8_max8997_32khz_ap_data = {
566         .constraints    = {
567                 .name           = "32KHz AP",
568                 .always_on      = 1,
569                 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
570                 .state_mem      = {
571                         .enabled        = 1,
572                         .disabled       = 0,
573                 },
574         },
575         .num_consumer_supplies = ARRAY_SIZE(p8_max8997_32khz_ap_consumer),
576         .consumer_supplies = p8_max8997_32khz_ap_consumer,
577 };
578
579 static struct regulator_init_data p8_max8997_32khz_cp_data = {
580         .constraints    = {
581                 .name           = "32KHz CP",
582                 .state_mem      = {
583                         .enabled        = 0,
584                         .disabled       = 1,
585                 },
586         },
587 };
588
589 static struct regulator_init_data p8_max8997_vichg_data = {
590         .constraints    = {
591                 .name           = "VICHG",
592                 .state_mem      = {
593                         .enabled        = 0,
594                         .disabled       = 1,
595                 },
596         },
597 };
598
599 static struct regulator_init_data p8_max8997_esafeout1_data = {
600         .constraints    = {
601                 .name           = "SAFEOUT1",
602                 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
603                 .state_mem      = {
604                         .enabled        = 0,
605                         .disabled       = 1,
606                 },
607         },
608         .num_consumer_supplies  = ARRAY_SIZE(p8_max8997_esafeout1_consumer),
609         .consumer_supplies      = p8_max8997_esafeout1_consumer,
610 };
611
612 static struct regulator_init_data p8_max8997_esafeout2_data = {
613         .constraints    = {
614                 .name           = "SAFEOUT2",
615                 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
616                 .state_mem      = {
617                         .enabled        = 0,
618                         .disabled       = 1,
619                 },
620         },
621         .num_consumer_supplies  = ARRAY_SIZE(p8_max8997_esafeout2_consumer),
622         .consumer_supplies      = p8_max8997_esafeout2_consumer,
623 };
624
625 #ifdef CONFIG_CHARGERCTRL_MAX8997
626 static struct regulator_init_data p8_max8997_charger_cv_data = {
627         .constraints    = {
628                 .name           = "CHARGER_CV",
629                 .min_uV         = 4200000,
630                 .max_uV         = 4200000,
631                 .apply_uV       = 1,
632         },
633 };
634
635 static struct regulator_init_data p8_max8997_charger_data = {
636         .constraints    = {
637                 .name           = "CHARGER",
638                 .min_uA         = 200000,
639                 .max_uA         = 950000,
640                 .boot_on        = 1,
641                 .valid_ops_mask = REGULATOR_CHANGE_STATUS |
642                                 REGULATOR_CHANGE_CURRENT,
643         },
644         .num_consumer_supplies  = ARRAY_SIZE(p8_max8997_charger_consumer),
645         .consumer_supplies      = p8_max8997_charger_consumer,
646 };
647
648 static struct regulator_init_data p8_max8997_charger_topoff_data = {
649         .constraints    = {
650                 .name           = "CHARGER TOPOFF",
651                 .min_uA         = 50000,
652                 .max_uA         = 200000,
653                 .valid_ops_mask = REGULATOR_CHANGE_CURRENT,
654         },
655         .num_consumer_supplies  = ARRAY_SIZE(p8_max8997_charger_topoff_consumer),
656         .consumer_supplies      = p8_max8997_charger_topoff_consumer,
657 };
658 #endif
659
660 static struct max8997_regulator_data p8_max8997_regulators[] = {
661         { MAX8997_LDO1, &p8_max8997_ldo1_data },
662         { MAX8997_LDO2, &p8_max8997_ldo2_data },
663         { MAX8997_LDO3, &p8_max8997_ldo3_data },
664         { MAX8997_LDO4, &p8_max8997_ldo4_data },
665         { MAX8997_LDO5, &p8_max8997_ldo5_data },
666         { MAX8997_LDO6, &p8_max8997_ldo6_data },
667         { MAX8997_LDO7, &p8_max8997_ldo7_data },
668         { MAX8997_LDO8, &p8_max8997_ldo8_data },
669         { MAX8997_LDO9, &p8_max8997_ldo9_data },
670         { MAX8997_LDO10, &p8_max8997_ldo10_data },
671         { MAX8997_LDO11, &p8_max8997_ldo11_data },
672         { MAX8997_LDO12, &p8_max8997_ldo12_data },
673         { MAX8997_LDO13, &p8_max8997_ldo13_data },
674         { MAX8997_LDO14, &p8_max8997_ldo14_data },
675         { MAX8997_LDO15, &p8_max8997_ldo15_data },
676         { MAX8997_LDO16, &p8_max8997_ldo16_data },
677         { MAX8997_LDO17, &p8_max8997_ldo17_data },
678         { MAX8997_LDO18, &p8_max8997_ldo18_data },
679         { MAX8997_LDO21, &p8_max8997_ldo21_data },
680
681         { MAX8997_BUCK1, &p8_max8997_buck1_data },
682         { MAX8997_BUCK2, &p8_max8997_buck2_data },
683         { MAX8997_BUCK3, &p8_max8997_buck3_data },
684         { MAX8997_BUCK4, &p8_max8997_buck4_data },
685         { MAX8997_BUCK5, &p8_max8997_buck5_data },
686         { MAX8997_BUCK6, &p8_max8997_buck6_data },
687         { MAX8997_BUCK7, &p8_max8997_buck7_data },
688
689         { MAX8997_EN32KHZ_AP, &p8_max8997_32khz_ap_data },
690         { MAX8997_EN32KHZ_CP, &p8_max8997_32khz_cp_data },
691
692         { MAX8997_ENVICHG, &p8_max8997_vichg_data },
693         { MAX8997_ESAFEOUT1, &p8_max8997_esafeout1_data },
694         { MAX8997_ESAFEOUT2, &p8_max8997_esafeout2_data },
695 #ifdef CONFIG_CHARGERCTRL_MAX8997
696         { MAX8997_CHARGER_CV, &p8_max8997_charger_cv_data },
697         { MAX8997_CHARGER, &p8_max8997_charger_data },
698         { MAX8997_CHARGER_TOPOFF, &p8_max8997_charger_topoff_data },
699 #endif
700 };
701
702 extern struct max8997_muic_platform_data p8_muic_pdata;
703 extern struct max8997_haptic_platform_data p8_haptic_pdata;
704
705 struct max8997_platform_data p8_max8997_pdata = {
706         .irq_base               = IRQ_PMIC_BASE,
707         .ono                    = 0,
708         .wakeup                 = 1,
709
710         .num_regulators         = ARRAY_SIZE(p8_max8997_regulators),
711         .regulators             = p8_max8997_regulators,
712
713         .buck125_gpios = { S5PV310_GPX0(5), S5PV310_GPX0(6), S5PV310_GPL0(0) },
714         .buck125_default_idx = 0,
715         .buck1_gpiodvs = false,
716         .buck2_gpiodvs = false,
717         .buck5_gpiodvs = false,
718
719         .buck1_voltage[0] = 1350000, /* 1.35V */
720         .buck1_voltage[1] = 1300000, /* 1.3V */
721         .buck1_voltage[2] = 1250000, /* 1.25V */
722         .buck1_voltage[3] = 1200000, /* 1.2V */
723         .buck1_voltage[4] = 1150000, /* 1.15V */
724         .buck1_voltage[5] = 1100000, /* 1.1V */
725         .buck1_voltage[6] = 1000000, /* 1.0V */ /* No room for 1.05V */
726         .buck1_voltage[7] = 950000, /* 0.95V */
727
728         .buck2_voltage[0] = 1100000, /* 1.1V */
729         .buck2_voltage[1] = 1000000, /* 1.0V */
730         .buck2_voltage[2] = 950000, /* 0.95V */
731         .buck2_voltage[3] = 900000, /* 0.9V */
732         .buck2_voltage[4] = 1100000, /* 1.1V */
733         .buck2_voltage[5] = 1000000, /* 1.0V */
734         .buck2_voltage[6] = 950000, /* 0.95V */
735         .buck2_voltage[7] = 900000, /* 0.9V */
736
737         .buck5_voltage[0] = 1200000, /* 1.2V */
738         .buck5_voltage[1] = 1200000, /* 1.2V */
739         .buck5_voltage[2] = 1200000, /* 1.2V */
740         .buck5_voltage[3] = 1200000, /* 1.2V */
741         .buck5_voltage[4] = 1200000, /* 1.2V */
742         .buck5_voltage[5] = 1200000, /* 1.2V */
743         .buck5_voltage[6] = 1200000, /* 1.2V */
744         .buck5_voltage[7] = 1200000, /* 1.2V */
745
746         /* CHARGER */
747         .eoc_mA         = 50,
748         .eoc_ratio      = 0,    /* TODO: change after ratio is implemented */
749         .vichg_adc_get_uV       = NULL, /* TODO: Need to fill this in */
750         .timeout        = 5,
751
752         /* haptic */
753         .haptic_pdata   = &p8_haptic_pdata,
754
755         /* muic */
756         .muic_pdata     = &p8_muic_pdata,
757
758         /* RTC */
759         .delay          = true,
760
761         /* Flash */
762         .flash_cntl_val = 0x53, /* Flash safety timer duration: 800msec,
763                                    Maximum timer mode */
764 };