===== drivers/serial/cpm_uart/cpm_uart.h 1.2 vs edited ===== --- 1.2/drivers/serial/cpm_uart/cpm_uart.h Fri Jun 4 10:37:06 2004 +++ edited/drivers/serial/cpm_uart/cpm_uart.h Mon Jun 7 11:07:52 2004 @@ -65,6 +65,9 @@ uint dp_addr; void *mem_addr; dma_addr_t dma_addr; + /* helpers */ + int baud; + int bits; }; extern int cpm_uart_port_map[UART_NR]; ===== drivers/serial/cpm_uart/cpm_uart_core.c 1.1 vs edited ===== --- 1.1/drivers/serial/cpm_uart/cpm_uart_core.c Thu Jun 3 16:42:27 2004 +++ edited/drivers/serial/cpm_uart/cpm_uart_core.c Mon Jun 7 11:07:52 2004 @@ -43,6 +43,7 @@ #include #include +#include #include #include @@ -242,10 +243,11 @@ pr_debug("CPM uart[%d]:stop tx\n", port->line); - if (IS_SMC(pinfo)) + if (IS_SMC(pinfo)) { smcp->smc_smcm &= ~SMCM_TX; - else + } else { sccp->scc_sccm &= ~UART_SCCM_TX; + } } /* @@ -479,6 +481,10 @@ if ((termios->c_cflag & CREAD) == 0) port->read_status_mask &= ~BD_SC_EMPTY; + /* if previous configuration exists wait 2 character times for tx to finish */ + if (pinfo->baud != 0 || pinfo->bits != 0) + udelay((2 * 1000000 * pinfo->bits) / pinfo->baud); + spin_lock_irqsave(&port->lock, flags); /* Start bit has not been added (so don't, because we would just @@ -499,6 +505,10 @@ } cpm_set_brg(pinfo->brg - 1, baud); + + pinfo->baud = baud; + pinfo->bits = bits; + spin_unlock_irqrestore(&port->lock, flags); }