]>
Commit | Line | Data |
---|---|---|
bbeddf52 JP |
1 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt |
2 | ||
3 | #include <linux/kernel.h> | |
4 | #include <linux/console.h> | |
2ed2b862 | 5 | #include <linux/errno.h> |
bbeddf52 JP |
6 | #include <linux/string.h> |
7 | ||
8 | #include "console_cmdline.h" | |
9 | #include "braille.h" | |
10 | ||
2ed2b862 | 11 | int _braille_console_setup(char **str, char **brl_options) |
bbeddf52 | 12 | { |
ae6c33ba | 13 | if (!strncmp(*str, "brl,", 4)) { |
bbeddf52 JP |
14 | *brl_options = ""; |
15 | *str += 4; | |
ae6c33ba | 16 | } else if (!strncmp(*str, "brl=", 4)) { |
bbeddf52 JP |
17 | *brl_options = *str + 4; |
18 | *str = strchr(*brl_options, ','); | |
2ed2b862 | 19 | if (!*str) { |
bbeddf52 | 20 | pr_err("need port name after brl=\n"); |
2ed2b862 ST |
21 | return -EINVAL; |
22 | } | |
23 | *((*str)++) = 0; | |
24 | } | |
bbeddf52 | 25 | |
2ed2b862 | 26 | return 0; |
bbeddf52 JP |
27 | } |
28 | ||
29 | int | |
30 | _braille_register_console(struct console *console, struct console_cmdline *c) | |
31 | { | |
32 | int rtn = 0; | |
33 | ||
34 | if (c->brl_options) { | |
35 | console->flags |= CON_BRL; | |
36 | rtn = braille_register_console(console, c->index, c->options, | |
37 | c->brl_options); | |
38 | } | |
39 | ||
40 | return rtn; | |
41 | } | |
42 | ||
43 | int | |
44 | _braille_unregister_console(struct console *console) | |
45 | { | |
46 | if (console->flags & CON_BRL) | |
47 | return braille_unregister_console(console); | |
48 | ||
49 | return 0; | |
50 | } |