summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rwxr-xr-xdrivers/usb/gadget/fsl_udc_core.c5
-rwxr-xr-xdrivers/usb/host/ehci-tegra.c16
2 files changed, 20 insertions, 1 deletions
diff --git a/drivers/usb/gadget/fsl_udc_core.c b/drivers/usb/gadget/fsl_udc_core.c
index 33502502c67e..f30912b62fca 100755
--- a/drivers/usb/gadget/fsl_udc_core.c
+++ b/drivers/usb/gadget/fsl_udc_core.c
@@ -2764,6 +2764,11 @@ static int fsl_udc_resume(struct platform_device *pdev)
udc_controller->usb_state = USB_STATE_ATTACHED;
udc_controller->ep0_state = WAIT_FOR_SETUP;
udc_controller->ep0_dir = 0;
+
+ /* Power down the phy if cable is not connected */
+ if (!(fsl_readl(&usb_sys_regs->vbus_wakeup) & USB_SYS_VBUS_STATUS))
+ platform_udc_clk_suspend();
+
return 0;
}
diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c
index cc1e51581c8f..b2469e5fbab8 100755
--- a/drivers/usb/host/ehci-tegra.c
+++ b/drivers/usb/host/ehci-tegra.c
@@ -320,11 +320,13 @@ static int tegra_ehci_bus_resume(struct usb_hcd *hcd)
{
struct ehci_hcd *ehci = hcd_to_ehci(hcd);
int err_status = 0;
+ u32 status;
-#ifdef CONFIG_USB_OTG_UTILS
struct tegra_hcd_platform_data *pdata;
/* initialize the platform data pointer */
pdata = hcd->self.controller->platform_data;
+
+#ifdef CONFIG_USB_OTG_UTILS
if ((pdata->pUsbProperty->UsbMode == NvOdmUsbModeType_OTG)
&& ehci->transceiver) {
if (ehci->transceiver->state != OTG_STATE_A_HOST) {
@@ -338,6 +340,18 @@ static int tegra_ehci_bus_resume(struct usb_hcd *hcd)
tegra_ehci_power_up(hcd);
err_status = ehci_bus_resume(hcd);
}
+
+ if ((pdata->pUsbProperty->UsbMode != NvOdmUsbModeType_OTG)
+ && (pdata->pUsbProperty->IdPinDetectionType ==
+ NvOdmUsbIdPinType_CableId)) {
+ /* read otgsc register for ID pin status */
+ status = readl(hcd->regs + TEGRA_USB_PHY_WAKEUP_REG_OFFSET);
+ writel(status, (hcd->regs + TEGRA_USB_PHY_WAKEUP_REG_OFFSET));
+ /* If no Id pin then disable the power */
+ if (status & TEGRA_USB_ID_PIN_STATUS) {
+ tegra_ehci_power_down(hcd);
+ }
+ }
return err_status;
}