cp210x.c (cdc32fd6f7b2b2580d7f1b74563f888e4dd9eb8a) cp210x.c (d1620ca9e7bb0030068c3b45b653defde8839dac)
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.

--- 380 unchanged lines hidden (view full) ---

389 else if (baud <= 129347) baud = 128000;
390 else if (baud <= 156868) baud = 153600;
391 else if (baud <= 237832) baud = 230400;
392 else if (baud <= 254234) baud = 250000;
393 else if (baud <= 273066) baud = 256000;
394 else if (baud <= 491520) baud = 460800;
395 else if (baud <= 567138) baud = 500000;
396 else if (baud <= 670254) baud = 576000;
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.

--- 380 unchanged lines hidden (view full) ---

389 else if (baud <= 129347) baud = 128000;
390 else if (baud <= 156868) baud = 153600;
391 else if (baud <= 237832) baud = 230400;
392 else if (baud <= 254234) baud = 250000;
393 else if (baud <= 273066) baud = 256000;
394 else if (baud <= 491520) baud = 460800;
395 else if (baud <= 567138) baud = 500000;
396 else if (baud <= 670254) baud = 576000;
397 else if (baud <= 1053257) baud = 921600;
398 else if (baud <= 1474560) baud = 1228800;
399 else if (baud <= 2457600) baud = 1843200;
400 else baud = 3686400;
397 else if (baud < 1000000)
398 baud = 921600;
399 else if (baud > 2000000)
400 baud = 2000000;
401 return baud;
402}
403
404static int cp210x_open(struct tty_struct *tty, struct usb_serial_port *port)
405{
406 int result;
407
408 dbg("%s - port %d", __func__, port->number);

--- 201 unchanged lines hidden (view full) ---

610 */
611static void cp210x_change_speed(struct tty_struct *tty,
612 struct usb_serial_port *port, struct ktermios *old_termios)
613{
614 u32 baud;
615
616 baud = tty->termios->c_ospeed;
617
401 return baud;
402}
403
404static int cp210x_open(struct tty_struct *tty, struct usb_serial_port *port)
405{
406 int result;
407
408 dbg("%s - port %d", __func__, port->number);

--- 201 unchanged lines hidden (view full) ---

610 */
611static void cp210x_change_speed(struct tty_struct *tty,
612 struct usb_serial_port *port, struct ktermios *old_termios)
613{
614 u32 baud;
615
616 baud = tty->termios->c_ospeed;
617
618 /* This maps the requested rate to a rate valid on cp2102 or cp2103.
618 /* This maps the requested rate to a rate valid on cp2102 or cp2103,
619 * or to an arbitrary rate in [1M,2M].
619 *
620 * NOTE: B0 is not implemented.
621 */
622 baud = cp210x_quantise_baudrate(baud);
623
624 dbg("%s - setting baud rate to %u", __func__, baud);
625 if (cp210x_set_config(port, CP210X_SET_BAUDRATE, &baud,
626 sizeof(baud))) {

--- 258 unchanged lines hidden ---
620 *
621 * NOTE: B0 is not implemented.
622 */
623 baud = cp210x_quantise_baudrate(baud);
624
625 dbg("%s - setting baud rate to %u", __func__, baud);
626 if (cp210x_set_config(port, CP210X_SET_BAUDRATE, &baud,
627 sizeof(baud))) {

--- 258 unchanged lines hidden ---