upload tizen1.0 source
[kernel/linux-2.6.36.git] / arch / arm / mach-s5pv310 / max8997-slp10.c
1 /*
2  * linux/arch/arm/mach-s5pv310/max8997-slp10.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 SLP10 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 slp10_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 slp10_max8997_ldo1_consumer[] = {
34         REGULATOR_SUPPLY("vadc", NULL),
35         REGULATOR_SUPPLY("vadc", "s5p-charger"),
36 };
37 static struct regulator_consumer_supply slp10_max8997_ldo2_consumer[] = {
38         REGULATOR_SUPPLY("vdd_alive", "s5pc210"), /* FIXME: device name */
39 };
40 static struct regulator_consumer_supply slp10_max8997_ldo3_consumer[] = {
41         REGULATOR_SUPPLY("vusb_a", NULL),       /* TODO: DEV NAME? */
42         REGULATOR_SUPPLY("vmipi_1.1v", NULL),   /* obsolete */
43         REGULATOR_SUPPLY("vdd11", "mipi"), /* FIXME: device name */
44 };
45 static struct regulator_consumer_supply slp10_max8997_ldo4_consumer[] = {
46         REGULATOR_SUPPLY("vmipi_1.8V", NULL), /* obsolete */
47         REGULATOR_SUPPLY("vdd18", "mipi"), /* FIXME: device name */
48         REGULATOR_SUPPLY("mipi_csi", "s5p-mipi-csis.0"), /* FIXME: device name */
49 };
50 static struct regulator_consumer_supply slp10_max8997_ldo5_consumer[] = {
51         REGULATOR_SUPPLY("vhsic", NULL), /* obsolete? */
52         REGULATOR_SUPPLY("vdd12_uhost", "s5pc210"), /* FIXME: device name */
53 };
54 static struct regulator_consumer_supply slp10_max8997_ldo6_consumer[] = {
55         /* FIXME: add Audio Codec, MAX8903 Switching Charger */
56         REGULATOR_SUPPLY("vcc_1.8v", "platform-lcd"),
57 };
58 static struct regulator_consumer_supply slp10_max8997_ldo7_consumer[] = {
59         /* pin "11" of HDC803 */
60         /* pin "10" of HDC803 */
61         REGULATOR_SUPPLY("dig_18", "0-001f"),
62 };
63 static struct regulator_consumer_supply slp10_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 slp10_max8997_ldo9_consumer[] = {
68         REGULATOR_SUPPLY("vcc_2.8v_pda", NULL), /* FIXME: update name */
69 };
70 static struct regulator_consumer_supply slp10_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 slp10_max8997_ldo11_consumer[] = {
75         REGULATOR_SUPPLY("vcc_aux", "3-004c"), /* FIXME: Touchscreen MUST use this */
76 };
77 static struct regulator_consumer_supply slp10_max8997_ldo12_consumer[] = {
78         REGULATOR_SUPPLY("avdd", "3-004c"), /* FIXME: Touchscreen MUST use this */
79 };
80 static struct regulator_consumer_supply slp10_max8997_ldo14_consumer[] = {
81         REGULATOR_SUPPLY("inmotor", "max8997-haptic"),
82 };
83 static struct regulator_consumer_supply slp10_max8997_ldo16_consumer[] = {
84         REGULATOR_SUPPLY("d_sensor", "0-001f"),
85 };
86 static struct regulator_consumer_supply slp10_max8997_ldo17_consumer[] = {
87         REGULATOR_SUPPLY("dig_28", "0-001f"),
88 };
89 static struct regulator_consumer_supply slp10_max8997_ldo18_consumer[] = {
90         REGULATOR_SUPPLY("vdd", "3-004c"), /* FIXME: Touchscreen MUST use this */
91 };
92 static struct regulator_consumer_supply slp10_max8997_ldo21_consumer[] = {
93         /* "Memory I/O Power" */
94 };
95
96 static struct regulator_consumer_supply slp10_max8997_buck1_consumer[] = {
97         REGULATOR_SUPPLY("vdd_arm", NULL),
98 };
99 static struct regulator_consumer_supply slp10_max8997_buck2_consumer[] = {
100         REGULATOR_SUPPLY("vdd_int", NULL),
101 };
102 static struct regulator_consumer_supply slp10_max8997_buck3_consumer[] = {
103         REGULATOR_SUPPLY("vg3d", "mali_dev.0"),
104 };
105 static struct regulator_consumer_supply slp10_max8997_buck4_consumer[] = {
106         /* FIXME: pin "12", "13", "14" of HDC803 */
107         REGULATOR_SUPPLY("core", "0-001f"),
108 };
109 static struct regulator_consumer_supply slp10_max8997_buck5_consumer[] = {
110         REGULATOR_SUPPLY("vdd_mem", NULL), /* LPDDR's Core Power */
111 };
112 static struct regulator_consumer_supply slp10_max8997_buck7_consumer[] = {
113         /* CAM POWER */
114         /* LDO INL. */
115         REGULATOR_SUPPLY("vcc_sub_2.0v", "0-003c"),     /* TODO: double check the name */
116 };
117
118 static struct regulator_consumer_supply slp10_max8997_esafeout1_consumer[] = {
119         REGULATOR_SUPPLY("usb_vbus_ap_5v", NULL), /* obsolete. FIXME name? */
120 };
121 static struct regulator_consumer_supply slp10_max8997_esafeout2_consumer[] = {
122         REGULATOR_SUPPLY("usb_vbus_cp_5v", NULL), /* obsolete. FIXME name? */
123 };
124
125 static struct regulator_consumer_supply slp10_max8997_charger_consumer[] = {
126         REGULATOR_SUPPLY("vinchg1", "charger-manager.0"),
127 };
128 static struct regulator_consumer_supply slp10_max8997_charger_topoff_consumer[] = {
129         REGULATOR_SUPPLY("vinchg_stop", NULL), 
130 };
131
132 static struct regulator_consumer_supply slp10_max8997_32khz_ap_consumer[] = {
133         REGULATOR_SUPPLY("gps_clk", NULL),
134         REGULATOR_SUPPLY("bt_clk", NULL),
135         REGULATOR_SUPPLY("wifi_clk", NULL),
136 };
137
138 static struct regulator_init_data slp10_max8997_ldo1_data = {
139         .constraints    = {
140                 .name           = "VADC_3.3V_C210",
141                 .min_uV         = 3300000,
142                 .max_uV         = 3300000,
143                 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
144                 .apply_uV       = 1,
145                 .state_mem      = {
146                         .enabled        = 0,
147                         .disabled       = 1,
148                 },
149         },
150         .num_consumer_supplies  = ARRAY_SIZE(slp10_max8997_ldo1_consumer),
151         .consumer_supplies      = slp10_max8997_ldo1_consumer,
152 };
153
154 static struct regulator_init_data slp10_max8997_ldo2_data = {
155         .constraints    = {
156                 .name           = "VALIVE_1.1V_C210",
157                 .min_uV         = 1100000,
158                 .max_uV         = 1100000,
159                 .apply_uV       = 1,
160                 .always_on      = 1,
161                 .state_mem      = {
162                         .enabled        = 1,
163                         .disabled       = 0,
164                 },
165         },
166         .num_consumer_supplies  = ARRAY_SIZE(slp10_max8997_ldo2_consumer),
167         .consumer_supplies      = slp10_max8997_ldo2_consumer,
168 };
169
170 static struct regulator_init_data slp10_max8997_ldo3_data = {
171         .constraints    = {
172                 .name           = "VUSB_1.1V_C210",
173                 .min_uV         = 1100000,
174                 .max_uV         = 1100000,
175                 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
176                 .apply_uV       = 1,
177                 .state_mem      = {
178                         .enabled        = 0,
179                         .disabled       = 1,
180                 },
181         },
182         .num_consumer_supplies  = ARRAY_SIZE(slp10_max8997_ldo3_consumer),
183         .consumer_supplies      = slp10_max8997_ldo3_consumer,
184 };
185
186 static struct regulator_init_data slp10_max8997_ldo4_data = {
187         .constraints    = {
188                 .name           = "VMIPI_1.8V",
189                 .min_uV         = 1800000,
190                 .max_uV         = 1800000,
191                 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
192                 .apply_uV       = 1,
193                 .state_mem      = {
194                         .enabled        = 0,
195                         .disabled       = 1,
196                 },
197         },
198         .num_consumer_supplies  = ARRAY_SIZE(slp10_max8997_ldo4_consumer),
199         .consumer_supplies      = slp10_max8997_ldo4_consumer,
200 };
201
202 static struct regulator_init_data slp10_max8997_ldo5_data = {
203         .constraints    = {
204                 .name           = "VHSIC_1.2V_C210",
205                 .min_uV         = 1200000,
206                 .max_uV         = 1200000,
207                 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
208                 .apply_uV       = 1,
209                 .state_mem      = {
210                         .enabled        = 0,
211                         .disabled       = 1,
212                 },
213         },
214         .num_consumer_supplies  = ARRAY_SIZE(slp10_max8997_ldo5_consumer),
215         .consumer_supplies      = slp10_max8997_ldo5_consumer,
216 };
217
218 static struct regulator_init_data slp10_max8997_ldo6_data = {
219         .constraints    = {
220                 .name           = "VCC_1.8V_PDA",
221                 .min_uV         = 1800000,
222                 .max_uV         = 1800000,
223                 .apply_uV       = 1,
224                 .always_on      = 1,
225                 .state_mem      = {
226                         .enabled        = 1,
227                         .disabled       = 0,
228                 },
229         },
230         .num_consumer_supplies  = ARRAY_SIZE(slp10_max8997_ldo6_consumer),
231         .consumer_supplies      = slp10_max8997_ldo6_consumer,
232 };
233
234 static struct regulator_init_data slp10_max8997_ldo7_data = {
235         .constraints    = {
236                 .name           = "CAM_ISP_1.8V",
237                 .min_uV         = 1800000,
238                 .max_uV         = 1800000,
239                 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
240                 .apply_uV       = 1,
241                 .state_mem      = {
242                         .enabled        = 0,
243                         .disabled       = 1,
244                 },
245         },
246         .num_consumer_supplies  = ARRAY_SIZE(slp10_max8997_ldo7_consumer),
247         .consumer_supplies      = slp10_max8997_ldo7_consumer,
248 };
249
250 static struct regulator_init_data slp10_max8997_ldo8_data = {
251         .constraints    = {
252                 .name           = "VUSB/VDAC_3.3V_C210",
253                 .min_uV         = 3300000,
254                 .max_uV         = 3300000,
255                 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
256                 .apply_uV       = 1,
257                 .state_mem      = {
258                         .enabled = 0,
259                         .disabled = 1,
260                 },
261         },
262         .num_consumer_supplies  = ARRAY_SIZE(slp10_max8997_ldo8_consumer),
263         .consumer_supplies      = slp10_max8997_ldo8_consumer,
264 };
265
266 static struct regulator_init_data slp10_max8997_ldo9_data = {
267         .constraints    = {
268                 .name           = "VCC_2.8V_PDA",
269                 .min_uV         = 2800000,
270                 .max_uV         = 2800000,
271                 .apply_uV       = 1,
272                 .always_on      = 1,
273                 .state_mem      = {
274                         .enabled        = 1,
275                         .disabled       = 0,
276                 },
277         },
278         .num_consumer_supplies  = ARRAY_SIZE(slp10_max8997_ldo9_consumer),
279         .consumer_supplies      = slp10_max8997_ldo9_consumer,
280 };
281
282 static struct regulator_init_data slp10_max8997_ldo10_data = {
283         .constraints    = {
284                 .name           = "VPLL_1.1V_C210",
285                 .min_uV         = 1100000,
286                 .max_uV         = 1100000,
287                 .apply_uV       = 1,
288                 .always_on      = 1,
289                 .state_mem      = {
290                         .enabled        = 0,
291                         .disabled       = 1,
292                 },
293         },
294         .num_consumer_supplies  = ARRAY_SIZE(slp10_max8997_ldo10_consumer),
295         .consumer_supplies      = slp10_max8997_ldo10_consumer,
296 };
297
298 static struct regulator_init_data slp10_max8997_ldo11_data = {
299         .constraints    = {
300                 .name           = "TOUCH_VCC_2.8V",
301                 .min_uV         = 2800000,
302                 .max_uV         = 2800000,
303                 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
304                 .apply_uV       = 1,
305                 .state_mem      = {
306                         .enabled        = 0,
307                         .disabled       = 1,
308                 },
309         },
310         .num_consumer_supplies  = ARRAY_SIZE(slp10_max8997_ldo11_consumer),
311         .consumer_supplies      = slp10_max8997_ldo11_consumer,
312 };
313
314 static struct regulator_init_data slp10_max8997_ldo12_data = {
315         .constraints    = {
316                 .name           = "TOUCH_AVDD_3.3V",
317                 .min_uV         = 3300000,
318                 .max_uV         = 3300000,
319                 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
320                 .apply_uV       = 1,
321                 .state_mem      = {
322                         .enabled = 0,
323                         .disabled = 1,
324                 },
325         },
326         .num_consumer_supplies  = ARRAY_SIZE(slp10_max8997_ldo12_consumer),
327         .consumer_supplies      = slp10_max8997_ldo12_consumer,
328 };
329
330 static struct regulator_init_data slp10_max8997_ldo14_data = {
331         .constraints    = {
332                 .name           = "VCC_3.0V_MOTOR",
333                 .min_uV         = 3000000,
334                 .max_uV         = 3000000,
335                 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
336                 .apply_uV       = 1,
337                 .state_mem      = {
338                         .enabled        = 0,
339                         .disabled       = 1,
340                 },
341         },
342         .num_consumer_supplies  = ARRAY_SIZE(slp10_max8997_ldo14_consumer),
343         .consumer_supplies      = slp10_max8997_ldo14_consumer,
344 };
345
346 static struct regulator_init_data slp10_max8997_ldo16_data = {
347         .constraints    = {
348                 .name           = "CAM_SENSOR_IO_1.8V",
349                 .min_uV         = 1800000,
350                 .max_uV         = 1800000,
351                 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
352                 .apply_uV       = 1,
353                 .state_mem      = {
354                         .enabled        = 0,
355                         .disabled       = 1,
356                 },
357         },
358         .num_consumer_supplies  = ARRAY_SIZE(slp10_max8997_ldo16_consumer),
359         .consumer_supplies      = slp10_max8997_ldo16_consumer,
360 };
361
362 static struct regulator_init_data slp10_max8997_ldo17_data = {
363         .constraints    = {
364                 .name           = "CAM_AF_2.8V",
365                 .min_uV         = 2800000,
366                 .max_uV         = 2800000,
367                 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
368                 .apply_uV       = 1,
369                 .state_mem      = {
370                         .enabled        = 0,
371                         .disabled       = 1,
372                 },
373         },
374         .num_consumer_supplies  = ARRAY_SIZE(slp10_max8997_ldo17_consumer),
375         .consumer_supplies      = slp10_max8997_ldo17_consumer,
376 };
377
378 static struct regulator_init_data slp10_max8997_ldo18_data = {
379         .constraints    = {
380                 .name           = "TOUCH_VCC_3.3V",
381                 .min_uV         = 3300000,
382                 .max_uV         = 3300000,
383                 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
384                 .apply_uV       = 1,
385                 .state_mem      = {
386                         .enabled        = 0,
387                         .disabled       = 1,
388                 },
389         },
390         .num_consumer_supplies  = ARRAY_SIZE(slp10_max8997_ldo18_consumer),
391         .consumer_supplies      = slp10_max8997_ldo18_consumer,
392 };
393
394 static struct regulator_init_data slp10_max8997_ldo21_data = {
395         .constraints    = {
396                 .name           = "VDDQ_M1M2_1.2V",
397                 .min_uV         = 1200000,
398                 .max_uV         = 1200000,
399                 .apply_uV       = 1,
400                 .always_on      = 1,
401                 .state_mem      = {
402                         .enabled        = 0,
403                         .disabled       = 1,
404                 },
405         },
406         .num_consumer_supplies  = ARRAY_SIZE(slp10_max8997_ldo21_consumer),
407         .consumer_supplies      = slp10_max8997_ldo21_consumer,
408 };
409
410 static struct regulator_init_data slp10_max8997_buck1_data = {
411         .constraints    = {
412                 .name           = "VARM_1.2V_C210",
413                 .min_uV         = 900000,
414                 .max_uV         = 1350000,
415                 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
416                 .always_on      = 1,
417                 .state_mem      = {
418                         .enabled = 0,
419                         .disabled = 1,
420                 },
421         },
422         .num_consumer_supplies = ARRAY_SIZE(slp10_max8997_buck1_consumer),
423         .consumer_supplies = slp10_max8997_buck1_consumer,
424 };
425
426 static struct regulator_init_data slp10_max8997_buck2_data = {
427         .constraints    = {
428                 .name           = "VINT_1.1V_C210",
429                 .min_uV         = 900000,
430                 .max_uV         = 1100000,
431                 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
432                 .always_on      = 1,
433                 .state_mem      = {
434                         .enabled = 0,
435                         .disabled = 1,
436                 },
437         },
438         .num_consumer_supplies = ARRAY_SIZE(slp10_max8997_buck2_consumer),
439         .consumer_supplies = slp10_max8997_buck2_consumer,
440 };
441
442 static struct regulator_init_data slp10_max8997_buck3_data = {
443         .constraints    = {
444                 .name           = "VG3D_1.1V_C210",
445                 .min_uV         = 900000,
446                 .max_uV         = 1100000,
447                 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
448                         REGULATOR_CHANGE_STATUS,
449                 .state_mem      = {
450                         .enabled = 0,
451                         .disabled = 1,
452                 },
453         },
454         .num_consumer_supplies = ARRAY_SIZE(slp10_max8997_buck3_consumer),
455         .consumer_supplies = slp10_max8997_buck3_consumer,
456 };
457
458 static struct regulator_init_data slp10_max8997_buck4_data = {
459         .constraints    = {
460                 .name           = "CAM_ISP_CORE_1.2V",
461                 .min_uV         = 1200000,
462                 .max_uV         = 1200000,
463                 .apply_uV       = 1,
464                 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
465                 .state_mem      = {
466                         .enabled = 0,
467                         .disabled = 1,
468                 },
469         },
470         .num_consumer_supplies = ARRAY_SIZE(slp10_max8997_buck4_consumer),
471         .consumer_supplies = slp10_max8997_buck4_consumer,
472 };
473
474 static struct regulator_init_data slp10_max8997_buck5_data = {
475         .constraints    = {
476                 .name           = "VMEM_1.2V_C210",
477                 .min_uV         = 1200000,
478                 .max_uV         = 1200000,
479                 .apply_uV       = 1,
480                 .always_on      = 1,
481                 .state_mem      = {
482                         .enabled = 1,
483                         .disabled = 0,
484                 },
485         },
486         .num_consumer_supplies = ARRAY_SIZE(slp10_max8997_buck5_consumer),
487         .consumer_supplies = slp10_max8997_buck5_consumer,
488 };
489
490 static struct regulator_init_data slp10_max8997_buck7_data = {
491         .constraints    = {
492                 .name           = "VCC_SUB_2.0V",
493                 .min_uV         = 2000000,
494                 .max_uV         = 2000000,
495                 .apply_uV       = 1,
496                 .always_on      = 1,
497                 .state_mem      = {
498                         .enabled = 1,
499                         .disabled = 0,
500                 },
501         },
502         .num_consumer_supplies = ARRAY_SIZE(slp10_max8997_buck7_consumer),
503         .consumer_supplies = slp10_max8997_buck7_consumer,
504 };
505
506 static struct regulator_init_data slp10_max8997_32khz_ap_data = {
507         .constraints    = {
508                 .name           = "32KHz AP",
509                 .always_on      = 1,
510                 .state_mem      = {
511                         .enabled = 1,
512                         .disabled = 0,
513                 },
514         },
515         .num_consumer_supplies = ARRAY_SIZE(slp10_max8997_32khz_ap_consumer),
516         .consumer_supplies = slp10_max8997_32khz_ap_consumer,
517 };
518
519 static struct regulator_init_data slp10_max8997_32khz_cp_data = {
520         .constraints    = {
521                 .name           = "32KHz CP",
522                 .state_mem      = {
523                         .enabled = 0,
524                         .disabled = 1,
525                 },
526         },
527 };
528
529 static struct regulator_init_data slp10_max8997_vichg_data = {
530         .constraints    = {
531                 .name           = "VICHG",
532                 .state_mem      = {
533                         .enabled = 0,
534                         .disabled = 1,
535                 },
536         },
537 };
538
539 /* FIMXE implement the buck enable at UDC drivers */
540 static struct regulator_init_data slp10_max8997_esafeout1_data = {
541         .constraints    = {
542                 .name           = "SAFEOUT1",
543                 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
544                 .state_mem      = {
545                         .enabled = 0,
546                         .disabled = 1,
547                 },
548         },
549         .num_consumer_supplies  = ARRAY_SIZE(slp10_max8997_esafeout1_consumer),
550         .consumer_supplies      = slp10_max8997_esafeout1_consumer,
551 };
552
553 static struct regulator_init_data slp10_max8997_esafeout2_data = {
554         .constraints    = {
555                 .name           = "SAFEOUT2",
556                 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
557                 .state_mem      = {
558                         .enabled = 0,
559                         .disabled = 1,
560                 },
561         },
562         .num_consumer_supplies  = ARRAY_SIZE(slp10_max8997_esafeout2_consumer),
563         .consumer_supplies      = slp10_max8997_esafeout2_consumer,
564 };
565
566 static struct regulator_init_data slp10_max8997_charger_cv_data = {
567         .constraints    = {
568                 .name           = "CHARGER_CV",
569                 .min_uV         = 4200000,
570                 .max_uV         = 4200000,
571                 .apply_uV       = 1,
572         },
573 };
574
575 static struct regulator_init_data slp10_max8997_charger_data = {
576         .constraints    = {
577                 .name           = "CHARGER",
578                 .min_uA         = 200000,
579                 .max_uA         = 950000,
580                 .always_on      = 1, /* EMERGENCY FORCE_DISABLE ONLY */
581                 .valid_ops_mask = REGULATOR_CHANGE_STATUS | /* Allow "enable" after "force-disable" */
582                         REGULATOR_CHANGE_CURRENT,
583         },
584         .num_consumer_supplies  = ARRAY_SIZE(slp10_max8997_charger_consumer),
585         .consumer_supplies      = slp10_max8997_charger_consumer,
586 };
587
588 static struct regulator_init_data slp10_max8997_charger_topoff_data = {
589         .constraints    = {
590                 .name           = "CHARGER TOPOFF",
591                 .min_uA         = 50000,
592                 .max_uA         = 200000,
593                 .valid_ops_mask = REGULATOR_CHANGE_CURRENT,
594         },
595         .num_consumer_supplies  = ARRAY_SIZE(slp10_max8997_charger_topoff_consumer),
596         .consumer_supplies      = slp10_max8997_charger_topoff_consumer,
597 };
598
599 static struct max8997_regulator_data slp10_max8997_regulators[] = {
600         { MAX8997_LDO1, &slp10_max8997_ldo1_data },
601         { MAX8997_LDO2, &slp10_max8997_ldo2_data },
602         { MAX8997_LDO3, &slp10_max8997_ldo3_data },
603         { MAX8997_LDO4, &slp10_max8997_ldo4_data },
604         { MAX8997_LDO5, &slp10_max8997_ldo5_data },
605         { MAX8997_LDO6, &slp10_max8997_ldo6_data },
606         { MAX8997_LDO7, &slp10_max8997_ldo7_data },
607         { MAX8997_LDO8, &slp10_max8997_ldo8_data },
608         { MAX8997_LDO9, &slp10_max8997_ldo9_data },
609         { MAX8997_LDO10, &slp10_max8997_ldo10_data },
610         { MAX8997_LDO11, &slp10_max8997_ldo11_data },
611         { MAX8997_LDO12, &slp10_max8997_ldo12_data },
612
613         { MAX8997_LDO14, &slp10_max8997_ldo14_data },
614
615         { MAX8997_LDO16, &slp10_max8997_ldo16_data },
616         { MAX8997_LDO17, &slp10_max8997_ldo17_data },
617         { MAX8997_LDO18, &slp10_max8997_ldo18_data },
618         { MAX8997_LDO21, &slp10_max8997_ldo21_data },
619
620         { MAX8997_BUCK1, &slp10_max8997_buck1_data },
621         { MAX8997_BUCK2, &slp10_max8997_buck2_data },
622         { MAX8997_BUCK3, &slp10_max8997_buck3_data },
623         { MAX8997_BUCK4, &slp10_max8997_buck4_data },
624         { MAX8997_BUCK5, &slp10_max8997_buck5_data },
625         { MAX8997_BUCK7, &slp10_max8997_buck7_data },
626
627         { MAX8997_EN32KHZ_AP, &slp10_max8997_32khz_ap_data },
628         { MAX8997_EN32KHZ_CP, &slp10_max8997_32khz_cp_data },
629
630         { MAX8997_ENVICHG, &slp10_max8997_vichg_data },
631         { MAX8997_ESAFEOUT1, &slp10_max8997_esafeout1_data },
632         { MAX8997_ESAFEOUT2, &slp10_max8997_esafeout2_data },
633         { MAX8997_CHARGER_CV, &slp10_max8997_charger_cv_data },
634         { MAX8997_CHARGER, &slp10_max8997_charger_data },
635         { MAX8997_CHARGER_TOPOFF, &slp10_max8997_charger_topoff_data },
636 };
637
638 extern struct max8997_muic_platform_data slp10_muic_pdata;
639 extern struct max8997_haptic_platform_data slp10_haptic_pdata;
640
641 struct max8997_platform_data slp10_max8997_pdata = {
642         .irq_base               = IRQ_PMIC_BASE,
643         .ono                    = 0,
644         .wakeup                 = 1,
645
646         .num_regulators         = ARRAY_SIZE(slp10_max8997_regulators),
647         .regulators             = slp10_max8997_regulators,
648
649         .buck125_gpios = { S5PV310_GPX0(5), S5PV310_GPX0(6), S5PV310_GPL0(0) },
650         .buck125_default_idx = 0,
651         .buck1_gpiodvs = false,
652         .buck2_gpiodvs = true,
653         .buck5_gpiodvs = false,
654
655         .buck1_voltage[0] = 1350000, /* 1.35V */
656         .buck1_voltage[1] = 1300000, /* 1.3V */
657         .buck1_voltage[2] = 1250000, /* 1.25V */
658         .buck1_voltage[3] = 1200000, /* 1.2V */
659         .buck1_voltage[4] = 1150000, /* 1.15V */
660         .buck1_voltage[5] = 1100000, /* 1.1V */
661         .buck1_voltage[6] = 1000000, /* 1.0V */ /* No room for 1.05V */
662         .buck1_voltage[7] = 950000, /* 0.95V */
663
664         .buck2_voltage[0] = 1100000, /* 1.1V */
665         .buck2_voltage[1] = 1000000, /* 1.0V */
666         .buck2_voltage[2] = 950000, /* 0.95V */
667         .buck2_voltage[3] = 900000, /* 0.9V */
668         .buck2_voltage[4] = 1100000, /* 1.1V */
669         .buck2_voltage[5] = 1000000, /* 1.0V */
670         .buck2_voltage[6] = 950000, /* 0.95V */
671         .buck2_voltage[7] = 900000, /* 0.9V */
672
673         .buck5_voltage[0] = 1200000, /* 1.2V */
674         .buck5_voltage[1] = 1200000, /* 1.2V */
675         .buck5_voltage[2] = 1200000, /* 1.2V */
676         .buck5_voltage[3] = 1200000, /* 1.2V */
677         .buck5_voltage[4] = 1200000, /* 1.2V */
678         .buck5_voltage[5] = 1200000, /* 1.2V */
679         .buck5_voltage[6] = 1200000, /* 1.2V */
680         .buck5_voltage[7] = 1200000, /* 1.2V */
681
682         /* CHARGER */
683         .eoc_mA         = 50,
684         .eoc_ratio      = 0,    /* TODO: change after ratio is implemented */
685         .vichg_adc_get_uV       = NULL, /* TODO: Need to fill this in */
686         .timeout        = 5,
687
688         /* haptic */
689         .haptic_pdata   = &slp10_haptic_pdata,
690
691         /* muic */
692         .muic_pdata     = &slp10_muic_pdata,
693
694         /* RTC */
695         .delay          = true,
696 };