aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2007-07-26 13:54:12 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-07-30 16:27:45 -0400
commit01e96d282a062f09923fea33e1039719925d09b8 (patch)
tree6c1476c113dc8ce3dc8fc5dde0ca912ce68309c7 /drivers
parent67f5dde3d4961032aeeecaf0d1c7a9232bef3f44 (diff)
cp2101: Remove broken termios optimisation, use proper speed API
I've also enabled the commented out support for 7200, 14400, 55854, 127117 and 3686400 baud as you can now set such rates in the kernel. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/serial/cp2101.c69
1 files changed, 27 insertions, 42 deletions
diff --git a/drivers/usb/serial/cp2101.c b/drivers/usb/serial/cp2101.c
index e831cb7f64fd..33f6ee50b8d3 100644
--- a/drivers/usb/serial/cp2101.c
+++ b/drivers/usb/serial/cp2101.c
@@ -356,7 +356,7 @@ static void cp2101_get_termios (struct usb_serial_port *port)
356 356
357 dbg("%s - port %d", __FUNCTION__, port->number); 357 dbg("%s - port %d", __FUNCTION__, port->number);
358 358
359 if ((!port->tty) || (!port->tty->termios)) { 359 if (!port->tty || !port->tty->termios) {
360 dbg("%s - no tty structures", __FUNCTION__); 360 dbg("%s - no tty structures", __FUNCTION__);
361 return; 361 return;
362 } 362 }
@@ -526,50 +526,35 @@ static void cp2101_set_termios (struct usb_serial_port *port,
526 return; 526 return;
527 } 527 }
528 cflag = port->tty->termios->c_cflag; 528 cflag = port->tty->termios->c_cflag;
529 529 old_cflag = old_termios->c_cflag;
530 /* Check that they really want us to change something */ 530 baud = tty_get_baud_rate(port->tty);
531 if (old_termios) {
532 if ((cflag == old_termios->c_cflag) &&
533 (RELEVANT_IFLAG(port->tty->termios->c_iflag)
534 == RELEVANT_IFLAG(old_termios->c_iflag))) {
535 dbg("%s - nothing to change...", __FUNCTION__);
536 return;
537 }
538
539 old_cflag = old_termios->c_cflag;
540 }
541 531
542 /* If the baud rate is to be updated*/ 532 /* If the baud rate is to be updated*/
543 if ((cflag & CBAUD) != (old_cflag & CBAUD)) { 533 if (baud != tty_termios_baud_rate(old_termios)) {
544 switch (cflag & CBAUD) { 534 switch (baud) {
545 /* 535 case 0:
546 * The baud rates which are commented out below 536 case 600:
547 * appear to be supported by the device 537 case 1200:
548 * but are non-standard 538 case 1800:
549 */ 539 case 2400:
550 case B0: baud = 0; break; 540 case 4800:
551 case B600: baud = 600; break; 541 case 7200:
552 case B1200: baud = 1200; break; 542 case 9600:
553 case B1800: baud = 1800; break; 543 case 14400:
554 case B2400: baud = 2400; break; 544 case 19200:
555 case B4800: baud = 4800; break; 545 case 28800:
556 /*case B7200: baud = 7200; break;*/ 546 case 38400:
557 case B9600: baud = 9600; break; 547 case 55854:
558 /*ase B14400: baud = 14400; break;*/ 548 case 57600:
559 case B19200: baud = 19200; break; 549 case 115200:
560 /*case B28800: baud = 28800; break;*/ 550 case 127117:
561 case B38400: baud = 38400; break; 551 case 230400:
562 /*case B55854: baud = 55054; break;*/ 552 case 460800:
563 case B57600: baud = 57600; break; 553 case 921600:
564 case B115200: baud = 115200; break; 554 case 3686400:
565 /*case B127117: baud = 127117; break;*/ 555 break;
566 case B230400: baud = 230400; break;
567 case B460800: baud = 460800; break;
568 case B921600: baud = 921600; break;
569 /*case B3686400: baud = 3686400; break;*/
570 default: 556 default:
571 dev_err(&port->dev, "cp2101 driver does not " 557 baud = 9600;
572 "support the baudrate requested\n");
573 break; 558 break;
574 } 559 }
575 560