USB: EHCI: Add support to detect docking station connection and removal
This change implements the docking station detection by reading the status
of MPP9 on PMIC8921. With this change VREG_5V(USB port 3 VBUS) is turned on
only when docking station is connected to Liquid platform in order to save
power.
Change-Id: I4282b4273adabf8aeaf8faad43cd2cfff36eeac6
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
diff --git a/arch/arm/mach-msm/board-8064-pmic.c b/arch/arm/mach-msm/board-8064-pmic.c
index 05002a2..f4650a9 100644
--- a/arch/arm/mach-msm/board-8064-pmic.c
+++ b/arch/arm/mach-msm/board-8064-pmic.c
@@ -141,6 +141,8 @@
/* External 5V regulator enable; shared by HDMI and USB_OTG switches. */
PM8921_MPP_INIT(7, D_OUTPUT, PM8921_MPP_DIG_LEVEL_VPH, DOUT_CTRL_LOW),
PM8921_MPP_INIT(8, D_OUTPUT, PM8921_MPP_DIG_LEVEL_S4, DOUT_CTRL_LOW),
+ /*MPP9 is used to detect docking station connection/removal on Liquid*/
+ PM8921_MPP_INIT(9, D_INPUT, PM8921_MPP_DIG_LEVEL_S4, DIN_TO_INT),
};
void __init apq8064_pm8xxx_gpio_mpp_init(void)
diff --git a/arch/arm/mach-msm/board-8064.c b/arch/arm/mach-msm/board-8064.c
index c589026..bc866d1 100644
--- a/arch/arm/mach-msm/board-8064.c
+++ b/arch/arm/mach-msm/board-8064.c
@@ -522,6 +522,9 @@
static void __init apq8064_ehci_host_init(void)
{
if (machine_is_apq8064_liquid()) {
+ msm_ehci_host_pdata.dock_connect_irq =
+ PM8921_MPP_IRQ(PM8921_IRQ_BASE, 9);
+
apq8064_device_ehci_host3.dev.platform_data =
&msm_ehci_host_pdata;
platform_device_register(&apq8064_device_ehci_host3);