stdio_dev.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. /*
  2. * (C) Copyright 2000
  3. * Paolo Scaffardi, AIRVENT SAM s.p.a - RIMINI(ITALY), arsenio@tin.it
  4. *
  5. * See file CREDITS for list of people who contributed to this
  6. * project.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as
  10. * published by the Free Software Foundation; either version 2 of
  11. * the License, or (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
  21. * MA 02111-1307 USA
  22. */
  23. #ifndef _STDIO_DEV_H_
  24. #define _STDIO_DEV_H_
  25. #include <linux/list.h>
  26. /*
  27. * STDIO DEVICES
  28. */
  29. #define DEV_FLAGS_INPUT 0x00000001 /* Device can be used as input console */
  30. #define DEV_FLAGS_OUTPUT 0x00000002 /* Device can be used as output console */
  31. #define DEV_FLAGS_SYSTEM 0x80000000 /* Device is a system device */
  32. #define DEV_EXT_VIDEO 0x00000001 /* Video extensions supported */
  33. /* Device information */
  34. struct stdio_dev {
  35. int flags; /* Device flags: input/output/system */
  36. int ext; /* Supported extensions */
  37. char name[16]; /* Device name */
  38. /* GENERAL functions */
  39. int (*start) (void); /* To start the device */
  40. int (*stop) (void); /* To stop the device */
  41. /* OUTPUT functions */
  42. void (*putc) (const char c); /* To put a char */
  43. void (*puts) (const char *s); /* To put a string (accelerator) */
  44. /* INPUT functions */
  45. int (*tstc) (void); /* To test if a char is ready... */
  46. int (*getc) (void); /* To get that char */
  47. /* Other functions */
  48. void *priv; /* Private extensions */
  49. struct list_head list;
  50. };
  51. /*
  52. * VIDEO EXTENSIONS
  53. */
  54. #define VIDEO_FORMAT_RGB_INDEXED 0x0000
  55. #define VIDEO_FORMAT_RGB_DIRECTCOLOR 0x0001
  56. #define VIDEO_FORMAT_YUYV_4_4_4 0x0010
  57. #define VIDEO_FORMAT_YUYV_4_2_2 0x0011
  58. typedef struct {
  59. void *address; /* Address of framebuffer */
  60. ushort width; /* Horizontal resolution */
  61. ushort height; /* Vertical resolution */
  62. uchar format; /* Format */
  63. uchar colors; /* Colors number or color depth */
  64. void (*setcolreg) (int, int, int, int);
  65. void (*getcolreg) (int, void *);
  66. } video_ext_t;
  67. /*
  68. * VARIABLES
  69. */
  70. extern struct stdio_dev *stdio_devices[];
  71. extern char *stdio_names[MAX_FILES];
  72. /*
  73. * PROTOTYPES
  74. */
  75. int stdio_register (struct stdio_dev * dev);
  76. int stdio_init (void);
  77. void stdio_print_current_devices(void);
  78. #ifdef CONFIG_SYS_STDIO_DEREGISTER
  79. int stdio_deregister(char *devname);
  80. #endif
  81. struct list_head* stdio_get_list(void);
  82. struct stdio_dev* stdio_get_by_name(char* name);
  83. struct stdio_dev* stdio_clone(struct stdio_dev *dev);
  84. #ifdef CONFIG_ARM_DCC_MULTI
  85. int drv_arm_dcc_init(void);
  86. #endif
  87. #ifdef CONFIG_LCD
  88. int drv_lcd_init (void);
  89. #endif
  90. #ifdef CONFIG_VFD
  91. int drv_vfd_init (void);
  92. #endif
  93. #if defined(CONFIG_VIDEO) || defined(CONFIG_CFB_CONSOLE)
  94. int drv_video_init (void);
  95. #endif
  96. #ifdef CONFIG_KEYBOARD
  97. int drv_keyboard_init (void);
  98. #endif
  99. #ifdef CONFIG_USB_TTY
  100. int drv_usbtty_init (void);
  101. #endif
  102. #ifdef CONFIG_NETCONSOLE
  103. int drv_nc_init (void);
  104. #endif
  105. #ifdef CONFIG_JTAG_CONSOLE
  106. int drv_jtag_console_init (void);
  107. #endif
  108. #endif