diff options
author | Suresh Mangipudi <smangipudi@nvidia.com> | 2011-09-14 14:33:45 +0530 |
---|---|---|
committer | Varun Colbert <vcolbert@nvidia.com> | 2011-09-27 17:48:32 -0700 |
commit | c1152c404f5742f4bf7473d378d586b620e78a59 (patch) | |
tree | 42931ace03e568031cbe810ad41c2d95c78b3841 | |
parent | 00affb2c03ac7918ffc0961375855d5e4ff3fbb1 (diff) |
usb: ehci: tegra: Hotplug detection
Removed the polling/PMC based method for the usb hotplug detection.
Bug 865094
Reviewed-on: http://git-master/r/52284
(cherry picked from commit fcded668224e1ea37ff8b239b32867afcd4081b0)
Change-Id: I8be9890d88f34af465f5e14a708443641b491ba3
Reviewed-on: http://git-master/r/54649
Reviewed-by: Rakesh Bodla <rbodla@nvidia.com>
Tested-by: Rakesh Bodla <rbodla@nvidia.com>
Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>
-rw-r--r-- | arch/arm/mach-tegra/include/mach/usb_phy.h | 2 | ||||
-rw-r--r-- | arch/arm/mach-tegra/usb_phy.c | 48 | ||||
-rw-r--r-- | drivers/usb/host/ehci-tegra.c | 41 |
3 files changed, 0 insertions, 91 deletions
diff --git a/arch/arm/mach-tegra/include/mach/usb_phy.h b/arch/arm/mach-tegra/include/mach/usb_phy.h index ae6b60d44495..2b70e7e3b899 100644 --- a/arch/arm/mach-tegra/include/mach/usb_phy.h +++ b/arch/arm/mach-tegra/include/mach/usb_phy.h @@ -143,6 +143,4 @@ bool tegra_usb_phy_charger_detect(struct tegra_usb_phy *phy); int __init tegra_usb_phy_init(struct usb_phy_plat_data *pdata, int size); -bool tegra_usb_phy_is_device_detected(struct tegra_usb_phy *phy); - #endif /* __MACH_USB_PHY_H */ diff --git a/arch/arm/mach-tegra/usb_phy.c b/arch/arm/mach-tegra/usb_phy.c index f1ff319fa028..c774abfd1d99 100644 --- a/arch/arm/mach-tegra/usb_phy.c +++ b/arch/arm/mach-tegra/usb_phy.c @@ -1161,10 +1161,6 @@ static int utmi_phy_power_off(struct tegra_usb_phy *phy, bool is_dpd) unsigned long val; void __iomem *base = phy->regs; -#ifndef CONFIG_ARCH_TEGRA_2x_SOC - if (phy->mode == TEGRA_USB_PHY_MODE_HOST) - utmip_setup_pmc_wake_detect(phy); -#endif if (phy->mode == TEGRA_USB_PHY_MODE_DEVICE) { val = readl(base + USB_SUSP_CTRL); val &= ~USB_WAKEUP_DEBOUNCE_COUNT(~0); @@ -1217,13 +1213,6 @@ static int utmi_phy_power_off(struct tegra_usb_phy *phy, bool is_dpd) val |= UTMIP_RESET; writel(val, base + USB_SUSP_CTRL); } -#ifndef CONFIG_ARCH_TEGRA_2x_SOC - if (phy->instance == 2) { - val = readl(base + USB_SUSP_CTRL); - val |= UTMIP_RESET; - writel(val, base + USB_SUSP_CTRL); - } -#endif utmip_pad_power_off(phy, true); return 0; } @@ -2476,40 +2465,3 @@ int __init tegra_usb_phy_init(struct usb_phy_plat_data *pdata, int size) return 0; } -bool tegra_usb_phy_is_device_detected(struct tegra_usb_phy *phy) -{ - bool ret = 0; -#ifndef CONFIG_ARCH_TEGRA_2x_SOC - void __iomem *pmc_base = IO_ADDRESS(TEGRA_PMC_BASE); - unsigned int inst = phy->instance; - u32 val; - - /* Change wake event to FSK */ - val = readl(pmc_base + PMC_SLEEP_CFG); - val |= UTMIP_WAKE_VAL(phy->instance, WAKE_VAL_FSK); - writel(val, pmc_base + PMC_SLEEP_CFG); - - /* The minimum time for the registers to get updated */ - udelay(130); - - val = readl(pmc_base + UTMIP_UHSIC_STATUS); - if ((UTMIP_USBON_VAL(phy->instance) | - UTMIP_USBOP_VAL(phy->instance)) &val) { - val = readl(pmc_base + PMC_SLEEP_CFG); - val &= ~UTMIP_WAKE_VAL(inst, 0x0); - val |= UTMIP_WAKE_VAL(inst, WAKE_VAL_NONE); - writel(val, pmc_base + PMC_SLEEP_CFG); - - val = readl(pmc_base + PMC_TRIGGERS); - val |= UTMIP_CLR_WAKE_ALARM(inst) | UTMIP_CLR_WALK_PTR(inst); - writel(val, pmc_base + PMC_TRIGGERS); - - val = readl(pmc_base + PMC_SLEEP_CFG); - val &= ~(UTMIP_MASTER_ENABLE(inst) |UTMIP_FSLS_USE_PMC(inst) | - UTMIP_RCTRL_USE_PMC(inst) |UTMIP_TCTRL_USE_PMC(inst)); - writel(val, pmc_base + PMC_SLEEP_CFG); - ret = 1; - } -#endif - return ret; -} diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c index 9e97e51b86d3..274c1f705128 100644 --- a/drivers/usb/host/ehci-tegra.c +++ b/drivers/usb/host/ehci-tegra.c @@ -68,7 +68,6 @@ struct tegra_ehci_hcd { enum tegra_usb_phy_port_speed port_speed; struct work_struct clk_timer_work; struct timer_list clk_timer; - struct timer_list timer_device_detect; bool clock_enabled; int hsic_connect_retries; struct mutex tegra_ehci_hcd_mutex; @@ -94,13 +93,6 @@ static void tegra_ehci_power_down(struct usb_hcd *hcd, bool is_dpd) #ifndef CONFIG_USB_HOTPLUG clk_disable(tegra->clk); #endif -#ifndef CONFIG_ARCH_TEGRA_2x_SOC - if (tegra->phy->instance == 2) { - if (mod_timer(&tegra->timer_device_detect, - jiffies + msecs_to_jiffies(2000))) - pr_err("timer configuration failed \n"); - } -#endif } static irqreturn_t tegra_ehci_irq (struct usb_hcd *hcd) @@ -826,34 +818,6 @@ void clk_timer_callback(unsigned long data) } } -void timer_callback_device_detect(unsigned long data) -{ -#ifndef CONFIG_ARCH_TEGRA_2x_SOC - struct tegra_ehci_hcd *tegra = (struct tegra_ehci_hcd*) data; - int ret; - u32 val; - struct usb_hcd *hcd; - u32 timer_deactivated; - hcd = ehci_to_hcd(tegra->ehci); - - if(tegra->phy->instance == 2) { - val = tegra_usb_phy_is_device_detected(tegra->phy); - if (val) { - timer_deactivated = del_timer( - &tegra->timer_device_detect); - if (timer_deactivated) - pr_err("timer deactivation failed \n"); - tegra_ehci_power_up(hcd, false); - } else { - ret = mod_timer(&tegra->timer_device_detect, - jiffies + msecs_to_jiffies(2000)); - if (ret) - pr_err("tegra device detect failed \n"); - } - } -#endif -} - static void clk_timer_work_handler(struct work_struct* clk_timer_work) { struct tegra_ehci_hcd *tegra = container_of(clk_timer_work, struct tegra_ehci_hcd, clk_timer_work); @@ -1014,10 +978,6 @@ static int tegra_ehci_probe(struct platform_device *pdev) tegra->clk_timer.function = clk_timer_callback; tegra->clk_timer.data = (unsigned long) tegra; - init_timer(&tegra->timer_device_detect); - tegra->timer_device_detect.function = timer_callback_device_detect; - tegra->timer_device_detect.data = (unsigned long) tegra; - #ifdef CONFIG_ARCH_TEGRA_2x_SOC /* Set DDR busy hints to 150MHz. For Tegra 2x SOC, DDR rate is half of EMC rate */ clk_set_rate(tegra->emc_clk, 300000000); @@ -1204,7 +1164,6 @@ static int tegra_ehci_remove(struct platform_device *pdev) iounmap(hcd->regs); del_timer_sync(&tegra->clk_timer); - del_timer_sync(&tegra->timer_device_detect); clk_disable(tegra->clk); clk_put(tegra->clk); |