diff options
author | Jay Agarwal <jagarwal@nvidia.com> | 2014-02-06 12:55:57 +0530 |
---|---|---|
committer | Jay Agarwal <jagarwal@nvidia.com> | 2014-02-10 23:15:51 -0800 |
commit | 7108e8212a4f794e3d468a9b0b8d9579389a58a9 (patch) | |
tree | 461f28cf55030593e3b0045ac1b35bd56e213b40 /drivers/usb/host | |
parent | aa2e12682fc91a25184b4f468644e008c5047274 (diff) |
usb: xhci: tegra: Power/Unpowergate PEX partition
This is WAR for HW Bug#1320346, PEX partition need
to be unpowergated whenever XUSB is used. Also
powergate it in suspend to save power.
Bug 1451279
Change-Id: I29d6c5182a8b38559911fb3b78d0074f990530f7
Signed-off-by: Jay Agarwal <jagarwal@nvidia.com>
Reviewed-on: http://git-master/r/361864
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>
Diffstat (limited to 'drivers/usb/host')
-rw-r--r-- | drivers/usb/host/xhci-tegra.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/usb/host/xhci-tegra.c b/drivers/usb/host/xhci-tegra.c index 707309c1894b..c83c0267d437 100644 --- a/drivers/usb/host/xhci-tegra.c +++ b/drivers/usb/host/xhci-tegra.c @@ -2701,6 +2701,14 @@ static int tegra_xhci_host_elpg_entry(struct tegra_xhci_hcd *tegra) /* TODO: error handling? */ return ret; } + if (tegra_powergate_is_powered(TEGRA_POWERGATE_PCIE)) { + ret = tegra_powergate_partition(TEGRA_POWERGATE_PCIE); + if (ret) { + xhci_err(xhci, "%s: could not powergate pex partition %d\n", + __func__, ret); + return ret; + } + } tegra->host_pwr_gated = true; clk_disable(tegra->host_clk); @@ -3028,6 +3036,15 @@ tegra_xhci_host_partition_elpg_exit(struct tegra_xhci_hcd *tegra) __func__, ret); goto out; } + /* unpwrgate PEX(if not done by PCIE driver) due to HW Bug1320346 */ + if (!tegra_powergate_is_powered(TEGRA_POWERGATE_PCIE)) { + ret = tegra_unpowergate_partition(TEGRA_POWERGATE_PCIE); + if (ret) { + xhci_err(xhci, "%s: could not unpowergate pex partition %d\n", + __func__, ret); + goto out; + } + } clk_enable(tegra->host_clk); /* Step 4: Deassert reset to host partition clk */ @@ -4407,6 +4424,13 @@ static int tegra_xhci_probe(struct platform_device *pdev) if (ret) dev_err(&pdev->dev, "could not unpowergate xusbc partition\n"); + /* unpwrgate PEX(if not done by PCIE driver) due to HW Bug1320346 */ + if (!tegra_powergate_is_powered(TEGRA_POWERGATE_PCIE)) { + ret = tegra_unpowergate_partition(TEGRA_POWERGATE_PCIE); + if (ret) + dev_err(&pdev->dev, "could not unpowergate pex partition\n"); + } + ret = tegra_enable_xusb_clk(tegra, pdev); if (ret) dev_err(&pdev->dev, "could not enable partition clock\n"); |