diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-08-06 12:48:31 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-08-06 12:48:31 -0400 |
commit | c87985a3ce723995fc7b25e598238d67154108a1 (patch) | |
tree | e60def1b77c25c1d74180f62e8a5603f9826f209 /drivers/usb/serial/keyspan.c | |
parent | d155255a344c417acad74156654295a2964e6b81 (diff) | |
parent | 0d7614f09c1ebdbaa1599a5aba7593f147bf96ee (diff) |
Merge tty-next into 3.6-rc1
This handles the merge issue in:
arch/um/drivers/line.c
arch/um/drivers/line.h
And resolves the duplicate patches that were in both trees do to the
tty-next branch not getting merged into 3.6-rc1.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial/keyspan.c')
-rw-r--r-- | drivers/usb/serial/keyspan.c | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c index 6225199119c0..7bcbb47e1449 100644 --- a/drivers/usb/serial/keyspan.c +++ b/drivers/usb/serial/keyspan.c | |||
@@ -176,7 +176,7 @@ static void keyspan_set_termios(struct tty_struct *tty, | |||
176 | tty_encode_baud_rate(tty, baud_rate, baud_rate); | 176 | tty_encode_baud_rate(tty, baud_rate, baud_rate); |
177 | /* set CTS/RTS handshake etc. */ | 177 | /* set CTS/RTS handshake etc. */ |
178 | p_priv->cflag = cflag; | 178 | p_priv->cflag = cflag; |
179 | p_priv->flow_control = (cflag & CRTSCTS)? flow_cts: flow_none; | 179 | p_priv->flow_control = (cflag & CRTSCTS) ? flow_cts : flow_none; |
180 | 180 | ||
181 | /* Mark/Space not supported */ | 181 | /* Mark/Space not supported */ |
182 | tty->termios.c_cflag &= ~CMSPAR; | 182 | tty->termios.c_cflag &= ~CMSPAR; |
@@ -474,7 +474,7 @@ static void usa28_indat_callback(struct urb *urb) | |||
474 | p_priv = usb_get_serial_port_data(port); | 474 | p_priv = usb_get_serial_port_data(port); |
475 | data = urb->transfer_buffer; | 475 | data = urb->transfer_buffer; |
476 | 476 | ||
477 | tty =tty_port_tty_get(&port->port); | 477 | tty = tty_port_tty_get(&port->port); |
478 | if (tty && urb->actual_length) { | 478 | if (tty && urb->actual_length) { |
479 | tty_insert_flip_string(tty, data, urb->actual_length); | 479 | tty_insert_flip_string(tty, data, urb->actual_length); |
480 | tty_flip_buffer_push(tty); | 480 | tty_flip_buffer_push(tty); |
@@ -557,9 +557,9 @@ static void usa28_instat_callback(struct urb *urb) | |||
557 | p_priv->dcd_state = ((msg->dcd) ? 1 : 0); | 557 | p_priv->dcd_state = ((msg->dcd) ? 1 : 0); |
558 | p_priv->ri_state = ((msg->ri) ? 1 : 0); | 558 | p_priv->ri_state = ((msg->ri) ? 1 : 0); |
559 | 559 | ||
560 | if( old_dcd_state != p_priv->dcd_state && old_dcd_state) { | 560 | if (old_dcd_state != p_priv->dcd_state && old_dcd_state) { |
561 | tty = tty_port_tty_get(&port->port); | 561 | tty = tty_port_tty_get(&port->port); |
562 | if (tty && !C_CLOCAL(tty)) | 562 | if (tty && !C_CLOCAL(tty)) |
563 | tty_hangup(tty); | 563 | tty_hangup(tty); |
564 | tty_kref_put(tty); | 564 | tty_kref_put(tty); |
565 | } | 565 | } |
@@ -1036,15 +1036,12 @@ static int keyspan_write_room(struct tty_struct *tty) | |||
1036 | static int keyspan_open(struct tty_struct *tty, struct usb_serial_port *port) | 1036 | static int keyspan_open(struct tty_struct *tty, struct usb_serial_port *port) |
1037 | { | 1037 | { |
1038 | struct keyspan_port_private *p_priv; | 1038 | struct keyspan_port_private *p_priv; |
1039 | struct keyspan_serial_private *s_priv; | ||
1040 | struct usb_serial *serial = port->serial; | ||
1041 | const struct keyspan_device_details *d_details; | 1039 | const struct keyspan_device_details *d_details; |
1042 | int i, err; | 1040 | int i, err; |
1043 | int baud_rate, device_port; | 1041 | int baud_rate, device_port; |
1044 | struct urb *urb; | 1042 | struct urb *urb; |
1045 | unsigned int cflag = 0; | 1043 | unsigned int cflag = 0; |
1046 | 1044 | ||
1047 | s_priv = usb_get_serial_data(serial); | ||
1048 | p_priv = usb_get_serial_port_data(port); | 1045 | p_priv = usb_get_serial_port_data(port); |
1049 | d_details = p_priv->device_details; | 1046 | d_details = p_priv->device_details; |
1050 | 1047 | ||
@@ -1102,7 +1099,7 @@ static int keyspan_open(struct tty_struct *tty, struct usb_serial_port *port) | |||
1102 | } | 1099 | } |
1103 | /* set CTS/RTS handshake etc. */ | 1100 | /* set CTS/RTS handshake etc. */ |
1104 | p_priv->cflag = cflag; | 1101 | p_priv->cflag = cflag; |
1105 | p_priv->flow_control = (cflag & CRTSCTS)? flow_cts: flow_none; | 1102 | p_priv->flow_control = (cflag & CRTSCTS) ? flow_cts : flow_none; |
1106 | 1103 | ||
1107 | keyspan_send_setup(port, 1); | 1104 | keyspan_send_setup(port, 1); |
1108 | /* mdelay(100); */ | 1105 | /* mdelay(100); */ |
@@ -1130,10 +1127,8 @@ static void keyspan_close(struct usb_serial_port *port) | |||
1130 | { | 1127 | { |
1131 | int i; | 1128 | int i; |
1132 | struct usb_serial *serial = port->serial; | 1129 | struct usb_serial *serial = port->serial; |
1133 | struct keyspan_serial_private *s_priv; | ||
1134 | struct keyspan_port_private *p_priv; | 1130 | struct keyspan_port_private *p_priv; |
1135 | 1131 | ||
1136 | s_priv = usb_get_serial_data(serial); | ||
1137 | p_priv = usb_get_serial_port_data(port); | 1132 | p_priv = usb_get_serial_port_data(port); |
1138 | 1133 | ||
1139 | p_priv->rts_state = 0; | 1134 | p_priv->rts_state = 0; |
@@ -1240,7 +1235,7 @@ static int keyspan_fake_startup(struct usb_serial *serial) | |||
1240 | 1235 | ||
1241 | if (request_ihex_firmware(&fw, fw_name, &serial->dev->dev)) { | 1236 | if (request_ihex_firmware(&fw, fw_name, &serial->dev->dev)) { |
1242 | dev_err(&serial->dev->dev, "Required keyspan firmware image (%s) unavailable.\n", fw_name); | 1237 | dev_err(&serial->dev->dev, "Required keyspan firmware image (%s) unavailable.\n", fw_name); |
1243 | return(1); | 1238 | return 1; |
1244 | } | 1239 | } |
1245 | 1240 | ||
1246 | dbg("Uploading Keyspan %s firmware.", fw_name); | 1241 | dbg("Uploading Keyspan %s firmware.", fw_name); |
@@ -1709,7 +1704,7 @@ static int keyspan_usa26_send_setup(struct usb_serial *serial, | |||
1709 | msg.setPrescaler = 0xff; | 1704 | msg.setPrescaler = 0xff; |
1710 | } | 1705 | } |
1711 | 1706 | ||
1712 | msg.lcr = (p_priv->cflag & CSTOPB)? STOPBITS_678_2: STOPBITS_5678_1; | 1707 | msg.lcr = (p_priv->cflag & CSTOPB) ? STOPBITS_678_2 : STOPBITS_5678_1; |
1713 | switch (p_priv->cflag & CSIZE) { | 1708 | switch (p_priv->cflag & CSIZE) { |
1714 | case CS5: | 1709 | case CS5: |
1715 | msg.lcr |= USA_DATABITS_5; | 1710 | msg.lcr |= USA_DATABITS_5; |
@@ -1726,7 +1721,7 @@ static int keyspan_usa26_send_setup(struct usb_serial *serial, | |||
1726 | } | 1721 | } |
1727 | if (p_priv->cflag & PARENB) { | 1722 | if (p_priv->cflag & PARENB) { |
1728 | /* note USA_PARITY_NONE == 0 */ | 1723 | /* note USA_PARITY_NONE == 0 */ |
1729 | msg.lcr |= (p_priv->cflag & PARODD)? | 1724 | msg.lcr |= (p_priv->cflag & PARODD) ? |
1730 | USA_PARITY_ODD : USA_PARITY_EVEN; | 1725 | USA_PARITY_ODD : USA_PARITY_EVEN; |
1731 | } | 1726 | } |
1732 | msg.setLcr = 0xff; | 1727 | msg.setLcr = 0xff; |
@@ -1994,7 +1989,7 @@ static int keyspan_usa49_send_setup(struct usb_serial *serial, | |||
1994 | /* msg.setPrescaler = 0xff; */ | 1989 | /* msg.setPrescaler = 0xff; */ |
1995 | } | 1990 | } |
1996 | 1991 | ||
1997 | msg.lcr = (p_priv->cflag & CSTOPB)? STOPBITS_678_2: STOPBITS_5678_1; | 1992 | msg.lcr = (p_priv->cflag & CSTOPB) ? STOPBITS_678_2 : STOPBITS_5678_1; |
1998 | switch (p_priv->cflag & CSIZE) { | 1993 | switch (p_priv->cflag & CSIZE) { |
1999 | case CS5: | 1994 | case CS5: |
2000 | msg.lcr |= USA_DATABITS_5; | 1995 | msg.lcr |= USA_DATABITS_5; |
@@ -2011,7 +2006,7 @@ static int keyspan_usa49_send_setup(struct usb_serial *serial, | |||
2011 | } | 2006 | } |
2012 | if (p_priv->cflag & PARENB) { | 2007 | if (p_priv->cflag & PARENB) { |
2013 | /* note USA_PARITY_NONE == 0 */ | 2008 | /* note USA_PARITY_NONE == 0 */ |
2014 | msg.lcr |= (p_priv->cflag & PARODD)? | 2009 | msg.lcr |= (p_priv->cflag & PARODD) ? |
2015 | USA_PARITY_ODD : USA_PARITY_EVEN; | 2010 | USA_PARITY_ODD : USA_PARITY_EVEN; |
2016 | } | 2011 | } |
2017 | msg.setLcr = 0xff; | 2012 | msg.setLcr = 0xff; |
@@ -2178,7 +2173,7 @@ static int keyspan_usa90_send_setup(struct usb_serial *serial, | |||
2178 | msg.txMode = TXMODE_BYHAND; | 2173 | msg.txMode = TXMODE_BYHAND; |
2179 | } | 2174 | } |
2180 | 2175 | ||
2181 | msg.lcr = (p_priv->cflag & CSTOPB)? STOPBITS_678_2: STOPBITS_5678_1; | 2176 | msg.lcr = (p_priv->cflag & CSTOPB) ? STOPBITS_678_2 : STOPBITS_5678_1; |
2182 | switch (p_priv->cflag & CSIZE) { | 2177 | switch (p_priv->cflag & CSIZE) { |
2183 | case CS5: | 2178 | case CS5: |
2184 | msg.lcr |= USA_DATABITS_5; | 2179 | msg.lcr |= USA_DATABITS_5; |
@@ -2195,7 +2190,7 @@ static int keyspan_usa90_send_setup(struct usb_serial *serial, | |||
2195 | } | 2190 | } |
2196 | if (p_priv->cflag & PARENB) { | 2191 | if (p_priv->cflag & PARENB) { |
2197 | /* note USA_PARITY_NONE == 0 */ | 2192 | /* note USA_PARITY_NONE == 0 */ |
2198 | msg.lcr |= (p_priv->cflag & PARODD)? | 2193 | msg.lcr |= (p_priv->cflag & PARODD) ? |
2199 | USA_PARITY_ODD : USA_PARITY_EVEN; | 2194 | USA_PARITY_ODD : USA_PARITY_EVEN; |
2200 | } | 2195 | } |
2201 | if (p_priv->old_cflag != p_priv->cflag) { | 2196 | if (p_priv->old_cflag != p_priv->cflag) { |
@@ -2322,7 +2317,7 @@ static int keyspan_usa67_send_setup(struct usb_serial *serial, | |||
2322 | } | 2317 | } |
2323 | if (p_priv->cflag & PARENB) { | 2318 | if (p_priv->cflag & PARENB) { |
2324 | /* note USA_PARITY_NONE == 0 */ | 2319 | /* note USA_PARITY_NONE == 0 */ |
2325 | msg.lcr |= (p_priv->cflag & PARODD)? | 2320 | msg.lcr |= (p_priv->cflag & PARODD) ? |
2326 | USA_PARITY_ODD : USA_PARITY_EVEN; | 2321 | USA_PARITY_ODD : USA_PARITY_EVEN; |
2327 | } | 2322 | } |
2328 | msg.setLcr = 0xff; | 2323 | msg.setLcr = 0xff; |