diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-09-24 16:22:33 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-09-24 16:22:33 -0400 |
commit | baea7b946f00a291b166ccae7fcfed6c01530cc6 (patch) | |
tree | 4aa275fbdbec9c7b9b4629e8bee2bbecd3c6a6af /drivers/usb/serial/spcp8x5.c | |
parent | ae19ffbadc1b2100285a5b5b3d0a4e0a11390904 (diff) | |
parent | 94e0fb086fc5663c38bbc0fe86d698be8314f82f (diff) |
Merge branch 'origin' into for-linus
Conflicts:
MAINTAINERS
Diffstat (limited to 'drivers/usb/serial/spcp8x5.c')
-rw-r--r-- | drivers/usb/serial/spcp8x5.c | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/drivers/usb/serial/spcp8x5.c b/drivers/usb/serial/spcp8x5.c index 3c249d8e8b8e..1e58220403d1 100644 --- a/drivers/usb/serial/spcp8x5.c +++ b/drivers/usb/serial/spcp8x5.c | |||
@@ -299,7 +299,6 @@ struct spcp8x5_private { | |||
299 | wait_queue_head_t delta_msr_wait; | 299 | wait_queue_head_t delta_msr_wait; |
300 | u8 line_control; | 300 | u8 line_control; |
301 | u8 line_status; | 301 | u8 line_status; |
302 | u8 termios_initialized; | ||
303 | }; | 302 | }; |
304 | 303 | ||
305 | /* desc : when device plug in,this function would be called. | 304 | /* desc : when device plug in,this function would be called. |
@@ -498,6 +497,15 @@ static void spcp8x5_close(struct usb_serial_port *port) | |||
498 | dev_dbg(&port->dev, "usb_unlink_urb(read_urb) = %d\n", result); | 497 | dev_dbg(&port->dev, "usb_unlink_urb(read_urb) = %d\n", result); |
499 | } | 498 | } |
500 | 499 | ||
500 | static void spcp8x5_init_termios(struct tty_struct *tty) | ||
501 | { | ||
502 | /* for the 1st time call this function */ | ||
503 | *(tty->termios) = tty_std_termios; | ||
504 | tty->termios->c_cflag = B115200 | CS8 | CREAD | HUPCL | CLOCAL; | ||
505 | tty->termios->c_ispeed = 115200; | ||
506 | tty->termios->c_ospeed = 115200; | ||
507 | } | ||
508 | |||
501 | /* set the serial param for transfer. we should check if we really need to | 509 | /* set the serial param for transfer. we should check if we really need to |
502 | * transfer. if we set flow control we should do this too. */ | 510 | * transfer. if we set flow control we should do this too. */ |
503 | static void spcp8x5_set_termios(struct tty_struct *tty, | 511 | static void spcp8x5_set_termios(struct tty_struct *tty, |
@@ -514,16 +522,6 @@ static void spcp8x5_set_termios(struct tty_struct *tty, | |||
514 | int i; | 522 | int i; |
515 | u8 control; | 523 | u8 control; |
516 | 524 | ||
517 | /* for the 1st time call this function */ | ||
518 | spin_lock_irqsave(&priv->lock, flags); | ||
519 | if (!priv->termios_initialized) { | ||
520 | *(tty->termios) = tty_std_termios; | ||
521 | tty->termios->c_cflag = B115200 | CS8 | CREAD | HUPCL | CLOCAL; | ||
522 | tty->termios->c_ispeed = 115200; | ||
523 | tty->termios->c_ospeed = 115200; | ||
524 | priv->termios_initialized = 1; | ||
525 | } | ||
526 | spin_unlock_irqrestore(&priv->lock, flags); | ||
527 | 525 | ||
528 | /* check that they really want us to change something */ | 526 | /* check that they really want us to change something */ |
529 | if (!tty_termios_hw_change(tty->termios, old_termios)) | 527 | if (!tty_termios_hw_change(tty->termios, old_termios)) |
@@ -546,7 +544,7 @@ static void spcp8x5_set_termios(struct tty_struct *tty, | |||
546 | } | 544 | } |
547 | 545 | ||
548 | /* Set Baud Rate */ | 546 | /* Set Baud Rate */ |
549 | baud = tty_get_baud_rate(tty);; | 547 | baud = tty_get_baud_rate(tty); |
550 | switch (baud) { | 548 | switch (baud) { |
551 | case 300: buf[0] = 0x00; break; | 549 | case 300: buf[0] = 0x00; break; |
552 | case 600: buf[0] = 0x01; break; | 550 | case 600: buf[0] = 0x01; break; |
@@ -623,8 +621,7 @@ static void spcp8x5_set_termios(struct tty_struct *tty, | |||
623 | 621 | ||
624 | /* open the serial port. do some usb system call. set termios and get the line | 622 | /* open the serial port. do some usb system call. set termios and get the line |
625 | * status of the device. then submit the read urb */ | 623 | * status of the device. then submit the read urb */ |
626 | static int spcp8x5_open(struct tty_struct *tty, | 624 | static int spcp8x5_open(struct tty_struct *tty, struct usb_serial_port *port) |
627 | struct usb_serial_port *port, struct file *filp) | ||
628 | { | 625 | { |
629 | struct ktermios tmp_termios; | 626 | struct ktermios tmp_termios; |
630 | struct usb_serial *serial = port->serial; | 627 | struct usb_serial *serial = port->serial; |
@@ -658,8 +655,6 @@ static int spcp8x5_open(struct tty_struct *tty, | |||
658 | priv->line_status = status & 0xf0 ; | 655 | priv->line_status = status & 0xf0 ; |
659 | spin_unlock_irqrestore(&priv->lock, flags); | 656 | spin_unlock_irqrestore(&priv->lock, flags); |
660 | 657 | ||
661 | /* FIXME: need to assert RTS and DTR if CRTSCTS off */ | ||
662 | |||
663 | dbg("%s - submitting read urb", __func__); | 658 | dbg("%s - submitting read urb", __func__); |
664 | port->read_urb->dev = serial->dev; | 659 | port->read_urb->dev = serial->dev; |
665 | ret = usb_submit_urb(port->read_urb, GFP_KERNEL); | 660 | ret = usb_submit_urb(port->read_urb, GFP_KERNEL); |
@@ -1011,6 +1006,7 @@ static struct usb_serial_driver spcp8x5_device = { | |||
1011 | .carrier_raised = spcp8x5_carrier_raised, | 1006 | .carrier_raised = spcp8x5_carrier_raised, |
1012 | .write = spcp8x5_write, | 1007 | .write = spcp8x5_write, |
1013 | .set_termios = spcp8x5_set_termios, | 1008 | .set_termios = spcp8x5_set_termios, |
1009 | .init_termios = spcp8x5_init_termios, | ||
1014 | .ioctl = spcp8x5_ioctl, | 1010 | .ioctl = spcp8x5_ioctl, |
1015 | .tiocmget = spcp8x5_tiocmget, | 1011 | .tiocmget = spcp8x5_tiocmget, |
1016 | .tiocmset = spcp8x5_tiocmset, | 1012 | .tiocmset = spcp8x5_tiocmset, |