summaryrefslogtreecommitdiffstats
path: root/include/console.h
diff options
context:
space:
mode:
authorBastian Stender <bst@pengutronix.de>2017-02-28 15:31:24 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2017-02-28 15:52:35 +0100
commit123357079882de948f5f42a15c1af21a26130af2 (patch)
treee139b36d21b05e749025ef5c2825cf96b272bbd0 /include/console.h
parent3cade5ec3a8a0bbf15c8495915961c9d718877be (diff)
downloadbarebox-123357079882de948f5f42a15c1af21a26130af2.tar.gz
barebox-123357079882de948f5f42a15c1af21a26130af2.tar.xz
console: replace set_active by open/close
Opening and closing consoles should be independent from setting them active. This way it is possible to open e.g. a framebuffer console and display text on it without showing stdout/stderr. Signed-off-by: Bastian Stender <bst@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/console.h')
-rw-r--r--include/console.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/console.h b/include/console.h
index 4b2f134a4c..a1ebc8581b 100644
--- a/include/console.h
+++ b/include/console.h
@@ -44,7 +44,8 @@ struct console_device {
int (*setbrg)(struct console_device *cdev, int baudrate);
void (*flush)(struct console_device *cdev);
int (*set_mode)(struct console_device *cdev, enum console_mode mode);
- int (*set_active)(struct console_device *cdev, unsigned active);
+ int (*open)(struct console_device *cdev);
+ int (*close)(struct console_device *cdev);
char *devname;
int devid;
@@ -54,6 +55,8 @@ struct console_device {
unsigned char f_active;
char active[4];
+ unsigned int open_count;
+
unsigned int baudrate;
unsigned int baudrate_param;
@@ -75,6 +78,8 @@ extern int barebox_loglevel;
struct console_device *console_get_first_active(void);
+int console_open(struct console_device *cdev);
+int console_close(struct console_device *cdev);
int console_set_active(struct console_device *cdev, unsigned active);
unsigned console_get_active(struct console_device *cdev);
int console_set_baudrate(struct console_device *cdev, unsigned baudrate);