serial: struct serial_device: add uninit() entry for drivers

Subsequent patch extends mpc512x serial driver to support
multiple PSC ports. The driver will provide an uninit()
function to stop the serial controller and to disable the
controller's clock. Adding uninit() entry to struct serial_device
allows disabling the serial controller after usage of
a stdio serial device.

This patch adds uninit() entry to the struct serial_device
and fixes initialization of this structure in the code
accordingly.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
This commit is contained in:
Anatolij Gustschin 2010-04-24 19:27:04 +02:00 committed by Wolfgang Denk
parent 6e5fb4eec3
commit fbb0030e38
9 changed files with 14 additions and 0 deletions

View File

@ -340,6 +340,7 @@ struct serial_device serial0_device =
"serial0",
"UART0",
serial0_init,
NULL,
serial0_setbrg,
serial0_getc,
serial0_tstc,
@ -352,6 +353,7 @@ struct serial_device serial1_device =
"serial1",
"UART1",
serial1_init,
NULL,
serial1_setbrg,
serial1_getc,
serial1_tstc,

View File

@ -392,6 +392,7 @@ struct serial_device serial_smc_device =
"serial_smc",
"SMC",
smc_init,
NULL,
smc_setbrg,
smc_getc,
smc_tstc,
@ -662,6 +663,7 @@ struct serial_device serial_scc_device =
"serial_scc",
"SCC",
scc_init,
NULL,
scc_setbrg,
scc_getc,
scc_tstc,

View File

@ -822,6 +822,7 @@ struct serial_device serial0_device =
"serial0",
"UART0",
serial0_init,
NULL,
serial0_setbrg,
serial0_getc,
serial0_tstc,
@ -834,6 +835,7 @@ struct serial_device serial1_device =
"serial1",
"UART1",
serial1_init,
NULL,
serial1_setbrg,
serial1_getc,
serial1_tstc,

View File

@ -65,6 +65,7 @@ struct serial_device zoom2_serial_device##n = \
N(n), \
U(n), \
quad_init_##n, \
NULL, \
quad_setbrg_##n, \
quad_getc_##n, \
quad_tstc_##n, \

View File

@ -115,6 +115,7 @@ static NS16550_t serial_ports[4] = {
name,\
bus,\
eserial##port##_init,\
NULL,\
eserial##port##_setbrg,\
eserial##port##_getc,\
eserial##port##_tstc,\

View File

@ -266,6 +266,7 @@ struct serial_device serial_ffuart_device =
"serial_ffuart",
"PXA",
ffuart_init,
NULL,
ffuart_setbrg,
ffuart_getc,
ffuart_tstc,
@ -310,6 +311,7 @@ struct serial_device serial_btuart_device =
"serial_btuart",
"PXA",
btuart_init,
NULL,
btuart_setbrg,
btuart_getc,
btuart_tstc,
@ -354,6 +356,7 @@ struct serial_device serial_stuart_device =
"serial_stuart",
"PXA",
stuart_init,
NULL,
stuart_setbrg,
stuart_getc,
stuart_tstc,

View File

@ -78,6 +78,7 @@ DECLARE_GLOBAL_DATA_PTR;
name, \
bus, \
s3serial##port##_init, \
NULL,\
s3serial##port##_setbrg, \
s3serial##port##_getc, \
s3serial##port##_tstc, \

View File

@ -185,6 +185,7 @@ void s5p_serial##port##_puts(const char *s) { serial_puts_dev(s, port); }
name, \
bus, \
s5p_serial##port##_init, \
NULL, \
s5p_serial##port##_setbrg, \
s5p_serial##port##_getc, \
s5p_serial##port##_tstc, \

View File

@ -9,6 +9,7 @@ struct serial_device {
char ctlr[CTLRSIZE];
int (*init) (void);
int (*uninit) (void);
void (*setbrg) (void);
int (*getc) (void);
int (*tstc) (void);