summaryrefslogtreecommitdiff
path: root/board
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2011-12-19 16:17:57 -0800
committerSimon Glass <sjg@chromium.org>2012-01-05 15:54:33 -0800
commit7d436642249ec30640a1d23b209214ccf4a2d0b1 (patch)
tree3bc30bdee60692ca65723d3f73be2dcaf6c2df0c /board
parent17b3e106d1da893de82dac51888e9515f689ea51 (diff)
tegra: Tidy up LCD init code to use a state machine
The LCD init takes place over five stages. We want to hide this init behind other operations, so turn it into a state machine which we can call at any time. For now, call it in lcd_enable(). BUG=chromium-os:22938 TEST=build and boot on Kaen Change-Id: Ia0b50ec74108ac4e015de12b7a9628426ea17656 Reviewed-on: https://gerrit.chromium.org/gerrit/13211 Reviewed-by: Tom Wai-Hong Tam <waihong@chromium.org> Reviewed-by: Che-Liang Chiou <clchiou@chromium.org> Tested-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'board')
-rw-r--r--board/nvidia/common/board.c2
-rw-r--r--board/nvidia/common/board.h20
2 files changed, 20 insertions, 2 deletions
diff --git a/board/nvidia/common/board.c b/board/nvidia/common/board.c
index 8adfe27d67..59307c3e7d 100644
--- a/board/nvidia/common/board.c
+++ b/board/nvidia/common/board.c
@@ -304,7 +304,7 @@ static void power_det_init(void)
int board_init(void)
{
#ifdef CONFIG_VIDEO_TEGRA2
- lcd_pinmux_early_init(gd->blob);
+ tegra_lcd_check_next_stage(gd->blob, 0);
#endif
#ifdef CONFIG_DELAY_CONSOLE
init_uarts(gd->blob);
diff --git a/board/nvidia/common/board.h b/board/nvidia/common/board.h
index 67048fe369..eef1a6900b 100644
--- a/board/nvidia/common/board.h
+++ b/board/nvidia/common/board.h
@@ -29,6 +29,24 @@ void gpio_early_init_uart(const void *blob);
void gpio_config_mmc(void);
int tegra_mmc_init(const void *blob);
void lcd_early_init(const void *blob);
-int lcd_pinmux_early_init(const void *blob);
+
+/**
+ * Perform the next stage of the LCD init if it is time to do so.
+ *
+ * LCD init can be time-consuming because of the number of delays we need
+ * while waiting for the backlight power supply, etc. This function can
+ * be called at various times during U-Boot operation to advance the
+ * initialization of the LCD to the next stage if sufficient time has
+ * passed since the last stage. It keeps track of what stage it is up to
+ * and the time that it is permitted to move to the next stage.
+ *
+ * The final call should have wait=1 to complete the init.
+ *
+ * @param blob fdt blob containing LCD information
+ * @param wait 1 to wait until all init is complete, and then return
+ * 0 to return immediately, potentially doing nothing if it is
+ * not yet time for the next init.
+ */
+int tegra_lcd_check_next_stage(const void *blob, int wait);
#endif /* BOARD_H */