[U-Boot] [PATCH v3 21/29] video: Move video_get_info_str() prototype to a header file

Simon Glass sjg at chromium.org
Thu Sep 29 22:23:20 CEST 2016


This should be defined in a header file so that arguments are checked.
Move it to video.h.

Signed-off-by: Simon Glass <sjg at chromium.org>
Reviewed-by: Tom Rini <trini at konsulko.com>
---

Changes in v3: None
Changes in v2: None

 board/liebherr/lwmon5/lwmon5.c |  1 +
 board/mosaixtech/icon/icon.c   |  1 +
 board/mpl/common/common_util.c |  1 +
 board/tqc/tqm5200/tqm5200.c    |  1 +
 drivers/video/cfb_console.c    | 25 ++++++++-----------------
 include/video.h                | 11 +++++++++++
 6 files changed, 23 insertions(+), 17 deletions(-)

diff --git a/board/liebherr/lwmon5/lwmon5.c b/board/liebherr/lwmon5/lwmon5.c
index 8ad6712..bb99a3b 100644
--- a/board/liebherr/lwmon5/lwmon5.c
+++ b/board/liebherr/lwmon5/lwmon5.c
@@ -13,6 +13,7 @@
 #include <asm/io.h>
 #include <post.h>
 #include <flash.h>
+#include <video.h>
 #include <mtd/cfi_flash.h>
 
 DECLARE_GLOBAL_DATA_PTR;
diff --git a/board/mosaixtech/icon/icon.c b/board/mosaixtech/icon/icon.c
index 1795464..7558234 100644
--- a/board/mosaixtech/icon/icon.c
+++ b/board/mosaixtech/icon/icon.c
@@ -11,6 +11,7 @@
 #include <libfdt.h>
 #include <fdt_support.h>
 #include <netdev.h>
+#include <video.h>
 #include <asm/processor.h>
 #include <asm/io.h>
 #include <asm/ppc4xx-gpio.h>
diff --git a/board/mpl/common/common_util.c b/board/mpl/common/common_util.c
index 3c110fa..a6edb6d 100644
--- a/board/mpl/common/common_util.c
+++ b/board/mpl/common/common_util.c
@@ -15,6 +15,7 @@
 #include <pci.h>
 #include <malloc.h>
 #include <bzlib.h>
+#include <video.h>
 
 #ifdef CONFIG_PIP405
 #include "../pip405/pip405.h"
diff --git a/board/tqc/tqm5200/tqm5200.c b/board/tqc/tqm5200/tqm5200.c
index 8b82c34..fef9d2b 100644
--- a/board/tqc/tqm5200/tqm5200.c
+++ b/board/tqc/tqm5200/tqm5200.c
@@ -18,6 +18,7 @@
 #include <asm/processor.h>
 #include <libfdt.h>
 #include <netdev.h>
+#include <video.h>
 
 #ifdef CONFIG_VIDEO_SM501
 #include <sm501.h>
diff --git a/drivers/video/cfb_console.c b/drivers/video/cfb_console.c
index c788651..b02a153 100644
--- a/drivers/video/cfb_console.c
+++ b/drivers/video/cfb_console.c
@@ -64,6 +64,7 @@
 #include <fdtdec.h>
 #include <version.h>
 #include <malloc.h>
+#include <video.h>
 #include <linux/compiler.h>
 
 /*
@@ -215,16 +216,6 @@
 #endif
 #endif
 
-#ifdef CONFIG_CONSOLE_EXTRA_INFO
-/*
- * setup a board string: type, speed, etc.
- *
- * line_number:	location to place info string beside logo
- * info:	buffer for info string
- */
-extern void video_get_info_str(int line_number,	char *info);
-#endif
-
 DECLARE_GLOBAL_DATA_PTR;
 
 /* Locals */
@@ -801,7 +792,7 @@ static void parse_putc(const char c)
 		video_set_cursor();
 }
 
-static void video_putc(struct stdio_dev *dev, const char c)
+static void cfb_video_putc(struct stdio_dev *dev, const char c)
 {
 #ifdef CONFIG_CFB_CONSOLE_ANSI
 	int i;
@@ -1015,7 +1006,7 @@ static void video_putc(struct stdio_dev *dev, const char c)
 		flush_cache(VIDEO_FB_ADRS, VIDEO_SIZE);
 }
 
-static void video_puts(struct stdio_dev *dev, const char *s)
+static void cfb_video_puts(struct stdio_dev *dev, const char *s)
 {
 	int flush = cfb_do_flush_cache;
 	int count = strlen(s);
@@ -1024,7 +1015,7 @@ static void video_puts(struct stdio_dev *dev, const char *s)
 	cfb_do_flush_cache = 0;
 
 	while (count--)
-		video_putc(dev, *s++);
+		cfb_video_putc(dev, *s++);
 
 	if (flush) {
 		cfb_do_flush_cache = flush;
@@ -1991,7 +1982,7 @@ void video_clear(void)
 #endif
 }
 
-static int video_init(void)
+static int cfg_video_init(void)
 {
 	unsigned char color8;
 
@@ -2117,7 +2108,7 @@ int drv_video_init(void)
 		return 0;
 
 	/* Init video chip - returns with framebuffer cleared */
-	if (video_init() == -1)
+	if (cfg_video_init() == -1)
 		return 0;
 
 	if (board_cfb_skip())
@@ -2142,8 +2133,8 @@ int drv_video_init(void)
 	memset(&console_dev, 0, sizeof(console_dev));
 	strcpy(console_dev.name, "vga");
 	console_dev.flags = DEV_FLAGS_OUTPUT;
-	console_dev.putc = video_putc;	/* 'putc' function */
-	console_dev.puts = video_puts;	/* 'puts' function */
+	console_dev.putc = cfb_video_putc;	/* 'putc' function */
+	console_dev.puts = cfb_video_puts;	/* 'puts' function */
 
 #if !defined(CONFIG_VGA_AS_SINGLE_DEVICE)
 	if (have_keyboard && keyboard_ok) {
diff --git a/include/video.h b/include/video.h
index 0d5bd21..5b4e78b 100644
--- a/include/video.h
+++ b/include/video.h
@@ -245,6 +245,17 @@ int lg4573_spi_startup(unsigned int bus, unsigned int cs,
 	unsigned int max_hz, unsigned int spi_mode);
 #endif
 
+/*
+ * video_get_info_str() - obtain a board string: type, speed, etc.
+ *
+ * This is called if CONFIG_CONSOLE_EXTRA_INFO is enabled.
+ *
+ * line_number:	location to place info string beside logo
+ * info:	buffer for info string (empty if nothing to display on this
+ * line)
+ */
+void video_get_info_str(int line_number, char *info);
+
 #endif /* CONFIG_DM_VIDEO */
 
 #endif
-- 
2.8.0.rc3.226.g39d4020



More information about the U-Boot mailing list