From 3b080222a7b37c31fe73be90c3e681096f8b82dd Mon Sep 17 00:00:00 2001 From: Vinayak Pane Date: Wed, 30 May 2012 17:14:18 -0700 Subject: usb: ehci: tegra: fix hsic enum failure HSIC device enumeration is broken after usb common phy changes. Setting correct hsic config in port_power and repairing wIndex in hub_control. Bug 991485 Change-Id: Ic2873879070cba8a06fb2cadc40d6c46158f71e9 Signed-off-by: Vinayak Pane Reviewed-on: http://git-master/r/105513 Reviewed-by: Simone Willett Tested-by: Simone Willett --- drivers/usb/host/ehci-tegra.c | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) (limited to 'drivers') diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c index 98f3d5106a38..c8d5485a7894 100644 --- a/drivers/usb/host/ehci-tegra.c +++ b/drivers/usb/host/ehci-tegra.c @@ -201,7 +201,6 @@ static int tegra_ehci_hub_control( { struct tegra_ehci_hcd *tegra = dev_get_drvdata(hcd->self.controller); struct ehci_hcd *ehci = hcd_to_ehci(hcd); - unsigned long flags; int retval = 0; u32 __iomem *status_reg; @@ -254,20 +253,23 @@ static int tegra_ehci_hub_control( retval = ehci_hub_control(hcd, typeReq, wValue, wIndex, buf, wLength); /* do tegra phy specific actions based on the type request */ - if (!retval) { - switch (typeReq) { - case SetPortFeature: - if (wValue == USB_PORT_FEAT_SUSPEND) { - /* Need a 4ms delay for controller to suspend */ - mdelay(4); - tegra_usb_phy_post_suspend(tegra->phy); - } else if (wValue == USB_PORT_FEAT_RESET) { - if (ehci->reset_done[0] && wIndex == 0) - tegra_usb_phy_bus_reset(tegra->phy); - } else if (wValue == USB_PORT_FEAT_POWER) { - if (wIndex == 1) - tegra_usb_phy_port_power(tegra->phy); - } + if (!retval && (typeReq == SetPortFeature)) { + wIndex--; + + switch (wValue) { + case USB_PORT_FEAT_SUSPEND: + /* Need a 4ms delay for controller to suspend */ + mdelay(4); + tegra_usb_phy_post_suspend(tegra->phy); + break; + case USB_PORT_FEAT_RESET: + if (ehci->reset_done[0] && wIndex == 0) + tegra_usb_phy_bus_reset(tegra->phy); + break; + case USB_PORT_FEAT_POWER: + if (wIndex == 0) + tegra_usb_phy_port_power(tegra->phy); + default: break; case ClearPortFeature: if (wValue == USB_PORT_FEAT_SUSPEND) { -- cgit v1.2.3