diff options
author | Suresh Mangipudi <smangipudi@nvidia.com> | 2011-05-23 17:23:59 +0530 |
---|---|---|
committer | Rohan Somvanshi <rsomvanshi@nvidia.com> | 2011-05-27 19:51:48 -0700 |
commit | b5d5cd3e4e7af0915d2013f578f285244d7e5acd (patch) | |
tree | 6487480311e89532218c8df49f7ee26d161f1af4 | |
parent | f982fa0f0878a8f4bc1739bf047313171d3cf38d (diff) |
usb: host: tegra: hotplug delay reduction
PortConnectionDetect to be cleared if the usbphy clock interrupt is set.
The USB plugin detection is done appropriately without missing
cableconnect event.
Bug 825920
Change-Id: I4400f208f405a110fff48f1fea777b472aacce62
Reviewed-on: http://git-master/r/32599
Tested-by: Alex Courbot <acourbot@nvidia.com>
Reviewed-by: Alex Courbot <acourbot@nvidia.com>
Reviewed-by: Rakesh Bodla <rbodla@nvidia.com>
Reviewed-by: Hanumanth Venkateswa Moganty <vmoganty@nvidia.com>
-rw-r--r-- | drivers/usb/host/ehci-tegra.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c index 3a28122b451a..0d2ae3ef17f9 100644 --- a/drivers/usb/host/ehci-tegra.c +++ b/drivers/usb/host/ehci-tegra.c @@ -31,6 +31,7 @@ #define TEGRA_USB_PHY_CLK_VALID (1 << 7) #define TEGRA_USB_SRT (1 << 25) #define TEGRA_USB_PHY_CLK_VALID_INT_ENB (1 << 9) +#define TEGRA_USB_PHY_CLK_VALID_INT_STS (1 << 8) #define TEGRA_USB_PORTSC1_OFFSET 0x184 #define TEGRA_USB_PORTSC1_WKCN (1 << 20) @@ -80,19 +81,26 @@ static void tegra_ehci_power_down(struct usb_hcd *hcd, bool is_dpd) static irqreturn_t tegra_ehci_irq (struct usb_hcd *hcd) { struct ehci_hcd *ehci = hcd_to_ehci (hcd); + struct ehci_regs __iomem *hw = ehci->regs; u32 val; spin_lock (&ehci->lock); val = readl(hcd->regs + TEGRA_USB_SUSP_CTRL_OFFSET); - val &= ~TEGRA_USB_PHY_CLK_VALID_INT_ENB; - writel(val , (hcd->regs + TEGRA_USB_SUSP_CTRL_OFFSET)); + if ((val & TEGRA_USB_PHY_CLK_VALID_INT_STS)) { + val &= ~TEGRA_USB_PHY_CLK_VALID_INT_ENB | TEGRA_USB_PHY_CLK_VALID_INT_STS; + writel(val , (hcd->regs + TEGRA_USB_SUSP_CTRL_OFFSET)); - val = readl(hcd->regs + TEGRA_USB_PORTSC1_OFFSET); - val &= ~TEGRA_USB_PORTSC1_WKCN; - writel(val , (hcd->regs + TEGRA_USB_PORTSC1_OFFSET)); + val = readl(hcd->regs + TEGRA_USB_PORTSC1_OFFSET); + val &= ~TEGRA_USB_PORTSC1_WKCN; + writel(val , (hcd->regs + TEGRA_USB_PORTSC1_OFFSET)); + val = readl(&hw->status); + if (!(val & STS_PCD)) { + spin_unlock (&ehci->lock); + return 0; + } + } spin_unlock (&ehci->lock); - return ehci_irq(hcd); } |