programmer_table: move each entry to the associated programmer source

Change-Id: I3d02bd789f0299e936eb86819b3b15b5ea2bb921
Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.de>
Original-Reviewed-on: https://review.coreboot.org/c/flashrom/+/52946
Original-Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Original-Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/flashrom-stable/+/71373
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/programmer.h b/programmer.h
index 50ec930..af7d500 100644
--- a/programmer.h
+++ b/programmer.h
@@ -347,7 +347,7 @@
 void probe_superio(void);
 int register_superio(struct superio s);
 extern enum chipbustype internal_buses_supported;
-int internal_init(void);
+extern const struct programmer_entry programmer_internal;
 #endif
 
 /* hwaccess.c */
@@ -385,140 +385,117 @@
 
 /* dummyflasher.c */
 #if CONFIG_DUMMY == 1
-int dummy_init(void);
-void *dummy_map(const char *descr, uintptr_t phys_addr, size_t len);
-void dummy_unmap(void *virt_addr, size_t len);
+extern const struct programmer_entry programmer_dummy;
 #endif
 
 /* nic3com.c */
 #if CONFIG_NIC3COM == 1
-int nic3com_init(void);
-extern const struct dev_entry nics_3com[];
+extern const struct programmer_entry programmer_nic3com;
 #endif
 
 /* gfxnvidia.c */
 #if CONFIG_GFXNVIDIA == 1
-int gfxnvidia_init(void);
-extern const struct dev_entry gfx_nvidia[];
+extern const struct programmer_entry programmer_gfxnvidia;
 #endif
 
 /* drkaiser.c */
 #if CONFIG_DRKAISER == 1
-int drkaiser_init(void);
-extern const struct dev_entry drkaiser_pcidev[];
+extern const struct programmer_entry programmer_drkaiser;
 #endif
 
 /* nicrealtek.c */
 #if CONFIG_NICREALTEK == 1
-int nicrealtek_init(void);
-extern const struct dev_entry nics_realtek[];
+extern const struct programmer_entry programmer_nicrealtek;
 #endif
 
 /* nicnatsemi.c */
 #if CONFIG_NICNATSEMI == 1
-int nicnatsemi_init(void);
-extern const struct dev_entry nics_natsemi[];
+extern const struct programmer_entry programmer_nicnatsemi;
 #endif
 
 /* nicintel.c */
 #if CONFIG_NICINTEL == 1
-int nicintel_init(void);
-extern const struct dev_entry nics_intel[];
+extern const struct programmer_entry programmer_nicintel;
 #endif
 
 /* nicintel_spi.c */
 #if CONFIG_NICINTEL_SPI == 1
-int nicintel_spi_init(void);
-extern const struct dev_entry nics_intel_spi[];
+extern const struct programmer_entry programmer_nicintel_spi;
 #endif
 
 /* nicintel_eeprom.c */
 #if CONFIG_NICINTEL_EEPROM == 1
-int nicintel_ee_init(void);
-extern const struct dev_entry nics_intel_ee[];
+extern const struct programmer_entry programmer_nicintel_eeprom;
 #endif
 
 /* ogp_spi.c */
 #if CONFIG_OGP_SPI == 1
-int ogp_spi_init(void);
-extern const struct dev_entry ogp_spi[];
+extern const struct programmer_entry programmer_ogp_spi;
 #endif
 
 /* satamv.c */
 #if CONFIG_SATAMV == 1
-int satamv_init(void);
-extern const struct dev_entry satas_mv[];
+extern const struct programmer_entry programmer_satamv;
 #endif
 
 /* satasii.c */
 #if CONFIG_SATASII == 1
-int satasii_init(void);
-extern const struct dev_entry satas_sii[];
+extern const struct programmer_entry programmer_satasii;
 #endif
 
 /* atahpt.c */
 #if CONFIG_ATAHPT == 1
-int atahpt_init(void);
-extern const struct dev_entry ata_hpt[];
+extern const struct programmer_entry programmer_atahpt;
 #endif
 
 /* atavia.c */
 #if CONFIG_ATAVIA == 1
-int atavia_init(void);
-void *atavia_map(const char *descr, uintptr_t phys_addr, size_t len);
-extern const struct dev_entry ata_via[];
+extern const struct programmer_entry programmer_atavia;
 #endif
 
 /* atapromise.c */
 #if CONFIG_ATAPROMISE == 1
-int atapromise_init(void);
-void *atapromise_map(const char *descr, uintptr_t phys_addr, size_t len);
-extern const struct dev_entry ata_promise[];
+extern const struct programmer_entry programmer_atapromise;
 #endif
 
 /* it8212.c */
 #if CONFIG_IT8212 == 1
