aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial
diff options
context:
space:
mode:
authorPatrick Gefre <pfg@sgi.com>2005-05-01 11:59:21 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-01 11:59:21 -0400
commit68985e486b708671a7c7d0b4de6d94a1547d1351 (patch)
tree93a8d63c810a1006e838718b62ed48ccd7c90b45 /drivers/serial
parent6cb2875f8d7e392982229094ad3b6d2f213f48da (diff)
[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 d3f4542616c6..d9629ee6b9b7 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,
1688{ 1688{
1689 struct ioc4_port *port = get_ioc4_port(the_port); 1689 struct ioc4_port *port = get_ioc4_port(the_port);
1690 int baud, bits; 1690 int baud, bits;
1691 unsigned cflag, cval; 1691 unsigned cflag;
1692 int new_parity = 0, new_parity_enable = 0, new_stop = 1, new_data = 8; 1692 int new_parity = 0, new_parity_enable = 0, new_stop = 0, new_data = 8;
1693 struct uart_info *info = the_port->info; 1693 struct uart_info *info = the_port->info;
1694 1694
1695 cflag = new_termios->c_cflag; 1695 cflag = new_termios->c_cflag;
@@ -1697,48 +1697,35 @@ ioc4_change_speed(struct uart_port *the_port,
1697 switch (cflag & CSIZE) { 1697 switch (cflag & CSIZE) {
1698 case CS5: 1698 case CS5:
1699 new_data = 5; 1699 new_data = 5;
1700 cval = 0x00;
1701 bits = 7; 1700 bits = 7;
1702 break; 1701 break;
1703 case CS6: 1702 case CS6:
1704 new_data = 6; 1703 new_data = 6;
1705 cval = 0x01;
1706 bits = 8; 1704 bits = 8;
1707 break; 1705 break;
1708 case CS7: 1706 case CS7:
1709 new_data = 7; 1707 new_data = 7;
1710 cval = 0x02;
1711 bits = 9; 1708 bits = 9;
1712 break; 1709 break;
1713 case CS8: 1710 case CS8:
1714 new_data = 8; 1711 new_data = 8;
1715 cval = 0x03;
1716 bits = 10; 1712 bits = 10;
1717 break; 1713 break;
1718 default: 1714 default:
1719 /* cuz we always need a default ... */ 1715 /* cuz we always need a default ... */
1720 new_data = 5; 1716 new_data = 5;
1721 cval = 0x00;
1722 bits = 7; 1717 bits = 7;
1723 break; 1718 break;
1724 } 1719 }
1725 if (cflag & CSTOPB) { 1720 if (cflag & CSTOPB) {
1726 cval |= 0x04;
1727 bits++; 1721 bits++;
1728 new_stop = 1; 1722 new_stop = 1;
1729 } 1723 }
1730 if (cflag & PARENB) { 1724 if (cflag & PARENB) {
1731 cval |= UART_LCR_PARITY;
1732 bits++; 1725 bits++;
1733 new_parity_enable = 1; 1726 new_parity_enable = 1;
1734 } 1727 if (cflag & PARODD)
1735 if (cflag & PARODD) { 1728 new_parity = 1;
1736 cval |= UART_LCR_EPAR;
1737 new_parity = 1;
1738 }
1739 if (cflag & IGNPAR) {
1740 cval &= ~UART_LCR_PARITY;
1741 new_parity_enable = 0;
1742 } 1729 }
1743 baud = uart_get_baud_rate(the_port, new_termios, old_termios, 1730 baud = uart_get_baud_rate(the_port, new_termios, old_termios,
1744 MIN_BAUD_SUPPORTED, MAX_BAUD_SUPPORTED); 1731 MIN_BAUD_SUPPORTED, MAX_BAUD_SUPPORTED);
@@ -1771,10 +1758,12 @@ ioc4_change_speed(struct uart_port *the_port,
1771 if (cflag & CRTSCTS) { 1758 if (cflag & CRTSCTS) {
1772 info->flags |= ASYNC_CTS_FLOW; 1759 info->flags |= ASYNC_CTS_FLOW;
1773 port->ip_sscr |= IOC4_SSCR_HFC_EN; 1760 port->ip_sscr |= IOC4_SSCR_HFC_EN;
1774 writel(port->ip_sscr, &port->ip_serial_regs->sscr);
1775 } 1761 }
1776 else 1762 else {
1777 info->flags &= ~ASYNC_CTS_FLOW; 1763 info->flags &= ~ASYNC_CTS_FLOW;
1764 port->ip_sscr &= ~IOC4_SSCR_HFC_EN;
1765 }
1766 writel(port->ip_sscr, &port->ip_serial_regs->sscr);
1778 1767
1779 /* Set the configuration and proper notification call */ 1768 /* Set the configuration and proper notification call */
1780 DPRINT_CONFIG(("%s : port 0x%p cflag 0%o " 1769 DPRINT_CONFIG(("%s : port 0x%p cflag 0%o "
@@ -1847,7 +1836,6 @@ static void ioc4_cb_output_lowat(struct ioc4_port *port)
1847 } 1836 }
1848} 1837}
1849 1838
1850
1851/** 1839/**
1852 * handle_intr - service any interrupts for the given port - 2nd level 1840 * handle_intr - service any interrupts for the given port - 2nd level
1853 * called via sd_intr 1841 * called via sd_intr