devices.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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. #include <linux/list.h>
  24. #ifndef _DEVICES_H_
  25. #define _DEVICES_H_
  26. /*
  27. * CONSOLE 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. typedef struct {
  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. } device_t;
  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 device_t *stdio_devices[];
  71. extern char *stdio_names[MAX_FILES];
  72. /*
  73. * PROTOTYPES
  74. */
  75. int device_register (device_t * dev);
  76. int devices_init (void);
  77. #ifdef CONFIG_SYS_DEVICE_DEREGISTER
  78. int device_deregister(char *devname);
  79. #endif
  80. struct list_head* device_get_list(void);
  81. device_t* device_get_by_name(char* name);
  82. device_t* device_clone(device_t *dev);
  83. #ifdef CONFIG_ARM_DCC_MULTI
  84. int drv_arm_dcc_init(void);
  85. #endif
  86. #ifdef CONFIG_LCD
  87. int drv_lcd_init (void);
  88. #endif
  89. #ifdef CONFIG_VFD
  90. int drv_vfd_init (void);
  91. #endif
  92. #if defined(CONFIG_VIDEO) || defined(CONFIG_CFB_CONSOLE)
  93. int drv_video_init (void);
  94. #endif
  95. #ifdef CONFIG_KEYBOARD
  96. int drv_keyboard_init (void);
  97. #endif
  98. #ifdef CONFIG_USB_TTY
  99. int drv_usbtty_init (void);
  100. #endif
  101. #ifdef CONFIG_NETCONSOLE
  102. int drv_nc_init (void);
  103. #endif
  104. #ifdef CONFIG_JTAG_CONSOLE
  105. int drv_jtag_console_init (void);
  106. #endif
  107. #endif /* _DEVICES_H_ */