USB: OTG: Fix Full speed USB Headset issue
Some Full speed USB headsets requires higher cross over voltage. The
cross over voltage is directly proportional to the phy 3.3 rail voltage.
The current code uses [3.07 - 3.3] range for this regulator and it is
supplied with 3.075V. To get 3.3V supply, use [3.3 - 3.3] range in
the host mode.
CRs-Fixed: 563496
Change-Id: I3d1705fd346212ecf42c4943995e43964ad14dc5
Signed-off-by: ChandanaKishori Chiluveru <cchilu@codeaurora.org>
diff --git a/drivers/usb/otg/msm_otg.c b/drivers/usb/otg/msm_otg.c
index f2ba9f1..0c08662 100644
--- a/drivers/usb/otg/msm_otg.c
+++ b/drivers/usb/otg/msm_otg.c
@@ -1181,6 +1181,7 @@
struct msm_otg *motg = container_of(otg->phy, struct msm_otg, phy);
struct msm_otg_platform_data *pdata = motg->pdata;
struct usb_hcd *hcd;
+ int rc;
if (!otg->host)
return;
@@ -1201,6 +1202,17 @@
*/
if (pdata->setup_gpio)
pdata->setup_gpio(OTG_STATE_A_HOST);
+
+ /*
+ * Increase 3.3V rail voltage to increase cross over voltage.
+ * This is required to get some full speed audio headsets
+ * working.
+ */
+ rc = regulator_set_voltage(hsusb_3p3, USB_PHY_3P3_VOL_MAX,
+ USB_PHY_3P3_VOL_MAX);
+ if (rc)
+ dev_dbg(otg->phy->dev, "unable to increase 3.3V rail\n");
+
usb_add_hcd(hcd, hcd->irq, IRQF_SHARED);
} else {
dev_dbg(otg->phy->dev, "host off\n");
@@ -1215,6 +1227,11 @@
if (pdata->otg_control == OTG_PHY_CONTROL)
ulpi_write(otg->phy, OTG_COMP_DISABLE,
ULPI_CLR(ULPI_PWR_CLK_MNG_REG));
+
+ rc = regulator_set_voltage(hsusb_3p3, USB_PHY_3P3_VOL_MIN,
+ USB_PHY_3P3_VOL_MAX);
+ if (rc)
+ dev_dbg(otg->phy->dev, "unable to restore 3.075V rail\n");
}
}