aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/console/dummycon.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-16 18:20:36 -0400
commit1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch)
tree0bba044c4ce775e45a88a51686b5d9f90697ea9d /drivers/video/console/dummycon.c
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history, even though we have it. We can create a separate "historical" git archive of that later if we want to, and in the meantime it's about 3.2GB when imported into git - space that would just make the early git days unnecessarily complicated, when we don't have a lot of good infrastructure for it. Let it rip!
Diffstat (limited to 'drivers/video/console/dummycon.c')
-rw-r--r--drivers/video/console/dummycon.c80
1 files changed, 80 insertions, 0 deletions
diff --git a/drivers/video/console/dummycon.c b/drivers/video/console/dummycon.c
new file mode 100644
index 000000000000..1ecda91e5a9c
--- /dev/null
+++ b/drivers/video/console/dummycon.c
@@ -0,0 +1,80 @@
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/vt_kern.h>
13#include <linux/init.h>
14#include <linux/module.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/* set by Kconfig. Use 80x25 for 640x480 and 160x64 for 1280x1024 */
25#include <linux/config.h>
26#define DUMMY_COLUMNS CONFIG_DUMMY_CONSOLE_COLUMNS
27#define DUMMY_ROWS CONFIG_DUMMY_CONSOLE_ROWS
28#else
29#define DUMMY_COLUMNS 80
30#define DUMMY_ROWS 25
31#endif
32
33static const char *dummycon_startup(void)
34{
35 return "dummy device";
36}
37
38static void dummycon_init(struct vc_data *vc, int init)
39{
40 vc->vc_can_do_color = 1;
41 if (init) {
42 vc->vc_cols = DUMMY_COLUMNS;
43 vc->vc_rows = DUMMY_ROWS;
44 } else
45 vc_resize(vc, DUMMY_COLUMNS, DUMMY_ROWS);
46}
47
48static int dummycon_dummy(void)
49{
50 return 0;
51}
52
53#define DUMMY (void *)dummycon_dummy
54
55/*
56 * The console `switch' structure for the dummy console
57 *
58 * Most of the operations are dummies.
59 */
60
61const struct consw dummy_con = {
62 .owner = THIS_MODULE,
63 .con_startup = dummycon_startup,
64 .con_init = dummycon_init,
65 .con_deinit = DUMMY,
66 .con_clear = DUMMY,
67 .con_putc = DUMMY,
68 .con_putcs = DUMMY,
69 .con_cursor = DUMMY,
70 .con_scroll = DUMMY,
71 .con_bmove = DUMMY,
72 .con_switch = DUMMY,
73 .con_blank = DUMMY,
74 .con_font_set = DUMMY,
75 .con_font_get = DUMMY,
76 .con_font_default = DUMMY,
77 .con_font_copy = DUMMY,
78 .con_set_palette = DUMMY,
79 .con_scrolldelta = DUMMY,
80};