msm: board-8960: Add external 3.3 V regulator for 8960 LiQUID
Add a GPIO controlled regulator device to manage the external
3.3 V buck-boost regulator on 8960 LiQUID via PMIC PM8018
GPIO 17. This regulator is shared between several consumers.
Signed-off-by: David Collins <collinsd@codeaurora.org>
diff --git a/arch/arm/mach-msm/board-msm8960-regulator.c b/arch/arm/mach-msm/board-msm8960-regulator.c
index ea54c07..da2a124 100644
--- a/arch/arm/mach-msm/board-msm8960-regulator.c
+++ b/arch/arm/mach-msm/board-msm8960-regulator.c
@@ -217,6 +217,9 @@
REGULATOR_SUPPLY("ext_l2", NULL),
REGULATOR_SUPPLY("vdd_phy", "spi0.0"),
};
+VREG_CONSUMERS(EXT_3P3V) = {
+ REGULATOR_SUPPLY("ext_3p3v", NULL),
+};
#define PM8921_VREG_INIT(_id, _min_uV, _max_uV, _modes, _ops, _apply_uV, \
_pull_down, _always_on, _supply_regulator, \
@@ -430,6 +433,8 @@
struct gpio_regulator_platform_data msm_gpio_regulator_pdata[] __devinitdata = {
GPIO_VREG_INIT(EXT_5V, "ext_5v", "ext_5v_en", PM8921_MPP_PM_TO_SYS(7)),
GPIO_VREG_INIT(EXT_L2, "ext_l2", "ext_l2_en", 91),
+ GPIO_VREG_INIT(EXT_3P3V, "ext_3p3v", "ext_3p3v_en",
+ PM8921_GPIO_PM_TO_SYS(17)),
};
/* SAW regulator constraints */
diff --git a/arch/arm/mach-msm/board-msm8960.c b/arch/arm/mach-msm/board-msm8960.c
index 61da9f5..4882772 100644
--- a/arch/arm/mach-msm/board-msm8960.c
+++ b/arch/arm/mach-msm/board-msm8960.c
@@ -2739,6 +2739,15 @@
},
};
+static struct platform_device msm8960_device_ext_3p3v_vreg __devinitdata = {
+ .name = GPIO_REGULATOR_DEV_NAME,
+ .id = PM8921_GPIO_PM_TO_SYS(17),
+ .dev = {
+ .platform_data =
+ &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_3P3V],
+ },
+};
+
static struct platform_device msm8960_device_rpm_regulator __devinitdata = {
.name = "rpm-regulator",
.id = -1,
@@ -3585,6 +3594,8 @@
msm8960_init_buses();
platform_add_devices(msm_footswitch_devices,
msm_num_footswitch_devices);
+ if (machine_is_msm8960_liquid())
+ platform_device_register(&msm8960_device_ext_3p3v_vreg);
platform_add_devices(common_devices, ARRAY_SIZE(common_devices));
pm8921_gpio_mpp_init();
platform_add_devices(cdp_devices, ARRAY_SIZE(cdp_devices));
diff --git a/arch/arm/mach-msm/board-msm8960.h b/arch/arm/mach-msm/board-msm8960.h
index 0b2a907..7a939af 100644
--- a/arch/arm/mach-msm/board-msm8960.h
+++ b/arch/arm/mach-msm/board-msm8960.h
@@ -31,6 +31,7 @@
#define GPIO_VREG_ID_EXT_5V 0
#define GPIO_VREG_ID_EXT_L2 1
+#define GPIO_VREG_ID_EXT_3P3V 2
extern struct gpio_regulator_platform_data
msm_gpio_regulator_pdata[] __devinitdata;