{
struct ehci_hcd *ehci = hcd_to_ehci(hcd);
struct tegra_ehci_hcd *tegra = dev_get_drvdata(hcd->self.controller);
+ struct platform_device *pdev = to_platform_device(hcd->self.controller);
+ struct tegra_usb_platform_data *pdata = dev_get_platdata(&pdev->dev);
mutex_lock(&tegra->sync_lock);
if (tegra_usb_phy_hw_accessible(tegra->phy)) {
spin_lock_irq(&ehci->lock);
ehci_silence_controller(ehci);
spin_unlock_irq(&ehci->lock);
}
+ if (pdata->port_otg)
+ tegra_usb_enable_vbus(tegra->phy, false);
mutex_unlock(&tegra->sync_lock);
}
static int tegra_ehci_resume(struct platform_device *pdev)
{
struct tegra_ehci_hcd *tegra = platform_get_drvdata(pdev);
-
+ struct tegra_usb_platform_data *pdata = dev_get_platdata(&pdev->dev);
+ if (pdata->u_data.host.turn_off_vbus_on_lp0 && pdata->port_otg)
+ tegra_usb_enable_vbus(tegra->phy, true);
return usb_phy_set_suspend(get_usb_phy(tegra->phy), 0);
}
static int tegra_ehci_suspend(struct platform_device *pdev, pm_message_t state)
{
struct tegra_ehci_hcd *tegra = platform_get_drvdata(pdev);
-
+ int err;
+ struct tegra_usb_platform_data *pdata = dev_get_platdata(&pdev->dev);
/* bus suspend could have failed because of remote wakeup resume */
if (tegra->bus_suspended_fail)
return -EBUSY;
- else
- return usb_phy_set_suspend(get_usb_phy(tegra->phy), 1);
+ else {
+ err = usb_phy_set_suspend(get_usb_phy(tegra->phy), 1);
+ if (pdata->u_data.host.turn_off_vbus_on_lp0 && pdata->port_otg)
+ tegra_usb_enable_vbus(tegra->phy, false);
+ return err;
+ }
}
#endif