X-Git-Url: http://developer.intra2net.com/git/?a=blobdiff_plain;f=src%2Fftdi.c;h=7ae48cb96a794efd6102f60c6a72246426577b3d;hb=6123f7abcc98374ffcfa00bf5eb3bfe9062ada50;hp=604d0c63ad9d5db93f86d9d15bd0fc0a9bf5a595;hpb=aa099f46f01d68f020796b4e5806b3bde7d6e03f;p=libftdi diff --git a/src/ftdi.c b/src/ftdi.c index 604d0c6..7ae48cb 100644 --- a/src/ftdi.c +++ b/src/ftdi.c @@ -2195,17 +2195,6 @@ void ftdi_eeprom_initdefaults(struct ftdi_context *ftdi) eeprom->product_id = 0x6001; else eeprom->product_id = 0x6010; - switch (ftdi->type) - { - case TYPE_2232C: - eeprom->release = 0x500; - break; - case TYPE_2232H: - eeprom->release = 0x200; - break; - default: - eeprom->release = 0; - } if (ftdi->type == TYPE_AM) eeprom->usb_version = 0x0101; else @@ -2336,7 +2325,7 @@ int ftdi_eeprom_build(struct ftdi_context *ftdi, unsigned char *output) // Addr 06: Device release number (0400h for BM features) output[0x06] = 0x00; - switch (eeprom->release) { + switch (ftdi->type) { case TYPE_AM: output[0x07] = 0x02; break; @@ -2349,6 +2338,12 @@ int ftdi_eeprom_build(struct ftdi_context *ftdi, unsigned char *output) case TYPE_R: output[0x07] = 0x06; break; + case TYPE_2232H: + output[0x07] = 0x07; + break; + case TYPE_4232H: + output[0x07] = 0x08; + break; default: output[0x07] = 0x00; } @@ -2630,6 +2625,7 @@ int ftdi_eeprom_decode(struct ftdi_context *ftdi, unsigned char *buf, int size, ftdi_error_return(-1,"EEPROM checksum error"); } + eeprom->channel_a_type = 0; if ((ftdi->type == TYPE_AM) || (ftdi->type == TYPE_BM)) { eeprom->chip = -1; @@ -2646,7 +2642,6 @@ int ftdi_eeprom_decode(struct ftdi_context *ftdi, unsigned char *buf, int size, } else if(ftdi->type == TYPE_R) { - eeprom->channel_a_type = 0; /* TYPE_R flags D2XX, not VCP as all others*/ eeprom->channel_a_driver = (~buf[0x00]) & DRIVER_VCP; eeprom->high_current = buf[0x00] & HIGH_CURRENT_DRIVE_R;