X-Git-Url: http://developer.intra2net.com/git/?p=libftdi;a=blobdiff_plain;f=src%2Fftdi.c;h=c9492f56124a78ad0a7bdb24df9269bfbdb959e5;hp=b9e3a00d3286c02f05c38c1f0bccede0815e6c57;hb=d45d6648ad017652e18aefc65c1300c5392b2f8e;hpb=a661e3e44b5df0dd84ddd1a5396a880a0063fe67 diff --git a/src/ftdi.c b/src/ftdi.c index b9e3a00..c9492f5 100644 --- a/src/ftdi.c +++ b/src/ftdi.c @@ -105,6 +105,7 @@ int ftdi_init(struct ftdi_context *ftdi) 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 */ @@ -2214,7 +2215,7 @@ int ftdi_eeprom_initdefaults(struct ftdi_context *ftdi, char * manufacturer, eeprom->usb_version = 0x0101; else eeprom->usb_version = 0x0200; - eeprom->max_power = 50; + eeprom->max_power = 100; if (eeprom->manufacturer) free (eeprom->manufacturer); @@ -2248,7 +2249,7 @@ int ftdi_eeprom_initdefaults(struct ftdi_context *ftdi, char * 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; @@ -2586,6 +2587,11 @@ int ftdi_eeprom_build(struct ftdi_context *ftdi) 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 @@ -2844,7 +2850,7 @@ int ftdi_eeprom_decode(struct ftdi_context *ftdi, int verbose) } 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;