2 * linux/arch/arm/mach-s5pv310/max8997-slp7.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 SLP7 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 slp7_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 slp7_max8997_ldo1_consumer[] = {
34 REGULATOR_SUPPLY("vadc", NULL),
36 static struct regulator_consumer_supply slp7_max8997_ldo2_consumer[] = {
37 REGULATOR_SUPPLY("vdd_alive", "s5pc210"), /* FIXME: device name */
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 */
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 */
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 */
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"),
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"),
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? */
66 static struct regulator_consumer_supply slp7_max8997_ldo9_consumer[] = {
67 REGULATOR_SUPPLY("vcc_2.8v_pda", NULL), /* FIXME: update name */
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 */
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"),
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 */
81 static struct regulator_consumer_supply slp7_max8997_ldo13_consumer[] = {
82 REGULATOR_SUPPLY("vmmc", "s3c-sdhci.2"),
84 static struct regulator_consumer_supply slp7_max8997_ldo14_consumer[] = {
85 REGULATOR_SUPPLY("inmotor", "max8997-haptic"),
87 static struct regulator_consumer_supply slp7_max8997_ldo15_consumer[] = {
88 REGULATOR_SUPPLY("avdd", "3-004a"), /* Touch Screen's AVDD */
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 */
94 static struct regulator_consumer_supply slp7_max8997_ldo18_consumer[] = {
95 REGULATOR_SUPPLY("vdd", "3-004a"), /* Touch Screen's VDD and I2C */
97 static struct regulator_consumer_supply slp7_max8997_ldo21_consumer[] = {
98 /* "Memory I/O Power" */
101 static struct regulator_consumer_supply slp7_max8997_buck1_consumer[] = {
102 REGULATOR_SUPPLY("vdd_arm", NULL),
104 static struct regulator_consumer_supply slp7_max8997_buck2_consumer[] = {
105 REGULATOR_SUPPLY("vdd_int", NULL),
107 static struct regulator_consumer_supply slp7_max8997_buck3_consumer[] = {
108 REGULATOR_SUPPLY("vg3d", "mali_dev.0"),
110 static struct regulator_consumer_supply slp7_max8997_buck4_consumer[] = {
111 /* FIXME: pin "12", "13", "14" of HDC803 */
112 REGULATOR_SUPPLY("core", "0-001f"),
114 static struct regulator_consumer_supply slp7_max8997_buck5_consumer[] = {
115 REGULATOR_SUPPLY("vdd_mem", NULL), /* LPDDR's Core Power */
117 static struct regulator_consumer_supply slp7_max8997_buck6_consumer[] = {
118 REGULATOR_SUPPLY("dig_28", "0-001f"), /* FIXME: pin "7" of HDC803 */
120 static struct regulator_consumer_supply slp7_max8997_buck7_consumer[] = {
123 REGULATOR_SUPPLY("vcc_sub_2.0v", "0-003c"), /* TODO: double check the name */
126 static struct regulator_consumer_supply slp7_max8997_esafeout1_consumer[] = {
127 REGULATOR_SUPPLY("usb_vbus_ap_5v", NULL), /* obsolete. FIXME name? */
129 static struct regulator_consumer_supply slp7_max8997_esafeout2_consumer[] = {
130 REGULATOR_SUPPLY("usb_vbus_cp_5v", NULL), /* obsolete. FIXME name? */
133 static struct regulator_consumer_supply slp7_max8997_charger_consumer[] = {
134 REGULATOR_SUPPLY("vinchg1", "charger-manager.0"),
136 static struct regulator_consumer_supply slp7_max8997_charger_topoff_consumer[] = {
137 REGULATOR_SUPPLY("vinchg_stop", NULL),
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),
146 static struct regulator_init_data slp7_max8997_ldo1_data = {
148 .name = "VADC_3.3V_C210",
151 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
158 .num_consumer_supplies = ARRAY_SIZE(slp7_max8997_ldo1_consumer),
159 .consumer_supplies = slp7_max8997_ldo1_consumer,
162 static struct regulator_init_data slp7_max8997_ldo2_data = {
164 .name = "VALIVE_1.1V_C210",
174 .num_consumer_supplies = ARRAY_SIZE(slp7_max8997_ldo2_consumer),
175 .consumer_supplies = slp7_max8997_ldo2_consumer,
178 static struct regulator_init_data slp7_max8997_ldo3_data = {
180 .name = "VUSB_1.1V_C210",
183 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
190 .num_consumer_supplies = ARRAY_SIZE(slp7_max8997_ldo3_consumer),
191 .consumer_supplies = slp7_max8997_ldo3_consumer,
194 static struct regulator_init_data slp7_max8997_ldo4_data = {
196 .name = "VMIPI_1.8V",
199 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
206 .num_consumer_supplies = ARRAY_SIZE(slp7_max8997_ldo4_consumer),
207 .consumer_supplies = slp7_max8997_ldo4_consumer,
210 static struct regulator_init_data slp7_max8997_ldo5_data = {
212 .name = "VHSIC_1.2V_C210",
215 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
222 .num_consumer_supplies = ARRAY_SIZE(slp7_max8997_ldo5_consumer),
223 .consumer_supplies = slp7_max8997_ldo5_consumer,
226 static struct regulator_init_data slp7_max8997_ldo6_data = {
228 .name = "VCC_1.8V_PDA",
238 .num_consumer_supplies = ARRAY_SIZE(slp7_max8997_ldo6_consumer),
239 .consumer_supplies = slp7_max8997_ldo6_consumer,
242 static struct regulator_init_data slp7_max8997_ldo7_data = {
244 .name = "CAM_ISP_1.8V",
247 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
254 .num_consumer_supplies = ARRAY_SIZE(slp7_max8997_ldo7_consumer),
255 .consumer_supplies = slp7_max8997_ldo7_consumer,
258 static struct regulator_init_data slp7_max8997_ldo8_data = {
260 .name = "VUSB/VDAC_3.3V_C210",
263 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
270 .num_consumer_supplies = ARRAY_SIZE(slp7_max8997_ldo8_consumer),
271 .consumer_supplies = slp7_max8997_ldo8_consumer,
274 static struct regulator_init_data slp7_max8997_ldo9_data = {
276 .name = "VCC_2.8V_PDA",
286 .num_consumer_supplies = ARRAY_SIZE(slp7_max8997_ldo9_consumer),
287 .consumer_supplies = slp7_max8997_ldo9_consumer,
290 static struct regulator_init_data slp7_max8997_ldo10_data = {
292 .name = "VPLL_1.1V_C210",
302 .num_consumer_supplies = ARRAY_SIZE(slp7_max8997_ldo10_consumer),
303 .consumer_supplies = slp7_max8997_ldo10_consumer,
306 static struct regulator_init_data slp7_max8997_ldo11_data = {
308 .name = "LVDS_VDD3.3V",
311 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
319 .num_consumer_supplies = ARRAY_SIZE(slp7_max8997_ldo11_consumer),
320 .consumer_supplies = slp7_max8997_ldo11_consumer,
323 static struct regulator_init_data slp7_max8997_ldo12_data = {
325 .name = "VT_CAM_1.8V",
328 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
335 .num_consumer_supplies = ARRAY_SIZE(slp7_max8997_ldo12_consumer),
336 .consumer_supplies = slp7_max8997_ldo12_consumer,
339 static struct regulator_init_data slp7_max8997_ldo13_data = {
344 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
351 .num_consumer_supplies = ARRAY_SIZE(slp7_max8997_ldo13_consumer),
352 .consumer_supplies = slp7_max8997_ldo13_consumer,
355 static struct regulator_init_data slp7_max8997_ldo14_data = {
357 .name = "VCC_3.0V_MOTOR",
360 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
367 .num_consumer_supplies = ARRAY_SIZE(slp7_max8997_ldo14_consumer),
368 .consumer_supplies = slp7_max8997_ldo14_consumer,
371 static struct regulator_init_data slp7_max8997_ldo15_data = {
373 .name = "VTOUCH_ADVV2.8V",
377 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
383 .num_consumer_supplies = ARRAY_SIZE(slp7_max8997_ldo15_consumer),
384 .consumer_supplies = slp7_max8997_ldo15_consumer,
387 static struct regulator_init_data slp7_max8997_ldo16_data = {
389 .name = "CAM_SENSOR_IO_1.8V",
392 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
399 .num_consumer_supplies = ARRAY_SIZE(slp7_max8997_ldo16_consumer),
400 .consumer_supplies = slp7_max8997_ldo16_consumer,
403 static struct regulator_init_data slp7_max8997_ldo18_data = {
405 .name = "VTOUCH_VDD2.8V",
408 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
415 .num_consumer_supplies = ARRAY_SIZE(slp7_max8997_ldo18_consumer),
416 .consumer_supplies = slp7_max8997_ldo18_consumer,
419 static struct regulator_init_data slp7_max8997_ldo21_data = {
421 .name = "VDDQ_M1M2_1.2V",
431 .num_consumer_supplies = ARRAY_SIZE(slp7_max8997_ldo21_consumer),
432 .consumer_supplies = slp7_max8997_ldo21_consumer,
435 static struct regulator_init_data slp7_max8997_buck1_data = {
437 .name = "VARM_1.2V_C210",
440 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
447 .num_consumer_supplies = ARRAY_SIZE(slp7_max8997_buck1_consumer),
448 .consumer_supplies = slp7_max8997_buck1_consumer,
451 static struct regulator_init_data slp7_max8997_buck2_data = {
453 .name = "VINT_1.1V_C210",
456 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
463 .num_consumer_supplies = ARRAY_SIZE(slp7_max8997_buck2_consumer),
464 .consumer_supplies = slp7_max8997_buck2_consumer,
467 static struct regulator_init_data slp7_max8997_buck3_data = {
469 .name = "VG3D_1.1V_C210",
472 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
473 REGULATOR_CHANGE_STATUS,
479 .num_consumer_supplies = ARRAY_SIZE(slp7_max8997_buck3_consumer),
480 .consumer_supplies = slp7_max8997_buck3_consumer,
483 static struct regulator_init_data slp7_max8997_buck4_data = {
485 .name = "CAM_ISP_CORE_1.2V",
489 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
495 .num_consumer_supplies = ARRAY_SIZE(slp7_max8997_buck4_consumer),
496 .consumer_supplies = slp7_max8997_buck4_consumer,
499 static struct regulator_init_data slp7_max8997_buck5_data = {
501 .name = "VMEM_1.2V_C210",
511 .num_consumer_supplies = ARRAY_SIZE(slp7_max8997_buck5_consumer),
512 .consumer_supplies = slp7_max8997_buck5_consumer,
515 static struct regulator_init_data slp7_max8997_buck6_data = {
517 .name = "CAM_AF_2.8V",
521 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
527 .num_consumer_supplies = ARRAY_SIZE(slp7_max8997_buck6_consumer),
528 .consumer_supplies = slp7_max8997_buck6_consumer,
531 static struct regulator_init_data slp7_max8997_buck7_data = {
533 .name = "VCC_SUB_2.0V",
543 .num_consumer_supplies = ARRAY_SIZE(slp7_max8997_buck7_consumer),
544 .consumer_supplies = slp7_max8997_buck7_consumer,
547 static struct regulator_init_data slp7_max8997_32khz_ap_data = {
556 .num_consumer_supplies = ARRAY_SIZE(slp7_max8997_32khz_ap_consumer),
557 .consumer_supplies = slp7_max8997_32khz_ap_consumer,
560 static struct regulator_init_data slp7_max8997_32khz_cp_data = {
570 static struct regulator_init_data slp7_max8997_vichg_data = {
580 /* FIMXE implement the buck enable at UDC drivers */
581 static struct regulator_init_data slp7_max8997_esafeout1_data = {
584 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
590 .num_consumer_supplies = ARRAY_SIZE(slp7_max8997_esafeout1_consumer),
591 .consumer_supplies = slp7_max8997_esafeout1_consumer,
594 static struct regulator_init_data slp7_max8997_esafeout2_data = {
597 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
603 .num_consumer_supplies = ARRAY_SIZE(slp7_max8997_esafeout2_consumer),
604 .consumer_supplies = slp7_max8997_esafeout2_consumer,
607 static struct regulator_init_data slp7_max8997_charger_cv_data = {
609 .name = "CHARGER_CV",
616 static struct regulator_init_data slp7_max8997_charger_data = {
622 .valid_ops_mask = REGULATOR_CHANGE_STATUS |
623 REGULATOR_CHANGE_CURRENT,
625 .num_consumer_supplies = ARRAY_SIZE(slp7_max8997_charger_consumer),
626 .consumer_supplies = slp7_max8997_charger_consumer,
629 static struct regulator_init_data slp7_max8997_charger_topoff_data = {
631 .name = "CHARGER TOPOFF",
634 .valid_ops_mask = REGULATOR_CHANGE_CURRENT,
636 .num_consumer_supplies = ARRAY_SIZE(slp7_max8997_charger_topoff_consumer),
637 .consumer_supplies = slp7_max8997_charger_topoff_consumer,
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 },
658 { MAX8997_LDO18, &slp7_max8997_ldo18_data },
659 { MAX8997_LDO21, &slp7_max8997_ldo21_data },
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 },
669 { MAX8997_EN32KHZ_AP, &slp7_max8997_32khz_ap_data },
670 { MAX8997_EN32KHZ_CP, &slp7_max8997_32khz_cp_data },
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 },
680 extern struct max8997_muic_platform_data slp7_muic_pdata;
681 extern struct max8997_haptic_platform_data slp7_haptic_pdata;
683 struct max8997_platform_data slp7_max8997_pdata = {
684 .irq_base = IRQ_PMIC_BASE,
688 .num_regulators = ARRAY_SIZE(slp7_max8997_regulators),
689 .regulators = slp7_max8997_regulators,
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,
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 */
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 */
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 */
726 .eoc_ratio = 0, /* TODO: change after ratio is implemented */
727 .vichg_adc_get_uV = NULL, /* TODO: Need to fill this in */
731 .haptic_pdata = &slp7_haptic_pdata,
734 .muic_pdata = &slp7_muic_pdata,