video: Allow console output to be silenced
When using expo we want to be able to control the information on the
display and avoid other messages (such as USB scanning) appearing.
Add a 'quiet' flag for the console, to help with this.
The test is a little messy since stdio is still using the original
vidconsole create on start-up. So take care to use the same.
Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/include/video_console.h b/include/video_console.h
index e4fc776..8f3f58f 100644
--- a/include/video_console.h
+++ b/include/video_console.h
@@ -53,6 +53,7 @@
* @row_saved: Saved Y position in pixels (0=top)
* @escape_buf: Buffer to accumulate escape sequence
* @utf8_buf: Buffer to accumulate UTF-8 byte sequence
+ * @quiet: Suppress all output from stdio
*/
struct vidconsole_priv {
struct stdio_dev sdev;
@@ -77,6 +78,7 @@
int col_saved;
char escape_buf[32];
char utf8_buf[5];
+ bool quiet;
};
/**
@@ -584,4 +586,12 @@
*/
int vidconsole_get_font_size(struct udevice *dev, const char **name, uint *sizep);
+/**
+ * vidconsole_set_quiet() - Select whether the console should output stdio
+ *
+ * @dev: vidconsole device
+ * @quiet: true to suppress stdout/stderr output, false to enable it
+ */
+void vidconsole_set_quiet(struct udevice *dev, bool quiet);
+
#endif