diff options
Diffstat (limited to 'include/linux/serial_core.h')
| -rw-r--r-- | include/linux/serial_core.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index f729be981da0..5bbb809ee197 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
| @@ -285,6 +285,28 @@ static inline int uart_poll_timeout(struct uart_port *port) | |||
| 285 | /* | 285 | /* |
| 286 | * Console helpers. | 286 | * Console helpers. |
| 287 | */ | 287 | */ |
| 288 | struct earlycon_device { | ||
| 289 | struct console *con; | ||
| 290 | struct uart_port port; | ||
| 291 | char options[16]; /* e.g., 115200n8 */ | ||
| 292 | unsigned int baud; | ||
| 293 | }; | ||
| 294 | int setup_earlycon(char *buf, const char *match, | ||
| 295 | int (*setup)(struct earlycon_device *, const char *)); | ||
| 296 | |||
| 297 | extern int of_setup_earlycon(unsigned long addr, | ||
| 298 | int (*setup)(struct earlycon_device *, const char *)); | ||
| 299 | |||
| 300 | #define EARLYCON_DECLARE(name, func) \ | ||
| 301 | static int __init name ## _setup_earlycon(char *buf) \ | ||
| 302 | { \ | ||
| 303 | return setup_earlycon(buf, __stringify(name), func); \ | ||
| 304 | } \ | ||
| 305 | early_param("earlycon", name ## _setup_earlycon); | ||
| 306 | |||
| 307 | #define OF_EARLYCON_DECLARE(name, compat, fn) \ | ||
| 308 | _OF_DECLARE(earlycon, name, compat, fn, void *) | ||
| 309 | |||
| 288 | struct uart_port *uart_get_console(struct uart_port *ports, int nr, | 310 | struct uart_port *uart_get_console(struct uart_port *ports, int nr, |
| 289 | struct console *c); | 311 | struct console *c); |
| 290 | void uart_parse_options(char *options, int *baud, int *parity, int *bits, | 312 | void uart_parse_options(char *options, int *baud, int *parity, int *bits, |
