diff options
Diffstat (limited to 'drivers/usb/serial')
-rw-r--r-- | drivers/usb/serial/airprime.c | 47 | ||||
-rw-r--r-- | drivers/usb/serial/cp2101.c | 2 | ||||
-rw-r--r-- | drivers/usb/serial/ftdi_sio.c | 90 | ||||
-rw-r--r-- | drivers/usb/serial/ftdi_sio.h | 21 | ||||
-rw-r--r-- | drivers/usb/serial/ipaq.c | 2 | ||||
-rw-r--r-- | drivers/usb/serial/usb-serial.c | 22 |
6 files changed, 129 insertions, 55 deletions
diff --git a/drivers/usb/serial/airprime.c b/drivers/usb/serial/airprime.c index 18816bf96a4d..310a8b5f5906 100644 --- a/drivers/usb/serial/airprime.c +++ b/drivers/usb/serial/airprime.c | |||
@@ -44,8 +44,43 @@ struct airprime_private { | |||
44 | int outstanding_urbs; | 44 | int outstanding_urbs; |
45 | int throttled; | 45 | int throttled; |
46 | struct urb *read_urbp[NUM_READ_URBS]; | 46 | struct urb *read_urbp[NUM_READ_URBS]; |
47 | |||
48 | /* Settings for the port */ | ||
49 | int rts_state; /* Handshaking pins (outputs) */ | ||
50 | int dtr_state; | ||
51 | int cts_state; /* Handshaking pins (inputs) */ | ||
52 | int dsr_state; | ||
53 | int dcd_state; | ||
54 | int ri_state; | ||
47 | }; | 55 | }; |
48 | 56 | ||
57 | static int airprime_send_setup(struct usb_serial_port *port) | ||
58 | { | ||
59 | struct usb_serial *serial = port->serial; | ||
60 | struct airprime_private *priv; | ||
61 | |||
62 | dbg("%s", __FUNCTION__); | ||
63 | |||
64 | if (port->number != 0) | ||
65 | return 0; | ||
66 | |||
67 | priv = usb_get_serial_port_data(port); | ||
68 | |||
69 | if (port->tty) { | ||
70 | int val = 0; | ||
71 | if (priv->dtr_state) | ||
72 | val |= 0x01; | ||
73 | if (priv->rts_state) | ||
74 | val |= 0x02; | ||
75 | |||
76 | return usb_control_msg(serial->dev, | ||
77 | usb_rcvctrlpipe(serial->dev, 0), | ||
78 | 0x22,0x21,val,0,NULL,0,USB_CTRL_SET_TIMEOUT); | ||
79 | } | ||
80 | |||
81 | return 0; | ||
82 | } | ||
83 | |||
49 | static void airprime_read_bulk_callback(struct urb *urb) | 84 | static void airprime_read_bulk_callback(struct urb *urb) |
50 | { | 85 | { |
51 | struct usb_serial_port *port = urb->context; | 86 | struct usb_serial_port *port = urb->context; |
@@ -118,6 +153,10 @@ static int airprime_open(struct usb_serial_port *port, struct file *filp) | |||
118 | usb_set_serial_port_data(port, priv); | 153 | usb_set_serial_port_data(port, priv); |
119 | } | 154 | } |
120 | 155 | ||
156 | /* Set some sane defaults */ | ||
157 | priv->rts_state = 1; | ||
158 | priv->dtr_state = 1; | ||
159 | |||
121 | for (i = 0; i < NUM_READ_URBS; ++i) { | 160 | for (i = 0; i < NUM_READ_URBS; ++i) { |
122 | buffer = kmalloc(buffer_size, GFP_KERNEL); | 161 | buffer = kmalloc(buffer_size, GFP_KERNEL); |
123 | if (!buffer) { | 162 | if (!buffer) { |
@@ -151,6 +190,9 @@ static int airprime_open(struct usb_serial_port *port, struct file *filp) | |||
151 | /* remember this urb so we can kill it when the port is closed */ | 190 | /* remember this urb so we can kill it when the port is closed */ |
152 | priv->read_urbp[i] = urb; | 191 | priv->read_urbp[i] = urb; |
153 | } | 192 | } |
193 | |||
194 | airprime_send_setup(port); | ||
195 | |||
154 | goto out; | 196 | goto out; |
155 | 197 | ||
156 | errout: | 198 | errout: |
@@ -176,6 +218,11 @@ static void airprime_close(struct usb_serial_port *port, struct file * filp) | |||
176 | 218 | ||
177 | dbg("%s - port %d", __FUNCTION__, port->number); | 219 | dbg("%s - port %d", __FUNCTION__, port->number); |
178 | 220 | ||
221 | priv->rts_state = 0; | ||
222 | priv->dtr_state = 0; | ||
223 | |||
224 | airprime_send_setup(port); | ||
225 | |||
179 | for (i = 0; i < NUM_READ_URBS; ++i) { | 226 | for (i = 0; i < NUM_READ_URBS; ++i) { |
180 | usb_kill_urb (priv->read_urbp[i]); | 227 | usb_kill_urb (priv->read_urbp[i]); |
181 | kfree (priv->read_urbp[i]->transfer_buffer); | 228 | kfree (priv->read_urbp[i]->transfer_buffer); |
diff --git a/drivers/usb/serial/cp2101.c b/drivers/usb/serial/cp2101.c index db623e754899..d7d0ba986a80 100644 --- a/drivers/usb/serial/cp2101.c +++ b/drivers/usb/serial/cp2101.c | |||
@@ -63,6 +63,8 @@ static struct usb_device_id id_table [] = { | |||
63 | { USB_DEVICE(0x10C4, 0x80CA) }, /* Degree Controls Inc */ | 63 | { USB_DEVICE(0x10C4, 0x80CA) }, /* Degree Controls Inc */ |
64 | { USB_DEVICE(0x10C4, 0x80F6) }, /* Suunto sports instrument */ | 64 | { USB_DEVICE(0x10C4, 0x80F6) }, /* Suunto sports instrument */ |
65 | { USB_DEVICE(0x10C4, 0x813D) }, /* Burnside Telecom Deskmobile */ | 65 | { USB_DEVICE(0x10C4, 0x813D) }, /* Burnside Telecom Deskmobile */ |
66 | { USB_DEVICE(0x10C4, 0x814A) }, /* West Mountain Radio RIGblaster P&P */ | ||
67 | { USB_DEVICE(0x10C4, 0x814B) }, /* West Mountain Radio RIGtalk */ | ||
66 | { USB_DEVICE(0x10C4, 0x815E) }, /* Helicomm IP-Link 1220-DVM */ | 68 | { USB_DEVICE(0x10C4, 0x815E) }, /* Helicomm IP-Link 1220-DVM */ |
67 | { USB_DEVICE(0x10C4, 0x81C8) }, /* Lipowsky Industrie Elektronik GmbH, Baby-JTAG */ | 69 | { USB_DEVICE(0x10C4, 0x81C8) }, /* Lipowsky Industrie Elektronik GmbH, Baby-JTAG */ |
68 | { USB_DEVICE(0x10C4, 0x81E2) }, /* Lipowsky Industrie Elektronik GmbH, Baby-LIN */ | 70 | { USB_DEVICE(0x10C4, 0x81E2) }, /* Lipowsky Industrie Elektronik GmbH, Baby-LIN */ |
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index c525b42dadde..1633a0fd48e8 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c | |||
@@ -315,6 +315,7 @@ static struct usb_device_id id_table_combined [] = { | |||
315 | { USB_DEVICE(FTDI_VID, FTDI_SIO_PID) }, | 315 | { USB_DEVICE(FTDI_VID, FTDI_SIO_PID) }, |
316 | { USB_DEVICE(FTDI_VID, FTDI_8U232AM_PID) }, | 316 | { USB_DEVICE(FTDI_VID, FTDI_8U232AM_PID) }, |
317 | { USB_DEVICE(FTDI_VID, FTDI_8U232AM_ALT_PID) }, | 317 | { USB_DEVICE(FTDI_VID, FTDI_8U232AM_ALT_PID) }, |
318 | { USB_DEVICE(FTDI_VID, FTDI_232RL_PID) }, | ||
318 | { USB_DEVICE(FTDI_VID, FTDI_8U2232C_PID) }, | 319 | { USB_DEVICE(FTDI_VID, FTDI_8U2232C_PID) }, |
319 | { USB_DEVICE(FTDI_VID, FTDI_MICRO_CHAMELEON_PID) }, | 320 | { USB_DEVICE(FTDI_VID, FTDI_MICRO_CHAMELEON_PID) }, |
320 | { USB_DEVICE(FTDI_VID, FTDI_RELAIS_PID) }, | 321 | { USB_DEVICE(FTDI_VID, FTDI_RELAIS_PID) }, |
@@ -420,6 +421,14 @@ static struct usb_device_id id_table_combined [] = { | |||
420 | { USB_DEVICE(FTDI_VID, FTDI_ELV_ALC8500_PID) }, | 421 | { USB_DEVICE(FTDI_VID, FTDI_ELV_ALC8500_PID) }, |
421 | { USB_DEVICE(FTDI_VID, FTDI_PYRAMID_PID) }, | 422 | { USB_DEVICE(FTDI_VID, FTDI_PYRAMID_PID) }, |
422 | { USB_DEVICE(FTDI_VID, FTDI_ELV_FHZ1000PC_PID) }, | 423 | { USB_DEVICE(FTDI_VID, FTDI_ELV_FHZ1000PC_PID) }, |
424 | { USB_DEVICE(FTDI_VID, FTDI_IBS_US485_PID) }, | ||
425 | { USB_DEVICE(FTDI_VID, FTDI_IBS_PICPRO_PID) }, | ||
426 | { USB_DEVICE(FTDI_VID, FTDI_IBS_PCMCIA_PID) }, | ||
427 | { USB_DEVICE(FTDI_VID, FTDI_IBS_PK1_PID) }, | ||
428 | { USB_DEVICE(FTDI_VID, FTDI_IBS_RS232MON_PID) }, | ||
429 | { USB_DEVICE(FTDI_VID, FTDI_IBS_APP70_PID) }, | ||
430 | { USB_DEVICE(FTDI_VID, FTDI_IBS_PEDO_PID) }, | ||
431 | { USB_DEVICE(FTDI_VID, FTDI_IBS_PROD_PID) }, | ||
423 | /* | 432 | /* |
424 | * These will probably use user-space drivers. Uncomment them if | 433 | * These will probably use user-space drivers. Uncomment them if |
425 | * you need them or use the user-specified vendor/product module | 434 | * you need them or use the user-specified vendor/product module |
@@ -459,6 +468,7 @@ static struct usb_device_id id_table_combined [] = { | |||
459 | { USB_DEVICE(FALCOM_VID, FALCOM_TWIST_PID) }, | 468 | { USB_DEVICE(FALCOM_VID, FALCOM_TWIST_PID) }, |
460 | { USB_DEVICE(FALCOM_VID, FALCOM_SAMBA_PID) }, | 469 | { USB_DEVICE(FALCOM_VID, FALCOM_SAMBA_PID) }, |
461 | { USB_DEVICE(FTDI_VID, FTDI_SUUNTO_SPORTS_PID) }, | 470 | { USB_DEVICE(FTDI_VID, FTDI_SUUNTO_SPORTS_PID) }, |
471 | { USB_DEVICE(TTI_VID, TTI_QL355P_PID) }, | ||
462 | { USB_DEVICE(FTDI_VID, FTDI_RM_CANVIEW_PID) }, | 472 | { USB_DEVICE(FTDI_VID, FTDI_RM_CANVIEW_PID) }, |
463 | { USB_DEVICE(BANDB_VID, BANDB_USOTL4_PID) }, | 473 | { USB_DEVICE(BANDB_VID, BANDB_USOTL4_PID) }, |
464 | { USB_DEVICE(BANDB_VID, BANDB_USTL4_PID) }, | 474 | { USB_DEVICE(BANDB_VID, BANDB_USTL4_PID) }, |
@@ -533,6 +543,7 @@ static const char *ftdi_chip_name[] = { | |||
533 | [FT8U232AM] = "FT8U232AM", | 543 | [FT8U232AM] = "FT8U232AM", |
534 | [FT232BM] = "FT232BM", | 544 | [FT232BM] = "FT232BM", |
535 | [FT2232C] = "FT2232C", | 545 | [FT2232C] = "FT2232C", |
546 | [FT232RL] = "FT232RL", | ||
536 | }; | 547 | }; |
537 | 548 | ||
538 | 549 | ||
@@ -588,6 +599,8 @@ struct ftdi_private { | |||
588 | static int ftdi_sio_probe (struct usb_serial *serial, const struct usb_device_id *id); | 599 | static int ftdi_sio_probe (struct usb_serial *serial, const struct usb_device_id *id); |
589 | static int ftdi_sio_attach (struct usb_serial *serial); | 600 | static int ftdi_sio_attach (struct usb_serial *serial); |
590 | static void ftdi_shutdown (struct usb_serial *serial); | 601 | static void ftdi_shutdown (struct usb_serial *serial); |
602 | static int ftdi_sio_port_probe (struct usb_serial_port *port); | ||
603 | static int ftdi_sio_port_remove (struct usb_serial_port *port); | ||
591 | static int ftdi_open (struct usb_serial_port *port, struct file *filp); | 604 | static int ftdi_open (struct usb_serial_port *port, struct file *filp); |
592 | static void ftdi_close (struct usb_serial_port *port, struct file *filp); | 605 | static void ftdi_close (struct usb_serial_port *port, struct file *filp); |
593 | static int ftdi_write (struct usb_serial_port *port, const unsigned char *buf, int count); | 606 | static int ftdi_write (struct usb_serial_port *port, const unsigned char *buf, int count); |
@@ -622,6 +635,8 @@ static struct usb_serial_driver ftdi_sio_device = { | |||
622 | .num_bulk_out = 1, | 635 | .num_bulk_out = 1, |
623 | .num_ports = 1, | 636 | .num_ports = 1, |
624 | .probe = ftdi_sio_probe, | 637 | .probe = ftdi_sio_probe, |
638 | .port_probe = ftdi_sio_port_probe, | ||
639 | .port_remove = ftdi_sio_port_remove, | ||
625 | .open = ftdi_open, | 640 | .open = ftdi_open, |
626 | .close = ftdi_close, | 641 | .close = ftdi_close, |
627 | .throttle = ftdi_throttle, | 642 | .throttle = ftdi_throttle, |
@@ -1024,11 +1039,10 @@ static ssize_t show_latency_timer(struct device *dev, struct device_attribute *a | |||
1024 | { | 1039 | { |
1025 | struct usb_serial_port *port = to_usb_serial_port(dev); | 1040 | struct usb_serial_port *port = to_usb_serial_port(dev); |
1026 | struct ftdi_private *priv = usb_get_serial_port_data(port); | 1041 | struct ftdi_private *priv = usb_get_serial_port_data(port); |
1027 | struct usb_device *udev; | 1042 | struct usb_device *udev = port->serial->dev; |
1028 | unsigned short latency = 0; | 1043 | unsigned short latency = 0; |
1029 | int rv = 0; | 1044 | int rv = 0; |
1030 | 1045 | ||
1031 | udev = to_usb_device(dev); | ||
1032 | 1046 | ||
1033 | dbg("%s",__FUNCTION__); | 1047 | dbg("%s",__FUNCTION__); |
1034 | 1048 | ||
@@ -1052,13 +1066,11 @@ static ssize_t store_latency_timer(struct device *dev, struct device_attribute * | |||
1052 | { | 1066 | { |
1053 | struct usb_serial_port *port = to_usb_serial_port(dev); | 1067 | struct usb_serial_port *port = to_usb_serial_port(dev); |
1054 | struct ftdi_private *priv = usb_get_serial_port_data(port); | 1068 | struct ftdi_private *priv = usb_get_serial_port_data(port); |
1055 | struct usb_device *udev; | 1069 | struct usb_device *udev = port->serial->dev; |
1056 | char buf[1]; | 1070 | char buf[1]; |
1057 | int v = simple_strtoul(valbuf, NULL, 10); | 1071 | int v = simple_strtoul(valbuf, NULL, 10); |
1058 | int rv = 0; | 1072 | int rv = 0; |
1059 | 1073 | ||
1060 | udev = to_usb_device(dev); | ||
1061 | |||
1062 | dbg("%s: setting latency timer = %i", __FUNCTION__, v); | 1074 | dbg("%s: setting latency timer = %i", __FUNCTION__, v); |
1063 | 1075 | ||
1064 | rv = usb_control_msg(udev, | 1076 | rv = usb_control_msg(udev, |
@@ -1083,13 +1095,11 @@ static ssize_t store_event_char(struct device *dev, struct device_attribute *att | |||
1083 | { | 1095 | { |
1084 | struct usb_serial_port *port = to_usb_serial_port(dev); | 1096 | struct usb_serial_port *port = to_usb_serial_port(dev); |
1085 | struct ftdi_private *priv = usb_get_serial_port_data(port); | 1097 | struct ftdi_private *priv = usb_get_serial_port_data(port); |
1086 | struct usb_device *udev; | 1098 | struct usb_device *udev = port->serial->dev; |
1087 | char buf[1]; | 1099 | char buf[1]; |
1088 | int v = simple_strtoul(valbuf, NULL, 10); | 1100 | int v = simple_strtoul(valbuf, NULL, 10); |
1089 | int rv = 0; | 1101 | int rv = 0; |
1090 | 1102 | ||
1091 | udev = to_usb_device(dev); | ||
1092 | |||
1093 | dbg("%s: setting event char = %i", __FUNCTION__, v); | 1103 | dbg("%s: setting event char = %i", __FUNCTION__, v); |
1094 | 1104 | ||
1095 | rv = usb_control_msg(udev, | 1105 | rv = usb_control_msg(udev, |
@@ -1110,46 +1120,38 @@ static ssize_t store_event_char(struct device *dev, struct device_attribute *att | |||
1110 | static DEVICE_ATTR(latency_timer, S_IWUSR | S_IRUGO, show_latency_timer, store_latency_timer); | 1120 | static DEVICE_ATTR(latency_timer, S_IWUSR | S_IRUGO, show_latency_timer, store_latency_timer); |
1111 | static DEVICE_ATTR(event_char, S_IWUSR, NULL, store_event_char); | 1121 | static DEVICE_ATTR(event_char, S_IWUSR, NULL, store_event_char); |
1112 | 1122 | ||
1113 | static int create_sysfs_attrs(struct usb_serial *serial) | 1123 | static int create_sysfs_attrs(struct usb_serial_port *port) |
1114 | { | 1124 | { |
1115 | struct ftdi_private *priv; | 1125 | struct ftdi_private *priv = usb_get_serial_port_data(port); |
1116 | struct usb_device *udev; | ||
1117 | int retval = 0; | 1126 | int retval = 0; |
1118 | 1127 | ||
1119 | dbg("%s",__FUNCTION__); | 1128 | dbg("%s",__FUNCTION__); |
1120 | 1129 | ||
1121 | priv = usb_get_serial_port_data(serial->port[0]); | ||
1122 | udev = serial->dev; | ||
1123 | |||
1124 | /* XXX I've no idea if the original SIO supports the event_char | 1130 | /* XXX I've no idea if the original SIO supports the event_char |
1125 | * sysfs parameter, so I'm playing it safe. */ | 1131 | * sysfs parameter, so I'm playing it safe. */ |
1126 | if (priv->chip_type != SIO) { | 1132 | if (priv->chip_type != SIO) { |
1127 | dbg("sysfs attributes for %s", ftdi_chip_name[priv->chip_type]); | 1133 | dbg("sysfs attributes for %s", ftdi_chip_name[priv->chip_type]); |
1128 | retval = device_create_file(&udev->dev, &dev_attr_event_char); | 1134 | retval = device_create_file(&port->dev, &dev_attr_event_char); |
1129 | if ((!retval) && | 1135 | if ((!retval) && |
1130 | (priv->chip_type == FT232BM || priv->chip_type == FT2232C)) { | 1136 | (priv->chip_type == FT232BM || priv->chip_type == FT2232C)) { |
1131 | retval = device_create_file(&udev->dev, | 1137 | retval = device_create_file(&port->dev, |
1132 | &dev_attr_latency_timer); | 1138 | &dev_attr_latency_timer); |
1133 | } | 1139 | } |
1134 | } | 1140 | } |
1135 | return retval; | 1141 | return retval; |
1136 | } | 1142 | } |
1137 | 1143 | ||
1138 | static void remove_sysfs_attrs(struct usb_serial *serial) | 1144 | static void remove_sysfs_attrs(struct usb_serial_port *port) |
1139 | { | 1145 | { |
1140 | struct ftdi_private *priv; | 1146 | struct ftdi_private *priv = usb_get_serial_port_data(port); |
1141 | struct usb_device *udev; | ||
1142 | 1147 | ||
1143 | dbg("%s",__FUNCTION__); | 1148 | dbg("%s",__FUNCTION__); |
1144 | 1149 | ||
1145 | priv = usb_get_serial_port_data(serial->port[0]); | ||
1146 | udev = serial->dev; | ||
1147 | |||
1148 | /* XXX see create_sysfs_attrs */ | 1150 | /* XXX see create_sysfs_attrs */ |
1149 | if (priv->chip_type != SIO) { | 1151 | if (priv->chip_type != SIO) { |
1150 | device_remove_file(&udev->dev, &dev_attr_event_char); | 1152 | device_remove_file(&port->dev, &dev_attr_event_char); |
1151 | if (priv->chip_type == FT232BM || priv->chip_type == FT2232C) { | 1153 | if (priv->chip_type == FT232BM || priv->chip_type == FT2232C) { |
1152 | device_remove_file(&udev->dev, &dev_attr_latency_timer); | 1154 | device_remove_file(&port->dev, &dev_attr_latency_timer); |
1153 | } | 1155 | } |
1154 | } | 1156 | } |
1155 | 1157 | ||
@@ -1169,13 +1171,9 @@ static int ftdi_sio_probe (struct usb_serial *serial, const struct usb_device_id | |||
1169 | return (0); | 1171 | return (0); |
1170 | } | 1172 | } |
1171 | 1173 | ||
1172 | /* attach subroutine */ | 1174 | static int ftdi_sio_port_probe(struct usb_serial_port *port) |
1173 | static int ftdi_sio_attach (struct usb_serial *serial) | ||
1174 | { | 1175 | { |
1175 | struct usb_serial_port *port = serial->port[0]; | ||
1176 | struct ftdi_private *priv; | 1176 | struct ftdi_private *priv; |
1177 | struct ftdi_sio_quirk *quirk; | ||
1178 | int retval; | ||
1179 | 1177 | ||
1180 | dbg("%s",__FUNCTION__); | 1178 | dbg("%s",__FUNCTION__); |
1181 | 1179 | ||
@@ -1215,19 +1213,21 @@ static int ftdi_sio_attach (struct usb_serial *serial) | |||
1215 | kfree(port->bulk_out_buffer); | 1213 | kfree(port->bulk_out_buffer); |
1216 | port->bulk_out_buffer = NULL; | 1214 | port->bulk_out_buffer = NULL; |
1217 | 1215 | ||
1218 | usb_set_serial_port_data(serial->port[0], priv); | 1216 | usb_set_serial_port_data(port, priv); |
1219 | 1217 | ||
1220 | ftdi_determine_type (serial->port[0]); | 1218 | ftdi_determine_type (port); |
1221 | retval = create_sysfs_attrs(serial); | 1219 | create_sysfs_attrs(port); |
1222 | if (retval) | 1220 | return 0; |
1223 | dev_err(&serial->dev->dev, "Error creating sysfs files, " | 1221 | } |
1224 | "continuing\n"); | ||
1225 | 1222 | ||
1223 | /* attach subroutine */ | ||
1224 | static int ftdi_sio_attach (struct usb_serial *serial) | ||
1225 | { | ||
1226 | /* Check for device requiring special set up. */ | 1226 | /* Check for device requiring special set up. */ |
1227 | quirk = (struct ftdi_sio_quirk *)usb_get_serial_data(serial); | 1227 | struct ftdi_sio_quirk *quirk = usb_get_serial_data(serial); |
1228 | if (quirk && quirk->setup) { | 1228 | |
1229 | if (quirk && quirk->setup) | ||
1229 | quirk->setup(serial); | 1230 | quirk->setup(serial); |
1230 | } | ||
1231 | 1231 | ||
1232 | return 0; | 1232 | return 0; |
1233 | } /* ftdi_sio_attach */ | 1233 | } /* ftdi_sio_attach */ |
@@ -1271,17 +1271,18 @@ static void ftdi_HE_TIRA1_setup (struct usb_serial *serial) | |||
1271 | * calls __serial_close for each open of the port | 1271 | * calls __serial_close for each open of the port |
1272 | * shutdown is called then (ie ftdi_shutdown) | 1272 | * shutdown is called then (ie ftdi_shutdown) |
1273 | */ | 1273 | */ |
1274 | |||
1275 | |||
1276 | static void ftdi_shutdown (struct usb_serial *serial) | 1274 | static void ftdi_shutdown (struct usb_serial *serial) |
1277 | { /* ftdi_shutdown */ | 1275 | { |
1276 | dbg("%s", __FUNCTION__); | ||
1277 | } | ||
1278 | 1278 | ||
1279 | struct usb_serial_port *port = serial->port[0]; | 1279 | static int ftdi_sio_port_remove(struct usb_serial_port *port) |
1280 | { | ||
1280 | struct ftdi_private *priv = usb_get_serial_port_data(port); | 1281 | struct ftdi_private *priv = usb_get_serial_port_data(port); |
1281 | 1282 | ||
1282 | dbg("%s", __FUNCTION__); | 1283 | dbg("%s", __FUNCTION__); |
1283 | 1284 | ||
1284 | remove_sysfs_attrs(serial); | 1285 | remove_sysfs_attrs(port); |
1285 | 1286 | ||
1286 | /* all open ports are closed at this point | 1287 | /* all open ports are closed at this point |
1287 | * (by usbserial.c:__serial_close, which calls ftdi_close) | 1288 | * (by usbserial.c:__serial_close, which calls ftdi_close) |
@@ -1291,8 +1292,9 @@ static void ftdi_shutdown (struct usb_serial *serial) | |||
1291 | usb_set_serial_port_data(port, NULL); | 1292 | usb_set_serial_port_data(port, NULL); |
1292 | kfree(priv); | 1293 | kfree(priv); |
1293 | } | 1294 | } |
1294 | } /* ftdi_shutdown */ | ||
1295 | 1295 | ||
1296 | return 0; | ||
1297 | } | ||
1296 | 1298 | ||
1297 | static int ftdi_open (struct usb_serial_port *port, struct file *filp) | 1299 | static int ftdi_open (struct usb_serial_port *port, struct file *filp) |
1298 | { /* ftdi_open */ | 1300 | { /* ftdi_open */ |
diff --git a/drivers/usb/serial/ftdi_sio.h b/drivers/usb/serial/ftdi_sio.h index 1bdda935f7d9..513cfe1b768b 100644 --- a/drivers/usb/serial/ftdi_sio.h +++ b/drivers/usb/serial/ftdi_sio.h | |||
@@ -27,6 +27,7 @@ | |||
27 | #define FTDI_8U232AM_PID 0x6001 /* Similar device to SIO above */ | 27 | #define FTDI_8U232AM_PID 0x6001 /* Similar device to SIO above */ |
28 | #define FTDI_8U232AM_ALT_PID 0x6006 /* FTDI's alternate PID for above */ | 28 | #define FTDI_8U232AM_ALT_PID 0x6006 /* FTDI's alternate PID for above */ |
29 | #define FTDI_8U2232C_PID 0x6010 /* Dual channel device */ | 29 | #define FTDI_8U2232C_PID 0x6010 /* Dual channel device */ |
30 | #define FTDI_232RL_PID 0xFBFA /* Product ID for FT232RL */ | ||
30 | #define FTDI_RELAIS_PID 0xFA10 /* Relais device from Rudolf Gugler */ | 31 | #define FTDI_RELAIS_PID 0xFA10 /* Relais device from Rudolf Gugler */ |
31 | #define FTDI_NF_RIC_VID 0x0DCD /* Vendor Id */ | 32 | #define FTDI_NF_RIC_VID 0x0DCD /* Vendor Id */ |
32 | #define FTDI_NF_RIC_PID 0x0001 /* Product Id */ | 33 | #define FTDI_NF_RIC_PID 0x0001 /* Product Id */ |
@@ -339,6 +340,12 @@ | |||
339 | #define FTDI_SUUNTO_SPORTS_PID 0xF680 /* Suunto Sports instrument */ | 340 | #define FTDI_SUUNTO_SPORTS_PID 0xF680 /* Suunto Sports instrument */ |
340 | 341 | ||
341 | /* | 342 | /* |
343 | * TTi (Thurlby Thandar Instruments) | ||
344 | */ | ||
345 | #define TTI_VID 0x103E /* Vendor Id */ | ||
346 | #define TTI_QL355P_PID 0x03E8 /* TTi QL355P power supply */ | ||
347 | |||
348 | /* | ||
342 | * Definitions for B&B Electronics products. | 349 | * Definitions for B&B Electronics products. |
343 | */ | 350 | */ |
344 | #define BANDB_VID 0x0856 /* B&B Electronics Vendor ID */ | 351 | #define BANDB_VID 0x0856 /* B&B Electronics Vendor ID */ |
@@ -497,6 +504,19 @@ | |||
497 | #define TELLDUS_VID 0x1781 /* Vendor ID */ | 504 | #define TELLDUS_VID 0x1781 /* Vendor ID */ |
498 | #define TELLDUS_TELLSTICK_PID 0x0C30 /* RF control dongle 433 MHz using FT232RL */ | 505 | #define TELLDUS_TELLSTICK_PID 0x0C30 /* RF control dongle 433 MHz using FT232RL */ |
499 | 506 | ||
507 | /* | ||
508 | * IBS elektronik product ids | ||
509 | * Submitted by Thomas Schleusener | ||
510 | */ | ||
511 | #define FTDI_IBS_US485_PID 0xff38 /* IBS US485 (USB<-->RS422/485 interface) */ | ||
512 | #define FTDI_IBS_PICPRO_PID 0xff39 /* IBS PIC-Programmer */ | ||
513 | #define FTDI_IBS_PCMCIA_PID 0xff3a /* IBS Card reader for PCMCIA SRAM-cards */ | ||
514 | #define FTDI_IBS_PK1_PID 0xff3b /* IBS PK1 - Particel counter */ | ||
515 | #define FTDI_IBS_RS232MON_PID 0xff3c /* IBS RS232 - Monitor */ | ||
516 | #define FTDI_IBS_APP70_PID 0xff3d /* APP 70 (dust monitoring system) */ | ||
517 | #define FTDI_IBS_PEDO_PID 0xff3e /* IBS PEDO-Modem (RF modem 868.35 MHz) */ | ||
518 | #define FTDI_IBS_PROD_PID 0xff3f /* future device */ | ||
519 | |||
500 | /* Commands */ | 520 | /* Commands */ |
501 | #define FTDI_SIO_RESET 0 /* Reset the port */ | 521 | #define FTDI_SIO_RESET 0 /* Reset the port */ |
502 | #define FTDI_SIO_MODEM_CTRL 1 /* Set the modem control register */ | 522 | #define FTDI_SIO_MODEM_CTRL 1 /* Set the modem control register */ |
@@ -620,6 +640,7 @@ typedef enum { | |||
620 | FT8U232AM = 2, | 640 | FT8U232AM = 2, |
621 | FT232BM = 3, | 641 | FT232BM = 3, |
622 | FT2232C = 4, | 642 | FT2232C = 4, |
643 | FT232RL = 5, | ||
623 | } ftdi_chip_type_t; | 644 | } ftdi_chip_type_t; |
624 | 645 | ||
625 | typedef enum { | 646 | typedef enum { |
diff --git a/drivers/usb/serial/ipaq.c b/drivers/usb/serial/ipaq.c index a408184334ea..d16e2e1764ad 100644 --- a/drivers/usb/serial/ipaq.c +++ b/drivers/usb/serial/ipaq.c | |||
@@ -247,6 +247,8 @@ static struct usb_device_id ipaq_id_table [] = { | |||
247 | { USB_DEVICE(0x04AD, 0x0301) }, /* USB Sync 0301 */ | 247 | { USB_DEVICE(0x04AD, 0x0301) }, /* USB Sync 0301 */ |
248 | { USB_DEVICE(0x04AD, 0x0302) }, /* USB Sync 0302 */ | 248 | { USB_DEVICE(0x04AD, 0x0302) }, /* USB Sync 0302 */ |
249 | { USB_DEVICE(0x04AD, 0x0303) }, /* USB Sync 0303 */ | 249 | { USB_DEVICE(0x04AD, 0x0303) }, /* USB Sync 0303 */ |
250 | { USB_DEVICE(0x04AD, 0x0306) }, /* GPS Pocket PC USB Sync */ | ||
251 | { USB_DEVICE(0x04B7, 0x0531) }, /* MyGuide 7000 XL USB Sync */ | ||
250 | { USB_DEVICE(0x04C5, 0x1058) }, /* FUJITSU USB Sync */ | 252 | { USB_DEVICE(0x04C5, 0x1058) }, /* FUJITSU USB Sync */ |
251 | { USB_DEVICE(0x04C5, 0x1079) }, /* FUJITSU USB Sync */ | 253 | { USB_DEVICE(0x04C5, 0x1079) }, /* FUJITSU USB Sync */ |
252 | { USB_DEVICE(0x04DA, 0x2500) }, /* Panasonic USB Sync */ | 254 | { USB_DEVICE(0x04DA, 0x2500) }, /* Panasonic USB Sync */ |
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index 6bf22a28adb8..8511352251f3 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c | |||
@@ -99,9 +99,12 @@ static struct usb_serial *get_free_serial (struct usb_serial *serial, int num_po | |||
99 | continue; | 99 | continue; |
100 | 100 | ||
101 | *minor = i; | 101 | *minor = i; |
102 | j = 0; | ||
102 | dbg("%s - minor base = %d", __FUNCTION__, *minor); | 103 | dbg("%s - minor base = %d", __FUNCTION__, *minor); |
103 | for (i = *minor; (i < (*minor + num_ports)) && (i < SERIAL_TTY_MINORS); ++i) | 104 | for (i = *minor; (i < (*minor + num_ports)) && (i < SERIAL_TTY_MINORS); ++i) { |
104 | serial_table[i] = serial; | 105 | serial_table[i] = serial; |
106 | serial->port[j++]->number = i; | ||
107 | } | ||
105 | spin_unlock(&table_lock); | 108 | spin_unlock(&table_lock); |
106 | return serial; | 109 | return serial; |
107 | } | 110 | } |
@@ -135,11 +138,6 @@ static void destroy_serial(struct kref *kref) | |||
135 | 138 | ||
136 | dbg("%s - %s", __FUNCTION__, serial->type->description); | 139 | dbg("%s - %s", __FUNCTION__, serial->type->description); |
137 | 140 | ||
138 | serial->type->shutdown(serial); | ||
139 | |||
140 | /* return the minor range that this device had */ | ||
141 | return_serial(serial); | ||
142 | |||
143 | for (i = 0; i < serial->num_ports; ++i) | 141 | for (i = 0; i < serial->num_ports; ++i) |
144 | serial->port[i]->open_count = 0; | 142 | serial->port[i]->open_count = 0; |
145 | 143 | ||
@@ -150,6 +148,12 @@ static void destroy_serial(struct kref *kref) | |||
150 | serial->port[i] = NULL; | 148 | serial->port[i] = NULL; |
151 | } | 149 | } |
152 | 150 | ||
151 | if (serial->type->shutdown) | ||
152 | serial->type->shutdown(serial); | ||
153 | |||
154 | /* return the minor range that this device had */ | ||
155 | return_serial(serial); | ||
156 | |||
153 | /* If this is a "fake" port, we have to clean it up here, as it will | 157 | /* If this is a "fake" port, we have to clean it up here, as it will |
154 | * not get cleaned up in port_release() as it was never registered with | 158 | * not get cleaned up in port_release() as it was never registered with |
155 | * the driver core */ | 159 | * the driver core */ |
@@ -826,7 +830,6 @@ int usb_serial_probe(struct usb_interface *interface, | |||
826 | num_ports = type->num_ports; | 830 | num_ports = type->num_ports; |
827 | } | 831 | } |
828 | 832 | ||
829 | serial->minor = minor; | ||
830 | serial->num_ports = num_ports; | 833 | serial->num_ports = num_ports; |
831 | serial->num_bulk_in = num_bulk_in; | 834 | serial->num_bulk_in = num_bulk_in; |
832 | serial->num_bulk_out = num_bulk_out; | 835 | serial->num_bulk_out = num_bulk_out; |
@@ -847,7 +850,6 @@ int usb_serial_probe(struct usb_interface *interface, | |||
847 | port = kzalloc(sizeof(struct usb_serial_port), GFP_KERNEL); | 850 | port = kzalloc(sizeof(struct usb_serial_port), GFP_KERNEL); |
848 | if (!port) | 851 | if (!port) |
849 | goto probe_error; | 852 | goto probe_error; |
850 | port->number = i + serial->minor; | ||
851 | port->serial = serial; | 853 | port->serial = serial; |
852 | spin_lock_init(&port->lock); | 854 | spin_lock_init(&port->lock); |
853 | mutex_init(&port->mutex); | 855 | mutex_init(&port->mutex); |
@@ -980,6 +982,7 @@ int usb_serial_probe(struct usb_interface *interface, | |||
980 | dev_err(&interface->dev, "No more free serial devices\n"); | 982 | dev_err(&interface->dev, "No more free serial devices\n"); |
981 | goto probe_error; | 983 | goto probe_error; |
982 | } | 984 | } |
985 | serial->minor = minor; | ||
983 | 986 | ||
984 | /* register all of the individual ports with the driver core */ | 987 | /* register all of the individual ports with the driver core */ |
985 | for (i = 0; i < num_ports; ++i) { | 988 | for (i = 0; i < num_ports; ++i) { |
@@ -1034,9 +1037,6 @@ probe_error: | |||
1034 | kfree(port->interrupt_out_buffer); | 1037 | kfree(port->interrupt_out_buffer); |
1035 | } | 1038 | } |
1036 | 1039 | ||
1037 | /* return the minor range that this device had */ | ||
1038 | return_serial (serial); | ||
1039 | |||
1040 | /* free up any memory that we allocated */ | 1040 | /* free up any memory that we allocated */ |
1041 | for (i = 0; i < serial->num_port_pointers; ++i) | 1041 | for (i = 0; i < serial->num_port_pointers; ++i) |
1042 | kfree(serial->port[i]); | 1042 | kfree(serial->port[i]); |