summaryrefslogtreecommitdiff
path: root/drivers/serial
diff options
context:
space:
mode:
authorPatrick Gefre <pfg@sgi.com>2005-05-01 15:59:21 (GMT)
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-01 15:59:21 (GMT)
commit68985e486b708671a7c7d0b4de6d94a1547d1351 (patch)
tree93a8d63c810a1006e838718b62ed48ccd7c90b45 /drivers/serial
parent6cb2875f8d7e392982229094ad3b6d2f213f48da (diff)
downloadlinux-68985e486b708671a7c7d0b4de6d94a1547d1351.tar.xz
[PATCH] Altix ioc4 serial - small uart setup mods
Small mods for setting up the uart - parity, flow control Signed-off-by: Patrick Gefre <pfg@sgi.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/serial')
-rw-r--r--drivers/serial/ioc4_serial.c28
1 files changed, 8 insertions, 20 deletions
diff --git a/drivers/serial/ioc4_serial.c b/drivers/serial/ioc4_serial.c
index d3f4542..d9629ee 100644
--- a/drivers/serial/ioc4_serial.c
+++ b/drivers/serial/ioc4_serial.c
@@ -1688,8 +1688,8 @@ ioc4_change_speed(struct uart_port *the_port,
{
struct ioc4_port *port = get_ioc4_port(the_port);
int baud, bits;
- unsigned cflag, cval;
- int new_parity = 0, new_parity_enable = 0, new_stop = 1, new_data = 8;
+ unsigned cflag;
+ int new_parity = 0, new_parity_enable = 0, new_stop = 0, new_data = 8;
struct uart_info *info = the_port->info;
cflag = new_termios->c_cflag;
@@ -1697,48 +1697,35 @@ ioc4_change_speed(struct uart_port *the_port,
switch (cflag & CSIZE) {
case CS5:
new_data = 5;
- cval = 0x00;
bits = 7;
break;
case CS6:
new_data = 6;
- cval = 0x01;
bits = 8;
break;
case CS7:
new_data = 7;
- cval = 0x02;
bits = 9;
break;
case CS8:
new_data = 8;
- cval = 0x03;
bits = 10;
break;
default:
/* cuz we always need a default ... */
new_data = 5;
- cval = 0x00;
bits = 7;
break;
}
if (cflag & CSTOPB) {
- cval |= 0x04;
bits++;
new_stop = 1;
}
if (cflag & PARENB) {
- cval |= UART_LCR_PARITY;
bits++;
new_parity_enable = 1;
- }
- if (cflag & PARODD) {
- cval |= UART_LCR_EPAR;
- new_parity = 1;
- }
- if (cflag & IGNPAR) {
- cval &= ~UART_LCR_PARITY;
- new_parity_enable = 0;
+ if (cflag & PARODD)
+ new_parity = 1;
}
baud = uart_get_baud_rate(the_port, new_termios, old_termios,
MIN_BAUD_SUPPORTED, MAX_BAUD_SUPPORTED);
@@ -1771,10 +1758,12 @@ ioc4_change_speed(struct uart_port *the_port,
if (cflag & CRTSCTS) {
info->flags |= ASYNC_CTS_FLOW;
port->ip_sscr |= IOC4_SSCR_HFC_EN;
- writel(port->ip_sscr, &port->ip_serial_regs->sscr);
}
- else
+ else {
info->flags &= ~ASYNC_CTS_FLOW;
+ port->ip_sscr &= ~IOC4_SSCR_HFC_EN;
+ }
+ writel(port->ip_sscr, &port->ip_serial_regs->sscr);
/* Set the configuration and proper notification call */
DPRINT_CONFIG(("%s : port 0x%p cflag 0%o "
@@ -1847,7 +1836,6 @@ static void ioc4_cb_output_lowat(struct ioc4_port *port)
}
}
-
/**
* handle_intr - service any interrupts for the given port - 2nd level
* called via sd_intr