-int it8212_init(void);
-extern const struct dev_entry devs_it8212[];
+extern const struct programmer_entry programmer_it8212;
 #endif
 
 /* ft2232_spi.c */
 #if CONFIG_FT2232_SPI == 1
-int ft2232_spi_init(void);
-extern const struct dev_entry devs_ft2232spi[];
+extern const struct programmer_entry programmer_ft2232_spi;
 #endif
 
 /* usbblaster_spi.c */
 #if CONFIG_USBBLASTER_SPI == 1
-int usbblaster_spi_init(void);
-extern const struct dev_entry devs_usbblasterspi[];
+extern const struct programmer_entry programmer_usbblaster_spi;
 #endif
 
 /* mstarddc_spi.c */
 #if CONFIG_MSTARDDC_SPI == 1
-int mstarddc_spi_init(void);
+extern const struct programmer_entry programmer_mstarddc_spi;
 #endif
 
 /* pickit2_spi.c */
 #if CONFIG_PICKIT2_SPI == 1
-int pickit2_spi_init(void);
-extern const struct dev_entry devs_pickit2_spi[];
+extern const struct programmer_entry programmer_pickit2_spi;
 #endif
 
 /* stlinkv3_spi.c */
 #if CONFIG_STLINKV3_SPI == 1
-int stlinkv3_spi_init(void);
-extern const struct dev_entry devs_stlinkv3_spi[];
+extern const struct programmer_entry programmer_stlinkv3_spi;
 #endif
 
 /* rayer_spi.c */
 #if CONFIG_RAYER_SPI == 1
-int rayer_spi_init(void);
+extern const struct programmer_entry programmer_rayer_spi;
 #endif
 
 /* pony_spi.c */
 #if CONFIG_PONY_SPI == 1
-int pony_spi_init(void);
+extern const struct programmer_entry programmer_pony_spi;
 #endif
 
 /* bitbang_spi.c */
@@ -526,52 +503,47 @@
 
 /* buspirate_spi.c */
 #if CONFIG_BUSPIRATE_SPI == 1
-int buspirate_spi_init(void);
+extern const struct programmer_entry programmer_buspirate_spi;
 #endif
 
 /* linux_mtd.c */
 #if CONFIG_LINUX_MTD == 1
-int linux_mtd_init(void);
+extern const struct programmer_entry programmer_linux_mtd;
 #endif
 
 /* linux_spi.c */
 #if CONFIG_LINUX_SPI == 1
-int linux_spi_init(void);
+extern const struct programmer_entry programmer_linux_spi;
 #endif
 
 /* dediprog.c */
 #if CONFIG_DEDIPROG == 1
-int dediprog_init(void);
-extern const struct dev_entry devs_dediprog[];
+extern const struct programmer_entry programmer_dediprog;
 #endif
 
 /* developerbox_spi.c */
 #if CONFIG_DEVELOPERBOX_SPI == 1
-int developerbox_spi_init(void);
-extern const struct dev_entry devs_developerbox_spi[];
+extern const struct programmer_entry programmer_developerbox;
 #endif
 
 /* ch341a_spi.c */
 #if CONFIG_CH341A_SPI == 1
-int ch341a_spi_init(void);
-void ch341a_spi_delay(unsigned int usecs);
-extern const struct dev_entry devs_ch341a_spi[];
+extern const struct programmer_entry programmer_ch341a_spi;
 #endif
 
 /* digilent_spi.c */
 #if CONFIG_DIGILENT_SPI == 1
-int digilent_spi_init(void);
-extern const struct dev_entry devs_digilent_spi[];
+extern const struct programmer_entry programmer_digilent_spi;
 #endif
 
 /* jlink_spi.c */
 #if CONFIG_JLINK_SPI == 1
-int jlink_spi_init(void);
+extern const struct programmer_entry programmer_jlink_spi;
 #endif
 
 /* ni845x_spi.c */
 #if CONFIG_NI845X_SPI == 1
-int ni845x_spi_init(void);
+extern const struct programmer_entry programmer_ni845x_spi;
 #endif
 
 /* flashrom.c */
@@ -668,7 +640,7 @@
 
 #if CONFIG_LINUX_MTD == 1
 /* trivial wrapper to avoid cluttering internal_init() with #if */
-static inline int try_mtd(void) { return linux_mtd_init(); };
+static inline int try_mtd(void) { return programmer_linux_mtd.init(); };
 #else
 static inline int try_mtd(void) { return 1; };
 #endif
@@ -731,9 +703,7 @@
 
 /* serprog.c */
 #if CONFIG_SERPROG == 1
-int serprog_init(void);
-void serprog_delay(unsigned int usecs);
-void *serprog_map(const char *descr, uintptr_t phys_addr, size_t len);
+extern const struct programmer_entry programmer_serprog;
 #endif
 
 /* serial.c */