regulator: s2mps11: Adjust supported buck voltages to real values
[linux/fpc-iii.git] / drivers / video / console / dummycon.c
blob45ad925ad5f8fbb203a137c0ab114f4fb71d62f2
1 /*
2 * linux/drivers/video/dummycon.c -- A dummy console driver
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 */
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/screen_info.h>
13 #include <linux/init.h>
14 #include <linux/module.h>
17 * Dummy console driver
20 #if defined(__arm__)
21 #define DUMMY_COLUMNS screen_info.orig_video_cols
22 #define DUMMY_ROWS screen_info.orig_video_lines
23 #else
24 /* set by Kconfig. Use 80x25 for 640x480 and 160x64 for 1280x1024 */
25 #define DUMMY_COLUMNS CONFIG_DUMMY_CONSOLE_COLUMNS
26 #define DUMMY_ROWS CONFIG_DUMMY_CONSOLE_ROWS
27 #endif
29 #ifdef CONFIG_FRAMEBUFFER_CONSOLE_DEFERRED_TAKEOVER
30 /* These are both protected by the console_lock */
31 static RAW_NOTIFIER_HEAD(dummycon_output_nh);
32 static bool dummycon_putc_called;
34 void dummycon_register_output_notifier(struct notifier_block *nb)
36 raw_notifier_chain_register(&dummycon_output_nh, nb);
38 if (dummycon_putc_called)
39 nb->notifier_call(nb, 0, NULL);
42 void dummycon_unregister_output_notifier(struct notifier_block *nb)
44 raw_notifier_chain_unregister(&dummycon_output_nh, nb);
47 static void dummycon_putc(struct vc_data *vc, int c, int ypos, int xpos)
49 dummycon_putc_called = true;
50 raw_notifier_call_chain(&dummycon_output_nh, 0, NULL);
53 static void dummycon_putcs(struct vc_data *vc, const unsigned short *s,
54 int count, int ypos, int xpos)
56 int i;
58 if (!dummycon_putc_called) {
59 /* Ignore erases */
60 for (i = 0 ; i < count; i++) {
61 if (s[i] != vc->vc_video_erase_char)
62 break;
64 if (i == count)
65 return;
67 dummycon_putc_called = true;
70 raw_notifier_call_chain(&dummycon_output_nh, 0, NULL);
73 static int dummycon_blank(struct vc_data *vc, int blank, int mode_switch)
75 /* Redraw, so that we get putc(s) for output done while blanked */
76 return 1;
78 #else
79 static void dummycon_putc(struct vc_data *vc, int c, int ypos, int xpos) { }
80 static void dummycon_putcs(struct vc_data *vc, const unsigned short *s,
81 int count, int ypos, int xpos) { }
82 static int dummycon_blank(struct vc_data *vc, int blank, int mode_switch)
84 return 0;
86 #endif
88 static const char *dummycon_startup(void)
90 return "dummy device";
93 static void dummycon_init(struct vc_data *vc, int init)
95 vc->vc_can_do_color = 1;
96 if (init) {
97 vc->vc_cols = DUMMY_COLUMNS;
98 vc->vc_rows = DUMMY_ROWS;
99 } else
100 vc_resize(vc, DUMMY_COLUMNS, DUMMY_ROWS);
103 static void dummycon_deinit(struct vc_data *vc) { }
104 static void dummycon_clear(struct vc_data *vc, int sy, int sx, int height,
105 int width) { }
106 static void dummycon_cursor(struct vc_data *vc, int mode) { }
108 static bool dummycon_scroll(struct vc_data *vc, unsigned int top,
109 unsigned int bottom, enum con_scroll dir,
110 unsigned int lines)
112 return false;
115 static int dummycon_switch(struct vc_data *vc)
117 return 0;
120 static int dummycon_font_set(struct vc_data *vc, struct console_font *font,
121 unsigned int flags)
123 return 0;
126 static int dummycon_font_default(struct vc_data *vc,
127 struct console_font *font, char *name)
129 return 0;
132 static int dummycon_font_copy(struct vc_data *vc, int con)
134 return 0;
138 * The console `switch' structure for the dummy console
140 * Most of the operations are dummies.
143 const struct consw dummy_con = {
144 .owner = THIS_MODULE,
145 .con_startup = dummycon_startup,
146 .con_init = dummycon_init,
147 .con_deinit = dummycon_deinit,
148 .con_clear = dummycon_clear,
149 .con_putc = dummycon_putc,
150 .con_putcs = dummycon_putcs,
151 .con_cursor = dummycon_cursor,
152 .con_scroll = dummycon_scroll,
153 .con_switch = dummycon_switch,
154 .con_blank = dummycon_blank,
155 .con_font_set = dummycon_font_set,
156 .con_font_default = dummycon_font_default,
157 .con_font_copy = dummycon_font_copy,
159 EXPORT_SYMBOL_GPL(dummy_con);