]> git.sur5r.net Git - u-boot/commitdiff
serial: struct serial_device: add uninit() entry for drivers
authorAnatolij Gustschin <agust@denx.de>
Sat, 24 Apr 2010 17:27:04 +0000 (19:27 +0200)
committerWolfgang Denk <wd@denx.de>
Sat, 24 Apr 2010 19:34:07 +0000 (21:34 +0200)
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>
arch/powerpc/cpu/mpc5xxx/serial.c
arch/powerpc/cpu/mpc8xx/serial.c
arch/powerpc/cpu/ppc4xx/4xx_uart.c
board/logicpd/zoom2/zoom2_serial.h
drivers/serial/serial.c
drivers/serial/serial_pxa.c
drivers/serial/serial_s3c24x0.c
drivers/serial/serial_s5pc1xx.c
include/serial.h

index 59a877a8f90df75710ab201007ffe29874bae52d..01270655ae414b8e4c25bc9f2eab16ee9eb997c2 100644 (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,
index 664db65a567e208fa05afc3c230f6705c83bec66..9514c66fd573ab9606cc8c8be9383cca425e5f22 100644 (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,
index 8de65425c97c130311fb87b6bd59692e2a421f80..e6ab570c0204036cf35181133794c7b693b29715 100644 (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,
index c98158f1ba6b1eae14878d5ad36a1101fab7d455..a6d2427fef028e3ee7d0efbe7d5d07c5495da7cd 100644 (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,                          \
index dd5f332ba93a3c467603dca91915e32db93504de..8eda95cd3eddd1e2e3b183cefba3ebc9fe04d569 100644 (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,\
index 9ba457e75aabfa97794a0689dbb6d0b3af191c2f..b74e43957ff70d4024efc78d6b0618c437823664 100644 (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,
index 5dd4dd8160469c6d66df82fe141524132cf0d3a2..8a3e30209cfae7857d3ad59925031480f8e4c791 100644 (file)
@@ -78,6 +78,7 @@ DECLARE_GLOBAL_DATA_PTR;
        name, \
        bus, \
        s3serial##port##_init, \
+       NULL,\
        s3serial##port##_setbrg, \
        s3serial##port##_getc, \
        s3serial##port##_tstc, \
index 73669a9f1704b581480d8257797082df786e28ad..8da0c8606dc693ae3e3168fdb674a878e4947b15 100644 (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, \
index f2638ec5667df90efd08f4610e5d2efd0ba50c8d..fbf101bd7f706888f7958199321751c32147cb62 100644 (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);