diff mbox

[U-Boot,001/159] LCD: Add an option to skip registration as an stdio output

Message ID 1449457640-3055-1-git-send-email-hl@rock-chips.com
State Not Applicable
Headers show

Commit Message

Lin Huang Dec. 7, 2015, 3:04 a.m. UTC
From: Stephane Ayotte <sayotte@tycoint.com>

This patch adds an option to skip the registration of LCD stdio output 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@tycoint.com>
---
 common/lcd.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

Comments

Lin Huang Dec. 7, 2015, 3:12 a.m. UTC | #1
Hi all,

         i am sorry send wrong patch, please ignore these patchs.



2015-12-07 11:04 GMT+08:00 Lin Huang <hl@rock-chips.com>:

> From: Stephane Ayotte <sayotte@tycoint.com>
>
> This patch adds an option to skip the registration of LCD stdio output 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@tycoint.com>
> ---
>  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.9.1
>
>
diff mbox

Patch

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));