msm: board-8960: Wrap PMIC 8921 GPIO 42 in a gpio-regulator device
Wrap PMIC 8921 GPIO 42 in a gpio-regulator device so that the USB
OTG driver can be simplified. GPIO 42 represents the OTG_CNTL
signal on 8960 devices. This drives a FET which switches the USB
OTG MVS output of the PMIC 8921. By controlling GPIO 42 with a
gpio-regulator, it is possible to encapsulate all USB OTG 5V
output dependencies within a single regulator_enable call. The
regulator framework is able to automatically set all GPIOs and
PMIC regulators appropriately thanks to the supply chain that
is defined for the regulators.
Change-Id: I8cd26b56a3a2871e784227b5d49f5d1089b19784
Signed-off-by: David Collins <collinsd@codeaurora.org>
diff --git a/arch/arm/mach-msm/board-8960.c b/arch/arm/mach-msm/board-8960.c
index 3ef7dea..c524c65 100644
--- a/arch/arm/mach-msm/board-8960.c
+++ b/arch/arm/mach-msm/board-8960.c
@@ -1599,6 +1599,15 @@
},
};
+static struct platform_device msm8960_device_ext_otg_sw_vreg __devinitdata = {
+ .name = GPIO_REGULATOR_DEV_NAME,
+ .id = PM8921_GPIO_PM_TO_SYS(42),
+ .dev = {
+ .platform_data =
+ &msm_gpio_regulator_pdata[GPIO_VREG_ID_EXT_OTG_SW],
+ },
+};
+
static struct platform_device msm8960_device_rpm_regulator __devinitdata = {
.name = "rpm-regulator",
.id = -1,
@@ -1635,6 +1644,7 @@
&msm_device_saw_core1,
&msm8960_device_ext_5v_vreg,
&msm8960_device_ssbi_pmic,
+ &msm8960_device_ext_otg_sw_vreg,
&msm8960_device_qup_spi_gsbi1,
&msm8960_device_qup_i2c_gsbi3,
&msm8960_device_qup_i2c_gsbi4,