Attention is currently required from: Alan Green, Angel Pons, Samir Ibradžić. Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/55695 )
Change subject: ft2232_spi: Revise comments about output pin states ......................................................................
Patch Set 1:
(1 comment)
File ft2232_spi.c:
https://review.coreboot.org/c/flashrom/+/55695/comment/949fe212_6a244b8b PS1, Line 98: * TCK/SK is bit 0. : * TDI/DO is bit 1. : * TDO/DI is bit 2. : * TMS/CS is bit 3. : * GPIOL0 is bit 4. : * GPIOL1 is bit 5. : * GPIOL2 is bit 6. : * GPIOL3 is bit 7.
Shouldn't this be code, e.g. macros or an enum? […]
I don't know, the identifiers wouldn't be used in the code. It's mostly reading a number from the UI and shifting that into a register value. Or we could write less condensed code, e.g.
switch (input) { case 0: cs_bits |= PIN_GPIOL0; ... break;
or
const int bits[] = { PIN_GPIOL0, PIN_GPIOL1, PIN_GPIOL2, PIN_GPIOL3 }; cs_bits |= bits[input]; ...
Not sure if I'd want to write it either way. What do you think?