From 5a1dcd55de579d5898f30e74f103e5f92156d0ad Mon Sep 17 00:00:00 2001 From: Thomas Jarosch Date: Tue, 25 Mar 2008 09:18:30 +0000 Subject: [PATCH] libftdi: (tomj) fix USB config descriptor --- ChangeLog | 1 + src/ftdi.c | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index be9e5f9..64cf333 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ New in 0.12 ----------- +* Fix USB config descriptor in the eeprom (Juergen Beisert) * Ability to purge RX/TX buffers separately (Arnim Läuger) * Setting of event and error character (Arnim Läuger) * Poll modem status function (Arnim Läuger and Intra2net) diff --git a/src/ftdi.c b/src/ftdi.c index ca52acd..b5cb4f3 100644 --- a/src/ftdi.c +++ b/src/ftdi.c @@ -1532,19 +1532,19 @@ int ftdi_eeprom_build(struct ftdi_eeprom *eeprom, unsigned char *output) output[0x07] = 0x02; // Addr 08: Config descriptor - // Bit 1: remote wakeup if 1 - // Bit 0: self powered if 1 - // - j = 0; +    // Bit 7: always 1 +    // Bit 6: 1 if this device is self powered, 0 if bus powered +    // Bit 5: 1 if this device uses remote wakeup +    // Bit 4: 1 if this device is battery powered + j = 0x80; if (eeprom->self_powered == 1) - j = j | 1; + j |= 0x40; if (eeprom->remote_wakeup == 1) - j = j | 2; + j |= 0x20; output[0x08] = j; // Addr 09: Max power consumption: max power = value * 2 mA output[0x09] = eeprom->max_power; - ; // Addr 0A: Chip configuration // Bit 7: 0 - reserved -- 1.7.1