blob: 0efc52f11ad003ae73063fa12ca2dd7bef86ddbe [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
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>
Linus Torvalds1da177e2005-04-16 15:20:36 -070010#include <linux/console.h>
11#include <linux/vt_kern.h>
Jon Smirl894673e2006-07-10 04:44:13 -070012#include <linux/screen_info.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070013#include <linux/init.h>
14#include <linux/module.h>
15
16/*
17 * Dummy console driver
18 */
19
20#if defined(__arm__)
H. Peter Anvin3ea33512007-10-16 22:36:04 -070021#define DUMMY_COLUMNS screen_info.orig_video_cols
22#define DUMMY_ROWS screen_info.orig_video_lines
Geert Uytterhoeven8f5b1e62015-01-12 21:17:02 +010023#else
Linus Torvalds1da177e2005-04-16 15:20:36 -070024/* set by Kconfig. Use 80x25 for 640x480 and 160x64 for 1280x1024 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070025#define DUMMY_COLUMNS CONFIG_DUMMY_CONSOLE_COLUMNS
26#define DUMMY_ROWS CONFIG_DUMMY_CONSOLE_ROWS
Linus Torvalds1da177e2005-04-16 15:20:36 -070027#endif
28
29static const char *dummycon_startup(void)
30{
31 return "dummy device";
32}
33
34static void dummycon_init(struct vc_data *vc, int init)
35{
36 vc->vc_can_do_color = 1;
37 if (init) {
38 vc->vc_cols = DUMMY_COLUMNS;
39 vc->vc_rows = DUMMY_ROWS;
40 } else
41 vc_resize(vc, DUMMY_COLUMNS, DUMMY_ROWS);
42}
43
44static int dummycon_dummy(void)
45{
46 return 0;
47}
48
49#define DUMMY (void *)dummycon_dummy
50
51/*
52 * The console `switch' structure for the dummy console
53 *
54 * Most of the operations are dummies.
55 */
56
57const struct consw dummy_con = {
58 .owner = THIS_MODULE,
59 .con_startup = dummycon_startup,
60 .con_init = dummycon_init,
61 .con_deinit = DUMMY,
62 .con_clear = DUMMY,
63 .con_putc = DUMMY,
64 .con_putcs = DUMMY,
65 .con_cursor = DUMMY,
66 .con_scroll = DUMMY,
67 .con_bmove = DUMMY,
68 .con_switch = DUMMY,
69 .con_blank = DUMMY,
70 .con_font_set = DUMMY,
71 .con_font_get = DUMMY,
72 .con_font_default = DUMMY,
73 .con_font_copy = DUMMY,
74 .con_set_palette = DUMMY,
75 .con_scrolldelta = DUMMY,
76};
Daniel Vettera4de0522014-06-05 16:20:46 +020077EXPORT_SYMBOL_GPL(dummy_con);