USB: empeg: clean up and handle speeds
The empeg is pretty fixed. Tidy up the long foo->bar->baz stuff and encode the fixed speed properly. Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
7fa36a994c
commit
998e863871
@@ -449,14 +449,9 @@ static int empeg_ioctl (struct usb_serial_port *port, struct file * file, unsign
|
|||||||
|
|
||||||
static void empeg_set_termios (struct usb_serial_port *port, struct ktermios *old_termios)
|
static void empeg_set_termios (struct usb_serial_port *port, struct ktermios *old_termios)
|
||||||
{
|
{
|
||||||
|
struct ktermios *termios = port->tty->termios;
|
||||||
dbg("%s - port %d", __FUNCTION__, port->number);
|
dbg("%s - port %d", __FUNCTION__, port->number);
|
||||||
|
|
||||||
if ((!port->tty) || (!port->tty->termios)) {
|
|
||||||
dbg("%s - no tty structures", __FUNCTION__);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The empeg-car player wants these particular tty settings.
|
* The empeg-car player wants these particular tty settings.
|
||||||
* You could, for example, change the baud rate, however the
|
* You could, for example, change the baud rate, however the
|
||||||
@@ -466,7 +461,7 @@ static void empeg_set_termios (struct usb_serial_port *port, struct ktermios *ol
|
|||||||
*
|
*
|
||||||
* The default requirements for this device are:
|
* The default requirements for this device are:
|
||||||
*/
|
*/
|
||||||
port->tty->termios->c_iflag
|
termios->c_iflag
|
||||||
&= ~(IGNBRK /* disable ignore break */
|
&= ~(IGNBRK /* disable ignore break */
|
||||||
| BRKINT /* disable break causes interrupt */
|
| BRKINT /* disable break causes interrupt */
|
||||||
| PARMRK /* disable mark parity errors */
|
| PARMRK /* disable mark parity errors */
|
||||||
@@ -476,24 +471,23 @@ static void empeg_set_termios (struct usb_serial_port *port, struct ktermios *ol
|
|||||||
| ICRNL /* disable translate CR to NL */
|
| ICRNL /* disable translate CR to NL */
|
||||||
| IXON); /* disable enable XON/XOFF flow control */
|
| IXON); /* disable enable XON/XOFF flow control */
|
||||||
|
|
||||||
port->tty->termios->c_oflag
|
termios->c_oflag
|
||||||
&= ~OPOST; /* disable postprocess output characters */
|
&= ~OPOST; /* disable postprocess output characters */
|
||||||
|
|
||||||
port->tty->termios->c_lflag
|
termios->c_lflag
|
||||||
&= ~(ECHO /* disable echo input characters */
|
&= ~(ECHO /* disable echo input characters */
|
||||||
| ECHONL /* disable echo new line */
|
| ECHONL /* disable echo new line */
|
||||||
| ICANON /* disable erase, kill, werase, and rprnt special characters */
|
| ICANON /* disable erase, kill, werase, and rprnt special characters */
|
||||||
| ISIG /* disable interrupt, quit, and suspend special characters */
|
| ISIG /* disable interrupt, quit, and suspend special characters */
|
||||||
| IEXTEN); /* disable non-POSIX special characters */
|
| IEXTEN); /* disable non-POSIX special characters */
|
||||||
|
|
||||||
port->tty->termios->c_cflag
|
termios->c_cflag
|
||||||
&= ~(CSIZE /* no size */
|
&= ~(CSIZE /* no size */
|
||||||
| PARENB /* disable parity bit */
|
| PARENB /* disable parity bit */
|
||||||
| CBAUD); /* clear current baud rate */
|
| CBAUD); /* clear current baud rate */
|
||||||
|
|
||||||
port->tty->termios->c_cflag
|
termios->c_cflag
|
||||||
|= (CS8 /* character size 8 bits */
|
|= CS8; /* character size 8 bits */
|
||||||
| B115200); /* baud rate 115200 */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Force low_latency on; otherwise the pushes are scheduled;
|
* Force low_latency on; otherwise the pushes are scheduled;
|
||||||
@@ -501,8 +495,7 @@ static void empeg_set_termios (struct usb_serial_port *port, struct ktermios *ol
|
|||||||
* on the floor. We don't want to drop bytes on the floor. :)
|
* on the floor. We don't want to drop bytes on the floor. :)
|
||||||
*/
|
*/
|
||||||
port->tty->low_latency = 1;
|
port->tty->low_latency = 1;
|
||||||
|
tty_encode_baud_rate(port->tty, 115200, 115200);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user