summaryrefslogtreecommitdiffstats
path: root/spi.c
diff options
context:
space:
mode:
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2009-08-19 13:27:58 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2009-08-19 13:27:58 +0000
commit3426ef6ab8dc13a0f1c306ab5d63e27664fb3e5c (patch)
tree78525e6b9821679dbf87c69dc56c8af7182e04c2 /spi.c
parent173e3eaabef842e3ad785f3c3c510bf4122deff9 (diff)
downloadflashrom-3426ef6ab8dc13a0f1c306ab5d63e27664fb3e5c.tar.gz
flashrom-3426ef6ab8dc13a0f1c306ab5d63e27664fb3e5c.tar.bz2
flashrom-3426ef6ab8dc13a0f1c306ab5d63e27664fb3e5c.zip
If FT2232H SPI is not enabled, it should be compiled out completely
We can't remove ft2232_spi.o from unconditional OBJS yet due to our makefile structure (make features), but this patch adds #ifdefs around all FT2232H code, so the net effect is the same. Corresponding to flashrom svn r691. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Stefan Reinauer <stepan@coresystems.de>
Diffstat (limited to 'spi.c')
-rw-r--r--spi.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/spi.c b/spi.c
index 85d1e47ef..7f678a139 100644
--- a/spi.c
+++ b/spi.c
@@ -82,12 +82,14 @@ const struct spi_programmer spi_programmer[] = {
.write_256 = wbsio_spi_write_1,
},
+#if FT2232_SPI_SUPPORT == 1
{ /* SPI_CONTROLLER_FT2232 */
.command = ft2232_spi_send_command,
.multicommand = default_spi_send_multicommand,
.read = ft2232_spi_read,
.write_256 = ft2232_spi_write_256,
},
+#endif
{ /* SPI_CONTROLLER_DUMMY */
.command = dummy_spi_send_command,
@@ -95,8 +97,11 @@ const struct spi_programmer spi_programmer[] = {
.read = NULL,
.write_256 = NULL,
},
+
+ {}, /* This entry corresponds to SPI_CONTROLLER_INVALID. */
};
+const int spi_programmer_count = ARRAY_SIZE(spi_programmer);
int spi_send_command(unsigned int writecnt, unsigned int readcnt,
const unsigned char *writearr, unsigned char *readarr)
@@ -293,7 +298,9 @@ int probe_spi_rdid4(struct flashchip *flash)
case SPI_CONTROLLER_VIA:
case SPI_CONTROLLER_SB600:
case SPI_CONTROLLER_WBSIO:
+#if FT2232_SPI_SUPPORT == 1
case SPI_CONTROLLER_FT2232:
+#endif
case SPI_CONTROLLER_DUMMY:
return probe_spi_rdid_generic(flash, 4);
default: