Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 325785
b: refs/heads/master
c: 6e62bdc
h: refs/heads/master
i:
  325783: 4ad1f52
v: v3
  • Loading branch information
Christophe Leroy authored and Greg Kroah-Hartman committed Sep 26, 2012
1 parent ea60f98 commit 283b932
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: fbbb9d9646f04768d0176f75e7fc93d29457b5db
refs/heads/master: 6e62bdc07e1b397704354cf3bd58950943ecaaf1
14 changes: 14 additions & 0 deletions trunk/drivers/tty/serial/cpm_uart/cpm_uart_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,7 @@ static void cpm_uart_set_termios(struct uart_port *port,
struct uart_cpm_port *pinfo = (struct uart_cpm_port *)port;
smc_t __iomem *smcp = pinfo->smcp;
scc_t __iomem *sccp = pinfo->sccp;
int maxidl;

pr_debug("CPM uart[%d]:set_termios\n", port->line);

Expand All @@ -511,6 +512,17 @@ static void cpm_uart_set_termios(struct uart_port *port,
else
pinfo->rx_fifosize = RX_BUF_SIZE;

/* MAXIDL is the timeout after which a receive buffer is closed
* when not full if no more characters are received.
* We calculate it from the baudrate so that the duration is
* always the same at standard rates: about 4ms.
*/
maxidl = baud / 2400;
if (maxidl < 1)
maxidl = 1;
if (maxidl > 0x10)
maxidl = 0x10;

/* Character length programmed into the mode register is the
* sum of: 1 start bit, number of data bits, 0 or 1 parity bit,
* 1 or 2 stop bits, minus 1.
Expand Down Expand Up @@ -611,6 +623,7 @@ static void cpm_uart_set_termios(struct uart_port *port,
* SMC/SCC receiver is disabled.
*/
out_be16(&pinfo->smcup->smc_mrblr, pinfo->rx_fifosize);
out_be16(&pinfo->smcup->smc_maxidl, maxidl);

/* Set the mode register. We want to keep a copy of the
* enables, because we want to put them back if they were
Expand All @@ -623,6 +636,7 @@ static void cpm_uart_set_termios(struct uart_port *port,
SMCMR_SM_UART | prev_mode);
} else {
out_be16(&pinfo->sccup->scc_genscc.scc_mrblr, pinfo->rx_fifosize);
out_be16(&pinfo->sccup->scc_maxidl, maxidl);
out_be16(&sccp->scc_psmr, (sbits << 12) | scval);
}

Expand Down

0 comments on commit 283b932

Please sign in to comment.