Blame view

include/stdio_dev.h 2.58 KB
e831ad54a   wdenk   Initial revision
1
2
3
4
  /*
   * (C) Copyright 2000
   * Paolo Scaffardi, AIRVENT SAM s.p.a - RIMINI(ITALY), arsenio@tin.it
   *
1a4596601   Wolfgang Denk   Add GPL-2.0+ SPDX...
5
   * SPDX-License-Identifier:	GPL-2.0+
e831ad54a   wdenk   Initial revision
6
   */
52cb4d4fb   Jean-Christophe PLAGNIOL-VILLARD   stdio/device: rew...
7
8
  #ifndef _STDIO_DEV_H_
  #define _STDIO_DEV_H_
e831ad54a   wdenk   Initial revision
9

52cb4d4fb   Jean-Christophe PLAGNIOL-VILLARD   stdio/device: rew...
10
  #include <linux/list.h>
e831ad54a   wdenk   Initial revision
11
12
  
  /*
52cb4d4fb   Jean-Christophe PLAGNIOL-VILLARD   stdio/device: rew...
13
   * STDIO DEVICES
e831ad54a   wdenk   Initial revision
14
15
16
17
18
19
   */
  
  #define DEV_FLAGS_INPUT	 0x00000001	/* Device can be used as input	console */
  #define DEV_FLAGS_OUTPUT 0x00000002	/* Device can be used as output console */
  #define DEV_FLAGS_SYSTEM 0x80000000	/* Device is a system device		*/
  #define DEV_EXT_VIDEO	 0x00000001	/* Video extensions supported		*/
47cd00fa7   wdenk   * Patches by Robe...
20
  /* Device information */
52cb4d4fb   Jean-Christophe PLAGNIOL-VILLARD   stdio/device: rew...
21
  struct stdio_dev {
e831ad54a   wdenk   Initial revision
22
23
  	int	flags;			/* Device flags: input/output/system	*/
  	int	ext;			/* Supported extensions			*/
281e00a3b   wdenk   * Code cleanup
24
  	char	name[16];		/* Device name				*/
e831ad54a   wdenk   Initial revision
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
  
  /* GENERAL functions */
  
  	int (*start) (void);		/* To start the device			*/
  	int (*stop) (void);		/* To stop the device			*/
  
  /* OUTPUT functions */
  
  	void (*putc) (const char c);	/* To put a char			*/
  	void (*puts) (const char *s);	/* To put a string (accelerator)	*/
  
  /* INPUT functions */
  
  	int (*tstc) (void);		/* To test if a char is ready...	*/
  	int (*getc) (void);		/* To get that char			*/
  
  /* Other functions */
  
  	void *priv;			/* Private extensions			*/
c1de7a6da   Jean-Christophe PLAGNIOL-VILLARD   devices: merge to...
44
  	struct list_head list;
52cb4d4fb   Jean-Christophe PLAGNIOL-VILLARD   stdio/device: rew...
45
  };
e831ad54a   wdenk   Initial revision
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
  
  /*
   * VIDEO EXTENSIONS
   */
  #define VIDEO_FORMAT_RGB_INDEXED	0x0000
  #define VIDEO_FORMAT_RGB_DIRECTCOLOR	0x0001
  #define VIDEO_FORMAT_YUYV_4_4_4		0x0010
  #define VIDEO_FORMAT_YUYV_4_2_2		0x0011
  
  typedef struct {
  	void *address;			/* Address of framebuffer		*/
  	ushort	width;			/* Horizontal resolution		*/
  	ushort	height;			/* Vertical resolution			*/
  	uchar	format;			/* Format				*/
  	uchar	colors;			/* Colors number or color depth		*/
  	void (*setcolreg) (int, int, int, int);
  	void (*getcolreg) (int, void *);
  } video_ext_t;
  
  /*
   * VARIABLES
   */
52cb4d4fb   Jean-Christophe PLAGNIOL-VILLARD   stdio/device: rew...
68
  extern struct stdio_dev *stdio_devices[];
e831ad54a   wdenk   Initial revision
69
70
71
72
73
  extern char *stdio_names[MAX_FILES];
  
  /*
   * PROTOTYPES
   */
52cb4d4fb   Jean-Christophe PLAGNIOL-VILLARD   stdio/device: rew...
74
75
  int	stdio_register (struct stdio_dev * dev);
  int	stdio_init (void);
7e3be7cf3   Jean-Christophe PLAGNIOL-VILLARD   console: unify pr...
76
  void	stdio_print_current_devices(void);
52cb4d4fb   Jean-Christophe PLAGNIOL-VILLARD   stdio/device: rew...
77
  #ifdef CONFIG_SYS_STDIO_DEREGISTER
d7be3056d   Mike Frysinger   stdio: constify "...
78
  int	stdio_deregister(const char *devname);
fea91edee   Jean-Christophe PLAGNIOL-VILLARD   usb_kbd: fix usb_...
79
  #endif
52cb4d4fb   Jean-Christophe PLAGNIOL-VILLARD   stdio/device: rew...
80
  struct list_head* stdio_get_list(void);
d7be3056d   Mike Frysinger   stdio: constify "...
81
  struct stdio_dev* stdio_get_by_name(const char* name);
52cb4d4fb   Jean-Christophe PLAGNIOL-VILLARD   stdio/device: rew...
82
  struct stdio_dev* stdio_clone(struct stdio_dev *dev);
c1de7a6da   Jean-Christophe PLAGNIOL-VILLARD   devices: merge to...
83

e831ad54a   wdenk   Initial revision
84
85
86
  #ifdef CONFIG_LCD
  int	drv_lcd_init (void);
  #endif
a6c7ad2f6   wdenk   * Fix startup pro...
87
  #if defined(CONFIG_VIDEO) || defined(CONFIG_CFB_CONSOLE)
e831ad54a   wdenk   Initial revision
88
89
  int	drv_video_init (void);
  #endif
682011ff6   wdenk   * Patches by Udi ...
90
91
  #ifdef CONFIG_KEYBOARD
  int	drv_keyboard_init (void);
e831ad54a   wdenk   Initial revision
92
  #endif
232c150a2   wdenk   Add support for S...
93
94
95
  #ifdef CONFIG_USB_TTY
  int	drv_usbtty_init (void);
  #endif
68ceb29e7   wdenk   Add support for c...
96
97
98
  #ifdef CONFIG_NETCONSOLE
  int	drv_nc_init (void);
  #endif
36ea8e9ad   Mike Frysinger   Blackfin: support...
99
100
101
  #ifdef CONFIG_JTAG_CONSOLE
  int drv_jtag_console_init (void);
  #endif
98ab435f7   Vadim Bendebury   x86: Add CBMEM co...
102
103
104
  #ifdef CONFIG_CBMEM_CONSOLE
  int cbmemc_init(void);
  #endif
e831ad54a   wdenk   Initial revision
105

52cb4d4fb   Jean-Christophe PLAGNIOL-VILLARD   stdio/device: rew...
106
  #endif