aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/serial/msm_serial.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/serial/msm_serial.c')
-rw-r--r--drivers/serial/msm_serial.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/serial/msm_serial.c b/drivers/serial/msm_serial.c
index 1a7c856f76f8..698048f64f5e 100644
--- a/drivers/serial/msm_serial.c
+++ b/drivers/serial/msm_serial.c
@@ -229,7 +229,7 @@ static void msm_break_ctl(struct uart_port *port, int break_ctl)
229 msm_write(port, UART_CR_CMD_STOP_BREAK, UART_CR); 229 msm_write(port, UART_CR_CMD_STOP_BREAK, UART_CR);
230} 230}
231 231
232static void msm_set_baud_rate(struct uart_port *port, unsigned int baud) 232static int msm_set_baud_rate(struct uart_port *port, unsigned int baud)
233{ 233{
234 unsigned int baud_code, rxstale, watermark; 234 unsigned int baud_code, rxstale, watermark;
235 235
@@ -281,6 +281,7 @@ static void msm_set_baud_rate(struct uart_port *port, unsigned int baud)
281 case 115200: 281 case 115200:
282 default: 282 default:
283 baud_code = UART_CSR_115200; 283 baud_code = UART_CSR_115200;
284 baud = 115200;
284 rxstale = 31; 285 rxstale = 31;
285 break; 286 break;
286 } 287 }
@@ -299,6 +300,8 @@ static void msm_set_baud_rate(struct uart_port *port, unsigned int baud)
299 300
300 /* set TX watermark */ 301 /* set TX watermark */
301 msm_write(port, 10, UART_TFWR); 302 msm_write(port, 10, UART_TFWR);
303
304 return baud;
302} 305}
303 306
304static void msm_reset(struct uart_port *port) 307static void msm_reset(struct uart_port *port)
@@ -395,8 +398,10 @@ static void msm_set_termios(struct uart_port *port, struct ktermios *termios,
395 398
396 /* calculate and set baud rate */ 399 /* calculate and set baud rate */
397 baud = uart_get_baud_rate(port, termios, old, 300, 115200); 400 baud = uart_get_baud_rate(port, termios, old, 300, 115200);
398 msm_set_baud_rate(port, baud); 401 baud = msm_set_baud_rate(port, baud);
399 402 if (tty_termios_baud_rate(termios))
403 tty_termios_encode_baud_rate(termios, baud, baud);
404
400 /* calculate parity */ 405 /* calculate parity */
401 mr = msm_read(port, UART_MR2); 406 mr = msm_read(port, UART_MR2);
402 mr &= ~UART_MR2_PARITY_MODE; 407 mr &= ~UART_MR2_PARITY_MODE;