summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArtiste Hsu <chhsu@nvidia.com>2011-09-27 09:47:32 +0800
committerVarun Colbert <vcolbert@nvidia.com>2011-10-13 15:34:52 -0700
commitb6da8566e1e8a2bd96a43a86d51f9b5e8790d2be (patch)
tree78bb7b53c6d7ef2b1cfcaf06ecb4d340e1666af3
parent016a4e3666e13b1205b5b9d680d31d073c115b31 (diff)
usb: host: tegra: Configurable USB hotplug
Hotplug on usb is supported when hotplug flag is set in platform data Bug 869745 (cherry picked from commit I57ba0b18a2d4232b2df2074c91aff97c6e639e7d) Reviewed-on: http://git-master/r/54588 Change-Id: I24e5ddf49cead14d3eebe30da0f92402015c95c7 Reviewed-on: http://git-master/r/57725 Tested-by: Artiste Hsu <chhsu@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
-rw-r--r--arch/arm/mach-tegra/board-cardhu.c1
-rw-r--r--arch/arm/mach-tegra/board-ventana.c1
-rw-r--r--drivers/usb/host/ehci-tegra.c4
-rw-r--r--include/linux/platform_data/tegra_usb.h1
4 files changed, 6 insertions, 1 deletions
diff --git a/arch/arm/mach-tegra/board-cardhu.c b/arch/arm/mach-tegra/board-cardhu.c
index 51280ae42ed3..51e9e900c938 100644
--- a/arch/arm/mach-tegra/board-cardhu.c
+++ b/arch/arm/mach-tegra/board-cardhu.c
@@ -769,6 +769,7 @@ static struct tegra_ehci_platform_data tegra_ehci_pdata[] = {
.phy_config = &utmi_phy_config[2],
.operating_mode = TEGRA_USB_HOST,
.power_down_on_bus_suspend = 1,
+ .hotplug = 1,
},
};
diff --git a/arch/arm/mach-tegra/board-ventana.c b/arch/arm/mach-tegra/board-ventana.c
index feee5929546c..6f05d8453b11 100644
--- a/arch/arm/mach-tegra/board-ventana.c
+++ b/arch/arm/mach-tegra/board-ventana.c
@@ -664,6 +664,7 @@ static struct tegra_ehci_platform_data tegra_ehci_pdata[] = {
.phy_config = &utmi_phy_config[1],
.operating_mode = TEGRA_USB_HOST,
.power_down_on_bus_suspend = 1,
+ .hotplug = 1,
},
};
diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c
index 4c33966fc279..69180f0d582e 100644
--- a/drivers/usb/host/ehci-tegra.c
+++ b/drivers/usb/host/ehci-tegra.c
@@ -64,6 +64,7 @@ struct tegra_ehci_hcd {
int bus_suspended;
int port_resuming;
int power_down_on_bus_suspend;
+ int hotplug;
struct delayed_work work;
enum tegra_usb_phy_port_speed port_speed;
struct work_struct clk_timer_work;
@@ -112,7 +113,7 @@ static irqreturn_t tegra_ehci_irq (struct usb_hcd *hcd)
spin_unlock (&ehci->lock);
}
}
- if (tegra->phy->instance == 2) {
+ if (tegra->hotplug) {
spin_lock(&ehci->lock);
val = readl(hcd->regs + TEGRA_USB_SUSP_CTRL_OFFSET);
if ((val & TEGRA_USB_PHY_CLK_VALID_INT_STS)) {
@@ -1062,6 +1063,7 @@ static int tegra_ehci_probe(struct platform_device *pdev)
tegra->host_resumed = 1;
tegra->power_down_on_bus_suspend = pdata->power_down_on_bus_suspend;
+ tegra->hotplug = pdata->hotplug;
tegra->ehci = hcd_to_ehci(hcd);
irq = platform_get_irq(pdev, 0);
diff --git a/include/linux/platform_data/tegra_usb.h b/include/linux/platform_data/tegra_usb.h
index 27879ce1d73e..cf75a98f5c37 100644
--- a/include/linux/platform_data/tegra_usb.h
+++ b/include/linux/platform_data/tegra_usb.h
@@ -34,6 +34,7 @@ struct tegra_ehci_platform_data {
enum tegra_usb_operating_modes operating_mode;
/* power down the phy on bus suspend */
int power_down_on_bus_suspend;
+ int hotplug;
void *phy_config;
enum tegra_usb_phy_type phy_type;
};