[U-Boot] [PATCH] LCD: Add an option to skip registration as an stdio output

sayotte.tyco at gmail.com sayotte.tyco at gmail.com
Tue Nov 3 17:14:49 CET 2015


From: Stephane Ayotte <sayotte at tycoint.com>

This patch adds an option to skip the registration of LCD stdio ouput for
boards that want to show different text on LCD than on serial output (or
the active stdout selected by the environment variable).

Signed-off-by: Stephane Ayotte <sayotte at tycoint.com>
---

This implementation is similar to what has been added to cfb_console.c by
Stefan Roese <sr at denx.de> per commit 6cc7ba9e on 05/15/2009

I am sending this patch using <sayotte.tyco at gmail.com>
as our regular smtp server <sayotte at tycoint.com> causes patch issues.

 common/lcd.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/common/lcd.c b/common/lcd.c
index d29308a..ed68be9 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -143,6 +143,16 @@ __weak int lcd_get_size(int *line_length)
 	return *line_length * panel_info.vl_row;
 }
 
+/*
+ * Implement a weak default function for boards that optionally
+ * need to skip the lcd console initialization.
+ */
+__weak int board_lcd_console_skip(void)
+{
+	/* As default, don't skip cfb init */
+	return 0;
+}
+
 int drv_lcd_init(void)
 {
 	struct stdio_dev lcddev;
@@ -152,6 +162,9 @@ int drv_lcd_init(void)
 
 	lcd_init(lcd_base);
 
+	if (board_lcd_console_skip())
+		return 0;
+
 	/* Device initialization */
 	memset(&lcddev, 0, sizeof(lcddev));
 
-- 
1.8.3.1



More information about the U-Boot mailing list