usb: phy: Correct usb device speed information
Petlozu Pravareshwar [Mon, 23 Nov 2015 12:17:46 +0000 (17:17 +0530)]
When turn_off_vbus_on_lp0 is set, we disconnect
VBUS before going to LP0 and re-enable it after
LP0 wakeup.

Present code assumes device speed info after LP0
is same as before LP0 which is not true if there
is a swapping of devices when system is in LP0.
Hence set speed as UNKNOWN in such condition.

Bug 200153623

change-Id: I129b88ecc8ad743a0a65341dcb0a7b6001f24ff8
Signed-off-by: Petlozu Pravareshwar <petlozup@nvidia.com>
Reviewed-on: http://git-master/r/837740
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Venu Byravarasu <vbyravarasu@nvidia.com>

drivers/usb/phy/tegra11x_usb_phy.c

index fc55f1b..d46b5c7 100644 (file)
@@ -1307,6 +1307,9 @@ static int utmi_phy_resume(struct tegra_usb_phy *phy)
                port_connected = val & USB_PORTSC_CCS;
                is_lp0 = !(readl(base + USB_ASYNCLISTADDR));
 
+               if (phy->pdata->u_data.host.turn_off_vbus_on_lp0 && is_lp0)
+                       phy->port_speed = USB_PHY_PORT_SPEED_UNKNOWN;
+
                if ((phy->port_speed < USB_PHY_PORT_SPEED_UNKNOWN) &&
                        (port_connected ^ is_lp0)) {
                        utmi_phy_restore_start(phy);