summaryrefslogtreecommitdiff
path: root/drivers/video
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2015-08-02 17:38:43 +0200
committerHans de Goede <hdegoede@redhat.com>2015-08-08 16:26:20 +0200
commitab2a2be988b571bf6b96bb00b6edf122c1cf9ddc (patch)
tree9c91a42b40d75336380a9a6bba9e23a1955d0b35 /drivers/video
parentbf689342a3b6c7dd9eb5a81fc9559cef84d9009a (diff)
downloadu-boot-imx-ab2a2be988b571bf6b96bb00b6edf122c1cf9ddc.zip
u-boot-imx-ab2a2be988b571bf6b96bb00b6edf122c1cf9ddc.tar.gz
u-boot-imx-ab2a2be988b571bf6b96bb00b6edf122c1cf9ddc.tar.bz2
sunxi: display: Correct clk_delay calculations for lcd displays
We should only subtract 2 from the vblank time when using tcon1. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Ian Campbell <ijc@hellion.org.uk>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/sunxi_display.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/video/sunxi_display.c b/drivers/video/sunxi_display.c
index 3942d2f..fa4241e 100644
--- a/drivers/video/sunxi_display.c
+++ b/drivers/video/sunxi_display.c
@@ -663,11 +663,14 @@ static void sunxi_lcdc_backlight_enable(void)
gpio_direction_output(pin, PWM_ON);
}
-static int sunxi_lcdc_get_clk_delay(const struct ctfb_res_modes *mode)
+static int sunxi_lcdc_get_clk_delay(const struct ctfb_res_modes *mode, int tcon)
{
int delay;
- delay = mode->lower_margin + mode->vsync_len + mode->upper_margin - 2;
+ delay = mode->lower_margin + mode->vsync_len + mode->upper_margin;
+ if (tcon == 1)
+ delay -= 2;
+
return (delay > 30) ? 30 : delay;
}
@@ -692,7 +695,7 @@ static void sunxi_lcdc_tcon0_mode_set(const struct ctfb_res_modes *mode,
clrsetbits_le32(&lcdc->ctrl, SUNXI_LCDC_CTRL_IO_MAP_MASK,
SUNXI_LCDC_CTRL_IO_MAP_TCON0);
- clk_delay = sunxi_lcdc_get_clk_delay(mode);
+ clk_delay = sunxi_lcdc_get_clk_delay(mode, 0);
writel(SUNXI_LCDC_TCON0_CTRL_ENABLE |
SUNXI_LCDC_TCON0_CTRL_CLK_DELAY(clk_delay), &lcdc->tcon0_ctrl);
@@ -770,7 +773,7 @@ static void sunxi_lcdc_tcon1_mode_set(const struct ctfb_res_modes *mode,
clrsetbits_le32(&lcdc->ctrl, SUNXI_LCDC_CTRL_IO_MAP_MASK,
SUNXI_LCDC_CTRL_IO_MAP_TCON1);
- clk_delay = sunxi_lcdc_get_clk_delay(mode);
+ clk_delay = sunxi_lcdc_get_clk_delay(mode, 1);
writel(SUNXI_LCDC_TCON1_CTRL_ENABLE |
SUNXI_LCDC_TCON1_CTRL_CLK_DELAY(clk_delay), &lcdc->tcon1_ctrl);