aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorIan Abbott <abbotti@mev.co.uk>2005-06-20 11:45:42 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-07-12 14:52:55 -0400
commit8f977e4201fcc0bd512eb01e775894e0a9c34a39 (patch)
treecc9c0bc66267c55c2bdeeb26eac11822d7325f6f /drivers
parent9c8d61783e5bb5e29744b6481a1c67c6e4e8e135 (diff)
[PATCH] USB ftdi_sio: reduce device id table clutter
ftdi_sio: Use a single usb_device_id table and detect the type of chip programatically. The table also flags devices requiring special initialization. The patch makes the driver about 10K smaller and makes it easier to add new device IDs. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/serial/ftdi_sio.c707
1 files changed, 144 insertions, 563 deletions
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index d882fa3ad19a..f843f7358867 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -264,16 +264,26 @@
264/* 264/*
265 * Version Information 265 * Version Information
266 */ 266 */
267#define DRIVER_VERSION "v1.4.2" 267#define DRIVER_VERSION "v1.4.3"
268#define DRIVER_AUTHOR "Greg Kroah-Hartman <greg@kroah.com>, Bill Ryder <bryder@sgi.com>, Kuba Ober <kuba@mareimbrium.org>" 268#define DRIVER_AUTHOR "Greg Kroah-Hartman <greg@kroah.com>, Bill Ryder <bryder@sgi.com>, Kuba Ober <kuba@mareimbrium.org>"
269#define DRIVER_DESC "USB FTDI Serial Converters Driver" 269#define DRIVER_DESC "USB FTDI Serial Converters Driver"
270 270
271static int debug; 271static int debug;
272 272
273static struct usb_device_id id_table_sio [] = { 273/* struct ftdi_sio_quirk is used by devices requiring special attention. */
274 { USB_DEVICE(FTDI_VID, FTDI_SIO_PID) }, 274struct ftdi_sio_quirk {
275 { USB_DEVICE(MOBILITY_VID, MOBILITY_USB_SERIAL_PID) }, 275 void (*setup)(struct usb_serial *); /* Special settings during startup. */
276 { } /* Terminating entry */ 276};
277
278static void ftdi_USB_UIRT_setup (struct usb_serial *serial);
279static void ftdi_HE_TIRA1_setup (struct usb_serial *serial);
280
281static struct ftdi_sio_quirk ftdi_USB_UIRT_quirk = {
282 .setup = ftdi_USB_UIRT_setup,
283};
284
285static struct ftdi_sio_quirk ftdi_HE_TIRA1_quirk = {
286 .setup = ftdi_HE_TIRA1_setup,
277}; 287};
278 288
279/* 289/*
@@ -288,237 +298,11 @@ static struct usb_device_id id_table_sio [] = {
288 * the bcdDevice value is used to differentiate FT232BM and FT245BM from 298 * the bcdDevice value is used to differentiate FT232BM and FT245BM from
289 * the earlier FT8U232AM and FT8U232BM. For now, include all known VID/PID 299 * the earlier FT8U232AM and FT8U232BM. For now, include all known VID/PID
290 * combinations in both tables. 300 * combinations in both tables.
291 * FIXME: perhaps bcdDevice can also identify 12MHz devices, but I don't know 301 * FIXME: perhaps bcdDevice can also identify 12MHz FT8U232AM devices,
292 * if those ever went into mass production. [Ian Abbott] 302 * but I don't know if those ever went into mass production. [Ian Abbott]
293 */ 303 */
294 304
295 305
296static struct usb_device_id id_table_8U232AM [] = {
297 { USB_DEVICE_VER(FTDI_VID, FTDI_IRTRANS_PID, 0, 0x3ff) },
298 { USB_DEVICE_VER(FTDI_VID, FTDI_8U232AM_PID, 0, 0x3ff) },
299 { USB_DEVICE_VER(FTDI_VID, FTDI_8U232AM_ALT_PID, 0, 0x3ff) },
300 { USB_DEVICE_VER(FTDI_VID, FTDI_RELAIS_PID, 0, 0x3ff) },
301 { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_IOBOARD_PID) },
302 { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_MINI_IOBOARD_PID) },
303 { USB_DEVICE_VER(FTDI_NF_RIC_VID, FTDI_NF_RIC_PID, 0, 0x3ff) },
304 { USB_DEVICE_VER(FTDI_VID, FTDI_XF_632_PID, 0, 0x3ff) },
305 { USB_DEVICE_VER(FTDI_VID, FTDI_XF_634_PID, 0, 0x3ff) },
306 { USB_DEVICE_VER(FTDI_VID, FTDI_XF_547_PID, 0, 0x3ff) },
307 { USB_DEVICE_VER(FTDI_VID, FTDI_XF_633_PID, 0, 0x3ff) },
308 { USB_DEVICE_VER(FTDI_VID, FTDI_XF_631_PID, 0, 0x3ff) },
309 { USB_DEVICE_VER(FTDI_VID, FTDI_XF_635_PID, 0, 0x3ff) },
310 { USB_DEVICE_VER(FTDI_VID, FTDI_XF_640_PID, 0, 0x3ff) },
311 { USB_DEVICE_VER(FTDI_VID, FTDI_XF_642_PID, 0, 0x3ff) },
312 { USB_DEVICE_VER(FTDI_VID, FTDI_VNHCPCUSB_D_PID, 0, 0x3ff) },
313 { USB_DEVICE_VER(FTDI_VID, FTDI_DSS20_PID, 0, 0x3ff) },
314 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2101_PID, 0, 0x3ff) },
315 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2102_PID, 0, 0x3ff) },
316 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2103_PID, 0, 0x3ff) },
317 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2104_PID, 0, 0x3ff) },
318 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2201_1_PID, 0, 0x3ff) },
319 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2201_2_PID, 0, 0x3ff) },
320 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2202_1_PID, 0, 0x3ff) },
321 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2202_2_PID, 0, 0x3ff) },
322 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2203_1_PID, 0, 0x3ff) },
323 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2203_2_PID, 0, 0x3ff) },
324 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2401_1_PID, 0, 0x3ff) },
325 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2401_2_PID, 0, 0x3ff) },
326 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2401_3_PID, 0, 0x3ff) },
327 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2401_4_PID, 0, 0x3ff) },
328 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2402_1_PID, 0, 0x3ff) },
329 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2402_2_PID, 0, 0x3ff) },
330 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2402_3_PID, 0, 0x3ff) },
331 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2402_4_PID, 0, 0x3ff) },
332 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2403_1_PID, 0, 0x3ff) },
333 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2403_2_PID, 0, 0x3ff) },
334 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2403_3_PID, 0, 0x3ff) },
335 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2403_4_PID, 0, 0x3ff) },
336 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2801_1_PID, 0, 0x3ff) },
337 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2801_2_PID, 0, 0x3ff) },
338 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2801_3_PID, 0, 0x3ff) },
339 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2801_4_PID, 0, 0x3ff) },
340 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2801_5_PID, 0, 0x3ff) },
341 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2801_6_PID, 0, 0x3ff) },
342 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2801_7_PID, 0, 0x3ff) },
343 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2801_8_PID, 0, 0x3ff) },
344 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2802_1_PID, 0, 0x3ff) },
345 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2802_2_PID, 0, 0x3ff) },
346 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2802_3_PID, 0, 0x3ff) },
347 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2802_4_PID, 0, 0x3ff) },
348 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2802_5_PID, 0, 0x3ff) },
349 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2802_6_PID, 0, 0x3ff) },
350 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2802_7_PID, 0, 0x3ff) },
351 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2802_8_PID, 0, 0x3ff) },
352 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2803_1_PID, 0, 0x3ff) },
353 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2803_2_PID, 0, 0x3ff) },
354 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2803_3_PID, 0, 0x3ff) },
355 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2803_4_PID, 0, 0x3ff) },
356 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2803_5_PID, 0, 0x3ff) },
357 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2803_6_PID, 0, 0x3ff) },
358 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2803_7_PID, 0, 0x3ff) },
359 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2803_8_PID, 0, 0x3ff) },
360 { USB_DEVICE_VER(IDTECH_VID, IDTECH_IDT1221U_PID, 0, 0x3ff) },
361 { USB_DEVICE_VER(OCT_VID, OCT_US101_PID, 0, 0x3ff) },
362 { USB_DEVICE_VER(FTDI_VID, PROTEGO_SPECIAL_1, 0, 0x3ff) },
363 { USB_DEVICE_VER(FTDI_VID, PROTEGO_R2X0, 0, 0x3ff) },
364 { USB_DEVICE_VER(FTDI_VID, PROTEGO_SPECIAL_3, 0, 0x3ff) },
365 { USB_DEVICE_VER(FTDI_VID, PROTEGO_SPECIAL_4, 0, 0x3ff) },
366 { USB_DEVICE_VER(FTDI_VID, FTDI_ELV_UO100_PID, 0, 0x3ff) },
367 { USB_DEVICE_VER(FTDI_VID, FTDI_ELV_UM100_PID, 0, 0x3ff) },
368 { USB_DEVICE_VER(FTDI_VID, INSIDE_ACCESSO, 0, 0x3ff) },
369 { USB_DEVICE_VER(INTREPID_VID, INTREPID_VALUECAN_PID, 0, 0x3ff) },
370 { USB_DEVICE_VER(INTREPID_VID, INTREPID_NEOVI_PID, 0, 0x3ff) },
371 { USB_DEVICE_VER(FALCOM_VID, FALCOM_TWIST_PID, 0, 0x3ff) },
372 { USB_DEVICE_VER(FTDI_VID, FTDI_SUUNTO_SPORTS_PID, 0, 0x3ff) },
373 { USB_DEVICE_VER(FTDI_VID, FTDI_RM_CANVIEW_PID, 0, 0x3ff) },
374 { USB_DEVICE_VER(BANDB_VID, BANDB_USOTL4_PID, 0, 0x3ff) },
375 { USB_DEVICE_VER(BANDB_VID, BANDB_USTL4_PID, 0, 0x3ff) },
376 { USB_DEVICE_VER(BANDB_VID, BANDB_USO9ML2_PID, 0, 0x3ff) },
377 { USB_DEVICE_VER(FTDI_VID, EVER_ECO_PRO_CDS, 0, 0x3ff) },
378 { USB_DEVICE_VER(FTDI_VID, FTDI_4N_GALAXY_DE_0_PID, 0, 0x3ff) },
379 { USB_DEVICE_VER(FTDI_VID, FTDI_4N_GALAXY_DE_1_PID, 0, 0x3ff) },
380 { USB_DEVICE_VER(FTDI_VID, FTDI_4N_GALAXY_DE_2_PID, 0, 0x3ff) },
381 { } /* Terminating entry */
382};
383
384
385static struct usb_device_id id_table_FT232BM [] = {
386 { USB_DEVICE_VER(FTDI_VID, FTDI_IRTRANS_PID, 0x400, 0xffff) },
387 { USB_DEVICE_VER(FTDI_VID, FTDI_8U232AM_PID, 0x400, 0xffff) },
388 { USB_DEVICE_VER(FTDI_VID, FTDI_8U232AM_ALT_PID, 0x400, 0xffff) },
389 { USB_DEVICE_VER(FTDI_VID, FTDI_RELAIS_PID, 0x400, 0xffff) },
390 { USB_DEVICE_VER(FTDI_NF_RIC_VID, FTDI_NF_RIC_PID, 0x400, 0xffff) },
391 { USB_DEVICE_VER(FTDI_VID, FTDI_XF_632_PID, 0x400, 0xffff) },
392 { USB_DEVICE_VER(FTDI_VID, FTDI_XF_634_PID, 0x400, 0xffff) },
393 { USB_DEVICE_VER(FTDI_VID, FTDI_XF_547_PID, 0x400, 0xffff) },
394 { USB_DEVICE_VER(FTDI_VID, FTDI_XF_633_PID, 0x400, 0xffff) },
395 { USB_DEVICE_VER(FTDI_VID, FTDI_XF_631_PID, 0x400, 0xffff) },
396 { USB_DEVICE_VER(FTDI_VID, FTDI_XF_635_PID, 0x400, 0xffff) },
397 { USB_DEVICE_VER(FTDI_VID, FTDI_XF_640_PID, 0x400, 0xffff) },
398 { USB_DEVICE_VER(FTDI_VID, FTDI_XF_642_PID, 0x400, 0xffff) },
399 { USB_DEVICE_VER(FTDI_VID, FTDI_VNHCPCUSB_D_PID, 0x400, 0xffff) },
400 { USB_DEVICE_VER(FTDI_VID, FTDI_DSS20_PID, 0x400, 0xffff) },
401 { USB_DEVICE_VER(FTDI_VID, FTDI_MTXORB_0_PID, 0x400, 0xffff) },
402 { USB_DEVICE_VER(FTDI_VID, FTDI_MTXORB_1_PID, 0x400, 0xffff) },
403 { USB_DEVICE_VER(FTDI_VID, FTDI_MTXORB_2_PID, 0x400, 0xffff) },
404 { USB_DEVICE_VER(FTDI_VID, FTDI_MTXORB_3_PID, 0x400, 0xffff) },
405 { USB_DEVICE_VER(FTDI_VID, FTDI_MTXORB_4_PID, 0x400, 0xffff) },
406 { USB_DEVICE_VER(FTDI_VID, FTDI_MTXORB_5_PID, 0x400, 0xffff) },
407 { USB_DEVICE_VER(FTDI_VID, FTDI_MTXORB_6_PID, 0x400, 0xffff) },
408 { USB_DEVICE_VER(FTDI_VID, FTDI_PERLE_ULTRAPORT_PID, 0x400, 0xffff) },
409 { USB_DEVICE_VER(FTDI_VID, FTDI_PIEGROUP_PID, 0x400, 0xffff) },
410 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2101_PID, 0x400, 0xffff) },
411 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2102_PID, 0x400, 0xffff) },
412 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2103_PID, 0x400, 0xffff) },
413 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2104_PID, 0x400, 0xffff) },
414 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2201_1_PID, 0x400, 0xffff) },
415 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2201_2_PID, 0x400, 0xffff) },
416 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2202_1_PID, 0x400, 0xffff) },
417 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2202_2_PID, 0x400, 0xffff) },
418 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2203_1_PID, 0x400, 0xffff) },
419 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2203_2_PID, 0x400, 0xffff) },
420 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2401_1_PID, 0x400, 0xffff) },
421 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2401_2_PID, 0x400, 0xffff) },
422 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2401_3_PID, 0x400, 0xffff) },
423 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2401_4_PID, 0x400, 0xffff) },
424 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2402_1_PID, 0x400, 0xffff) },
425 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2402_2_PID, 0x400, 0xffff) },
426 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2402_3_PID, 0x400, 0xffff) },
427 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2402_4_PID, 0x400, 0xffff) },
428 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2403_1_PID, 0x400, 0xffff) },
429 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2403_2_PID, 0x400, 0xffff) },
430 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2403_3_PID, 0x400, 0xffff) },
431 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2403_4_PID, 0x400, 0xffff) },
432 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2801_1_PID, 0x400, 0xffff) },
433 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2801_2_PID, 0x400, 0xffff) },
434 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2801_3_PID, 0x400, 0xffff) },
435 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2801_4_PID, 0x400, 0xffff) },
436 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2801_5_PID, 0x400, 0xffff) },
437 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2801_6_PID, 0x400, 0xffff) },
438 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2801_7_PID, 0x400, 0xffff) },
439 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2801_8_PID, 0x400, 0xffff) },
440 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2802_1_PID, 0x400, 0xffff) },
441 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2802_2_PID, 0x400, 0xffff) },
442 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2802_3_PID, 0x400, 0xffff) },
443 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2802_4_PID, 0x400, 0xffff) },
444 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2802_5_PID, 0x400, 0xffff) },
445 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2802_6_PID, 0x400, 0xffff) },
446 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2802_7_PID, 0x400, 0xffff) },
447 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2802_8_PID, 0x400, 0xffff) },
448 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2803_1_PID, 0x400, 0xffff) },
449 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2803_2_PID, 0x400, 0xffff) },
450 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2803_3_PID, 0x400, 0xffff) },
451 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2803_4_PID, 0x400, 0xffff) },
452 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2803_5_PID, 0x400, 0xffff) },
453 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2803_6_PID, 0x400, 0xffff) },
454 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2803_7_PID, 0x400, 0xffff) },
455 { USB_DEVICE_VER(SEALEVEL_VID, SEALEVEL_2803_8_PID, 0x400, 0xffff) },
456 { USB_DEVICE_VER(IDTECH_VID, IDTECH_IDT1221U_PID, 0x400, 0xffff) },
457 { USB_DEVICE_VER(OCT_VID, OCT_US101_PID, 0x400, 0xffff) },
458 { USB_DEVICE_VER(FTDI_VID, PROTEGO_SPECIAL_1, 0x400, 0xffff) },
459 { USB_DEVICE_VER(FTDI_VID, PROTEGO_R2X0, 0x400, 0xffff) },
460 { USB_DEVICE_VER(FTDI_VID, PROTEGO_SPECIAL_3, 0x400, 0xffff) },
461 { USB_DEVICE_VER(FTDI_VID, PROTEGO_SPECIAL_4, 0x400, 0xffff) },
462 { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E808_PID, 0x400, 0xffff) },
463 { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E809_PID, 0x400, 0xffff) },
464 { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E80A_PID, 0x400, 0xffff) },
465 { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E80B_PID, 0x400, 0xffff) },
466 { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E80C_PID, 0x400, 0xffff) },
467 { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E80D_PID, 0x400, 0xffff) },
468 { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E80E_PID, 0x400, 0xffff) },
469 { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E80F_PID, 0x400, 0xffff) },
470 { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E888_PID, 0x400, 0xffff) },
471 { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E889_PID, 0x400, 0xffff) },
472 { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E88A_PID, 0x400, 0xffff) },
473 { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E88B_PID, 0x400, 0xffff) },
474 { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E88C_PID, 0x400, 0xffff) },
475 { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E88D_PID, 0x400, 0xffff) },
476 { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E88E_PID, 0x400, 0xffff) },
477 { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E88F_PID, 0x400, 0xffff) },
478 { USB_DEVICE_VER(FTDI_VID, FTDI_ELV_UO100_PID, 0x400, 0xffff) },
479 { USB_DEVICE_VER(FTDI_VID, FTDI_ELV_UM100_PID, 0x400, 0xffff) },
480 { USB_DEVICE_VER(FTDI_VID, LINX_SDMUSBQSS_PID, 0x400, 0xffff) },
481 { USB_DEVICE_VER(FTDI_VID, LINX_MASTERDEVEL2_PID, 0x400, 0xffff) },
482 { USB_DEVICE_VER(FTDI_VID, LINX_FUTURE_0_PID, 0x400, 0xffff) },
483 { USB_DEVICE_VER(FTDI_VID, LINX_FUTURE_1_PID, 0x400, 0xffff) },
484 { USB_DEVICE_VER(FTDI_VID, LINX_FUTURE_2_PID, 0x400, 0xffff) },
485 { USB_DEVICE(FTDI_VID, FTDI_CCSICDU20_0_PID) },
486 { USB_DEVICE(FTDI_VID, FTDI_CCSICDU40_1_PID) },
487 { USB_DEVICE_VER(FTDI_VID, INSIDE_ACCESSO, 0x400, 0xffff) },
488 { USB_DEVICE_VER(INTREPID_VID, INTREPID_VALUECAN_PID, 0x400, 0xffff) },
489 { USB_DEVICE_VER(INTREPID_VID, INTREPID_NEOVI_PID, 0x400, 0xffff) },
490 { USB_DEVICE_VER(FALCOM_VID, FALCOM_TWIST_PID, 0x400, 0xffff) },
491 { USB_DEVICE_VER(FTDI_VID, FTDI_SUUNTO_SPORTS_PID, 0x400, 0xffff) },
492 { USB_DEVICE_VER(FTDI_VID, FTDI_RM_CANVIEW_PID, 0x400, 0xffff) },
493 { USB_DEVICE_VER(BANDB_VID, BANDB_USOTL4_PID, 0x400, 0xffff) },
494 { USB_DEVICE_VER(BANDB_VID, BANDB_USTL4_PID, 0x400, 0xffff) },
495 { USB_DEVICE_VER(BANDB_VID, BANDB_USO9ML2_PID, 0x400, 0xffff) },
496 { USB_DEVICE_VER(FTDI_VID, EVER_ECO_PRO_CDS, 0x400, 0xffff) },
497 { USB_DEVICE_VER(FTDI_VID, FTDI_4N_GALAXY_DE_0_PID, 0x400, 0xffff) },
498 { USB_DEVICE_VER(FTDI_VID, FTDI_4N_GALAXY_DE_1_PID, 0x400, 0xffff) },
499 { USB_DEVICE_VER(FTDI_VID, FTDI_4N_GALAXY_DE_2_PID, 0x400, 0xffff) },
500 { USB_DEVICE_VER(FTDI_VID, FTDI_ACTIVE_ROBOTS_PID, 0x400, 0xffff) },
501 { } /* Terminating entry */
502};
503
504
505static struct usb_device_id id_table_USB_UIRT [] = {
506 { USB_DEVICE(FTDI_VID, FTDI_USB_UIRT_PID) },
507 { } /* Terminating entry */
508};
509
510
511static struct usb_device_id id_table_HE_TIRA1 [] = {
512 { USB_DEVICE_VER(FTDI_VID, FTDI_HE_TIRA1_PID, 0x400, 0xffff) },
513 { } /* Terminating entry */
514};
515
516
517static struct usb_device_id id_table_FT2232C[] = {
518 { USB_DEVICE(FTDI_VID, FTDI_8U2232C_PID) },
519 { } /* Terminating entry */
520};
521
522 306
523static struct usb_device_id id_table_combined [] = { 307static struct usb_device_id id_table_combined [] = {
524 { USB_DEVICE(FTDI_VID, FTDI_IRTRANS_PID) }, 308 { USB_DEVICE(FTDI_VID, FTDI_IRTRANS_PID) },
@@ -540,14 +324,14 @@ static struct usb_device_id id_table_combined [] = {
540 { USB_DEVICE(FTDI_VID, FTDI_DSS20_PID) }, 324 { USB_DEVICE(FTDI_VID, FTDI_DSS20_PID) },
541 { USB_DEVICE(FTDI_NF_RIC_VID, FTDI_NF_RIC_PID) }, 325 { USB_DEVICE(FTDI_NF_RIC_VID, FTDI_NF_RIC_PID) },
542 { USB_DEVICE(FTDI_VID, FTDI_VNHCPCUSB_D_PID) }, 326 { USB_DEVICE(FTDI_VID, FTDI_VNHCPCUSB_D_PID) },
543 { USB_DEVICE_VER(FTDI_VID, FTDI_MTXORB_0_PID, 0x400, 0xffff) }, 327 { USB_DEVICE(FTDI_VID, FTDI_MTXORB_0_PID) },
544 { USB_DEVICE_VER(FTDI_VID, FTDI_MTXORB_1_PID, 0x400, 0xffff) }, 328 { USB_DEVICE(FTDI_VID, FTDI_MTXORB_1_PID) },
545 { USB_DEVICE_VER(FTDI_VID, FTDI_MTXORB_2_PID, 0x400, 0xffff) }, 329 { USB_DEVICE(FTDI_VID, FTDI_MTXORB_2_PID) },
546 { USB_DEVICE_VER(FTDI_VID, FTDI_MTXORB_3_PID, 0x400, 0xffff) }, 330 { USB_DEVICE(FTDI_VID, FTDI_MTXORB_3_PID) },
547 { USB_DEVICE_VER(FTDI_VID, FTDI_MTXORB_4_PID, 0x400, 0xffff) }, 331 { USB_DEVICE(FTDI_VID, FTDI_MTXORB_4_PID) },
548 { USB_DEVICE_VER(FTDI_VID, FTDI_MTXORB_5_PID, 0x400, 0xffff) }, 332 { USB_DEVICE(FTDI_VID, FTDI_MTXORB_5_PID) },
549 { USB_DEVICE_VER(FTDI_VID, FTDI_MTXORB_6_PID, 0x400, 0xffff) }, 333 { USB_DEVICE(FTDI_VID, FTDI_MTXORB_6_PID) },
550 { USB_DEVICE_VER(FTDI_VID, FTDI_PERLE_ULTRAPORT_PID, 0x400, 0xffff) }, 334 { USB_DEVICE(FTDI_VID, FTDI_PERLE_ULTRAPORT_PID) },
551 { USB_DEVICE(FTDI_VID, FTDI_PIEGROUP_PID) }, 335 { USB_DEVICE(FTDI_VID, FTDI_PIEGROUP_PID) },
552 { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2101_PID) }, 336 { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2101_PID) },
553 { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2102_PID) }, 337 { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2102_PID) },
@@ -597,35 +381,37 @@ static struct usb_device_id id_table_combined [] = {
597 { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_8_PID) }, 381 { USB_DEVICE(SEALEVEL_VID, SEALEVEL_2803_8_PID) },
598 { USB_DEVICE(IDTECH_VID, IDTECH_IDT1221U_PID) }, 382 { USB_DEVICE(IDTECH_VID, IDTECH_IDT1221U_PID) },
599 { USB_DEVICE(OCT_VID, OCT_US101_PID) }, 383 { USB_DEVICE(OCT_VID, OCT_US101_PID) },
600 { USB_DEVICE_VER(FTDI_VID, FTDI_HE_TIRA1_PID, 0x400, 0xffff) }, 384 { USB_DEVICE(FTDI_VID, FTDI_HE_TIRA1_PID),
601 { USB_DEVICE(FTDI_VID, FTDI_USB_UIRT_PID) }, 385 .driver_info = (kernel_ulong_t)&ftdi_HE_TIRA1_quirk },
386 { USB_DEVICE(FTDI_VID, FTDI_USB_UIRT_PID),
387 .driver_info = (kernel_ulong_t)&ftdi_USB_UIRT_quirk },
602 { USB_DEVICE(FTDI_VID, PROTEGO_SPECIAL_1) }, 388 { USB_DEVICE(FTDI_VID, PROTEGO_SPECIAL_1) },
603 { USB_DEVICE(FTDI_VID, PROTEGO_R2X0) }, 389 { USB_DEVICE(FTDI_VID, PROTEGO_R2X0) },
604 { USB_DEVICE(FTDI_VID, PROTEGO_SPECIAL_3) }, 390 { USB_DEVICE(FTDI_VID, PROTEGO_SPECIAL_3) },
605 { USB_DEVICE(FTDI_VID, PROTEGO_SPECIAL_4) }, 391 { USB_DEVICE(FTDI_VID, PROTEGO_SPECIAL_4) },
606 { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E808_PID, 0x400, 0xffff) }, 392 { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E808_PID) },
607 { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E809_PID, 0x400, 0xffff) }, 393 { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E809_PID) },
608 { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E80A_PID, 0x400, 0xffff) }, 394 { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E80A_PID) },
609 { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E80B_PID, 0x400, 0xffff) }, 395 { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E80B_PID) },
610 { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E80C_PID, 0x400, 0xffff) }, 396 { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E80C_PID) },
611 { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E80D_PID, 0x400, 0xffff) }, 397 { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E80D_PID) },
612 { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E80E_PID, 0x400, 0xffff) }, 398 { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E80E_PID) },
613 { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E80F_PID, 0x400, 0xffff) }, 399 { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E80F_PID) },
614 { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E888_PID, 0x400, 0xffff) }, 400 { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E888_PID) },
615 { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E889_PID, 0x400, 0xffff) }, 401 { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E889_PID) },
616 { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E88A_PID, 0x400, 0xffff) }, 402 { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E88A_PID) },
617 { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E88B_PID, 0x400, 0xffff) }, 403 { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E88B_PID) },
618 { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E88C_PID, 0x400, 0xffff) }, 404 { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E88C_PID) },
619 { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E88D_PID, 0x400, 0xffff) }, 405 { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E88D_PID) },
620 { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E88E_PID, 0x400, 0xffff) }, 406 { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E88E_PID) },
621 { USB_DEVICE_VER(FTDI_VID, FTDI_GUDEADS_E88F_PID, 0x400, 0xffff) }, 407 { USB_DEVICE(FTDI_VID, FTDI_GUDEADS_E88F_PID) },
622 { USB_DEVICE(FTDI_VID, FTDI_ELV_UO100_PID) }, 408 { USB_DEVICE(FTDI_VID, FTDI_ELV_UO100_PID) },
623 { USB_DEVICE(FTDI_VID, FTDI_ELV_UM100_PID) }, 409 { USB_DEVICE(FTDI_VID, FTDI_ELV_UM100_PID) },
624 { USB_DEVICE_VER(FTDI_VID, LINX_SDMUSBQSS_PID, 0x400, 0xffff) }, 410 { USB_DEVICE(FTDI_VID, LINX_SDMUSBQSS_PID) },
625 { USB_DEVICE_VER(FTDI_VID, LINX_MASTERDEVEL2_PID, 0x400, 0xffff) }, 411 { USB_DEVICE(FTDI_VID, LINX_MASTERDEVEL2_PID) },
626 { USB_DEVICE_VER(FTDI_VID, LINX_FUTURE_0_PID, 0x400, 0xffff) }, 412 { USB_DEVICE(FTDI_VID, LINX_FUTURE_0_PID) },
627 { USB_DEVICE_VER(FTDI_VID, LINX_FUTURE_1_PID, 0x400, 0xffff) }, 413 { USB_DEVICE(FTDI_VID, LINX_FUTURE_1_PID) },
628 { USB_DEVICE_VER(FTDI_VID, LINX_FUTURE_2_PID, 0x400, 0xffff) }, 414 { USB_DEVICE(FTDI_VID, LINX_FUTURE_2_PID) },
629 { USB_DEVICE(FTDI_VID, FTDI_CCSICDU20_0_PID) }, 415 { USB_DEVICE(FTDI_VID, FTDI_CCSICDU20_0_PID) },
630 { USB_DEVICE(FTDI_VID, FTDI_CCSICDU40_1_PID) }, 416 { USB_DEVICE(FTDI_VID, FTDI_CCSICDU40_1_PID) },
631 { USB_DEVICE(FTDI_VID, INSIDE_ACCESSO) }, 417 { USB_DEVICE(FTDI_VID, INSIDE_ACCESSO) },
@@ -642,7 +428,7 @@ static struct usb_device_id id_table_combined [] = {
642 { USB_DEVICE(FTDI_VID, FTDI_4N_GALAXY_DE_1_PID) }, 428 { USB_DEVICE(FTDI_VID, FTDI_4N_GALAXY_DE_1_PID) },
643 { USB_DEVICE(FTDI_VID, FTDI_4N_GALAXY_DE_2_PID) }, 429 { USB_DEVICE(FTDI_VID, FTDI_4N_GALAXY_DE_2_PID) },
644 { USB_DEVICE(MOBILITY_VID, MOBILITY_USB_SERIAL_PID) }, 430 { USB_DEVICE(MOBILITY_VID, MOBILITY_USB_SERIAL_PID) },
645 { USB_DEVICE_VER(FTDI_VID, FTDI_ACTIVE_ROBOTS_PID, 0x400, 0xffff) }, 431 { USB_DEVICE(FTDI_VID, FTDI_ACTIVE_ROBOTS_PID) },
646 { } /* Terminating entry */ 432 { } /* Terminating entry */
647}; 433};
648 434
@@ -705,12 +491,8 @@ struct ftdi_private {
705 ASYNC_SPD_CUST | ASYNC_SPD_SHI | ASYNC_SPD_WARP ) 491 ASYNC_SPD_CUST | ASYNC_SPD_SHI | ASYNC_SPD_WARP )
706 492
707/* function prototypes for a FTDI serial converter */ 493/* function prototypes for a FTDI serial converter */
708static int ftdi_SIO_startup (struct usb_serial *serial); 494static int ftdi_sio_probe (struct usb_serial *serial, const struct usb_device_id *id);
709static int ftdi_8U232AM_startup (struct usb_serial *serial); 495static int ftdi_sio_attach (struct usb_serial *serial);
710static int ftdi_FT232BM_startup (struct usb_serial *serial);
711static int ftdi_FT2232C_startup (struct usb_serial *serial);
712static int ftdi_USB_UIRT_startup (struct usb_serial *serial);
713static int ftdi_HE_TIRA1_startup (struct usb_serial *serial);
714static void ftdi_shutdown (struct usb_serial *serial); 496static void ftdi_shutdown (struct usb_serial *serial);
715static int ftdi_open (struct usb_serial_port *port, struct file *filp); 497static int ftdi_open (struct usb_serial_port *port, struct file *filp);
716static void ftdi_close (struct usb_serial_port *port, struct file *filp); 498static void ftdi_close (struct usb_serial_port *port, struct file *filp);
@@ -733,66 +515,16 @@ static unsigned short int ftdi_232am_baud_to_divisor (int baud);
733static __u32 ftdi_232bm_baud_base_to_divisor (int baud, int base); 515static __u32 ftdi_232bm_baud_base_to_divisor (int baud, int base);
734static __u32 ftdi_232bm_baud_to_divisor (int baud); 516static __u32 ftdi_232bm_baud_to_divisor (int baud);
735 517
736static struct usb_serial_device_type ftdi_SIO_device = { 518static struct usb_serial_device_type ftdi_sio_device = {
737 .owner = THIS_MODULE,
738 .name = "FTDI SIO",
739 .id_table = id_table_sio,
740 .num_interrupt_in = 0,
741 .num_bulk_in = 1,
742 .num_bulk_out = 1,
743 .num_ports = 1,
744 .open = ftdi_open,
745 .close = ftdi_close,
746 .throttle = ftdi_throttle,
747 .unthrottle = ftdi_unthrottle,
748 .write = ftdi_write,
749 .write_room = ftdi_write_room,
750 .chars_in_buffer = ftdi_chars_in_buffer,
751 .read_bulk_callback = ftdi_read_bulk_callback,
752 .write_bulk_callback = ftdi_write_bulk_callback,
753 .tiocmget = ftdi_tiocmget,
754 .tiocmset = ftdi_tiocmset,
755 .ioctl = ftdi_ioctl,
756 .set_termios = ftdi_set_termios,
757 .break_ctl = ftdi_break_ctl,
758 .attach = ftdi_SIO_startup,
759 .shutdown = ftdi_shutdown,
760};
761
762static struct usb_serial_device_type ftdi_8U232AM_device = {
763 .owner = THIS_MODULE,
764 .name = "FTDI 8U232AM Compatible",
765 .id_table = id_table_8U232AM,
766 .num_interrupt_in = 0,
767 .num_bulk_in = 1,
768 .num_bulk_out = 1,
769 .num_ports = 1,
770 .open = ftdi_open,
771 .close = ftdi_close,
772 .throttle = ftdi_throttle,
773 .unthrottle = ftdi_unthrottle,
774 .write = ftdi_write,
775 .write_room = ftdi_write_room,
776 .chars_in_buffer = ftdi_chars_in_buffer,
777 .read_bulk_callback = ftdi_read_bulk_callback,
778 .write_bulk_callback = ftdi_write_bulk_callback,
779 .tiocmget = ftdi_tiocmget,
780 .tiocmset = ftdi_tiocmset,
781 .ioctl = ftdi_ioctl,
782 .set_termios = ftdi_set_termios,
783 .break_ctl = ftdi_break_ctl,
784 .attach = ftdi_8U232AM_startup,
785 .shutdown = ftdi_shutdown,
786};
787
788static struct usb_serial_device_type ftdi_FT232BM_device = {
789 .owner = THIS_MODULE, 519 .owner = THIS_MODULE,
790 .name = "FTDI FT232BM Compatible", 520 .name = "FTDI USB Serial Device",
791 .id_table = id_table_FT232BM, 521 .short_name = "ftdi_sio",
522 .id_table = id_table_combined,
792 .num_interrupt_in = 0, 523 .num_interrupt_in = 0,
793 .num_bulk_in = 1, 524 .num_bulk_in = 1,
794 .num_bulk_out = 1, 525 .num_bulk_out = 1,
795 .num_ports = 1, 526 .num_ports = 1,
527 .probe = ftdi_sio_probe,
796 .open = ftdi_open, 528 .open = ftdi_open,
797 .close = ftdi_close, 529 .close = ftdi_close,
798 .throttle = ftdi_throttle, 530 .throttle = ftdi_throttle,
@@ -807,91 +539,10 @@ static struct usb_serial_device_type ftdi_FT232BM_device = {
807 .ioctl = ftdi_ioctl, 539 .ioctl = ftdi_ioctl,
808 .set_termios = ftdi_set_termios, 540 .set_termios = ftdi_set_termios,
809 .break_ctl = ftdi_break_ctl, 541 .break_ctl = ftdi_break_ctl,
810 .attach = ftdi_FT232BM_startup, 542 .attach = ftdi_sio_attach,
811 .shutdown = ftdi_shutdown, 543 .shutdown = ftdi_shutdown,
812}; 544};
813 545
814static struct usb_serial_device_type ftdi_FT2232C_device = {
815 .owner = THIS_MODULE,
816 .name = "FTDI FT2232C Compatible",
817 .id_table = id_table_FT2232C,
818 .num_interrupt_in = 0,
819 .num_bulk_in = 1,
820 .num_bulk_out = 1,
821 .num_ports = 1,
822 .open = ftdi_open,
823 .close = ftdi_close,
824 .throttle = ftdi_throttle,
825 .unthrottle = ftdi_unthrottle,
826 .write = ftdi_write,
827 .write_room = ftdi_write_room,
828 .chars_in_buffer = ftdi_chars_in_buffer,
829 .read_bulk_callback = ftdi_read_bulk_callback,
830 .write_bulk_callback = ftdi_write_bulk_callback,
831 .tiocmget = ftdi_tiocmget,
832 .tiocmset = ftdi_tiocmset,
833 .ioctl = ftdi_ioctl,
834 .set_termios = ftdi_set_termios,
835 .break_ctl = ftdi_break_ctl,
836 .attach = ftdi_FT2232C_startup,
837 .shutdown = ftdi_shutdown,
838};
839
840static struct usb_serial_device_type ftdi_USB_UIRT_device = {
841 .owner = THIS_MODULE,
842 .name = "USB-UIRT Infrared Tranceiver",
843 .id_table = id_table_USB_UIRT,
844 .num_interrupt_in = 0,
845 .num_bulk_in = 1,
846 .num_bulk_out = 1,
847 .num_ports = 1,
848 .open = ftdi_open,
849 .close = ftdi_close,
850 .throttle = ftdi_throttle,
851 .unthrottle = ftdi_unthrottle,
852 .write = ftdi_write,
853 .write_room = ftdi_write_room,
854 .chars_in_buffer = ftdi_chars_in_buffer,
855 .read_bulk_callback = ftdi_read_bulk_callback,
856 .write_bulk_callback = ftdi_write_bulk_callback,
857 .tiocmget = ftdi_tiocmget,
858 .tiocmset = ftdi_tiocmset,
859 .ioctl = ftdi_ioctl,
860 .set_termios = ftdi_set_termios,
861 .break_ctl = ftdi_break_ctl,
862 .attach = ftdi_USB_UIRT_startup,
863 .shutdown = ftdi_shutdown,
864};
865
866/* The TIRA1 is based on a FT232BM which requires a fixed baud rate of 100000
867 * and which requires RTS-CTS to be enabled. */
868static struct usb_serial_device_type ftdi_HE_TIRA1_device = {
869 .owner = THIS_MODULE,
870 .name = "Home-Electronics TIRA-1 IR Transceiver",
871 .id_table = id_table_HE_TIRA1,
872 .num_interrupt_in = 0,
873 .num_bulk_in = 1,
874 .num_bulk_out = 1,
875 .num_ports = 1,
876 .open = ftdi_open,
877 .close = ftdi_close,
878 .throttle = ftdi_throttle,
879 .unthrottle = ftdi_unthrottle,
880 .write = ftdi_write,
881 .write_room = ftdi_write_room,
882 .chars_in_buffer = ftdi_chars_in_buffer,
883 .read_bulk_callback = ftdi_read_bulk_callback,
884 .write_bulk_callback = ftdi_write_bulk_callback,
885 .tiocmget = ftdi_tiocmget,
886 .tiocmset = ftdi_tiocmset,
887 .ioctl = ftdi_ioctl,
888 .set_termios = ftdi_set_termios,
889 .break_ctl = ftdi_break_ctl,
890 .attach = ftdi_HE_TIRA1_startup,
891 .shutdown = ftdi_shutdown,
892};
893
894
895 546
896#define WDR_TIMEOUT 5000 /* default urb timeout */ 547#define WDR_TIMEOUT 5000 /* default urb timeout */
897 548
@@ -1212,6 +863,59 @@ check_and_exit:
1212} /* set_serial_info */ 863} /* set_serial_info */
1213 864
1214 865
866/* Determine type of FTDI chip based on USB config and descriptor. */
867static void ftdi_determine_type(struct usb_serial_port *port)
868{
869 struct ftdi_private *priv = usb_get_serial_port_data(port);
870 struct usb_serial *serial = port->serial;
871 struct usb_device *udev = serial->dev;
872 unsigned version;
873 unsigned interfaces;
874
875 /* Assume it is not the original SIO device for now. */
876 priv->baud_base = 48000000 / 16;
877 priv->write_offset = 0;
878
879 version = le16_to_cpu(udev->descriptor.bcdDevice);
880 interfaces = udev->actconfig->desc.bNumInterfaces;
881 dbg("%s: bcdDevice = 0x%x, bNumInterfaces = %u", __FUNCTION__,
882 version, interfaces);
883 if (interfaces > 1) {
884 int inter;
885
886 /* Multiple interfaces. Assume FT2232C. */
887 priv->chip_type = FT2232C;
888 /* Determine interface code. */
889 inter = serial->interface->altsetting->desc.bInterfaceNumber;
890 if (inter == 0) {
891 priv->interface = PIT_SIOA;
892 } else {
893 priv->interface = PIT_SIOB;
894 }
895 /* BM-type devices have a bug where bcdDevice gets set
896 * to 0x200 when iSerialNumber is 0. */
897 if (version < 0x500) {
898 dbg("%s: something fishy - bcdDevice too low for multi-interface device",
899 __FUNCTION__);
900 }
901 } else if (version < 0x200) {
902 /* Old device. Assume its the original SIO. */
903 priv->chip_type = SIO;
904 priv->baud_base = 12000000 / 16;
905 priv->write_offset = 1;
906 } else if (version < 0x400) {
907 /* Assume its an FT8U232AM (or FT8U245AM) */
908 /* (It might be a BM because of the iSerialNumber bug,
909 * but it will still work as an AM device.) */
910 priv->chip_type = FT8U232AM;
911 } else {
912 /* Assume its an FT232BM (or FT245BM) */
913 priv->chip_type = FT232BM;
914 }
915 info("Detected %s", ftdi_chip_name[priv->chip_type]);
916}
917
918
1215/* 919/*
1216 * *************************************************************************** 920 * ***************************************************************************
1217 * Sysfs Attribute 921 * Sysfs Attribute
@@ -1355,12 +1059,20 @@ static void remove_sysfs_attrs(struct usb_serial *serial)
1355 * *************************************************************************** 1059 * ***************************************************************************
1356 */ 1060 */
1357 1061
1358/* Common startup subroutine */ 1062/* Probe function to check for special devices */
1359/* Called from ftdi_SIO_startup, etc. */ 1063static int ftdi_sio_probe (struct usb_serial *serial, const struct usb_device_id *id)
1360static int ftdi_common_startup (struct usb_serial *serial) 1064{
1065 usb_set_serial_data(serial, (void *)id->driver_info);
1066
1067 return (0);
1068}
1069
1070/* attach subroutine */
1071static int ftdi_sio_attach (struct usb_serial *serial)
1361{ 1072{
1362 struct usb_serial_port *port = serial->port[0]; 1073 struct usb_serial_port *port = serial->port[0];
1363 struct ftdi_private *priv; 1074 struct ftdi_private *priv;
1075 struct ftdi_sio_quirk *quirk;
1364 1076
1365 dbg("%s",__FUNCTION__); 1077 dbg("%s",__FUNCTION__);
1366 1078
@@ -1400,150 +1112,49 @@ static int ftdi_common_startup (struct usb_serial *serial)
1400 port->bulk_out_buffer = NULL; 1112 port->bulk_out_buffer = NULL;
1401 1113
1402 usb_set_serial_port_data(serial->port[0], priv); 1114 usb_set_serial_port_data(serial->port[0], priv);
1403
1404 return (0);
1405}
1406
1407
1408/* Startup for the SIO chip */
1409/* Called from usbserial:serial_probe */
1410static int ftdi_SIO_startup (struct usb_serial *serial)
1411{
1412 struct ftdi_private *priv;
1413 int err;
1414 1115
1415 dbg("%s",__FUNCTION__); 1116 ftdi_determine_type (serial->port[0]);
1416
1417 err = ftdi_common_startup(serial);
1418 if (err){
1419 return (err);
1420 }
1421
1422 priv = usb_get_serial_port_data(serial->port[0]);
1423 priv->chip_type = SIO;
1424 priv->baud_base = 12000000 / 16;
1425 priv->write_offset = 1;
1426
1427 return (0);
1428}
1429
1430/* Startup for the 8U232AM chip */
1431/* Called from usbserial:serial_probe */
1432static int ftdi_8U232AM_startup (struct usb_serial *serial)
1433{ /* ftdi_8U232AM_startup */
1434 struct ftdi_private *priv;
1435 int err;
1436
1437 dbg("%s",__FUNCTION__);
1438 err = ftdi_common_startup(serial);
1439 if (err){
1440 return (err);
1441 }
1442
1443 priv = usb_get_serial_port_data(serial->port[0]);
1444 priv->chip_type = FT8U232AM;
1445 priv->baud_base = 48000000 / 2; /* Would be / 16, but FTDI supports 0.125, 0.25 and 0.5 divisor fractions! */
1446
1447 create_sysfs_attrs(serial); 1117 create_sysfs_attrs(serial);
1448
1449 return (0);
1450} /* ftdi_8U232AM_startup */
1451 1118
1452/* Startup for the FT232BM chip */ 1119 /* Check for device requiring special set up. */
1453/* Called from usbserial:serial_probe */ 1120 quirk = (struct ftdi_sio_quirk *)usb_get_serial_data(serial);
1454static int ftdi_FT232BM_startup (struct usb_serial *serial) 1121 if (quirk && quirk->setup) {
1455{ /* ftdi_FT232BM_startup */ 1122 quirk->setup(serial);
1456 struct ftdi_private *priv;
1457 int err;
1458
1459 dbg("%s",__FUNCTION__);
1460 err = ftdi_common_startup(serial);
1461 if (err){
1462 return (err);
1463 } 1123 }
1464
1465 priv = usb_get_serial_port_data(serial->port[0]);
1466 priv->chip_type = FT232BM;
1467 priv->baud_base = 48000000 / 2; /* Would be / 16, but FT232BM supports multiple of 0.125 divisor fractions! */
1468 1124
1469 create_sysfs_attrs(serial);
1470
1471 return (0); 1125 return (0);
1472} /* ftdi_FT232BM_startup */ 1126} /* ftdi_sio_attach */
1473 1127
1474/* Startup for the FT2232C chip */
1475/* Called from usbserial:serial_probe */
1476static int ftdi_FT2232C_startup (struct usb_serial *serial)
1477{ /* ftdi_FT2232C_startup */
1478 struct ftdi_private *priv;
1479 int err;
1480 int inter;
1481
1482 dbg("%s",__FUNCTION__);
1483 err = ftdi_common_startup(serial);
1484 if (err){
1485 return (err);
1486 }
1487
1488 priv = usb_get_serial_port_data(serial->port[0]);
1489 priv->chip_type = FT2232C;
1490 inter = serial->interface->altsetting->desc.bInterfaceNumber;
1491
1492 if (inter) {
1493 priv->interface = PIT_SIOB;
1494 }
1495 else {
1496 priv->interface = PIT_SIOA;
1497 }
1498 priv->baud_base = 48000000 / 2; /* Would be / 16, but FT2232C supports multiple of 0.125 divisor fractions! */
1499
1500 create_sysfs_attrs(serial);
1501
1502 return (0);
1503} /* ftdi_FT2232C_startup */
1504 1128
1505/* Startup for the USB-UIRT device, which requires hardwired baudrate (38400 gets mapped to 312500) */ 1129/* Setup for the USB-UIRT device, which requires hardwired
1130 * baudrate (38400 gets mapped to 312500) */
1506/* Called from usbserial:serial_probe */ 1131/* Called from usbserial:serial_probe */
1507static int ftdi_USB_UIRT_startup (struct usb_serial *serial) 1132static void ftdi_USB_UIRT_setup (struct usb_serial *serial)
1508{ /* ftdi_USB_UIRT_startup */ 1133{
1509 struct ftdi_private *priv; 1134 struct ftdi_private *priv;
1510 int err;
1511 1135
1512 dbg("%s",__FUNCTION__); 1136 dbg("%s",__FUNCTION__);
1513 err = ftdi_8U232AM_startup(serial);
1514 if (err){
1515 return (err);
1516 }
1517 1137
1518 priv = usb_get_serial_port_data(serial->port[0]); 1138 priv = usb_get_serial_port_data(serial->port[0]);
1519 priv->flags |= ASYNC_SPD_CUST; 1139 priv->flags |= ASYNC_SPD_CUST;
1520 priv->custom_divisor = 77; 1140 priv->custom_divisor = 77;
1521 priv->force_baud = B38400; 1141 priv->force_baud = B38400;
1522 1142} /* ftdi_USB_UIRT_setup */
1523 return (0);
1524} /* ftdi_USB_UIRT_startup */
1525 1143
1526/* Startup for the HE-TIRA1 device, which requires hardwired 1144/* Setup for the HE-TIRA1 device, which requires hardwired
1527 * baudrate (38400 gets mapped to 100000) */ 1145 * baudrate (38400 gets mapped to 100000) and RTS-CTS enabled. */
1528static int ftdi_HE_TIRA1_startup (struct usb_serial *serial) 1146static void ftdi_HE_TIRA1_setup (struct usb_serial *serial)
1529{ /* ftdi_HE_TIRA1_startup */ 1147{
1530 struct ftdi_private *priv; 1148 struct ftdi_private *priv;
1531 int err;
1532 1149
1533 dbg("%s",__FUNCTION__); 1150 dbg("%s",__FUNCTION__);
1534 err = ftdi_FT232BM_startup(serial);
1535 if (err){
1536 return (err);
1537 }
1538 1151
1539 priv = usb_get_serial_port_data(serial->port[0]); 1152 priv = usb_get_serial_port_data(serial->port[0]);
1540 priv->flags |= ASYNC_SPD_CUST; 1153 priv->flags |= ASYNC_SPD_CUST;
1541 priv->custom_divisor = 240; 1154 priv->custom_divisor = 240;
1542 priv->force_baud = B38400; 1155 priv->force_baud = B38400;
1543 priv->force_rtscts = 1; 1156 priv->force_rtscts = 1;
1544 1157} /* ftdi_HE_TIRA1_setup */
1545 return (0);
1546} /* ftdi_HE_TIRA1_startup */
1547 1158
1548 1159
1549/* ftdi_shutdown is called from usbserial:usb_serial_disconnect 1160/* ftdi_shutdown is called from usbserial:usb_serial_disconnect
@@ -2516,24 +2127,9 @@ static int __init ftdi_init (void)
2516 int retval; 2127 int retval;
2517 2128
2518 dbg("%s", __FUNCTION__); 2129 dbg("%s", __FUNCTION__);
2519 retval = usb_serial_register(&ftdi_SIO_device); 2130 retval = usb_serial_register(&ftdi_sio_device);
2520 if (retval)
2521 goto failed_SIO_register;
2522 retval = usb_serial_register(&ftdi_8U232AM_device);
2523 if (retval)
2524 goto failed_8U232AM_register;
2525 retval = usb_serial_register(&ftdi_FT232BM_device);
2526 if (retval)
2527 goto failed_FT232BM_register;
2528 retval = usb_serial_register(&ftdi_FT2232C_device);
2529 if (retval)
2530 goto failed_FT2232C_register;
2531 retval = usb_serial_register(&ftdi_USB_UIRT_device);
2532 if (retval)
2533 goto failed_USB_UIRT_register;
2534 retval = usb_serial_register(&ftdi_HE_TIRA1_device);
2535 if (retval) 2131 if (retval)
2536 goto failed_HE_TIRA1_register; 2132 goto failed_sio_register;
2537 retval = usb_register(&ftdi_driver); 2133 retval = usb_register(&ftdi_driver);
2538 if (retval) 2134 if (retval)
2539 goto failed_usb_register; 2135 goto failed_usb_register;
@@ -2541,18 +2137,8 @@ static int __init ftdi_init (void)
2541 info(DRIVER_VERSION ":" DRIVER_DESC); 2137 info(DRIVER_VERSION ":" DRIVER_DESC);
2542 return 0; 2138 return 0;
2543failed_usb_register: 2139failed_usb_register:
2544 usb_serial_deregister(&ftdi_HE_TIRA1_device); 2140 usb_serial_deregister(&ftdi_sio_device);
2545failed_HE_TIRA1_register: 2141failed_sio_register:
2546 usb_serial_deregister(&ftdi_USB_UIRT_device);
2547failed_USB_UIRT_register:
2548 usb_serial_deregister(&ftdi_FT2232C_device);
2549failed_FT2232C_register:
2550 usb_serial_deregister(&ftdi_FT232BM_device);
2551failed_FT232BM_register:
2552 usb_serial_deregister(&ftdi_8U232AM_device);
2553failed_8U232AM_register:
2554 usb_serial_deregister(&ftdi_SIO_device);
2555failed_SIO_register:
2556 return retval; 2142 return retval;
2557} 2143}
2558 2144
@@ -2563,12 +2149,7 @@ static void __exit ftdi_exit (void)
2563 dbg("%s", __FUNCTION__); 2149 dbg("%s", __FUNCTION__);
2564 2150
2565 usb_deregister (&ftdi_driver); 2151 usb_deregister (&ftdi_driver);
2566 usb_serial_deregister (&ftdi_HE_TIRA1_device); 2152 usb_serial_deregister (&ftdi_sio_device);
2567 usb_serial_deregister (&ftdi_USB_UIRT_device);
2568 usb_serial_deregister (&ftdi_FT2232C_device);
2569 usb_serial_deregister (&ftdi_FT232BM_device);
2570 usb_serial_deregister (&ftdi_8U232AM_device);
2571 usb_serial_deregister (&ftdi_SIO_device);
2572 2153
2573} 2154}
2574 2155