2 * linux/arch/arm/mach-s5pv310/max8997-slp10.c
4 * Copyright (c) 2011 Samsung Electronics Co., Ltd.
5 * MyungJoo Ham <myungjoo.ham@samsung.com>
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.
11 * MAX8997 Setting for SLP10 Board
14 #include <linux/mfd/max8997.h>
15 #include <linux/regulator/machine.h>
17 #include <mach/gpio.h>
18 #include <mach/irqs.h>
20 #include <plat/gpio-cfg.h>
22 void __init slp10_pmic_init(void)
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);
33 static struct regulator_consumer_supply slp10_max8997_ldo1_consumer[] = {
34 REGULATOR_SUPPLY("vadc", NULL),
35 REGULATOR_SUPPLY("vadc", "s5p-charger"),
37 static struct regulator_consumer_supply slp10_max8997_ldo2_consumer[] = {
38 REGULATOR_SUPPLY("vdd_alive", "s5pc210"), /* FIXME: device name */
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 */
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 */
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 */
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"),
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"),
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? */
67 static struct regulator_consumer_supply slp10_max8997_ldo9_consumer[] = {
68 REGULATOR_SUPPLY("vcc_2.8v_pda", NULL), /* FIXME: update name */
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 */
74 static struct regulator_consumer_supply slp10_max8997_ldo11_consumer[] = {
75 REGULATOR_SUPPLY("vcc_aux", "3-004c"), /* FIXME: Touchscreen MUST use this */
77 static struct regulator_consumer_supply slp10_max8997_ldo12_consumer[] = {
78 REGULATOR_SUPPLY("avdd", "3-004c"), /* FIXME: Touchscreen MUST use this */
80 static struct regulator_consumer_supply slp10_max8997_ldo14_consumer[] = {
81 REGULATOR_SUPPLY("inmotor", "max8997-haptic"),
83 static struct regulator_consumer_supply slp10_max8997_ldo16_consumer[] = {
84 REGULATOR_SUPPLY("d_sensor", "0-001f"),
86 static struct regulator_consumer_supply slp10_max8997_ldo17_consumer[] = {
87 REGULATOR_SUPPLY("dig_28", "0-001f"),
89 static struct regulator_consumer_supply slp10_max8997_ldo18_consumer[] = {
90 REGULATOR_SUPPLY("vdd", "3-004c"), /* FIXME: Touchscreen MUST use this */
92 static struct regulator_consumer_supply slp10_max8997_ldo21_consumer[] = {
93 /* "Memory I/O Power" */
96 static struct regulator_consumer_supply slp10_max8997_buck1_consumer[] = {
97 REGULATOR_SUPPLY("vdd_arm", NULL),
99 static struct regulator_consumer_supply slp10_max8997_buck2_consumer[] = {
100 REGULATOR_SUPPLY("vdd_int", NULL),
102 static struct regulator_consumer_supply slp10_max8997_buck3_consumer[] = {
103 REGULATOR_SUPPLY("vg3d", "mali_dev.0"),
105 static struct regulator_consumer_supply slp10_max8997_buck4_consumer[] = {
106 /* FIXME: pin "12", "13", "14" of HDC803 */
107 REGULATOR_SUPPLY("core", "0-001f"),
109 static struct regulator_consumer_supply slp10_max8997_buck5_consumer[] = {
110 REGULATOR_SUPPLY("vdd_mem", NULL), /* LPDDR's Core Power */
112 static struct regulator_consumer_supply slp10_max8997_buck7_consumer[] = {
115 REGULATOR_SUPPLY("vcc_sub_2.0v", "0-003c"), /* TODO: double check the name */
118 static struct regulator_consumer_supply slp10_max8997_esafeout1_consumer[] = {
119 REGULATOR_SUPPLY("usb_vbus_ap_5v", NULL), /* obsolete. FIXME name? */
121 static struct regulator_consumer_supply slp10_max8997_esafeout2_consumer[] = {
122 REGULATOR_SUPPLY("usb_vbus_cp_5v", NULL), /* obsolete. FIXME name? */
125 static struct regulator_consumer_supply slp10_max8997_charger_consumer[] = {
126 REGULATOR_SUPPLY("vinchg1", "charger-manager.0"),
128 static struct regulator_consumer_supply slp10_max8997_charger_topoff_consumer[] = {
129 REGULATOR_SUPPLY("vinchg_stop", NULL),
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),
138 static struct regulator_init_data slp10_max8997_ldo1_data = {
140 .name = "VADC_3.3V_C210",
143 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
150 .num_consumer_supplies = ARRAY_SIZE(slp10_max8997_ldo1_consumer),
151 .consumer_supplies = slp10_max8997_ldo1_consumer,
154 static struct regulator_init_data slp10_max8997_ldo2_data = {
156 .name = "VALIVE_1.1V_C210",
166 .num_consumer_supplies = ARRAY_SIZE(slp10_max8997_ldo2_consumer),
167 .consumer_supplies = slp10_max8997_ldo2_consumer,
170 static struct regulator_init_data slp10_max8997_ldo3_data = {
172 .name = "VUSB_1.1V_C210",
175 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
182 .num_consumer_supplies = ARRAY_SIZE(slp10_max8997_ldo3_consumer),
183 .consumer_supplies = slp10_max8997_ldo3_consumer,
186 static struct regulator_init_data slp10_max8997_ldo4_data = {
188 .name = "VMIPI_1.8V",
191 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
198 .num_consumer_supplies = ARRAY_SIZE(slp10_max8997_ldo4_consumer),
199 .consumer_supplies = slp10_max8997_ldo4_consumer,
202 static struct regulator_init_data slp10_max8997_ldo5_data = {
204 .name = "VHSIC_1.2V_C210",
207 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
214 .num_consumer_supplies = ARRAY_SIZE(slp10_max8997_ldo5_consumer),
215 .consumer_supplies = slp10_max8997_ldo5_consumer,
218 static struct regulator_init_data slp10_max8997_ldo6_data = {
220 .name = "VCC_1.8V_PDA",
230 .num_consumer_supplies = ARRAY_SIZE(slp10_max8997_ldo6_consumer),
231 .consumer_supplies = slp10_max8997_ldo6_consumer,
234 static struct regulator_init_data slp10_max8997_ldo7_data = {
236 .name = "CAM_ISP_1.8V",
239 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
246 .num_consumer_supplies = ARRAY_SIZE(slp10_max8997_ldo7_consumer),
247 .consumer_supplies = slp10_max8997_ldo7_consumer,
250 static struct regulator_init_data slp10_max8997_ldo8_data = {
252 .name = "VUSB/VDAC_3.3V_C210",
255 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
262 .num_consumer_supplies = ARRAY_SIZE(slp10_max8997_ldo8_consumer),
263 .consumer_supplies = slp10_max8997_ldo8_consumer,
266 static struct regulator_init_data slp10_max8997_ldo9_data = {
268 .name = "VCC_2.8V_PDA",
278 .num_consumer_supplies = ARRAY_SIZE(slp10_max8997_ldo9_consumer),
279 .consumer_supplies = slp10_max8997_ldo9_consumer,
282 static struct regulator_init_data slp10_max8997_ldo10_data = {
284 .name = "VPLL_1.1V_C210",
294 .num_consumer_supplies = ARRAY_SIZE(slp10_max8997_ldo10_consumer),
295 .consumer_supplies = slp10_max8997_ldo10_consumer,
298 static struct regulator_init_data slp10_max8997_ldo11_data = {
300 .name = "TOUCH_VCC_2.8V",
303 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
310 .num_consumer_supplies = ARRAY_SIZE(slp10_max8997_ldo11_consumer),
311 .consumer_supplies = slp10_max8997_ldo11_consumer,
314 static struct regulator_init_data slp10_max8997_ldo12_data = {
316 .name = "TOUCH_AVDD_3.3V",
319 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
326 .num_consumer_supplies = ARRAY_SIZE(slp10_max8997_ldo12_consumer),
327 .consumer_supplies = slp10_max8997_ldo12_consumer,
330 static struct regulator_init_data slp10_max8997_ldo14_data = {
332 .name = "VCC_3.0V_MOTOR",
335 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
342 .num_consumer_supplies = ARRAY_SIZE(slp10_max8997_ldo14_consumer),
343 .consumer_supplies = slp10_max8997_ldo14_consumer,
346 static struct regulator_init_data slp10_max8997_ldo16_data = {
348 .name = "CAM_SENSOR_IO_1.8V",
351 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
358 .num_consumer_supplies = ARRAY_SIZE(slp10_max8997_ldo16_consumer),
359 .consumer_supplies = slp10_max8997_ldo16_consumer,
362 static struct regulator_init_data slp10_max8997_ldo17_data = {
364 .name = "CAM_AF_2.8V",
367 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
374 .num_consumer_supplies = ARRAY_SIZE(slp10_max8997_ldo17_consumer),
375 .consumer_supplies = slp10_max8997_ldo17_consumer,
378 static struct regulator_init_data slp10_max8997_ldo18_data = {
380 .name = "TOUCH_VCC_3.3V",
383 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
390 .num_consumer_supplies = ARRAY_SIZE(slp10_max8997_ldo18_consumer),
391 .consumer_supplies = slp10_max8997_ldo18_consumer,
394 static struct regulator_init_data slp10_max8997_ldo21_data = {
396 .name = "VDDQ_M1M2_1.2V",
406 .num_consumer_supplies = ARRAY_SIZE(slp10_max8997_ldo21_consumer),
407 .consumer_supplies = slp10_max8997_ldo21_consumer,
410 static struct regulator_init_data slp10_max8997_buck1_data = {
412 .name = "VARM_1.2V_C210",
415 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
422 .num_consumer_supplies = ARRAY_SIZE(slp10_max8997_buck1_consumer),
423 .consumer_supplies = slp10_max8997_buck1_consumer,
426 static struct regulator_init_data slp10_max8997_buck2_data = {
428 .name = "VINT_1.1V_C210",
431 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
438 .num_consumer_supplies = ARRAY_SIZE(slp10_max8997_buck2_consumer),
439 .consumer_supplies = slp10_max8997_buck2_consumer,
442 static struct regulator_init_data slp10_max8997_buck3_data = {
444 .name = "VG3D_1.1V_C210",
447 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
448 REGULATOR_CHANGE_STATUS,
454 .num_consumer_supplies = ARRAY_SIZE(slp10_max8997_buck3_consumer),
455 .consumer_supplies = slp10_max8997_buck3_consumer,
458 static struct regulator_init_data slp10_max8997_buck4_data = {
460 .name = "CAM_ISP_CORE_1.2V",
464 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
470 .num_consumer_supplies = ARRAY_SIZE(slp10_max8997_buck4_consumer),
471 .consumer_supplies = slp10_max8997_buck4_consumer,
474 static struct regulator_init_data slp10_max8997_buck5_data = {
476 .name = "VMEM_1.2V_C210",
486 .num_consumer_supplies = ARRAY_SIZE(slp10_max8997_buck5_consumer),
487 .consumer_supplies = slp10_max8997_buck5_consumer,
490 static struct regulator_init_data slp10_max8997_buck7_data = {
492 .name = "VCC_SUB_2.0V",
502 .num_consumer_supplies = ARRAY_SIZE(slp10_max8997_buck7_consumer),
503 .consumer_supplies = slp10_max8997_buck7_consumer,
506 static struct regulator_init_data slp10_max8997_32khz_ap_data = {
515 .num_consumer_supplies = ARRAY_SIZE(slp10_max8997_32khz_ap_consumer),
516 .consumer_supplies = slp10_max8997_32khz_ap_consumer,
519 static struct regulator_init_data slp10_max8997_32khz_cp_data = {
529 static struct regulator_init_data slp10_max8997_vichg_data = {
539 /* FIMXE implement the buck enable at UDC drivers */
540 static struct regulator_init_data slp10_max8997_esafeout1_data = {
543 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
549 .num_consumer_supplies = ARRAY_SIZE(slp10_max8997_esafeout1_consumer),
550 .consumer_supplies = slp10_max8997_esafeout1_consumer,
553 static struct regulator_init_data slp10_max8997_esafeout2_data = {
556 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
562 .num_consumer_supplies = ARRAY_SIZE(slp10_max8997_esafeout2_consumer),
563 .consumer_supplies = slp10_max8997_esafeout2_consumer,
566 static struct regulator_init_data slp10_max8997_charger_cv_data = {
568 .name = "CHARGER_CV",
575 static struct regulator_init_data slp10_max8997_charger_data = {
580 .always_on = 1, /* EMERGENCY FORCE_DISABLE ONLY */
581 .valid_ops_mask = REGULATOR_CHANGE_STATUS | /* Allow "enable" after "force-disable" */
582 REGULATOR_CHANGE_CURRENT,
584 .num_consumer_supplies = ARRAY_SIZE(slp10_max8997_charger_consumer),
585 .consumer_supplies = slp10_max8997_charger_consumer,
588 static struct regulator_init_data slp10_max8997_charger_topoff_data = {
590 .name = "CHARGER TOPOFF",
593 .valid_ops_mask = REGULATOR_CHANGE_CURRENT,
595 .num_consumer_supplies = ARRAY_SIZE(slp10_max8997_charger_topoff_consumer),
596 .consumer_supplies = slp10_max8997_charger_topoff_consumer,
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 },
613 { MAX8997_LDO14, &slp10_max8997_ldo14_data },
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 },
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 },
627 { MAX8997_EN32KHZ_AP, &slp10_max8997_32khz_ap_data },
628 { MAX8997_EN32KHZ_CP, &slp10_max8997_32khz_cp_data },
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 },
638 extern struct max8997_muic_platform_data slp10_muic_pdata;
639 extern struct max8997_haptic_platform_data slp10_haptic_pdata;
641 struct max8997_platform_data slp10_max8997_pdata = {
642 .irq_base = IRQ_PMIC_BASE,
646 .num_regulators = ARRAY_SIZE(slp10_max8997_regulators),
647 .regulators = slp10_max8997_regulators,
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,
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 */
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 */
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 */
684 .eoc_ratio = 0, /* TODO: change after ratio is implemented */
685 .vichg_adc_get_uV = NULL, /* TODO: Need to fill this in */
689 .haptic_pdata = &slp10_haptic_pdata,
692 .muic_pdata = &slp10_muic_pdata,