sunxi: video: Use sunxi_lcdc_get_clk_delay to calculate tcon1 delay
[oweals/u-boot.git] / drivers / video / sunxi_display.c
index 0ce695cc4be2f476dd5edc41c1d365e15a696641..bb18fe229720f38b65cc4fb976d7ec78c000a9e2 100644 (file)
@@ -576,15 +576,15 @@ static void sunxi_lcdc_tcon1_mode_set(const struct ctfb_res_modes *mode,
 {
        struct sunxi_lcdc_reg * const lcdc =
                (struct sunxi_lcdc_reg *)SUNXI_LCD0_BASE;
-       int bp, total;
+       int bp, clk_delay, total;
 
        /* Use tcon1 */
        clrsetbits_le32(&lcdc->ctrl, SUNXI_LCDC_CTRL_IO_MAP_MASK,
                        SUNXI_LCDC_CTRL_IO_MAP_TCON1);
 
-       /* Enabled, 0x1e start delay */
+       clk_delay = sunxi_lcdc_get_clk_delay(mode);
        writel(SUNXI_LCDC_TCON1_CTRL_ENABLE |
-              SUNXI_LCDC_TCON1_CTRL_CLK_DELAY(0x1e), &lcdc->tcon1_ctrl);
+              SUNXI_LCDC_TCON1_CTRL_CLK_DELAY(clk_delay), &lcdc->tcon1_ctrl);
 
        writel(SUNXI_LCDC_X(mode->xres) | SUNXI_LCDC_Y(mode->yres),
               &lcdc->tcon1_timing_source);