1 /*
2 * linux/drivers/video/dummycon.c -- A dummy console driver
3 *
4 * To be used if there's no other console driver (e.g. for plain VGA text)
5 * available, usually until fbcon takes console over.
6 */
7
8 #include <linux/types.h>
9 #include <linux/kdev_t.h>
10 #include <linux/tty.h>
11 #include <linux/console.h>
12 #include <linux/console_struct.h>
13 #include <linux/vt_kern.h>
14 #include <linux/init.h>
15
16 /*
17 * Dummy console driver
18 */
19
20 #if defined(__arm__)
21 #define DUMMY_COLUMNS ORIG_VIDEO_COLS
22 #define DUMMY_ROWS ORIG_VIDEO_LINES
23 #elif defined(__hppa__)
24 #define DUMMY_COLUMNS 80 /* fixme ! (mine uses 160x64 at 1280x1024) */
25 #define DUMMY_ROWS 25
26 #else
27 #define DUMMY_COLUMNS 80
28 #define DUMMY_ROWS 25
29 #endif
30
dummycon_startup(void)31 static const char *dummycon_startup(void)
32 {
33 return "dummy device";
34 }
35
dummycon_init(struct vc_data * conp,int init)36 static void dummycon_init(struct vc_data *conp, int init)
37 {
38 conp->vc_can_do_color = 1;
39 if (init) {
40 conp->vc_cols = DUMMY_COLUMNS;
41 conp->vc_rows = DUMMY_ROWS;
42 } else
43 vc_resize_con(DUMMY_ROWS, DUMMY_COLUMNS, conp->vc_num);
44 }
45
dummycon_dummy(void)46 static int dummycon_dummy(void)
47 {
48 return 0;
49 }
50
51 #define DUMMY (void *)dummycon_dummy
52
53 /*
54 * The console `switch' structure for the dummy console
55 *
56 * Most of the operations are dummies.
57 */
58
59 const struct consw dummy_con = {
60 con_startup: dummycon_startup,
61 con_init: dummycon_init,
62 con_deinit: DUMMY,
63 con_clear: DUMMY,
64 con_putc: DUMMY,
65 con_putcs: DUMMY,
66 con_cursor: DUMMY,
67 con_scroll: DUMMY,
68 con_bmove: DUMMY,
69 con_switch: DUMMY,
70 con_blank: DUMMY,
71 con_font_op: DUMMY,
72 con_set_palette: DUMMY,
73 con_scrolldelta: DUMMY,
74 };
75