diff options
author | Thierry Reding <treding@nvidia.com> | 2013-12-12 11:06:55 +0100 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2013-12-20 15:56:07 +0100 |
commit | 72d302861530bcdb780ea57ebfc3dff6ec4f802c (patch) | |
tree | 07651dcd966b1502a18c1944268b8d31a8abdb0e /drivers/gpu/drm/tegra/dsi.c | |
parent | 8620fc629aeec02ac3b3735703940696386a3039 (diff) | |
download | linux-72d302861530bcdb780ea57ebfc3dff6ec4f802c.tar.gz linux-72d302861530bcdb780ea57ebfc3dff6ec4f802c.tar.bz2 linux-72d302861530bcdb780ea57ebfc3dff6ec4f802c.zip |
drm/tegra: Relocate some output-specific code
Some of the code in the CRTC's mode setting code is specific to the RGB
output or needs to be called slightly differently depending on the type
of output. Push that code down into the output drivers.
Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/gpu/drm/tegra/dsi.c')
-rw-r--r-- | drivers/gpu/drm/tegra/dsi.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/drivers/gpu/drm/tegra/dsi.c b/drivers/gpu/drm/tegra/dsi.c index 844818f3e2d5..d452faab0235 100644 --- a/drivers/gpu/drm/tegra/dsi.c +++ b/drivers/gpu/drm/tegra/dsi.c @@ -450,15 +450,16 @@ static int tegra_output_dsi_enable(struct tegra_output *output) value |= DSI_ENABLE; tegra_dc_writel(dc, value, DC_DISP_DISP_WIN_OPTIONS); - value = PW0_ENABLE | PW1_ENABLE | PW2_ENABLE | PW3_ENABLE | - PW4_ENABLE | PM0_ENABLE | PM1_ENABLE; - tegra_dc_writel(dc, value, DC_CMD_DISPLAY_POWER_CONTROL); - value = tegra_dc_readl(dc, DC_CMD_DISPLAY_COMMAND); value &= ~DISP_CTRL_MODE_MASK; value |= DISP_CTRL_MODE_C_DISPLAY; tegra_dc_writel(dc, value, DC_CMD_DISPLAY_COMMAND); + value = tegra_dc_readl(dc, DC_CMD_DISPLAY_POWER_CONTROL); + value |= PW0_ENABLE | PW1_ENABLE | PW2_ENABLE | PW3_ENABLE | + PW4_ENABLE | PM0_ENABLE | PM1_ENABLE; + tegra_dc_writel(dc, value, DC_CMD_DISPLAY_POWER_CONTROL); + tegra_dc_writel(dc, GENERAL_ACT_REQ << 8, DC_CMD_STATE_CONTROL); tegra_dc_writel(dc, GENERAL_ACT_REQ, DC_CMD_STATE_CONTROL); @@ -482,11 +483,15 @@ static int tegra_output_dsi_disable(struct tegra_output *output) tegra_dsi_writel(dsi, value, DSI_POWER_CONTROL); /* - * FIXME: The output isn't attached to any CRTC when it's being - * disabled, so the following will never be executed. + * The following accesses registers of the display controller, so make + * sure it's only executed when the output is attached to one. */ if (dc) { - /* disable display controller */ + value = tegra_dc_readl(dc, DC_CMD_DISPLAY_POWER_CONTROL); + value &= ~(PW0_ENABLE | PW1_ENABLE | PW2_ENABLE | PW3_ENABLE | + PW4_ENABLE | PM0_ENABLE | PM1_ENABLE); + tegra_dc_writel(dc, value, DC_CMD_DISPLAY_POWER_CONTROL); + value = tegra_dc_readl(dc, DC_CMD_DISPLAY_COMMAND); value &= ~DISP_CTRL_MODE_MASK; tegra_dc_writel(dc, value, DC_CMD_DISPLAY_COMMAND); @@ -494,6 +499,9 @@ static int tegra_output_dsi_disable(struct tegra_output *output) value = tegra_dc_readl(dc, DC_DISP_DISP_WIN_OPTIONS); value &= ~DSI_ENABLE; tegra_dc_writel(dc, value, DC_DISP_DISP_WIN_OPTIONS); + + tegra_dc_writel(dc, GENERAL_ACT_REQ << 8, DC_CMD_STATE_CONTROL); + tegra_dc_writel(dc, GENERAL_ACT_REQ, DC_CMD_STATE_CONTROL); } clk_disable(dsi->clk); |