aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/serial')
-rw-r--r--drivers/serial/8250.c23
-rw-r--r--drivers/serial/pxa.c5
-rw-r--r--drivers/serial/serial_ks8695.c61
3 files changed, 72 insertions, 17 deletions
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index 9ccc563d8730..8058533f8418 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -2211,9 +2211,9 @@ serial8250_set_termios(struct uart_port *port, struct ktermios *termios,
2211 serial_outp(up, UART_EFR, efr); 2211 serial_outp(up, UART_EFR, efr);
2212 } 2212 }
2213 2213
2214#ifdef CONFIG_ARCH_OMAP15XX 2214#ifdef CONFIG_ARCH_OMAP
2215 /* Workaround to enable 115200 baud on OMAP1510 internal ports */ 2215 /* Workaround to enable 115200 baud on OMAP1510 internal ports */
2216 if (cpu_is_omap1510() && is_omap_port((unsigned int)up->port.membase)) { 2216 if (cpu_is_omap1510() && is_omap_port(up)) {
2217 if (baud == 115200) { 2217 if (baud == 115200) {
2218 quot = 1; 2218 quot = 1;
2219 serial_out(up, UART_OMAP_OSC_12M_SEL, 1); 2219 serial_out(up, UART_OMAP_OSC_12M_SEL, 1);
@@ -2266,18 +2266,27 @@ serial8250_pm(struct uart_port *port, unsigned int state,
2266 p->pm(port, state, oldstate); 2266 p->pm(port, state, oldstate);
2267} 2267}
2268 2268
2269static unsigned int serial8250_port_size(struct uart_8250_port *pt)
2270{
2271 if (pt->port.iotype == UPIO_AU)
2272 return 0x100000;
2273#ifdef CONFIG_ARCH_OMAP
2274 if (is_omap_port(pt))
2275 return 0x16 << pt->port.regshift;
2276#endif
2277 return 8 << pt->port.regshift;
2278}
2279
2269/* 2280/*
2270 * Resource handling. 2281 * Resource handling.
2271 */ 2282 */
2272static int serial8250_request_std_resource(struct uart_8250_port *up) 2283static int serial8250_request_std_resource(struct uart_8250_port *up)
2273{ 2284{
2274 unsigned int size = 8 << up->port.regshift; 2285 unsigned int size = serial8250_port_size(up);
2275 int ret = 0; 2286 int ret = 0;
2276 2287
2277 switch (up->port.iotype) { 2288 switch (up->port.iotype) {
2278 case UPIO_AU: 2289 case UPIO_AU:
2279 size = 0x100000;
2280 /* fall thru */
2281 case UPIO_TSI: 2290 case UPIO_TSI:
2282 case UPIO_MEM32: 2291 case UPIO_MEM32:
2283 case UPIO_MEM: 2292 case UPIO_MEM:
@@ -2311,12 +2320,10 @@ static int serial8250_request_std_resource(struct uart_8250_port *up)
2311 2320
2312static void serial8250_release_std_resource(struct uart_8250_port *up) 2321static void serial8250_release_std_resource(struct uart_8250_port *up)
2313{ 2322{
2314 unsigned int size = 8 << up->port.regshift; 2323 unsigned int size = serial8250_port_size(up);
2315 2324
2316 switch (up->port.iotype) { 2325 switch (up->port.iotype) {
2317 case UPIO_AU: 2326 case UPIO_AU:
2318 size = 0x100000;
2319 /* fall thru */
2320 case UPIO_TSI: 2327 case UPIO_TSI:
2321 case UPIO_MEM32: 2328 case UPIO_MEM32:
2322 case UPIO_MEM: 2329 case UPIO_MEM:
diff --git a/drivers/serial/pxa.c b/drivers/serial/pxa.c
index f7a0d37c4221..abc00be55433 100644
--- a/drivers/serial/pxa.c
+++ b/drivers/serial/pxa.c
@@ -534,6 +534,11 @@ serial_pxa_set_termios(struct uart_port *port, struct ktermios *termios,
534 534
535 serial_out(up, UART_IER, up->ier); 535 serial_out(up, UART_IER, up->ier);
536 536
537 if (termios->c_cflag & CRTSCTS)
538 up->mcr |= UART_MCR_AFE;
539 else
540 up->mcr &= ~UART_MCR_AFE;
541
537 serial_out(up, UART_LCR, cval | UART_LCR_DLAB);/* set DLAB */ 542 serial_out(up, UART_LCR, cval | UART_LCR_DLAB);/* set DLAB */
538 serial_out(up, UART_DLL, quot & 0xff); /* LS of divisor */ 543 serial_out(up, UART_DLL, quot & 0xff); /* LS of divisor */
539 serial_out(up, UART_DLM, quot >> 8); /* MS of divisor */ 544 serial_out(up, UART_DLM, quot >> 8); /* MS of divisor */
diff --git a/drivers/serial/serial_ks8695.c b/drivers/serial/serial_ks8695.c
index b9cbfc87f616..998e89dc5aaf 100644
--- a/drivers/serial/serial_ks8695.c
+++ b/drivers/serial/serial_ks8695.c
@@ -63,8 +63,44 @@
63#define UART_DUMMY_LSR_RX 0x100 63#define UART_DUMMY_LSR_RX 0x100
64#define UART_PORT_SIZE (KS8695_USR - KS8695_URRB + 4) 64#define UART_PORT_SIZE (KS8695_USR - KS8695_URRB + 4)
65 65
66#define tx_enabled(port) ((port)->unused[0]) 66static inline int tx_enabled(struct uart_port *port)
67#define rx_enabled(port) ((port)->unused[1]) 67{
68 return port->unused[0] & 1;
69}
70
71static inline int rx_enabled(struct uart_port *port)
72{
73 return port->unused[0] & 2;
74}
75
76static inline int ms_enabled(struct uart_port *port)
77{
78 return port->unused[0] & 4;
79}
80
81static inline void ms_enable(struct uart_port *port, int enabled)
82{
83 if(enabled)
84 port->unused[0] |= 4;
85 else
86 port->unused[0] &= ~4;
87}
88
89static inline void rx_enable(struct uart_port *port, int enabled)
90{
91 if(enabled)
92 port->unused[0] |= 2;
93 else
94 port->unused[0] &= ~2;
95}
96
97static inline void tx_enable(struct uart_port *port, int enabled)
98{
99 if(enabled)
100 port->unused[0] |= 1;
101 else
102 port->unused[0] &= ~1;
103}
68 104
69 105
70#ifdef SUPPORT_SYSRQ 106#ifdef SUPPORT_SYSRQ
@@ -75,7 +111,7 @@ static void ks8695uart_stop_tx(struct uart_port *port)
75{ 111{
76 if (tx_enabled(port)) { 112 if (tx_enabled(port)) {
77 disable_irq(KS8695_IRQ_UART_TX); 113 disable_irq(KS8695_IRQ_UART_TX);
78 tx_enabled(port) = 0; 114 tx_enable(port, 0);
79 } 115 }
80} 116}
81 117
@@ -83,7 +119,7 @@ static void ks8695uart_start_tx(struct uart_port *port)
83{ 119{
84 if (!tx_enabled(port)) { 120 if (!tx_enabled(port)) {
85 enable_irq(KS8695_IRQ_UART_TX); 121 enable_irq(KS8695_IRQ_UART_TX);
86 tx_enabled(port) = 1; 122 tx_enable(port, 1);
87 } 123 }
88} 124}
89 125
@@ -91,18 +127,24 @@ static void ks8695uart_stop_rx(struct uart_port *port)
91{ 127{
92 if (rx_enabled(port)) { 128 if (rx_enabled(port)) {
93 disable_irq(KS8695_IRQ_UART_RX); 129 disable_irq(KS8695_IRQ_UART_RX);
94 rx_enabled(port) = 0; 130 rx_enable(port, 0);
95 } 131 }
96} 132}
97 133
98static void ks8695uart_enable_ms(struct uart_port *port) 134static void ks8695uart_enable_ms(struct uart_port *port)
99{ 135{
100 enable_irq(KS8695_IRQ_UART_MODEM_STATUS); 136 if (!ms_enabled(port)) {
137 enable_irq(KS8695_IRQ_UART_MODEM_STATUS);
138 ms_enable(port,1);
139 }
101} 140}
102 141
103static void ks8695uart_disable_ms(struct uart_port *port) 142static void ks8695uart_disable_ms(struct uart_port *port)
104{ 143{
105 disable_irq(KS8695_IRQ_UART_MODEM_STATUS); 144 if (ms_enabled(port)) {
145 disable_irq(KS8695_IRQ_UART_MODEM_STATUS);
146 ms_enable(port,0);
147 }
106} 148}
107 149
108static irqreturn_t ks8695uart_rx_chars(int irq, void *dev_id) 150static irqreturn_t ks8695uart_rx_chars(int irq, void *dev_id)
@@ -285,8 +327,9 @@ static int ks8695uart_startup(struct uart_port *port)
285 int retval; 327 int retval;
286 328
287 set_irq_flags(KS8695_IRQ_UART_TX, IRQF_VALID | IRQF_NOAUTOEN); 329 set_irq_flags(KS8695_IRQ_UART_TX, IRQF_VALID | IRQF_NOAUTOEN);
288 tx_enabled(port) = 0; 330 tx_enable(port, 0);
289 rx_enabled(port) = 1; 331 rx_enable(port, 1);
332 ms_enable(port, 1);
290 333
291 /* 334 /*
292 * Allocate the IRQ 335 * Allocate the IRQ