Commit 68985e48 authored by Patrick Gefre's avatar Patrick Gefre Committed by Linus Torvalds

[PATCH] Altix ioc4 serial - small uart setup mods

Small mods for setting up the uart - parity, flow control
Signed-off-by: default avatarPatrick Gefre <pfg@sgi.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 6cb2875f
...@@ -1688,8 +1688,8 @@ ioc4_change_speed(struct uart_port *the_port, ...@@ -1688,8 +1688,8 @@ ioc4_change_speed(struct uart_port *the_port,
{ {
struct ioc4_port *port = get_ioc4_port(the_port); struct ioc4_port *port = get_ioc4_port(the_port);
int baud, bits; int baud, bits;
unsigned cflag, cval; unsigned cflag;
int new_parity = 0, new_parity_enable = 0, new_stop = 1, new_data = 8; int new_parity = 0, new_parity_enable = 0, new_stop = 0, new_data = 8;
struct uart_info *info = the_port->info; struct uart_info *info = the_port->info;
cflag = new_termios->c_cflag; cflag = new_termios->c_cflag;
...@@ -1697,49 +1697,36 @@ ioc4_change_speed(struct uart_port *the_port, ...@@ -1697,49 +1697,36 @@ ioc4_change_speed(struct uart_port *the_port,
switch (cflag & CSIZE) { switch (cflag & CSIZE) {
case CS5: case CS5:
new_data = 5; new_data = 5;
cval = 0x00;
bits = 7; bits = 7;
break; break;
case CS6: case CS6:
new_data = 6; new_data = 6;
cval = 0x01;
bits = 8; bits = 8;
break; break;
case CS7: case CS7:
new_data = 7; new_data = 7;
cval = 0x02;
bits = 9; bits = 9;
break; break;
case CS8: case CS8:
new_data = 8; new_data = 8;
cval = 0x03;
bits = 10; bits = 10;
break; break;
default: default:
/* cuz we always need a default ... */ /* cuz we always need a default ... */
new_data = 5; new_data = 5;
cval = 0x00;
bits = 7; bits = 7;
break; break;
} }
if (cflag & CSTOPB) { if (cflag & CSTOPB) {
cval |= 0x04;
bits++; bits++;
new_stop = 1; new_stop = 1;
} }
if (cflag & PARENB) { if (cflag & PARENB) {
cval |= UART_LCR_PARITY;
bits++; bits++;
new_parity_enable = 1; new_parity_enable = 1;
} if (cflag & PARODD)
if (cflag & PARODD) {
cval |= UART_LCR_EPAR;
new_parity = 1; new_parity = 1;
} }
if (cflag & IGNPAR) {
cval &= ~UART_LCR_PARITY;
new_parity_enable = 0;
}
baud = uart_get_baud_rate(the_port, new_termios, old_termios, baud = uart_get_baud_rate(the_port, new_termios, old_termios,
MIN_BAUD_SUPPORTED, MAX_BAUD_SUPPORTED); MIN_BAUD_SUPPORTED, MAX_BAUD_SUPPORTED);
DPRINT_CONFIG(("%s: returned baud %d\n", __FUNCTION__, baud)); DPRINT_CONFIG(("%s: returned baud %d\n", __FUNCTION__, baud));
...@@ -1771,10 +1758,12 @@ ioc4_change_speed(struct uart_port *the_port, ...@@ -1771,10 +1758,12 @@ ioc4_change_speed(struct uart_port *the_port,
if (cflag & CRTSCTS) { if (cflag & CRTSCTS) {
info->flags |= ASYNC_CTS_FLOW; info->flags |= ASYNC_CTS_FLOW;
port->ip_sscr |= IOC4_SSCR_HFC_EN; port->ip_sscr |= IOC4_SSCR_HFC_EN;
writel(port->ip_sscr, &port->ip_serial_regs->sscr);
} }
else else {
info->flags &= ~ASYNC_CTS_FLOW; 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 */ /* Set the configuration and proper notification call */
DPRINT_CONFIG(("%s : port 0x%p cflag 0%o " DPRINT_CONFIG(("%s : port 0x%p cflag 0%o "
...@@ -1847,7 +1836,6 @@ static void ioc4_cb_output_lowat(struct ioc4_port *port) ...@@ -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 * handle_intr - service any interrupts for the given port - 2nd level
* called via sd_intr * called via sd_intr
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment