summaryrefslogtreecommitdiff
path: root/drivers/usb/host
diff options
context:
space:
mode:
authorSuresh Mangipudi <smangipudi@nvidia.com>2011-05-23 17:23:59 +0530
committerNiket Sirsi <nsirsi@nvidia.com>2011-06-06 18:19:40 -0700
commit877e19039d6fb2b3beced077ca194680b7b4f0b5 (patch)
tree14af613444a73ec2e6a6ebdb43d7f60ea850035f /drivers/usb/host
parent0a1051e151bc626d87e10d7627162284c62f3025 (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 (cherry picked from commit b5d5cd3e4e7af0915d2013f578f285244d7e5acd) Change-Id: Ie6b7b83b0bf056ec8b3ae6310b2b610b714f9109 Reviewed-on: http://git-master/r/34839 Reviewed-by: Suresh Mangipudi <smangipudi@nvidia.com> Tested-by: Suresh Mangipudi <smangipudi@nvidia.com> Reviewed-by: Rakesh Bodla <rbodla@nvidia.com> Reviewed-by: Hanumanth Venkateswa Moganty <vmoganty@nvidia.com>
Diffstat (limited to 'drivers/usb/host')
-rw-r--r--drivers/usb/host/ehci-tegra.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c
index 74c0737a1357..fd85abb9a4fc 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,27 @@ 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);
+ 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));
-
- val = readl(hcd->regs + TEGRA_USB_PORTSC1_OFFSET);
- val &= ~TEGRA_USB_PORTSC1_WKCN;
- writel(val , (hcd->regs + TEGRA_USB_PORTSC1_OFFSET));
-
- spin_unlock (&ehci->lock);
-
+ 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(&hw->status);
+ if (!(val & STS_PCD)) {
+ spin_unlock(&ehci->lock);
+ return 0;
+ }
+ }
+ spin_unlock(&ehci->lock);
return ehci_irq(hcd);
}