Skip to content

Commit

Permalink
drm/tegra: sor - Power on only the necessary lanes
Browse files Browse the repository at this point in the history
Power on only those lanes required for the specified link.

Signed-off-by: Thierry Reding <treding@nvidia.com>
  • Loading branch information
Thierry Reding committed Jun 9, 2014
1 parent d692229 commit 899451b
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions drivers/gpu/drm/tegra/sor.c
Original file line number Diff line number Diff line change
Expand Up @@ -634,10 +634,24 @@ static int tegra_output_sor_enable(struct tegra_output *output)
if (err < 0)
dev_err(sor->dev, "failed to set DP parent clock: %d\n", err);

/* power dplanes (XXX parameterize based on link?) */
/* power DP lanes */
value = tegra_sor_readl(sor, SOR_DP_PADCTL_0);
value |= SOR_DP_PADCTL_PD_TXD_3 | SOR_DP_PADCTL_PD_TXD_0 |
SOR_DP_PADCTL_PD_TXD_1 | SOR_DP_PADCTL_PD_TXD_2;

if (link.num_lanes <= 2)
value &= ~(SOR_DP_PADCTL_PD_TXD_3 | SOR_DP_PADCTL_PD_TXD_2);
else
value |= SOR_DP_PADCTL_PD_TXD_3 | SOR_DP_PADCTL_PD_TXD_2;

if (link.num_lanes <= 1)
value &= ~SOR_DP_PADCTL_PD_TXD_1;
else
value |= SOR_DP_PADCTL_PD_TXD_1;

if (link.num_lanes == 0)
value &= ~SOR_DP_PADCTL_PD_TXD_0;
else
value |= SOR_DP_PADCTL_PD_TXD_0;

tegra_sor_writel(sor, value, SOR_DP_PADCTL_0);

value = tegra_sor_readl(sor, SOR_DP_LINKCTL_0);
Expand Down

0 comments on commit 899451b

Please sign in to comment.