cp210x.c (7f482fc88ac47662228d6b1f05759797c8936a30) | cp210x.c (34b76fcaee574017862ea3fa0efdcd77a9d0e57d) |
---|---|
1/* 2 * Silicon Laboratories CP210x USB to RS232 serial adaptor driver 3 * 4 * Copyright (C) 2005 Craig Shelley (craig@microtron.org.uk) 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License version 8 * 2 as published by the Free Software Foundation. --- 566 unchanged lines hidden (view full) --- 575 576 *cflagp = cflag; 577} 578 579static void cp210x_set_termios(struct tty_struct *tty, 580 struct usb_serial_port *port, struct ktermios *old_termios) 581{ 582 unsigned int cflag, old_cflag; | 1/* 2 * Silicon Laboratories CP210x USB to RS232 serial adaptor driver 3 * 4 * Copyright (C) 2005 Craig Shelley (craig@microtron.org.uk) 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License version 8 * 2 as published by the Free Software Foundation. --- 566 unchanged lines hidden (view full) --- 575 576 *cflagp = cflag; 577} 578 579static void cp210x_set_termios(struct tty_struct *tty, 580 struct usb_serial_port *port, struct ktermios *old_termios) 581{ 582 unsigned int cflag, old_cflag; |
583 unsigned int baud = 0, bits; | 583 u32 baud; 584 unsigned int bits; |
584 unsigned int modem_ctl[4]; 585 586 dbg("%s - port %d", __func__, port->number); 587 588 if (!tty) 589 return; 590 591 cflag = tty->termios->c_cflag; 592 old_cflag = old_termios->c_cflag; 593 baud = cp210x_quantise_baudrate(tty_get_baud_rate(tty)); 594 595 /* If the baud rate is to be updated*/ 596 if (baud != tty_termios_baud_rate(old_termios) && baud != 0) { 597 dbg("%s - Setting baud rate to %d baud", __func__, 598 baud); | 585 unsigned int modem_ctl[4]; 586 587 dbg("%s - port %d", __func__, port->number); 588 589 if (!tty) 590 return; 591 592 cflag = tty->termios->c_cflag; 593 old_cflag = old_termios->c_cflag; 594 baud = cp210x_quantise_baudrate(tty_get_baud_rate(tty)); 595 596 /* If the baud rate is to be updated*/ 597 if (baud != tty_termios_baud_rate(old_termios) && baud != 0) { 598 dbg("%s - Setting baud rate to %d baud", __func__, 599 baud); |
599 if (cp210x_set_config(port, CP210X_SET_BAUDRATE, &baud, 4)) { | 600 if (cp210x_set_config(port, CP210X_SET_BAUDRATE, &baud, sizeof(baud))) { |
600 dbg("Baud rate requested not supported by device"); 601 baud = tty_termios_baud_rate(old_termios); 602 } 603 } 604 /* Report back the resulting baud rate */ 605 tty_encode_baud_rate(tty, baud, baud); 606 607 /* If the number of data bits is to be updated */ --- 229 unchanged lines hidden --- | 601 dbg("Baud rate requested not supported by device"); 602 baud = tty_termios_baud_rate(old_termios); 603 } 604 } 605 /* Report back the resulting baud rate */ 606 tty_encode_baud_rate(tty, baud, baud); 607 608 /* If the number of data bits is to be updated */ --- 229 unchanged lines hidden --- |