OSDN Git Service

PCI: tegra: Clear CLKREQ# enable on port disable
authorThierry Reding <treding@nvidia.com>
Tue, 26 Aug 2014 15:11:35 +0000 (17:11 +0200)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 16 Sep 2014 22:54:05 +0000 (16:54 -0600)
When a root port is disabled, disable the CLKREQ# signal if available.

Tested-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
drivers/pci/host/pci-tegra.c

index 7be31f5..42241b5 100644 (file)
@@ -569,6 +569,7 @@ static void tegra_pcie_port_enable(struct tegra_pcie_port *port)
 
 static void tegra_pcie_port_disable(struct tegra_pcie_port *port)
 {
+       const struct tegra_pcie_soc_data *soc = port->pcie->soc_data;
        unsigned long ctrl = tegra_pcie_port_get_pex_ctrl(port);
        unsigned long value;
 
@@ -579,6 +580,10 @@ static void tegra_pcie_port_disable(struct tegra_pcie_port *port)
 
        /* disable reference clock */
        value = afi_readl(port->pcie, ctrl);
+
+       if (soc->has_pex_clkreq_en)
+               value &= ~AFI_PEX_CTRL_CLKREQ_EN;
+
        value &= ~AFI_PEX_CTRL_REFCLK_EN;
        afi_writel(port->pcie, value, ctrl);
 }