diff options
Diffstat (limited to 'drivers/usb/host')
-rw-r--r-- | drivers/usb/host/ehci-tegra.c | 29 |
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); } |