From 30603b102100c4fa3314d39d9ac763a885ad9066 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 12 Jul 2014 08:05:22 -0600 Subject: [PATCH] SAMA5D4-EK LCDC: Adding a delay after enabling the LCD solves lots of start-up timing issues --- arch/arm/src/sama5/sam_lcd.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/arch/arm/src/sama5/sam_lcd.c b/arch/arm/src/sama5/sam_lcd.c index 8674368efc4..bd7fba9d06f 100644 --- a/arch/arm/src/sama5/sam_lcd.c +++ b/arch/arm/src/sama5/sam_lcd.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/sama5/sam_lcd.c * - * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2013-2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * References: @@ -2973,6 +2973,18 @@ int up_fbinitialize(void) sam_show_hcr(); #endif +#if defined(BOARD_LCDC_ENABLE_DELAY) && BOARD_LCDC_ENABLE_DELAY > 0 + /* Delay a bit after enabling the LDC. I presume that a delay of a few + * frame times allows some unstable clocking to synchronize before we + * tart thrashing the framebuffer? But I am not sure why this is + * necessary and, in fact, is certainly not necessary in most LCDC + * configurations. Perhaps this delay would not be necessary if timings + * were more precise? + */ + + usleep(BOARD_LCDC_ENABLE_DELAY); +#endif + /* Enable the backlight. * * REVISIT: Backlight level could be dynamically adjustable