Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 338377
b: refs/heads/master
c: 7ae75e9
h: refs/heads/master
i:
  338375: b39da69
v: v3
  • Loading branch information
Alexander Shiyan authored and Greg Kroah-Hartman committed Oct 24, 2012
1 parent 212b287 commit 29190be
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 25 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f52ede2ac1159f844994519ae0386def308a296b
refs/heads/master: 7ae75e94ec1128598f91dc56ca2919c45701ec32
36 changes: 12 additions & 24 deletions trunk/drivers/tty/serial/clps711x.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,10 +273,9 @@ clps711xuart_set_termios(struct uart_port *port, struct ktermios *termios,
unsigned int ubrlcr, baud, quot;
unsigned long flags;

/*
* We don't implement CREAD.
*/
termios->c_cflag |= CREAD;
/* Mask termios capabilities we don't support */
termios->c_cflag &= ~CMSPAR;
termios->c_iflag &= ~(BRKINT | IGNBRK);

/* Ask the core to calculate the divisor for us */
baud = uart_get_baud_rate(port, termios, old, port->uartclk / 4096,
Expand All @@ -297,8 +296,10 @@ clps711xuart_set_termios(struct uart_port *port, struct ktermios *termios,
ubrlcr = UBRLCR_WRDLEN8;
break;
}

if (termios->c_cflag & CSTOPB)
ubrlcr |= UBRLCR_XSTOP;

if (termios->c_cflag & PARENB) {
ubrlcr |= UBRLCR_PRTEN;
if (!(termios->c_cflag & PARODD))
Expand All @@ -310,33 +311,20 @@ clps711xuart_set_termios(struct uart_port *port, struct ktermios *termios,

spin_lock_irqsave(&port->lock, flags);

/*
* Update the per-port timeout.
*/
uart_update_timeout(port, termios->c_cflag, baud);

/* Set read status mask */
port->read_status_mask = UARTDR_OVERR;
if (termios->c_iflag & INPCK)
port->read_status_mask |= UARTDR_PARERR | UARTDR_FRMERR;

/*
* Characters to ignore
*/
/* Set status ignore mask */
port->ignore_status_mask = 0;
if (termios->c_iflag & IGNPAR)
port->ignore_status_mask |= UARTDR_FRMERR | UARTDR_PARERR;
if (termios->c_iflag & IGNBRK) {
/*
* If we're ignoring parity and break indicators,
* ignore overruns to (for real raw support).
*/
if (termios->c_iflag & IGNPAR)
port->ignore_status_mask |= UARTDR_OVERR;
}
if (!(termios->c_cflag & CREAD))
port->ignore_status_mask |= UARTDR_OVERR | UARTDR_PARERR |
UARTDR_FRMERR;

quot -= 1;
uart_update_timeout(port, termios->c_cflag, baud);

clps_writel(ubrlcr | quot, UBRLCR(port));
clps_writel(ubrlcr | (quot - 1), UBRLCR(port));

spin_unlock_irqrestore(&port->lock, flags);
}
Expand Down

0 comments on commit 29190be

Please sign in to comment.