[flashrom] [PATCH] ft2232_spi.c: use ftdi.h named constants instead of magic numbers

Stefan Tauner stefan.tauner at alumni.tuwien.ac.at
Sat Jan 24 20:03:23 CET 2015

On Sat, 24 Jan 2015 16:24:36 +0100
Stefan Tauner <stefan.tauner at alumni.tuwien.ac.at> wrote:

> Hello Antony,
> thanks for your patch. It looks good in general, but there are still
> some magic constants in the code:
> - the initial values for cs_bits and pindir

No, because they are actually simple bit masks and there are no defines
for the meaning of the bits. But we could add our own defines for the
bit offsets, e.g. "#define TMS_CS_OFF (3)" and or them together in
other #defines for the few combinations we actually need for the
initial values... I don't think that's worth it though. But I have
added various comments explaining this.

> - 0x11 to enable writes

The 0x11 seems to be equivalent of "MPSSE_DO_WRITE | MPSSE_WRITE_NEG",
right? If anyone can confirm this, I'll commit that resulting patch.

Kind regards/Mit freundlichen Grüßen, Stefan Tauner

More information about the flashrom mailing list