cpm_uart: Support uart_wait_until_sent()
authorLaurent Pinchart <laurentp@cse-semaphore.com>
Wed, 2 Jul 2008 08:58:45 +0000 (10:58 +0200)
committerKumar Gala <galak@kernel.crashing.org>
Mon, 14 Jul 2008 12:55:38 +0000 (07:55 -0500)
Set port->fifosize to the software FIFO size, and update the port timeout
when the baud rate is modified. SCC ports have an optional 32 byte hardware
FIFO which is currently not taken into account, as there is no documented way
to check when the FIFO becomes empty.

Signed-off-by: Laurent Pinchart <laurentp@cse-semaphore.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
drivers/serial/cpm_uart/cpm_uart_core.c [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index d389a76..abe129c
@@ -491,6 +491,11 @@ static void cpm_uart_set_termios(struct uart_port *port,
        }
 
        /*
+        * Update the timeout
+        */
+       uart_update_timeout(port, termios->c_cflag, baud);
+
+       /*
         * Set up parity check flag
         */
 #define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK))
@@ -938,6 +943,7 @@ static int cpm_uart_init_port(struct device_node *np,
        pinfo->port.type = PORT_CPM;
        pinfo->port.ops = &cpm_uart_pops,
        pinfo->port.iotype = UPIO_MEM;
+       pinfo->port.fifosize = pinfo->tx_nrfifos * pinfo->tx_fifosize;
        spin_lock_init(&pinfo->port.lock);
 
        pinfo->port.irq = of_irq_to_resource(np, 0, NULL);