Blame view

include/stdio_dev.h 3.24 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
   */
  
  #define DEV_FLAGS_INPUT	 0x00000001	/* Device can be used as input	console */
  #define DEV_FLAGS_OUTPUT 0x00000002	/* Device can be used as output console */
7b3c4c3a5   Simon Glass   dm: console: Chec...
18
  #define DEV_FLAGS_DM     0x00000004	/* Device priv is a struct udevice * */
e831ad54a   wdenk   Initial revision
19

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			*/
5294e9783   Alexey Brodkin   stdio: extend "na...
24
  	char	name[32];		/* Device name				*/
e831ad54a   wdenk   Initial revision
25
26
  
  /* GENERAL functions */
709ea543b   Simon Glass   stdio: Pass devic...
27
28
  	int (*start)(struct stdio_dev *dev);	/* To start the device */
  	int (*stop)(struct stdio_dev *dev);	/* To stop the device */
e831ad54a   wdenk   Initial revision
29
30
  
  /* OUTPUT functions */
709ea543b   Simon Glass   stdio: Pass devic...
31
32
33
34
  	/* To put a char */
  	void (*putc)(struct stdio_dev *dev, const char c);
  	/* To put a string (accelerator) */
  	void (*puts)(struct stdio_dev *dev, const char *s);
e831ad54a   wdenk   Initial revision
35
36
  
  /* INPUT functions */
709ea543b   Simon Glass   stdio: Pass devic...
37
38
39
  	/* To test if a char is ready... */
  	int (*tstc)(struct stdio_dev *dev);
  	int (*getc)(struct stdio_dev *dev);	/* To get that char */
e831ad54a   wdenk   Initial revision
40
41
42
43
  
  /* 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
  int	stdio_register (struct stdio_dev * dev);
d97143a67   Simon Glass   stdio: Provide fu...
75
  int stdio_register_dev(struct stdio_dev *dev, struct stdio_dev **devp);
9fb02491f   Simon Glass   dm: Make driver m...
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
  
  /**
   * stdio_init_tables() - set up stdio tables ready for devices
   *
   * This does not add any devices, but just prepares stdio for use.
   */
  int stdio_init_tables(void);
  
  /**
   * stdio_add_devices() - Add stdio devices to the table
   *
   * This makes calls to all the various subsystems that use stdio, to make
   * them register with stdio.
   */
  int stdio_add_devices(void);
  
  /**
   * stdio_init() - Sets up stdio ready for use
   *
   * This calls stdio_init_tables() and stdio_add_devices()
   */
  int stdio_init(void);
7e3be7cf3   Jean-Christophe PLAGNIOL-VILLARD   console: unify pr...
98
  void	stdio_print_current_devices(void);
869588dec   Simon Glass   Convert CONFIG_SY...
99
  #if CONFIG_IS_ENABLED(SYS_STDIO_DEREGISTER)
32d019265   Hans de Goede   stdio: Add force ...
100
101
  int stdio_deregister(const char *devname, int force);
  int stdio_deregister_dev(struct stdio_dev *dev, int force);
fea91edee   Jean-Christophe PLAGNIOL-VILLARD   usb_kbd: fix usb_...
102
  #endif
52cb4d4fb   Jean-Christophe PLAGNIOL-VILLARD   stdio/device: rew...
103
  struct list_head* stdio_get_list(void);
d7be3056d   Mike Frysinger   stdio: constify "...
104
  struct stdio_dev* stdio_get_by_name(const char* name);
52cb4d4fb   Jean-Christophe PLAGNIOL-VILLARD   stdio/device: rew...
105
  struct stdio_dev* stdio_clone(struct stdio_dev *dev);
c1de7a6da   Jean-Christophe PLAGNIOL-VILLARD   devices: merge to...
106

e831ad54a   wdenk   Initial revision
107
108
109
  #ifdef CONFIG_LCD
  int	drv_lcd_init (void);
  #endif
a6c7ad2f6   wdenk   * Fix startup pro...
110
  #if defined(CONFIG_VIDEO) || defined(CONFIG_CFB_CONSOLE)
e831ad54a   wdenk   Initial revision
111
112
  int	drv_video_init (void);
  #endif
682011ff6   wdenk   * Patches by Udi ...
113
114
  #ifdef CONFIG_KEYBOARD
  int	drv_keyboard_init (void);
e831ad54a   wdenk   Initial revision
115
  #endif
232c150a2   wdenk   Add support for S...
116
117
118
  #ifdef CONFIG_USB_TTY
  int	drv_usbtty_init (void);
  #endif
68ceb29e7   wdenk   Add support for c...
119
120
121
  #ifdef CONFIG_NETCONSOLE
  int	drv_nc_init (void);
  #endif
36ea8e9ad   Mike Frysinger   Blackfin: support...
122
123
124
  #ifdef CONFIG_JTAG_CONSOLE
  int drv_jtag_console_init (void);
  #endif
98ab435f7   Vadim Bendebury   x86: Add CBMEM co...
125
126
127
  #ifdef CONFIG_CBMEM_CONSOLE
  int cbmemc_init(void);
  #endif
e831ad54a   wdenk   Initial revision
128

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