1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-04-27 23:22:37 +02:00

ft2232_spi: Cosmetic fixes

Various whitespace- and cosmetic fixes. Also, Use %04x:%04x for printing
the USB IDs (which are 4 hex digits long), not %02x:%02x.

Corresponding to flashrom svn r1123.

Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
This commit is contained in:
Uwe Hermann 2010-07-29 19:57:55 +00:00
parent 49228cb826
commit 701452913c

View File

@ -31,7 +31,6 @@
#include "spi.h"
#include <ftdi.h>
#define FTDI_VID 0x0403
#define FTDI_FT2232H_PID 0x6010
#define FTDI_FT4232H_PID 0x6011
@ -66,10 +65,9 @@ const struct usbdev_status devs_ft2232spi[] = {
* JTAGkey(2) needs to enable its output via Bit4 / GPIOL0
* value: 0x18 OE=high, CS=high, DI=low, DO=low, SK=low
* dir: 0x1b OE=output, CS=output, DI=input, DO=output, SK=output
*
*/
static unsigned char cs_bits = 0x08;
static unsigned char pindir = 0x0b;
static uint8_t cs_bits = 0x08;
static uint8_t pindir = 0x0b;
static struct ftdi_context ftdic_context;
static const char *get_ft2232_devicename(int ft2232_vid, int ft2232_type)
@ -94,9 +92,8 @@ static const char *get_ft2232_vendorname(int ft2232_vid, int ft2232_type)
return "unknown vendor";
}
static int send_buf(struct ftdi_context *ftdic, const unsigned char *buf, int size)
static int send_buf(struct ftdi_context *ftdic, const unsigned char *buf,
int size)
{
int r;
r = ftdi_write_data(ftdic, (unsigned char *) buf, size);
@ -108,7 +105,8 @@ static int send_buf(struct ftdi_context *ftdic, const unsigned char *buf, int si
return 0;
}
static int get_buf(struct ftdi_context *ftdic, const unsigned char *buf, int size)
static int get_buf(struct ftdi_context *ftdic, const unsigned char *buf,
int size)
{
int r;
r = ftdi_read_data(ftdic, (unsigned char *) buf, size);
@ -350,13 +348,11 @@ void print_supported_usbdevs(const struct usbdev_status *devs)
int i;
for (i = 0; devs[i].vendor_name != NULL; i++) {
msg_pinfo("%s %s [%02x:%02x]%s\n", devs[i].vendor_name,
msg_pinfo("%s %s [%04x:%04x]%s\n", devs[i].vendor_name,
devs[i].device_name, devs[i].vendor_id,
devs[i].device_id,
(devs[i].status == NT) ? " (untested)" : "");
}
}
#endif