diff options
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/host/ehci-tegra.c | 32 | ||||
-rw-r--r-- | drivers/usb/otg/tegra-otg.c | 9 |
2 files changed, 20 insertions, 21 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 diff --git a/drivers/usb/otg/tegra-otg.c b/drivers/usb/otg/tegra-otg.c index a063630e529d..d23356e9c1a7 100644 --- a/drivers/usb/otg/tegra-otg.c +++ b/drivers/usb/otg/tegra-otg.c @@ -324,6 +324,8 @@ static int tegra_otg_set_suspend(struct otg_transceiver *otg, int suspend) static int tegra_otg_probe(struct platform_device *pdev) { struct tegra_otg_data *tegra; + struct tegra_otg_platform_data *otg_pdata; + struct tegra_ehci_platform_data *ehci_pdata; struct resource *res; int err; @@ -332,6 +334,8 @@ static int tegra_otg_probe(struct platform_device *pdev) return -ENOMEM; tegra->otg.dev = &pdev->dev; + otg_pdata = tegra->otg.dev->platform_data; + ehci_pdata = otg_pdata->ehci_pdata; tegra->otg.label = "tegra-otg"; tegra->otg.state = OTG_STATE_UNDEFINED; tegra->otg.set_host = tegra_otg_set_host; @@ -391,9 +395,8 @@ static int tegra_otg_probe(struct platform_device *pdev) } INIT_WORK (&tegra->work, irq_work); -#ifndef CONFIG_USB_HOTPLUG - clk_disable(tegra->clk); -#endif + if (!ehci_pdata->default_enable) + clk_disable(tegra->clk); dev_info(&pdev->dev, "otg transceiver registered\n"); return 0; |