7c8eeeb30a479eb55b7291a38fe16ceede8f9b6d
[linux-drm-fsl-dcu.git] / drivers / video / console / dummycon.c
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/console.h>
11 #include <linux/vt_kern.h>
12 #include <linux/init.h>
13 #include <linux/module.h>
14
15 /*
16  *  Dummy console driver
17  */
18
19 #if defined(__arm__)
20 #define DUMMY_COLUMNS   ORIG_VIDEO_COLS
21 #define DUMMY_ROWS      ORIG_VIDEO_LINES
22 #elif defined(__hppa__)
23 /* set by Kconfig. Use 80x25 for 640x480 and 160x64 for 1280x1024 */
24 #define DUMMY_COLUMNS   CONFIG_DUMMY_CONSOLE_COLUMNS
25 #define DUMMY_ROWS      CONFIG_DUMMY_CONSOLE_ROWS
26 #else
27 #define DUMMY_COLUMNS   80
28 #define DUMMY_ROWS      25
29 #endif
30
31 static const char *dummycon_startup(void)
32 {
33     return "dummy device";
34 }
35
36 static void dummycon_init(struct vc_data *vc, int init)
37 {
38     vc->vc_can_do_color = 1;
39     if (init) {
40         vc->vc_cols = DUMMY_COLUMNS;
41         vc->vc_rows = DUMMY_ROWS;
42     } else
43         vc_resize(vc, DUMMY_COLUMNS, DUMMY_ROWS);
44 }
45
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     .owner =            THIS_MODULE,
61     .con_startup =      dummycon_startup,
62     .con_init =         dummycon_init,
63     .con_deinit =       DUMMY,
64     .con_clear =        DUMMY,
65     .con_putc =         DUMMY,
66     .con_putcs =        DUMMY,
67     .con_cursor =       DUMMY,
68     .con_scroll =       DUMMY,
69     .con_bmove =        DUMMY,
70     .con_switch =       DUMMY,
71     .con_blank =        DUMMY,
72     .con_font_set =     DUMMY,
73     .con_font_get =     DUMMY,
74     .con_font_default = DUMMY,
75     .con_font_copy =    DUMMY,
76     .con_set_palette =  DUMMY,
77     .con_scrolldelta =  DUMMY,
78 };