From ac4a82a5f51231ae1fc0e8b189245e7aecd2cad7 Mon Sep 17 00:00:00 2001 From: Uwe Bonnes Date: Fri, 17 Jun 2011 19:22:16 +0200 Subject: [PATCH] Add FT1284 driver mode and new VCP bit position --- src/ftdi.c | 10 +++++++++- src/ftdi.h | 1 + 2 files changed, 10 insertions(+), 1 deletions(-) diff --git a/src/ftdi.c b/src/ftdi.c index e7902d4..ab57c27 100644 --- a/src/ftdi.c +++ b/src/ftdi.c @@ -2658,6 +2658,12 @@ int ftdi_eeprom_build(struct ftdi_context *ftdi) fprintf(stderr,"FIXME: Build FT4232H specific EEPROM settings\n"); break; case TYPE_232H: + output[0x00] = (eeprom->channel_a_type); + if ( eeprom->channel_a_driver == DRIVER_VCP) + output[0x00] |= DRIVER_VCPH; + else + output[0x00] &= ~DRIVER_VCPH; + output[0x1e] = eeprom->chip; fprintf(stderr,"FIXME: Build FT232H specific EEPROM settings\n"); break; @@ -2899,13 +2905,15 @@ int ftdi_eeprom_decode(struct ftdi_context *ftdi, int verbose) } else if (ftdi->type == TYPE_232H) { + eeprom->channel_a_type = buf[0x00] & 0xf; + eeprom->channel_a_driver = (buf[0x00] & DRIVER_VCPH)?DRIVER_VCP:0; eeprom->chip = buf[0x1e]; /*FIXME: Decipher more values*/ } if (verbose) { - char *channel_mode[] = {"UART","245","CPU", "unknown", "OPTO"/*, "FT1284"*/}; + char *channel_mode[] = {"UART","245","CPU", "unknown", "OPTO", "unknown1","unknown2","unknown3","FT1284"}; fprintf(stdout, "VID: 0x%04x\n",eeprom->vendor_id); fprintf(stdout, "PID: 0x%04x\n",eeprom->product_id); fprintf(stdout, "Release: 0x%04x\n",release); diff --git a/src/ftdi.h b/src/ftdi.h index dced21d..cd3f63b 100644 --- a/src/ftdi.h +++ b/src/ftdi.h @@ -436,6 +436,7 @@ enum ftdi_cbus_func {/* FIXME: Recheck value, especially the last */ /** Driver Type. */ #define DRIVER_VCP 0x08 +#define DRIVER_VCPH 0x10 /* FT232H has moved the VCP bit */ #define USE_USB_VERSION_BIT 0x10 -- 1.7.1