mirror of
https://review.coreboot.org/flashrom.git
synced 2025-04-28 07:23:43 +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:
parent
49228cb826
commit
701452913c
18
ft2232_spi.c
18
ft2232_spi.c
@ -31,7 +31,6 @@
|
|||||||
#include "spi.h"
|
#include "spi.h"
|
||||||
#include <ftdi.h>
|
#include <ftdi.h>
|
||||||
|
|
||||||
|
|
||||||
#define FTDI_VID 0x0403
|
#define FTDI_VID 0x0403
|
||||||
#define FTDI_FT2232H_PID 0x6010
|
#define FTDI_FT2232H_PID 0x6010
|
||||||
#define FTDI_FT4232H_PID 0x6011
|
#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
|
* JTAGkey(2) needs to enable its output via Bit4 / GPIOL0
|
||||||
* value: 0x18 OE=high, CS=high, DI=low, DO=low, SK=low
|
* value: 0x18 OE=high, CS=high, DI=low, DO=low, SK=low
|
||||||
* dir: 0x1b OE=output, CS=output, DI=input, DO=output, SK=output
|
* dir: 0x1b OE=output, CS=output, DI=input, DO=output, SK=output
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
static unsigned char cs_bits = 0x08;
|
static uint8_t cs_bits = 0x08;
|
||||||
static unsigned char pindir = 0x0b;
|
static uint8_t pindir = 0x0b;
|
||||||
static struct ftdi_context ftdic_context;
|
static struct ftdi_context ftdic_context;
|
||||||
|
|
||||||
static const char *get_ft2232_devicename(int ft2232_vid, int ft2232_type)
|
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";
|
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;
|
int r;
|
||||||
r = ftdi_write_data(ftdic, (unsigned char *) buf, size);
|
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;
|
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;
|
int r;
|
||||||
r = ftdi_read_data(ftdic, (unsigned char *) buf, size);
|
r = ftdi_read_data(ftdic, (unsigned char *) buf, size);
|
||||||
@ -350,13 +348,11 @@ void print_supported_usbdevs(const struct usbdev_status *devs)
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; devs[i].vendor_name != NULL; 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_name, devs[i].vendor_id,
|
||||||
devs[i].device_id,
|
devs[i].device_id,
|
||||||
(devs[i].status == NT) ? " (untested)" : "");
|
(devs[i].status == NT) ? " (untested)" : "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user