summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorKen Chang <kenc@nvidia.com>2011-07-01 15:35:06 +0800
committerManish Tuteja <mtuteja@nvidia.com>2011-07-06 03:28:09 -0700
commit894ef272deec269ccbf1caf2b9a5e4ce3bbf7a0f (patch)
tree47d7e5d06d7483b5310c97ce947c67b3682186cb /drivers
parent17cf593083f77b5a86ea29ab73741ce2950778ae (diff)
usb: ehci: tegra: fix hotplug issue on usb2
usb hotplug is supported only for UTMI phy. usb_phy_type should be carefully checked in ehci irq. bug 845612 Change-Id: I2fdc7c79b9816dd3465353375448b07f138ff950 Reviewed-on: http://git-master/r/39338 Tested-by: Ken Chang <kenc@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Reviewed-by: Yu-Fong (Foster) Cho <ycho@nvidia.com> Reviewed-by: ChihJen Hsu <chhsu@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/gadget/fsl_tegra_udc.c2
-rw-r--r--drivers/usb/host/ehci-tegra.c40
2 files changed, 22 insertions, 20 deletions
diff --git a/drivers/usb/gadget/fsl_tegra_udc.c b/drivers/usb/gadget/fsl_tegra_udc.c
index 712636d8ee8e..73f6bc99cd6a 100644
--- a/drivers/usb/gadget/fsl_tegra_udc.c
+++ b/drivers/usb/gadget/fsl_tegra_udc.c
@@ -74,7 +74,7 @@ int fsl_udc_clk_init(struct platform_device *pdev)
instance = 0;
phy = tegra_usb_phy_open(instance, udc_base, pdata->phy_config,
- TEGRA_USB_PHY_MODE_DEVICE);
+ TEGRA_USB_PHY_MODE_DEVICE, pdata->usb_phy_type);
if (IS_ERR(phy)) {
dev_err(&pdev->dev, "Can't open phy\n");
err = PTR_ERR(phy);
diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c
index 90c88009ed45..04b9ec60b476 100644
--- a/drivers/usb/host/ehci-tegra.c
+++ b/drivers/usb/host/ehci-tegra.c
@@ -85,28 +85,30 @@ static irqreturn_t tegra_ehci_irq (struct usb_hcd *hcd)
struct ehci_regs __iomem *hw = ehci->regs;
u32 val;
- spin_lock (&ehci->lock);
- val = readl(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(&hw->status);
- if (!(val & STS_PCD)) {
+ if (tegra->phy->usb_phy_type == TEGRA_USB_PHY_TYPE_UTMIP) {
+ spin_lock (&ehci->lock);
+ val = readl(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(&hw->status);
+ if (!(val & STS_PCD)) {
+ spin_unlock (&ehci->lock);
+ return IRQ_NONE;
+ }
+ }
+ /* we would lock if we went further without power */
+ if (!tegra->host_resumed) {
spin_unlock (&ehci->lock);
- return IRQ_NONE;
+ return IRQ_HANDLED;
}
- }
- /* we would lock if we went further without power */
- if (!tegra->host_resumed) {
spin_unlock (&ehci->lock);
- return IRQ_HANDLED;
}
- spin_unlock (&ehci->lock);
return ehci_irq(hcd);
}
@@ -902,7 +904,7 @@ static int tegra_ehci_probe(struct platform_device *pdev)
INIT_DELAYED_WORK(&tegra->work, tegra_hsic_connection_work);
tegra->phy = tegra_usb_phy_open(instance, hcd->regs, pdata->phy_config,
- TEGRA_USB_PHY_MODE_HOST);
+ TEGRA_USB_PHY_MODE_HOST, pdata->phy_type);
if (IS_ERR(tegra->phy)) {
dev_err(&pdev->dev, "Failed to open USB phy\n");
err = -ENXIO;