USB: cp210x: initialise baud rate at open
authorJohan Hovold <jhovold@gmail.com>
Sun, 15 Jan 2012 23:36:52 +0000 (00:36 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 24 Jan 2012 19:58:46 +0000 (11:58 -0800)
The newer cp2104 devices require the baud rate to be initialised after
power on. Make sure it is set when port is opened.

Signed-off-by: Johan Hovold <jhovold@gmail.com>
Cc: Preston Fick <preston.fick@silabs.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/serial/cp210x.c

index 2d2d239..5c3e859 100644 (file)
@@ -417,6 +417,10 @@ static int cp210x_open(struct tty_struct *tty, struct usb_serial_port *port)
        /* Configure the termios structure */
        cp210x_get_termios(tty, port);
 
+       /* The baud rate must be initialised on cp2104 */
+       if (tty)
+               cp210x_change_speed(tty, port, NULL);
+
        return usb_serial_generic_open(tty, port);
 }