dummycon.c 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. #include <linux/types.h>
  8. #include <linux/kdev_t.h>
  9. #include <linux/console.h>
  10. #include <linux/vt_kern.h>
  11. #include <linux/screen_info.h>
  12. #include <linux/init.h>
  13. #include <linux/module.h>
  14. /*
  15. * Dummy console driver
  16. */
  17. #if defined(__arm__)
  18. #define DUMMY_COLUMNS screen_info.orig_video_cols
  19. #define DUMMY_ROWS screen_info.orig_video_lines
  20. #elif defined(__hppa__)
  21. /* set by Kconfig. Use 80x25 for 640x480 and 160x64 for 1280x1024 */
  22. #define DUMMY_COLUMNS CONFIG_DUMMY_CONSOLE_COLUMNS
  23. #define DUMMY_ROWS CONFIG_DUMMY_CONSOLE_ROWS
  24. #else
  25. #define DUMMY_COLUMNS 80
  26. #define DUMMY_ROWS 25
  27. #endif
  28. static const char *dummycon_startup(void)
  29. {
  30. return "dummy device";
  31. }
  32. static void dummycon_init(struct vc_data *vc, int init)
  33. {
  34. vc->vc_can_do_color = 1;
  35. if (init) {
  36. vc->vc_cols = DUMMY_COLUMNS;
  37. vc->vc_rows = DUMMY_ROWS;
  38. } else
  39. vc_resize(vc, DUMMY_COLUMNS, DUMMY_ROWS);
  40. }
  41. static int dummycon_dummy(void)
  42. {
  43. return 0;
  44. }
  45. #define DUMMY (void *)dummycon_dummy
  46. /*
  47. * The console `switch' structure for the dummy console
  48. *
  49. * Most of the operations are dummies.
  50. */
  51. const struct consw dummy_con = {
  52. .owner = THIS_MODULE,
  53. .con_startup = dummycon_startup,
  54. .con_init = dummycon_init,
  55. .con_deinit = DUMMY,
  56. .con_clear = DUMMY,
  57. .con_putc = DUMMY,
  58. .con_putcs = DUMMY,
  59. .con_cursor = DUMMY,
  60. .con_scroll = DUMMY,
  61. .con_bmove = DUMMY,
  62. .con_switch = DUMMY,
  63. .con_blank = DUMMY,
  64. .con_font_set = DUMMY,
  65. .con_font_get = DUMMY,
  66. .con_font_default = DUMMY,
  67. .con_font_copy = DUMMY,
  68. .con_set_palette = DUMMY,
  69. .con_scrolldelta = DUMMY,
  70. };