diff options
author | Seshendra Gadagottu <sgadagottu@nvidia.com> | 2011-09-02 18:14:40 +0530 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:49:10 -0800 |
commit | bc3638c9c538cd8cc27736f240f1a490bacc9279 (patch) | |
tree | b88c88c3b92e52add38fb1f15c49a058c66404d8 /arch/arm/mach-tegra | |
parent | a1478bcfafecdc8cbe356f71b869e236aeb58cda (diff) |
tegra: usb: phy: phy ready and phy off callbacks for HSIC
Added phy ready and phy off callbacks to indicate HSIC
phy state.
BUG 828389
Reviewed-on: http://git-master/r/50276
(cherry picked from commit e654b3633e92c9b2ce26ce8ceaed7baaad071282)
Change-Id: I3b076a342047824a76312b0771a8880619c5cf58
Reviewed-on: http://git-master/r/54199
Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
Rebase-Id: Ra48c32fac6cdf1c7d3539ab6be141e01f27f5b52
Diffstat (limited to 'arch/arm/mach-tegra')
-rw-r--r-- | arch/arm/mach-tegra/include/mach/usb_phy.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-tegra/usb_phy.c | 12 |
2 files changed, 14 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/include/mach/usb_phy.h b/arch/arm/mach-tegra/include/mach/usb_phy.h index 0b794bb51964..a6fa0944ce23 100644 --- a/arch/arm/mach-tegra/include/mach/usb_phy.h +++ b/arch/arm/mach-tegra/include/mach/usb_phy.h @@ -63,6 +63,8 @@ struct tegra_uhsic_config { u8 elastic_overrun_limit; int (*postsuspend)(void); int (*preresume)(void); + int (*usb_phy_ready)(void); + int (*post_phy_off)(void); }; enum tegra_usb_phy_port_speed { diff --git a/arch/arm/mach-tegra/usb_phy.c b/arch/arm/mach-tegra/usb_phy.c index b5d1a2afa79e..c0f068238bea 100644 --- a/arch/arm/mach-tegra/usb_phy.c +++ b/arch/arm/mach-tegra/usb_phy.c @@ -2107,6 +2107,8 @@ static int uhsic_phy_power_off(struct tegra_usb_phy *phy, bool is_dpd) /* keep hsic reset de-asserted for 1 ms */ udelay(1000); } + if (uhsic_config->post_phy_off && uhsic_config->post_phy_off()) + return -EAGAIN; return 0; } @@ -2485,6 +2487,7 @@ int tegra_usb_phy_bus_connect(struct tegra_usb_phy *phy) { unsigned long val; void __iomem *base = phy->regs; + struct tegra_uhsic_config *uhsic_config = phy->config; if (phy->usb_phy_type == TEGRA_USB_PHY_TYPE_HSIC) { #ifndef CONFIG_ARCH_TEGRA_2x_SOC @@ -2512,6 +2515,10 @@ int tegra_usb_phy_bus_connect(struct tegra_usb_phy *phy) #endif writel(val, base + UHSIC_PADS_CFG1); + if (uhsic_config->usb_phy_ready && + uhsic_config->usb_phy_ready()) + return -EAGAIN; + if (utmi_wait_register(base + UHSIC_STAT_CFG0, UHSIC_CONNECT_DETECT, UHSIC_CONNECT_DETECT) < 0) { pr_err("%s: timeout waiting for hsic connect detect\n", __func__); return -ETIMEDOUT; @@ -2605,6 +2612,7 @@ int tegra_usb_phy_bus_idle(struct tegra_usb_phy *phy) { unsigned long val; void __iomem *base = phy->regs; + struct tegra_uhsic_config *uhsic_config = phy->config; if (phy->usb_phy_type == TEGRA_USB_PHY_TYPE_HSIC) { #ifndef CONFIG_ARCH_TEGRA_2x_SOC @@ -2631,6 +2639,10 @@ int tegra_usb_phy_bus_idle(struct tegra_usb_phy *phy) val |= UHSIC_RPU_STROBE; #endif writel(val, base + UHSIC_PADS_CFG1); + + if (uhsic_config->usb_phy_ready && + uhsic_config->usb_phy_ready()) + return -EAGAIN; } return 0; } |