if (eeprom == 0)
ftdi_error_return(-2, "Can't malloc struct ftdi_eeprom");
+ memset(eeprom, 0, sizeof(struct ftdi_eeprom));
ftdi->eeprom = eeprom;
/* All fine. Now allocate the readbuffer */
eeprom->usb_version = 0x0101;
else
eeprom->usb_version = 0x0200;
- eeprom->max_power = 50;
+ eeprom->max_power = 100;
if (eeprom->manufacturer)
free (eeprom->manufacturer);
if(ftdi->type == TYPE_R)
{
- eeprom->max_power = 45;
+ eeprom->max_power = 90;
eeprom->size = 0x80;
eeprom->cbus_function[0] = CBUS_TXLED;
eeprom->cbus_function[1] = CBUS_RXLED;
else
output[0x01] &= ~SUSPEND_DBUS7;
+ if (eeprom->suspend_pull_downs == 1)
+ output[0x0A] |= 0x4;
+ else
+ output[0x0A] &= ~0x4;
+
if(eeprom->group0_drive > DRIVE_16MA)
output[0x0c] |= DRIVE_16MA;
else
output[0x18] = eeprom->chip;
break;
+ case TYPE_4232H:
+ fprintf(stderr,"FIXME: Build FT4232H specific EEPROM settings\n");
}
// calculate checksum
}
else if ((ftdi->type == TYPE_2232H) ||(ftdi->type == TYPE_4232H))
{
- eeprom->high_current = buf[0x00] & HIGH_CURRENT_DRIVE_R;
+ eeprom->channel_a_type = buf[0x00] & 0x7;
eeprom->channel_a_driver = buf[0x00] & DRIVER_VCP;
eeprom->channel_b_type = buf[0x01] & 0x7;
eeprom->channel_b_driver = buf[0x01] & DRIVER_VCP;
Chip is 93x46 if magic is read at word position 0x00, as wraparound happens around 0x40
Chip is 93x56 if magic is read at word position 0x40, as wraparound happens around 0x80
Chip is 93x66 if magic is only read at word position 0xc0*/
- if( ftdi_write_eeprom_location(ftdi, 0xc0, MAGIC))
+ if (libusb_control_transfer(ftdi->usb_dev, FTDI_DEVICE_OUT_REQTYPE,
+ SIO_WRITE_EEPROM_REQUEST, MAGIC, 0xc0,
+ NULL, 0, ftdi->usb_write_timeout) != 0)
ftdi_error_return(-3, "Writing magic failed");
if (ftdi_read_eeprom_location( ftdi, 0x00, &eeprom_value))
ftdi_error_return(-4, "Reading failed failed");