aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2014-06-05 10:19:48 -0400
committerThierry Reding <treding@nvidia.com>2014-06-09 06:02:50 -0400
commit899451b787eb55d51c46468aaf99367c5f3420a1 (patch)
tree4985096378aa5bc6fcf90f68543565ec07fe9fbd
parentd6922295e2c29a4a5e8b38f24249887728373e62 (diff)
drm/tegra: sor - Power on only the necessary lanes
Power on only those lanes required for the specified link. Signed-off-by: Thierry Reding <treding@nvidia.com>
-rw-r--r--drivers/gpu/drm/tegra/sor.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c
index c06af3db3026..fefd26f0c751 100644
--- a/drivers/gpu/drm/tegra/sor.c
+++ b/drivers/gpu/drm/tegra/sor.c
@@ -634,10 +634,24 @@ static int tegra_output_sor_enable(struct tegra_output *output)
634 if (err < 0) 634 if (err < 0)
635 dev_err(sor->dev, "failed to set DP parent clock: %d\n", err); 635 dev_err(sor->dev, "failed to set DP parent clock: %d\n", err);
636 636
637 /* power dplanes (XXX parameterize based on link?) */ 637 /* power DP lanes */
638 value = tegra_sor_readl(sor, SOR_DP_PADCTL_0); 638 value = tegra_sor_readl(sor, SOR_DP_PADCTL_0);
639 value |= SOR_DP_PADCTL_PD_TXD_3 | SOR_DP_PADCTL_PD_TXD_0 | 639
640 SOR_DP_PADCTL_PD_TXD_1 | SOR_DP_PADCTL_PD_TXD_2; 640 if (link.num_lanes <= 2)
641 value &= ~(SOR_DP_PADCTL_PD_TXD_3 | SOR_DP_PADCTL_PD_TXD_2);
642 else
643 value |= SOR_DP_PADCTL_PD_TXD_3 | SOR_DP_PADCTL_PD_TXD_2;
644
645 if (link.num_lanes <= 1)
646 value &= ~SOR_DP_PADCTL_PD_TXD_1;
647 else
648 value |= SOR_DP_PADCTL_PD_TXD_1;
649
650 if (link.num_lanes == 0)
651 value &= ~SOR_DP_PADCTL_PD_TXD_0;
652 else
653 value |= SOR_DP_PADCTL_PD_TXD_0;
654
641 tegra_sor_writel(sor, value, SOR_DP_PADCTL_0); 655 tegra_sor_writel(sor, value, SOR_DP_PADCTL_0);
642 656
643 value = tegra_sor_readl(sor, SOR_DP_LINKCTL_0); 657 value = tegra_sor_readl(sor, SOR_DP_LINKCTL_0);