So far, we have up to 4 different names for the same thing (ignoring capitalization)

CONFIG_FT2232SPI (makefile config option)
FT2232_SPI_SUPPORT (#define)
ft2232spi (programmer name)
ft2232_spi.c (programmer file)

Use CONFIG_* with underscores for makefile config options and #defines
and kill the useless _SUPPORT idiom.
Use lowercase names with underscores for programmer names and programmer
files.

With this, you can run "grep -i ft2232_spi" and find everything related
to the ft2232_spi driver. Same applies to all other programmers.

Corresponding to flashrom svn r1023.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Uwe Hermann <uwe@hermann-uwe.de>
diff --git a/Makefile b/Makefile
index 7bc5509..2180374 100644
--- a/Makefile
+++ b/Makefile
@@ -51,7 +51,7 @@
 ifeq ($(OS_ARCH), DOS)
 CPPFLAGS += -I../libgetopt -I../libpci/include
 # Bus Pirate and Serprog are not supported under DOS.
-CONFIG_BUSPIRATESPI = no
+CONFIG_BUSPIRATE_SPI = no
 CONFIG_SERPROG = no
 endif
 
@@ -102,7 +102,7 @@
 CONFIG_ATAHPT ?= no
 
 # Always enable FT2232 SPI dongles for now.
-CONFIG_FT2232SPI ?= yes
+CONFIG_FT2232_SPI ?= yes
 
 # Always enable dummy tracing for now.
 CONFIG_DUMMY ?= yes
@@ -114,7 +114,7 @@
 CONFIG_NICREALTEK ?= yes
 
 # Always enable Bus Pirate SPI for now.
-CONFIG_BUSPIRATESPI ?= yes
+CONFIG_BUSPIRATE_SPI ?= yes
 
 # Disable Dediprog SF100 until support is complete and tested.
 CONFIG_DEDIPROG ?= no
@@ -123,7 +123,7 @@
 CONFIG_PRINT_WIKI ?= no
 
 ifeq ($(CONFIG_INTERNAL), yes)
-FEATURE_CFLAGS += -D'INTERNAL_SUPPORT=1'
+FEATURE_CFLAGS += -D'CONFIG_INTERNAL=1'
 PROGRAMMER_OBJS += chipset_enable.o board_enable.o cbtable.o dmi.o internal.o
 # FIXME: The PROGRAMMER_OBJS below should only be included on x86.
 PROGRAMMER_OBJS += it87spi.o ichspi.o sb600spi.o wbsio_spi.o
@@ -131,7 +131,7 @@
 endif
 
 ifeq ($(CONFIG_SERPROG), yes)
-FEATURE_CFLAGS += -D'SERPROG_SUPPORT=1'
+FEATURE_CFLAGS += -D'CONFIG_SERPROG=1'
 PROGRAMMER_OBJS += serprog.o
 ifeq ($(OS_ARCH), SunOS)
 LIBS += -lsocket
@@ -139,66 +139,66 @@
 endif
 
 ifeq ($(CONFIG_BITBANG_SPI), yes)
-FEATURE_CFLAGS += -D'BITBANG_SPI_SUPPORT=1'
+FEATURE_CFLAGS += -D'CONFIG_BITBANG_SPI=1'
 PROGRAMMER_OBJS += bitbang_spi.o
 endif
 
 ifeq ($(CONFIG_NIC3COM), yes)
-FEATURE_CFLAGS += -D'NIC3COM_SUPPORT=1'
+FEATURE_CFLAGS += -D'CONFIG_NIC3COM=1'
 PROGRAMMER_OBJS += nic3com.o
 NEED_PCI := yes
 endif
 
 ifeq ($(CONFIG_GFXNVIDIA), yes)
-FEATURE_CFLAGS += -D'GFXNVIDIA_SUPPORT=1'
+FEATURE_CFLAGS += -D'CONFIG_GFXNVIDIA=1'
 PROGRAMMER_OBJS += gfxnvidia.o
 NEED_PCI := yes
 endif
 
 ifeq ($(CONFIG_SATASII), yes)
-FEATURE_CFLAGS += -D'SATASII_SUPPORT=1'
+FEATURE_CFLAGS += -D'CONFIG_SATASII=1'
 PROGRAMMER_OBJS += satasii.o
 NEED_PCI := yes
 endif
 
 ifeq ($(CONFIG_ATAHPT), yes)
-FEATURE_CFLAGS += -D'ATAHPT_SUPPORT=1'
+FEATURE_CFLAGS += -D'CONFIG_ATAHPT=1'
 PROGRAMMER_OBJS += atahpt.o
 NEED_PCI := yes
 endif
 
-ifeq ($(CONFIG_FT2232SPI), yes)
+ifeq ($(CONFIG_FT2232_SPI), yes)
 FTDILIBS := $(shell pkg-config --libs libftdi 2>/dev/null || printf "%s" "-lftdi -lusb")
 # This is a totally ugly hack.
-FEATURE_CFLAGS += $(shell LC_ALL=C grep -q "FTDISUPPORT := yes" .features && printf "%s" "-D'FT2232_SPI_SUPPORT=1'")
+FEATURE_CFLAGS += $(shell LC_ALL=C grep -q "FTDISUPPORT := yes" .features && printf "%s" "-D'CONFIG_FT2232_SPI=1'")
 FEATURE_LIBS += $(shell LC_ALL=C grep -q "FTDISUPPORT := yes" .features && printf "%s" "$(FTDILIBS)")
 PROGRAMMER_OBJS += ft2232_spi.o
 endif
 
 ifeq ($(CONFIG_DUMMY), yes)
-FEATURE_CFLAGS += -D'DUMMY_SUPPORT=1'
+FEATURE_CFLAGS += -D'CONFIG_DUMMY=1'
 PROGRAMMER_OBJS += dummyflasher.o
 endif
 
 ifeq ($(CONFIG_DRKAISER), yes)
-FEATURE_CFLAGS += -D'DRKAISER_SUPPORT=1'
+FEATURE_CFLAGS += -D'CONFIG_DRKAISER=1'
 PROGRAMMER_OBJS += drkaiser.o
 NEED_PCI := yes
 endif
 
 ifeq ($(CONFIG_NICREALTEK), yes)
-FEATURE_CFLAGS += -D'NICREALTEK_SUPPORT=1'
+FEATURE_CFLAGS += -D'CONFIG_NICREALTEK=1'
 PROGRAMMER_OBJS += nicrealtek.o
 NEED_PCI := yes
 endif
 
-ifeq ($(CONFIG_BUSPIRATESPI), yes)
-FEATURE_CFLAGS += -D'BUSPIRATE_SPI_SUPPORT=1'
+ifeq ($(CONFIG_BUSPIRATE_SPI), yes)
+FEATURE_CFLAGS += -D'CONFIG_BUSPIRATE_SPI=1'
 PROGRAMMER_OBJS += buspirate_spi.o
 endif
 
 ifeq ($(CONFIG_DEDIPROG), yes)
-FEATURE_CFLAGS += -D'DEDIPROG_SUPPORT=1'
+FEATURE_CFLAGS += -D'CONFIG_DEDIPROG=1'
 FEATURE_LIBS += -lusb
 PROGRAMMER_OBJS += dediprog.o
 endif
@@ -207,7 +207,7 @@
 ifeq ($(CONFIG_SERPROG), yes)
 LIB_OBJS += serial.o
 else
-ifeq ($(CONFIG_BUSPIRATESPI), yes)
+ifeq ($(CONFIG_BUSPIRATE_SPI), yes)
 LIB_OBJS += serial.o
 endif
 endif
@@ -233,7 +233,7 @@
 endif
 
 ifeq ($(CONFIG_PRINT_WIKI), yes)
-FEATURE_CFLAGS += -D'PRINT_WIKI_SUPPORT=1'
+FEATURE_CFLAGS += -D'CONFIG_PRINT_WIKI=1'
 CLI_OBJS += print_wiki.o
 endif
 
@@ -308,7 +308,7 @@
 
 .features: features
 
-ifeq ($(CONFIG_FT2232SPI), yes)
+ifeq ($(CONFIG_FT2232_SPI), yes)
 features: compiler
 	@echo "FEATURES := yes" > .features.tmp
 	@printf "Checking for FTDI support... "
diff --git a/buspirate_spi.c b/buspirate_spi.c
index 524b608..281a5f5 100644
--- a/buspirate_spi.c
+++ b/buspirate_spi.c
@@ -116,7 +116,7 @@
 	}
 	if (!dev) {
 		msg_perr("No serial device given. Use flashrom -p "
-			"buspiratespi:dev=/dev/ttyUSB0\n");
+			"buspirate_spi:dev=/dev/ttyUSB0\n");
 		return 1;
 	}
 	if (speed) {
diff --git a/cli_classic.c b/cli_classic.c
index f541084..4899b3a 100644
--- a/cli_classic.c
+++ b/cli_classic.c
@@ -39,7 +39,7 @@
 	enum programmer p;
 
 	printf("Usage: %s [-n] [-V] [-f] [-h|-R|-L|"
-#if PRINT_WIKI_SUPPORT == 1
+#if CONFIG_PRINT_WIKI == 1
 	         "-z|"
 #endif
 	         "-E|-r <file>|-w <file>|-v <file>]\n"
@@ -66,7 +66,7 @@
 	       "   -V | --verbose                    more verbose output\n"
 	       "   -c | --chip <chipname>            probe only for specified "
 	         "flash chip\n"
-#if INTERNAL_SUPPORT == 1
+#if CONFIG_INTERNAL == 1
 	       /* FIXME: --mainboard should be a programmer parameter */
 	       "   -m | --mainboard <[vendor:]part>  override mainboard "
 	         "detection\n"
@@ -79,7 +79,7 @@
 	       "   -i | --image <name>               only flash image <name> "
 	         "from flash layout\n"
 	       "   -L | --list-supported             print supported devices\n"
-#if PRINT_WIKI_SUPPORT == 1
+#if CONFIG_PRINT_WIKI == 1
 	       "   -z | --list-supported-wiki        print supported devices "
 	         "in wiki syntax\n"
 #endif
@@ -111,7 +111,7 @@
 	}
 
 	printf("\nYou can specify one of -h, -R, -L, "
-#if PRINT_WIKI_SUPPORT == 1
+#if CONFIG_PRINT_WIKI == 1
 	         "-z, "
 #endif
 	         "-E, -r, -w, -v or no operation.\n"
@@ -137,7 +137,7 @@
 	int force = 0;
 	int read_it = 0, write_it = 0, erase_it = 0, verify_it = 0;
 	int dont_verify_it = 0, list_supported = 0;
-#if PRINT_WIKI_SUPPORT == 1
+#if CONFIG_PRINT_WIKI == 1
 	int list_supported_wiki = 0;
 #endif
 	int operation_specified = 0;
@@ -237,7 +237,7 @@
 			erase_it = 1;
 			break;
 		case 'm':
-#if INTERNAL_SUPPORT == 1
+#if CONFIG_INTERNAL == 1
 			tempstr = strdup(optarg);
 			lb_vendor_dev_from_string(tempstr);
 #else
@@ -268,7 +268,7 @@
 			list_supported = 1;
 			break;
 		case 'z':
-#if PRINT_WIKI_SUPPORT == 1
+#if CONFIG_PRINT_WIKI == 1
 			if (++operation_specified > 1) {
 				fprintf(stderr, "More than one operation "
 					"specified. Aborting.\n");
@@ -344,7 +344,7 @@
 		exit(0);
 	}
 
-#if PRINT_WIKI_SUPPORT == 1
+#if CONFIG_PRINT_WIKI == 1
 	if (list_supported_wiki) {
 		print_supported_wiki();
 		exit(0);
@@ -356,7 +356,7 @@
 		cli_classic_abort_usage(argv[0]);
 	}
 
-#if INTERNAL_SUPPORT == 1
+#if CONFIG_INTERNAL == 1
 	if ((programmer != PROGRAMMER_INTERNAL) && (lb_part || lb_vendor)) {
 		fprintf(stderr, "Error: --mainboard requires the internal "
 				"programmer. Aborting.\n");
diff --git a/flash.h b/flash.h
index 8e8939b..7e91633 100644
--- a/flash.h
+++ b/flash.h
@@ -39,46 +39,46 @@
 typedef unsigned long chipaddr;
 
 enum programmer {
-#if INTERNAL_SUPPORT == 1
+#if CONFIG_INTERNAL == 1
 	PROGRAMMER_INTERNAL,
 #endif
-#if DUMMY_SUPPORT == 1
+#if CONFIG_DUMMY == 1
 	PROGRAMMER_DUMMY,
 #endif
-#if NIC3COM_SUPPORT == 1
+#if CONFIG_NIC3COM == 1
 	PROGRAMMER_NIC3COM,
 #endif
-#if NICREALTEK_SUPPORT == 1
+#if CONFIG_NICREALTEK == 1
 	PROGRAMMER_NICREALTEK,
 	PROGRAMMER_NICREALTEK2,
 #endif	
-#if GFXNVIDIA_SUPPORT == 1
+#if CONFIG_GFXNVIDIA == 1
 	PROGRAMMER_GFXNVIDIA,
 #endif
-#if DRKAISER_SUPPORT == 1
+#if CONFIG_DRKAISER == 1
 	PROGRAMMER_DRKAISER,
 #endif
-#if SATASII_SUPPORT == 1
+#if CONFIG_SATASII == 1
 	PROGRAMMER_SATASII,
 #endif
-#if ATAHPT_SUPPORT == 1
+#if CONFIG_ATAHPT == 1
 	PROGRAMMER_ATAHPT,
 #endif
-#if INTERNAL_SUPPORT == 1
+#if CONFIG_INTERNAL == 1
 #if defined(__i386__) || defined(__x86_64__)
 	PROGRAMMER_IT87SPI,
 #endif
 #endif
-#if FT2232_SPI_SUPPORT == 1
-	PROGRAMMER_FT2232SPI,
+#if CONFIG_FT2232_SPI == 1
+	PROGRAMMER_FT2232_SPI,
 #endif
-#if SERPROG_SUPPORT == 1
+#if CONFIG_SERPROG == 1
 	PROGRAMMER_SERPROG,
 #endif
-#if BUSPIRATE_SPI_SUPPORT == 1
-	PROGRAMMER_BUSPIRATESPI,
+#if CONFIG_BUSPIRATE_SPI == 1
+	PROGRAMMER_BUSPIRATE_SPI,
 #endif
-#if DEDIPROG_SUPPORT == 1
+#if CONFIG_DEDIPROG == 1
 	PROGRAMMER_DEDIPROG,
 #endif
 	PROGRAMMER_INVALID /* This must always be the last entry. */
@@ -258,7 +258,7 @@
 
 extern struct flashchip flashchips[];
 
-#if INTERNAL_SUPPORT == 1
+#if CONFIG_INTERNAL == 1
 struct penable {
 	uint16_t vendor_id;
 	uint16_t device_id;
@@ -338,7 +338,7 @@
 /* print.c */
 char *flashbuses_to_text(enum chipbustype bustype);
 void print_supported(void);
-#if (NIC3COM_SUPPORT == 1) || (GFXNVIDIA_SUPPORT == 1) || (DRKAISER_SUPPORT == 1) || (SATASII_SUPPORT == 1) || (ATAHPT_SUPPORT == 1) || (NICREALTEK_SUPPORT == 1)
+#if CONFIG_NIC3COM+CONFIG_NICREALTEK+CONFIG_GFXNVIDIA+CONFIG_DRKAISER+CONFIG_SATASII+CONFIG_ATAHPT >= 1
 void print_supported_pcidevs(struct pcidev_status *devs);
 #endif
 void print_supported_wiki(void);
@@ -390,7 +390,7 @@
 #endif
 void get_io_perms(void);
 void release_io_perms(void);
-#if INTERNAL_SUPPORT == 1
+#if CONFIG_INTERNAL == 1
 extern int is_laptop;
 extern int force_boardenable;
 extern int force_boardmismatch;
@@ -432,7 +432,7 @@
 void fallback_chip_readn(uint8_t *buf, const chipaddr addr, size_t len);
 
 /* dummyflasher.c */
-#if DUMMY_SUPPORT == 1
+#if CONFIG_DUMMY == 1
 int dummy_init(void);
 int dummy_shutdown(void);
 void *dummy_map(const char *descr, unsigned long phys_addr, size_t len);
@@ -450,7 +450,7 @@
 #endif
 
 /* nic3com.c */
-#if NIC3COM_SUPPORT == 1
+#if CONFIG_NIC3COM == 1
 int nic3com_init(void);
 int nic3com_shutdown(void);
 void nic3com_chip_writeb(uint8_t val, chipaddr addr);
@@ -459,7 +459,7 @@
 #endif
 
 /* gfxnvidia.c */
-#if GFXNVIDIA_SUPPORT == 1
+#if CONFIG_GFXNVIDIA == 1
 int gfxnvidia_init(void);
 int gfxnvidia_shutdown(void);
 void gfxnvidia_chip_writeb(uint8_t val, chipaddr addr);
@@ -468,7 +468,7 @@
 #endif
 
 /* drkaiser.c */
-#if DRKAISER_SUPPORT == 1
+#if CONFIG_DRKAISER == 1
 int drkaiser_init(void);
 int drkaiser_shutdown(void);
 void drkaiser_chip_writeb(uint8_t val, chipaddr addr);
@@ -477,7 +477,7 @@
 #endif
 
 /* nicrealtek.c */
-#if NICREALTEK_SUPPORT == 1
+#if CONFIG_NICREALTEK == 1
 int nicrealtek_init(void);
 int nicsmc1211_init(void);
 int nicrealtek_shutdown(void);
@@ -489,7 +489,7 @@
 
 
 /* satasii.c */
-#if SATASII_SUPPORT == 1
+#if CONFIG_SATASII == 1
 int satasii_init(void);
 int satasii_shutdown(void);
 void satasii_chip_writeb(uint8_t val, chipaddr addr);
@@ -498,7 +498,7 @@
 #endif
 
 /* atahpt.c */
-#if ATAHPT_SUPPORT == 1
+#if CONFIG_ATAHPT == 1
 int atahpt_init(void);
 int atahpt_shutdown(void);
 void atahpt_chip_writeb(uint8_t val, chipaddr addr);
@@ -611,7 +611,7 @@
 /* spi.c */
 enum spi_controller {
 	SPI_CONTROLLER_NONE,
-#if INTERNAL_SUPPORT == 1
+#if CONFIG_INTERNAL == 1
 #if defined(__i386__) || defined(__x86_64__)
 	SPI_CONTROLLER_ICH7,
 	SPI_CONTROLLER_ICH9,
@@ -621,16 +621,16 @@
 	SPI_CONTROLLER_WBSIO,
 #endif
 #endif
-#if FT2232_SPI_SUPPORT == 1
+#if CONFIG_FT2232_SPI == 1
 	SPI_CONTROLLER_FT2232,
 #endif
-#if DUMMY_SUPPORT == 1
+#if CONFIG_DUMMY == 1
 	SPI_CONTROLLER_DUMMY,
 #endif
-#if BUSPIRATE_SPI_SUPPORT == 1
+#if CONFIG_BUSPIRATE_SPI == 1
 	SPI_CONTROLLER_BUSPIRATE,
 #endif
-#if DEDIPROG_SUPPORT == 1
+#if CONFIG_DEDIPROG == 1
 	SPI_CONTROLLER_DEDIPROG,
 #endif
 	SPI_CONTROLLER_INVALID /* This must always be the last entry. */
diff --git a/flashrom.8 b/flashrom.8
index 87dd69b..160b311 100644
--- a/flashrom.8
+++ b/flashrom.8
@@ -166,11 +166,11 @@
 .sp
 .BR "* it87spi" " (for flash ROMs behind an ITE IT87xx Super I/O LPC/SPI translation unit)"
 .sp
-.BR "* ft2232spi" " (for flash ROMs attached to a FT2232H/FT4232H based USB SPI programmer)"
+.BR "* ft2232_spi" " (for flash ROMs attached to a FT2232H/FT4232H based USB SPI programmer)"
 .sp
 .BR "* serprog" " (for flash ROMs attached to Urja's AVR programmer)"
 .sp
-.BR "* buspiratespi" " (for flash ROMs attached to a Bus Pirate)"
+.BR "* buspirate_spi" " (for flash ROMs attached to a Bus Pirate)"
 .sp
 Some programmers have optional or mandatory parameters which are described
 in detail in the
@@ -307,10 +307,10 @@
 .B portnum
 is an I/O port number which must be a multiple of 8.
 .TP
-.BR "ft2232spi " programmer
+.BR "ft2232_spi " programmer
 An optional parameter species the controller
 type and interface/port it should support. For that you have to use the
-.B "flashrom -p ft2232spi:model,port=interface"
+.B "flashrom -p ft2232_spi:model,port=interface"
 syntax where
 .B model
 can be any of
@@ -335,12 +335,12 @@
 instead. More information about serprog is available in serprog-protocol.txt in
 the source distribution.
 .TP
-.BR "buspiratespi " programmer
+.BR "buspirate_spi " programmer
 A required dev parameter specifies the Bus Pirate device node and an optional
 spispeed parameter specifies the frequency of the SPI bus. The parameter
 delimiter is a comma. Syntax is
 .sp
-.B "flashrom -p buspiratespi:dev=/dev/device,spispeed=frequency"
+.B "flashrom -p buspirate_spi:dev=/dev/device,spispeed=frequency"
 .sp
 where
 .B frequency
diff --git a/flashrom.c b/flashrom.c
index 071c52e..8a97454 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -38,9 +38,9 @@
 char *chip_to_probe = NULL;
 int verbose = 0;
 
-#if INTERNAL_SUPPORT == 1
+#if CONFIG_INTERNAL == 1
 enum programmer programmer = PROGRAMMER_INTERNAL;
-#elif DUMMY_SUPPORT == 1
+#elif CONFIG_DUMMY == 1
 enum programmer programmer = PROGRAMMER_DUMMY;
 #else
 /* If neither internal nor dummy are selected, we must pick a sensible default.
@@ -48,39 +48,39 @@
  * if more than one of them is selected. If only one is selected, it is clear
  * that the user wants that one to become the default.
  */
-#if NIC3COM_SUPPORT+GFXNVIDIA_SUPPORT+DRKAISER_SUPPORT+SATASII_SUPPORT+ATAHPT_SUPPORT+FT2232_SPI_SUPPORT+SERPROG_SUPPORT+BUSPIRATE_SPI_SUPPORT+DEDIPROG_SUPPORT+NICREALTEK_SUPPORT > 1
-#error Please enable either CONFIG_DUMMY or CONFIG_INTERNAL or disable support for all external programmers except one.
+#if CONFIG_NIC3COM+CONFIG_NICREALTEK+CONFIG_GFXNVIDIA+CONFIG_DRKAISER+CONFIG_SATASII+CONFIG_ATAHPT+CONFIG_FT2232_SPI+CONFIG_SERPROG+CONFIG_BUSPIRATE_SPI+CONFIG_DEDIPROG > 1
+#error Please enable either CONFIG_DUMMY or CONFIG_INTERNAL or disable support for all programmers except one.
 #endif
 enum programmer programmer =
-#if NIC3COM_SUPPORT == 1
+#if CONFIG_NIC3COM == 1
 	PROGRAMMER_NIC3COM
 #endif
-#if NICREALTEK_SUPPORT == 1
+#if CONFIG_NICREALTEK == 1
 	PROGRAMMER_NICREALTEK
 	PROGRAMMER_NICREALTEK2
 #endif
-#if GFXNVIDIA_SUPPORT == 1
+#if CONFIG_GFXNVIDIA == 1
 	PROGRAMMER_GFXNVIDIA
 #endif
-#if DRKAISER_SUPPORT == 1
+#if CONFIG_DRKAISER == 1
 	PROGRAMMER_DRKAISER
 #endif
-#if SATASII_SUPPORT == 1
+#if CONFIG_SATASII == 1
 	PROGRAMMER_SATASII
 #endif
-#if ATAHPT_SUPPORT == 1
+#if CONFIG_ATAHPT == 1
 	PROGRAMMER_ATAHPT
 #endif
-#if FT2232_SPI_SUPPORT == 1
-	PROGRAMMER_FT2232SPI
+#if CONFIG_FT2232_SPI == 1
+	PROGRAMMER_FT2232_SPI
 #endif
-#if SERPROG_SUPPORT == 1
+#if CONFIG_SERPROG == 1
 	PROGRAMMER_SERPROG
 #endif
-#if BUSPIRATE_SPI_SUPPORT == 1
-	PROGRAMMER_BUSPIRATESPI
+#if CONFIG_BUSPIRATE_SPI == 1
+	PROGRAMMER_BUSPIRATE_SPI
 #endif
-#if DEDIPROG_SUPPORT == 1
+#if CONFIG_DEDIPROG == 1
 	PROGRAMMER_DEDIPROG
 #endif
 ;
@@ -107,7 +107,7 @@
 };
 
 const struct programmer_entry programmer_table[] = {
-#if INTERNAL_SUPPORT == 1
+#if CONFIG_INTERNAL == 1
 	{
 		.name			= "internal",
 		.init			= internal_init,
@@ -126,7 +126,7 @@
 	},
 #endif
 
-#if DUMMY_SUPPORT == 1
+#if CONFIG_DUMMY == 1
 	{
 		.name			= "dummy",
 		.init			= dummy_init,
@@ -145,7 +145,7 @@
 	},
 #endif
 
-#if NIC3COM_SUPPORT == 1
+#if CONFIG_NIC3COM == 1
 	{
 		.name			= "nic3com",
 		.init			= nic3com_init,
@@ -164,7 +164,7 @@
 	},
 #endif
 
-#if NICREALTEK_SUPPORT == 1
+#if CONFIG_NICREALTEK == 1
 	{
 		.name                   = "nicrealtek",
 		.init                   = nicrealtek_init,
@@ -200,7 +200,7 @@
 #endif
 
 
-#if GFXNVIDIA_SUPPORT == 1
+#if CONFIG_GFXNVIDIA == 1
 	{
 		.name			= "gfxnvidia",
 		.init			= gfxnvidia_init,
@@ -219,7 +219,7 @@
 	},
 #endif
 
-#if DRKAISER_SUPPORT == 1
+#if CONFIG_DRKAISER == 1
 	{
 		.name			= "drkaiser",
 		.init			= drkaiser_init,
@@ -238,7 +238,7 @@
 	},
 #endif
 
-#if SATASII_SUPPORT == 1
+#if CONFIG_SATASII == 1
 	{
 		.name			= "satasii",
 		.init			= satasii_init,
@@ -257,7 +257,7 @@
 	},
 #endif
 
-#if ATAHPT_SUPPORT == 1
+#if CONFIG_ATAHPT == 1
 	{
 		.name			= "atahpt",
 		.init			= atahpt_init,
@@ -276,7 +276,7 @@
 	},
 #endif
 
-#if INTERNAL_SUPPORT == 1
+#if CONFIG_INTERNAL == 1
 #if defined(__i386__) || defined(__x86_64__)
 	{
 		.name			= "it87spi",
@@ -297,9 +297,9 @@
 #endif
 #endif
 
-#if FT2232_SPI_SUPPORT == 1
+#if CONFIG_FT2232_SPI == 1
 	{
-		.name			= "ft2232spi",
+		.name			= "ft2232_spi",
 		.init			= ft2232_spi_init,
 		.shutdown		= noop_shutdown, /* Missing shutdown */
 		.map_flash_region	= fallback_map,
@@ -316,7 +316,7 @@
 	},
 #endif
 
-#if SERPROG_SUPPORT == 1
+#if CONFIG_SERPROG == 1
 	{
 		.name			= "serprog",
 		.init			= serprog_init,
@@ -335,9 +335,9 @@
 	},
 #endif
 
-#if BUSPIRATE_SPI_SUPPORT == 1
+#if CONFIG_BUSPIRATE_SPI == 1
 	{
-		.name			= "buspiratespi",
+		.name			= "buspirate_spi",
 		.init			= buspirate_spi_init,
 		.shutdown		= buspirate_spi_shutdown,
 		.map_flash_region	= fallback_map,
@@ -354,7 +354,7 @@
 	},
 #endif
 
-#if DEDIPROG_SUPPORT == 1
+#if CONFIG_DEDIPROG == 1
 	{
 		.name			= "dediprog",
 		.init			= dediprog_init,
@@ -1259,7 +1259,7 @@
 		msg_gerr("SPI programmer table miscompilation!\n");
 		ret = 1;
 	}
-#if BITBANG_SPI_SUPPORT == 1
+#if CONFIG_BITBANG_SPI == 1
 	if (bitbang_spi_master_count - 1 != BITBANG_SPI_INVALID) {
 		msg_gerr("Bitbanging SPI master table miscompilation!\n");
 		ret = 1;
@@ -1410,7 +1410,7 @@
 		}
 
 		numbytes = fread(buf, 1, size, image);
-#if INTERNAL_SUPPORT == 1
+#if CONFIG_INTERNAL == 1
 		show_id(buf, size, force);
 #endif
 		fclose(image);
diff --git a/ft2232_spi.c b/ft2232_spi.c
index 111b46d..9a3072e 100644
--- a/ft2232_spi.c
+++ b/ft2232_spi.c
@@ -18,7 +18,7 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  */
 
-#if FT2232_SPI_SUPPORT == 1
+#if CONFIG_FT2232_SPI == 1
 
 #include <stdio.h>
 #include <stdint.h>
diff --git a/internal.c b/internal.c
index bbad788..d0eb782 100644
--- a/internal.c
+++ b/internal.c
@@ -98,7 +98,7 @@
 }
 #endif
 
-#if INTERNAL_SUPPORT == 1
+#if CONFIG_INTERNAL == 1
 int force_boardenable = 0;
 int force_boardmismatch = 0;
 
diff --git a/layout.c b/layout.c
index 363e4f3..d95cf12 100644
--- a/layout.c
+++ b/layout.c
@@ -24,7 +24,7 @@
 #include <ctype.h>
 #include "flash.h"
 
-#if INTERNAL_SUPPORT == 1
+#if CONFIG_INTERNAL == 1
 char *mainboard_vendor = NULL;
 char *mainboard_part = NULL;
 #endif
@@ -41,7 +41,7 @@
 
 romlayout_t rom_entries[MAX_ROMLAYOUT];
 
-#if INTERNAL_SUPPORT == 1 /* FIXME: Move the whole block to cbtable.c? */
+#if CONFIG_INTERNAL == 1 /* FIXME: Move the whole block to cbtable.c? */
 static char *def_name = "DEFAULT";
 
 int show_id(uint8_t *bios, int size, int force)
diff --git a/print.c b/print.c
index a2f4e5d..65af085 100644
--- a/print.c
+++ b/print.c
@@ -145,7 +145,7 @@
 	}
 }
 
-#if INTERNAL_SUPPORT == 1
+#if CONFIG_INTERNAL == 1
 void print_supported_chipsets(void)
 {
 	int i, j, chipsetcount = 0;
@@ -228,37 +228,37 @@
 void print_supported(void)
 {
 		print_supported_chips();
-#if INTERNAL_SUPPORT == 1
+#if CONFIG_INTERNAL == 1
 		print_supported_chipsets();
 		print_supported_boards();
 #endif
-#if (NIC3COM_SUPPORT == 1) || (GFXNVIDIA_SUPPORT == 1) || (DRKAISER_SUPPORT == 1) || (SATASII_SUPPORT == 1)
+#if CONFIG_NIC3COM+CONFIG_NICREALTEK+CONFIG_GFXNVIDIA+CONFIG_DRKAISER+CONFIG_SATASII+CONFIG_ATAHPT >= 1
 		printf("\nSupported PCI devices flashrom can use "
 		       "as programmer:\n\n");
 #endif
-#if NIC3COM_SUPPORT == 1
+#if CONFIG_NIC3COM == 1
 		print_supported_pcidevs(nics_3com);
 #endif
-#if NICREALTEK_SUPPORT == 1
+#if CONFIG_NICREALTEK == 1
 		print_supported_pcidevs(nics_realtek);
 		print_supported_pcidevs(nics_realteksmc1211);
 #endif
-#if GFXNVIDIA_SUPPORT == 1
+#if CONFIG_GFXNVIDIA == 1
 		print_supported_pcidevs(gfx_nvidia);
 #endif
-#if DRKAISER_SUPPORT == 1
+#if CONFIG_DRKAISER == 1
 		print_supported_pcidevs(drkaiser_pcidev);
 #endif
-#if SATASII_SUPPORT == 1
+#if CONFIG_SATASII == 1
 		print_supported_pcidevs(satas_sii);
 #endif
-#if ATAHPT_SUPPORT == 1
+#if CONFIG_ATAHPT == 1
 		print_supported_pcidevs(ata_hpt);
 #endif
 }
 
 
-#if INTERNAL_SUPPORT == 1
+#if CONFIG_INTERNAL == 1
 /* Please keep this list alphabetically ordered by vendor/board. */
 const struct board_info boards_ok[] = {
 	/* Verified working boards that don't need write-enables. */
diff --git a/print_wiki.c b/print_wiki.c
index 3d51bfa..d2fd022 100644
--- a/print_wiki.c
+++ b/print_wiki.c
@@ -25,7 +25,7 @@
 #include "flash.h"
 #include "flashchips.h"
 
-#if INTERNAL_SUPPORT == 1
+#if CONFIG_INTERNAL == 1
 struct board_info_url {
 	const char *vendor;
 	const char *name;
@@ -46,7 +46,7 @@
 generated by pasting '''flashrom -z''' output.<br />\
 '''Last update:''' %s(generated by flashrom %s)\n</small></div>\n";
 
-#if INTERNAL_SUPPORT == 1
+#if CONFIG_INTERNAL == 1
 const char *chipset_th = "{| border=\"0\" style=\"font-size: smaller\"\n\
 |- bgcolor=\"#6699dd\"\n! align=\"left\" | Vendor\n\
 ! align=\"left\" | Southbridge\n! align=\"left\" | PCI IDs\n\
@@ -89,7 +89,7 @@
 ! align=\"left\" | Device\n! align=\"left\" | PCI IDs\n\
 ! align=\"left\" | Status\n\n";
 
-#if INTERNAL_SUPPORT == 1
+#if CONFIG_INTERNAL == 1
 const char *laptop_intro = "\n== Supported laptops/notebooks ==\n\n\
 In general, flashing laptops is more difficult because laptops\n\n\
 * often use the flash chip for stuff besides the BIOS,\n\
@@ -599,29 +599,29 @@
 	time_t t = time(NULL);
 
 	printf(wiki_header, ctime(&t), flashrom_version);
-#if INTERNAL_SUPPORT == 1
+#if CONFIG_INTERNAL == 1
 	print_supported_chips_wiki(2);
 	print_supported_chipsets_wiki(3);
 	print_supported_boards_wiki();
 #endif
 	printf("%s", programmer_section);
-#if NIC3COM_SUPPORT == 1
+#if CONFIG_NIC3COM == 1
 	print_supported_pcidevs_wiki(nics_3com);
 #endif
-#if NICREALTEK_SUPPORT == 1
+#if CONFIG_NICREALTEK == 1
 	print_supported_pcidevs_wiki(nics_realtek);
 	print_supported_pcidevs_wiki(nics_realteksmc1211);
 #endif
-#if GFXNVIDIA_SUPPORT == 1
+#if CONFIG_GFXNVIDIA == 1
 	print_supported_pcidevs_wiki(gfx_nvidia);
 #endif
-#if DRKAISER_SUPPORT == 1
+#if CONFIG_DRKAISER == 1
 	print_supported_pcidevs_wiki(drkaiser_pcidev);
 #endif
-#if SATASII_SUPPORT == 1
+#if CONFIG_SATASII == 1
 	print_supported_pcidevs_wiki(satas_sii);
 #endif
-#if ATAHPT_SUPPORT == 1
+#if CONFIG_ATAHPT == 1
 	print_supported_pcidevs_wiki(ata_hpt);
 #endif
 	printf("\n|}\n");
diff --git a/spi.c b/spi.c
index 67682b5..30e0d33 100644
--- a/spi.c
+++ b/spi.c
@@ -40,7 +40,7 @@
 		.write_256 = NULL,
 	},
 
-#if INTERNAL_SUPPORT == 1
+#if CONFIG_INTERNAL == 1
 #if defined(__i386__) || defined(__x86_64__)
 	{ /* SPI_CONTROLLER_ICH7 */
 		.command = ich_spi_send_command,
@@ -86,7 +86,7 @@
 #endif
 #endif
 
-#if FT2232_SPI_SUPPORT == 1
+#if CONFIG_FT2232_SPI == 1
 	{ /* SPI_CONTROLLER_FT2232 */
 		.command = ft2232_spi_send_command,
 		.multicommand = default_spi_send_multicommand,
@@ -95,7 +95,7 @@
 	},
 #endif
 
-#if DUMMY_SUPPORT == 1
+#if CONFIG_DUMMY == 1
 	{ /* SPI_CONTROLLER_DUMMY */
 		.command = dummy_spi_send_command,
 		.multicommand = default_spi_send_multicommand,
@@ -104,7 +104,7 @@
 	},
 #endif
 
-#if BUSPIRATE_SPI_SUPPORT == 1
+#if CONFIG_BUSPIRATE_SPI == 1
 	{ /* SPI_CONTROLLER_BUSPIRATE */
 		.command = buspirate_spi_send_command,
 		.multicommand = default_spi_send_multicommand,
@@ -113,7 +113,7 @@
 	},
 #endif
 
-#if DEDIPROG_SUPPORT == 1
+#if CONFIG_DEDIPROG == 1
 	{ /* SPI_CONTROLLER_DEDIPROG */
 		.command = dediprog_spi_send_command,
 		.multicommand = default_spi_send_multicommand,
@@ -214,7 +214,7 @@
 uint32_t spi_get_valid_read_addr(void)
 {
 	switch (spi_controller) {
-#if INTERNAL_SUPPORT == 1
+#if CONFIG_INTERNAL == 1
 #if defined(__i386__) || defined(__x86_64__)
 	case SPI_CONTROLLER_ICH7:
 		/* Return BBAR for ICH chipsets. */
diff --git a/spi25.c b/spi25.c
index 72940c1..c6b5119 100644
--- a/spi25.c
+++ b/spi25.c
@@ -171,7 +171,7 @@
 {
 	/* only some SPI chipsets support 4 bytes commands */
 	switch (spi_controller) {
-#if INTERNAL_SUPPORT == 1
+#if CONFIG_INTERNAL == 1
 #if defined(__i386__) || defined(__x86_64__)
 	case SPI_CONTROLLER_ICH7:
 	case SPI_CONTROLLER_ICH9:
@@ -180,16 +180,16 @@
 	case SPI_CONTROLLER_WBSIO:
 #endif
 #endif
-#if FT2232_SPI_SUPPORT == 1
+#if CONFIG_FT2232_SPI == 1
 	case SPI_CONTROLLER_FT2232:
 #endif
-#if DUMMY_SUPPORT == 1
+#if CONFIG_DUMMY == 1
 	case SPI_CONTROLLER_DUMMY:
 #endif
-#if BUSPIRATE_SPI_SUPPORT == 1
+#if CONFIG_BUSPIRATE_SPI == 1
 	case SPI_CONTROLLER_BUSPIRATE:
 #endif
-#if DEDIPROG_SUPPORT == 1
+#if CONFIG_DEDIPROG == 1
 	case SPI_CONTROLLER_DEDIPROG:
 #endif
 		return probe_spi_rdid_generic(flash, 4);
@@ -1023,7 +1023,7 @@
 	int result;
 
 	switch (spi_controller) {
-#if INTERNAL_SUPPORT == 1
+#if CONFIG_INTERNAL == 1
 #if defined(__i386__) || defined(__x86_64__)
 	case SPI_CONTROLLER_WBSIO:
 		msg_cerr("%s: impossible with Winbond SPI masters,"