Add fallback functions for programmer shutdown and memory mapping and fix FT2232 and IT87

FT2232 and IT87 programmers used functions of the dummy programmer
instead of fallback functions.

The dummy programmer is a "real" programmer with possible side effects
and its functions should not be abused by other programmers. Make
FT2232 and IT87 use official fallback functions instead. Create
fallback_shutdown(). Create fallback_chip_writeb(). Convert the
programmer #defines to an enum.

Corresponding to flashrom svn r678.

Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
diff --git a/flashrom.c b/flashrom.c
index 12b4e46..a1d0cc2 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -33,7 +33,7 @@
 const char *flashrom_version = FLASHROM_VERSION;
 char *chip_to_probe = NULL;
 int verbose = 0;
-int programmer = PROGRAMMER_INTERNAL;
+enum programmer programmer = PROGRAMMER_INTERNAL;
 
 const struct programmer_entry programmer_table[] = {
 	{
@@ -102,14 +102,14 @@
 
 	{
 		.init			= it87spi_init,
-		.shutdown		= dummy_shutdown,
-		.map_flash_region	= dummy_map,
-		.unmap_flash_region	= dummy_unmap,
+		.shutdown		= fallback_shutdown,
+		.map_flash_region	= fallback_map,
+		.unmap_flash_region	= fallback_unmap,
 		.chip_readb		= dummy_chip_readb,
 		.chip_readw		= fallback_chip_readw,
 		.chip_readl		= fallback_chip_readl,
 		.chip_readn		= fallback_chip_readn,
-		.chip_writeb		= dummy_chip_writeb,
+		.chip_writeb		= fallback_chip_writeb,
 		.chip_writew		= fallback_chip_writew,
 		.chip_writel		= fallback_chip_writel,
 		.chip_writen		= fallback_chip_writen,
@@ -118,19 +118,20 @@
 
 	{
 		.init			= ft2232_spi_init,
-		.shutdown		= dummy_shutdown,
-		.map_flash_region	= dummy_map,
-		.unmap_flash_region	= dummy_unmap,
+		.shutdown		= fallback_shutdown,
+		.map_flash_region	= fallback_map,
+		.unmap_flash_region	= fallback_unmap,
 		.chip_readb		= dummy_chip_readb,
 		.chip_readw		= fallback_chip_readw,
 		.chip_readl		= fallback_chip_readl,
 		.chip_readn		= fallback_chip_readn,
-		.chip_writeb		= dummy_chip_writeb,
+		.chip_writeb		= fallback_chip_writeb,
 		.chip_writew		= fallback_chip_writew,
 		.chip_writel		= fallback_chip_writel,
 		.chip_writen		= fallback_chip_writen,
 		.delay			= internal_delay,
 	},
+
 	{
 		.init			= serprog_init,
 		.shutdown		= serprog_shutdown,