summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-tegra/tegra2_usb_phy.c3
-rw-r--r--arch/arm/mach-tegra/tegra3_usb_phy.c10
-rw-r--r--arch/arm/mach-tegra/usb_phy.c3
-rw-r--r--drivers/usb/host/ehci-tegra.c32
4 files changed, 22 insertions, 26 deletions
diff --git a/arch/arm/mach-tegra/tegra2_usb_phy.c b/arch/arm/mach-tegra/tegra2_usb_phy.c
index 7b18333cc77c..f0d5ebda2a37 100644
--- a/arch/arm/mach-tegra/tegra2_usb_phy.c
+++ b/arch/arm/mach-tegra/tegra2_usb_phy.c
@@ -1177,6 +1177,9 @@ static int uhsic_phy_bus_port_power(struct tegra_usb_phy *phy)
val &= ~USB_USBCMD_RS;
writel(val, base + USB_USBCMD);
+ if (phy->pdata->ops && phy->pdata->ops->port_power)
+ phy->pdata->ops->port_power();
+
if (usb_phy_reg_status_wait(base + UHSIC_STAT_CFG0,
UHSIC_CONNECT_DETECT, UHSIC_CONNECT_DETECT, 2000)) {
pr_err("%s: timeout waiting for UHSIC_CONNECT_DETECT\n",
diff --git a/arch/arm/mach-tegra/tegra3_usb_phy.c b/arch/arm/mach-tegra/tegra3_usb_phy.c
index 8ada255cad55..ce2d54beb9b6 100644
--- a/arch/arm/mach-tegra/tegra3_usb_phy.c
+++ b/arch/arm/mach-tegra/tegra3_usb_phy.c
@@ -1925,9 +1925,6 @@ int uhsic_phy_bus_port_power(struct tegra_usb_phy *phy)
void __iomem *base = phy->regs;
DBG("%s(%d) inst:[%d]\n", __func__, __LINE__, phy->inst);
- val = readl(base + UHSIC_STAT_CFG0);
- val &= ~UHSIC_CONNECT_DETECT;
- writel(val, base + UHSIC_STAT_CFG0);
val = readl(base + USB_USBMODE);
val |= USB_USBMODE_HOST;
@@ -1952,13 +1949,10 @@ int uhsic_phy_bus_port_power(struct tegra_usb_phy *phy)
val = readl(base + UHSIC_PADS_CFG1);
val &= ~UHSIC_RPD_STROBE;
- /* safe to enable RPU on STROBE at all times during idle */
- val |= UHSIC_RPU_STROBE;
writel(val, base + UHSIC_PADS_CFG1);
- val = readl(base + USB_USBCMD);
- val &= ~USB_USBCMD_RS;
- writel(val, base + USB_USBCMD);
+ if (phy->pdata->ops && phy->pdata->ops->port_power)
+ phy->pdata->ops->port_power();
if (usb_phy_reg_status_wait(base + UHSIC_STAT_CFG0,
UHSIC_CONNECT_DETECT, UHSIC_CONNECT_DETECT, 25000)) {
diff --git a/arch/arm/mach-tegra/usb_phy.c b/arch/arm/mach-tegra/usb_phy.c
index bfb9abae2c94..dfbd621428fb 100644
--- a/arch/arm/mach-tegra/usb_phy.c
+++ b/arch/arm/mach-tegra/usb_phy.c
@@ -622,9 +622,6 @@ int tegra_usb_phy_port_power(struct tegra_usb_phy *phy)
if (phy->ops && phy->ops->port_power)
status = phy->ops->port_power(phy);
- if (phy->pdata->ops && phy->pdata->ops->port_power)
- phy->pdata->ops->port_power();
-
return status;
}
int tegra_usb_phy_bus_reset(struct tegra_usb_phy *phy)
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) {