summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuresh Mangipudi <smangipudi@nvidia.com>2011-09-07 15:37:40 +0530
committerRohan Somvanshi <rsomvanshi@nvidia.com>2011-09-14 05:58:00 -0700
commitee2ea382a7d99d693afbcef995c7b76369f40ede (patch)
treeb1cc53d702a41efaf94d1dc52fbbc80b0aa290e3
parent8d7dbca91e92c015a16e5238624950701770688f (diff)
usb: ehci: tegra: Hotplug detection
Removed the polling/PMC based method for the usb hotplug detection. Bug 865094 Change-Id: I6c41907aae35b52d9be01210bf206cb407b4a9d4 Reviewed-on: http://git-master/r/51082 Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com> Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
-rw-r--r--arch/arm/mach-tegra/include/mach/usb_phy.h2
-rw-r--r--arch/arm/mach-tegra/usb_phy.c49
-rw-r--r--drivers/usb/host/ehci-tegra.c41
3 files changed, 0 insertions, 92 deletions
diff --git a/arch/arm/mach-tegra/include/mach/usb_phy.h b/arch/arm/mach-tegra/include/mach/usb_phy.h
index 9d28b6e861b2..72029d68340f 100644
--- a/arch/arm/mach-tegra/include/mach/usb_phy.h
+++ b/arch/arm/mach-tegra/include/mach/usb_phy.h
@@ -145,6 +145,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 15977a3868a0..67cf77054c7f 100644
--- a/arch/arm/mach-tegra/usb_phy.c
+++ b/arch/arm/mach-tegra/usb_phy.c
@@ -725,7 +725,6 @@ static int utmip_pad_power_off(struct tegra_usb_phy *phy, bool is_dpd)
#endif
writel(val, base + UTMIP_BIAS_CFG0);
}
-
spin_unlock_irqrestore(&utmip_pad_lock, flags);
clk_disable(phy->pad_clk);
@@ -1161,10 +1160,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 +1212,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;
}
@@ -2487,40 +2475,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 3b3ce418cf92..b72da22aa866 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)
@@ -822,34 +814,7 @@ void clk_timer_callback(unsigned long data)
tegra->clock_enabled = 0;
spin_unlock_irqrestore(&tegra->ehci->lock, flags);
}
-}
-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) {
@@ -1011,11 +976,6 @@ static int tegra_ehci_probe(struct platform_device *pdev)
init_timer(&tegra->clk_timer);
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);
@@ -1202,7 +1162,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);