diff options
author | Rakesh Bodla <rbodla@nvidia.com> | 2012-09-20 12:11:39 +0530 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2013-09-14 12:34:42 -0700 |
commit | fd01ce2873eb104a8af36c7d262c3b7b9f79287f (patch) | |
tree | 6257b25e77896fb2f68ad49bd071cfbc32ea034e /arch/arm/mach-tegra | |
parent | 12a75e97d68df6cac54a0ef51e05aa8a4dd11c65 (diff) |
ARM: tegra: usb: read hot plug only in host mode
Hot plug data is available only in host mode. Guard hotplug
read with host mode.
Bug 1047763
Bug 1050193
Change-Id: I92fccc228db38f0ae0cebffe8a6fc69378f3da83
Signed-off-by: Rakesh Bodla <rbodla@nvidia.com>
Reviewed-on: http://git-master/r/133682
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>
Rebase-Id: R2ef46e0142d5bb7e164078b6449ba84a4e072dee
Diffstat (limited to 'arch/arm/mach-tegra')
-rw-r--r-- | arch/arm/mach-tegra/tegra11x_usb_phy.c | 10 | ||||
-rw-r--r-- | arch/arm/mach-tegra/tegra2_usb_phy.c | 6 | ||||
-rw-r--r-- | arch/arm/mach-tegra/tegra3_usb_phy.c | 10 | ||||
-rw-r--r-- | arch/arm/mach-tegra/tegra_usb_phy.h | 1 |
4 files changed, 14 insertions, 13 deletions
diff --git a/arch/arm/mach-tegra/tegra11x_usb_phy.c b/arch/arm/mach-tegra/tegra11x_usb_phy.c index f74e38a7e961..507951764a54 100644 --- a/arch/arm/mach-tegra/tegra11x_usb_phy.c +++ b/arch/arm/mach-tegra/tegra11x_usb_phy.c @@ -1229,7 +1229,7 @@ static void utmi_phy_close(struct tegra_usb_phy *phy) DBG("%s inst:[%d]\n", __func__, phy->inst); /* Disable PHY clock valid interrupts while going into suspend*/ - if (phy->pdata->u_data.host.hot_plug) { + if (phy->hot_plug) { val = readl(base + USB_SUSP_CTRL); val &= ~USB_PHY_CLK_VALID_INT_ENB; writel(val, base + USB_SUSP_CTRL); @@ -1312,7 +1312,7 @@ static int utmi_phy_irq(struct tegra_usb_phy *phy) remote_wakeup = true; } - if (phy->pdata->u_data.host.hot_plug) { + if (phy->hot_plug) { val = readl(base + USB_SUSP_CTRL); if ((val & USB_PHY_CLK_VALID_INT_STS)) { val &= ~USB_PHY_CLK_VALID_INT_ENB | @@ -1410,7 +1410,7 @@ static int utmi_phy_power_off(struct tegra_usb_phy *phy) utmip_setup_pmc_wake_detect(phy); } - if (!phy->pdata->u_data.host.hot_plug) { + if (!phy->hot_plug) { val = readl(base + UTMIP_XCVR_CFG0); val |= (UTMIP_FORCE_PD_POWERDOWN | UTMIP_FORCE_PD2_POWERDOWN | UTMIP_FORCE_PDZI_POWERDOWN); @@ -1428,7 +1428,7 @@ static int utmi_phy_power_off(struct tegra_usb_phy *phy) utmi_phy_pad_power_off(phy); - if (phy->pdata->u_data.host.hot_plug) { + if (phy->hot_plug) { bool enable_hotplug = true; /* if it is OTG port then make sure to enable hot-plug feature only if host adaptor is connected, i.e id is low */ @@ -1461,7 +1461,7 @@ static int utmi_phy_power_off(struct tegra_usb_phy *phy) val |= HOSTPC1_DEVLC_PHCD; writel(val, base + HOSTPC1_DEVLC); - if (!phy->pdata->u_data.host.hot_plug) { + if (!phy->hot_plug) { val = readl(base + USB_SUSP_CTRL); val |= UTMIP_RESET; writel(val, base + USB_SUSP_CTRL); diff --git a/arch/arm/mach-tegra/tegra2_usb_phy.c b/arch/arm/mach-tegra/tegra2_usb_phy.c index 1befe2b0d0f6..07bf7ee03b6f 100644 --- a/arch/arm/mach-tegra/tegra2_usb_phy.c +++ b/arch/arm/mach-tegra/tegra2_usb_phy.c @@ -610,7 +610,7 @@ static int utmi_phy_irq(struct tegra_usb_phy *phy) DBG("%s(%d) inst:[%d]\n", __func__, __LINE__, phy->inst); usb_phy_fence_read(phy); - if (phy->pdata->u_data.host.hot_plug) { + if (phy->hot_plug) { val = readl(base + USB_SUSP_CTRL); if ((val & USB_PHY_CLK_VALID_INT_STS)) { val &= ~USB_PHY_CLK_VALID_INT_ENB | @@ -697,7 +697,7 @@ static int utmi_phy_power_off(struct tegra_usb_phy *phy) writel(val, base + UTMIP_BAT_CHRG_CFG0); } - if (!phy->pdata->u_data.host.hot_plug) { + if (!phy->hot_plug) { val = readl(base + UTMIP_XCVR_UHSIC_HSRX_CFG0); val |= (UTMIP_FORCE_PD_POWERDOWN | UTMIP_FORCE_PD2_POWERDOWN | UTMIP_FORCE_PDZI_POWERDOWN); @@ -718,7 +718,7 @@ static int utmi_phy_power_off(struct tegra_usb_phy *phy) phy->port_speed = (readl(base + USB_PORTSC) >> 26) & USB_PORTSC_PSPD_MASK; - if (phy->pdata->u_data.host.hot_plug) { + if (phy->hot_plug) { bool enable_hotplug = true; /* if it is OTG port then make sure to enable hot-plug feature only if host adaptor is connected, i.e id is low */ diff --git a/arch/arm/mach-tegra/tegra3_usb_phy.c b/arch/arm/mach-tegra/tegra3_usb_phy.c index 156ecc603a24..c9b37b8cb4ec 100644 --- a/arch/arm/mach-tegra/tegra3_usb_phy.c +++ b/arch/arm/mach-tegra/tegra3_usb_phy.c @@ -1157,7 +1157,7 @@ static void utmi_phy_close(struct tegra_usb_phy *phy) DBG("%s inst:[%d]\n", __func__, phy->inst); /* Disable PHY clock valid interrupts while going into suspend*/ - if (phy->pdata->u_data.host.hot_plug) { + if (phy->hot_plug) { val = readl(base + USB_SUSP_CTRL); val &= ~USB_PHY_CLK_VALID_INT_ENB; writel(val, base + USB_SUSP_CTRL); @@ -1241,7 +1241,7 @@ static int utmi_phy_irq(struct tegra_usb_phy *phy) remote_wakeup = true; } - if (phy->pdata->u_data.host.hot_plug) { + if (phy->hot_plug) { val = readl(base + USB_SUSP_CTRL); if ((val & USB_PHY_CLK_VALID_INT_STS)) { val &= ~USB_PHY_CLK_VALID_INT_ENB | @@ -1472,7 +1472,7 @@ static int utmi_phy_power_off(struct tegra_usb_phy *phy) utmip_setup_pmc_wake_detect(phy); } - if (!phy->pdata->u_data.host.hot_plug) { + if (!phy->hot_plug) { val = readl(base + UTMIP_XCVR_CFG0); val |= (UTMIP_FORCE_PD_POWERDOWN | UTMIP_FORCE_PD2_POWERDOWN | UTMIP_FORCE_PDZI_POWERDOWN); @@ -1490,7 +1490,7 @@ static int utmi_phy_power_off(struct tegra_usb_phy *phy) utmi_phy_pad_power_off(phy); - if (phy->pdata->u_data.host.hot_plug) { + if (phy->hot_plug) { bool enable_hotplug = true; /* if it is OTG port then make sure to enable hot-plug feature only if host adaptor is connected, i.e id is low */ @@ -1523,7 +1523,7 @@ static int utmi_phy_power_off(struct tegra_usb_phy *phy) val |= HOSTPC1_DEVLC_PHCD; writel(val, base + HOSTPC1_DEVLC); - if (!phy->pdata->u_data.host.hot_plug) { + if (!phy->hot_plug) { val = readl(base + USB_SUSP_CTRL); val |= UTMIP_RESET; writel(val, base + USB_SUSP_CTRL); diff --git a/arch/arm/mach-tegra/tegra_usb_phy.h b/arch/arm/mach-tegra/tegra_usb_phy.h index 1b62804fd567..3331445fb80c 100644 --- a/arch/arm/mach-tegra/tegra_usb_phy.h +++ b/arch/arm/mach-tegra/tegra_usb_phy.h @@ -100,6 +100,7 @@ struct tegra_usb_phy { bool pmc_sleepwalk; bool bus_reseting; bool linkphy_init; + bool hot_plug; }; int usb_phy_reg_status_wait(void __iomem *reg, u32 mask, |