summaryrefslogtreecommitdiff
path: root/drivers/usb/host/ehci-tegra.c
diff options
context:
space:
mode:
authorKurt Yi <kyi@nvidia.com>2012-01-11 21:11:07 +0900
committerVarun Colbert <vcolbert@nvidia.com>2012-01-19 16:25:39 -0800
commitbdd9e97c84f69bab23f5542dc6ac2efa93e53224 (patch)
treef59beafbd80de5e72a5d273a0113eed2d0aafa0b /drivers/usb/host/ehci-tegra.c
parent4b9dfedec9ab23b03949407856c03635f31cfa49 (diff)
usb: host: tegra: replace CONFIG_USB_HOTPLUG to tegra_ehci_platform_data
remove CONFIG_USB_HOTPLUG and add default_enable into tegra_ehci_platform_data We can't use different def_config because whistler & ventana source code is merged in same tree. BUG 923705 Change-Id: I3dfdf237d80865831264f02104c89c8088101905 Reviewed-on: http://git-master/r/74574 Signed-off-by: Kurt Yi <kyi@nvidia.com> Signed-off-by: Varun Wadekar <vwadekar@nvidia.com> Reviewed-on: http://git-master/r/75888 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com>
Diffstat (limited to 'drivers/usb/host/ehci-tegra.c')
-rw-r--r--drivers/usb/host/ehci-tegra.c32
1 files changed, 14 insertions, 18 deletions
diff --git a/drivers/usb/host/ehci-tegra.c b/drivers/usb/host/ehci-tegra.c
index 308fb315e4b0..917796c20d8a 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 default_enable;
struct delayed_work work;
enum tegra_usb_phy_port_speed port_speed;
struct work_struct clk_timer_work;
@@ -79,9 +80,8 @@ static void tegra_ehci_power_up(struct usb_hcd *hcd, bool is_dpd)
{
struct tegra_ehci_hcd *tegra = dev_get_drvdata(hcd->self.controller);
-#ifndef CONFIG_USB_HOTPLUG
- clk_enable(tegra->clk);
-#endif
+ if (!tegra->default_enable)
+ clk_enable(tegra->clk);
tegra_usb_phy_power_on(tegra->phy, is_dpd);
tegra->host_resumed = 1;
}
@@ -92,9 +92,8 @@ static void tegra_ehci_power_down(struct usb_hcd *hcd, bool is_dpd)
tegra->host_resumed = 0;
tegra_usb_phy_power_off(tegra->phy, is_dpd);
-#ifndef CONFIG_USB_HOTPLUG
- clk_disable(tegra->clk);
-#endif
+ if (!tegra->default_enable)
+ clk_disable(tegra->clk);
}
static int tegra_ehci_internal_port_reset(
@@ -1023,6 +1022,7 @@ static int tegra_ehci_probe(struct platform_device *pdev)
}
platform_set_drvdata(pdev, tegra);
+ tegra->default_enable = pdata->default_enable;
tegra->clk = clk_get(&pdev->dev, NULL);
if (IS_ERR(tegra->clk)) {
@@ -1169,15 +1169,13 @@ static int tegra_ehci_resume(struct platform_device *pdev)
struct usb_hcd *hcd = ehci_to_hcd(tegra->ehci);
if ((tegra->bus_suspended) && (tegra->power_down_on_bus_suspend)) {
-#ifdef CONFIG_USB_HOTPLUG
- clk_enable(tegra->clk);
-#endif
+ if (tegra->default_enable)
+ clk_enable(tegra->clk);
return 0;
}
-#ifdef CONFIG_USB_HOTPLUG
- clk_enable(tegra->clk);
-#endif
+ if (tegra->default_enable)
+ clk_enable(tegra->clk);
return tegra_usb_resume(hcd, true);
}
@@ -1196,9 +1194,8 @@ static int tegra_ehci_suspend(struct platform_device *pdev, pm_message_t state)
}
if ((tegra->bus_suspended) && (tegra->power_down_on_bus_suspend)) {
-#ifdef CONFIG_USB_HOTPLUG
- clk_disable(tegra->clk);
-#endif
+ if (tegra->default_enable)
+ clk_disable(tegra->clk);
return 0;
}
@@ -1206,9 +1203,8 @@ static int tegra_ehci_suspend(struct platform_device *pdev, pm_message_t state)
msleep(10);
ret = tegra_usb_suspend(hcd, true);
-#ifdef CONFIG_USB_HOTPLUG
- clk_disable(tegra->clk);
-#endif
+ if (tegra->default_enable)
+ clk_disable(tegra->clk);
return ret;
}
#endif