Start implementing struct flashprog_programmer
Our libflashprog API was already prepared for a programmer level context
stored in an opaque `struct flashprog_programmer`. We start filling this
struct with a pointer to the programmer driver (entry in the programmer
table) and a mutable copy of the parameter string.
Change-Id: If9a795627b1e50ea6006569e723f400ff337be20
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/72525
diff --git a/include/programmer.h b/include/programmer.h
index 286516d..f45aab9 100644
--- a/include/programmer.h
+++ b/include/programmer.h
@@ -95,8 +95,13 @@
extern const struct programmer_entry programmer_usbblaster_spi;
extern const struct programmer_entry programmer_dirtyjtag_spi;
-int programmer_init(const struct programmer_entry *prog, const char *param);
-int programmer_shutdown(void);
+struct flashprog_programmer {
+ const struct programmer_entry *driver;
+ char *param; /* TODO: Replace with flashprog_cfg (cf. flashrom/master) */
+};
+
+int programmer_init(struct flashprog_programmer *);
+int programmer_shutdown(struct flashprog_programmer *);
struct bitbang_spi_master {
/* Note that CS# is active low, so val=0 means the chip is active. */