opaque: Move probing into PREPARE_POST_PROBE hook
To get rid of the flash context in probing, we have to split the
detection of chip parameters out into a preparation step. Below
the opaque-master API, things could actually stay as they are,
we rename `.probe` to `.prepare` though for completeness.
Change-Id: Ic8418e6c5bdc49f5133cdb21efed0bf6dc2f820e
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/449
diff --git a/include/chipdrivers/opaque.h b/include/chipdrivers/opaque.h
index a621f66..d172861 100644
--- a/include/chipdrivers/opaque.h
+++ b/include/chipdrivers/opaque.h
@@ -20,6 +20,9 @@
struct flashprog_flashctx;
+enum preparation_steps;
+int prepare_opaque(struct flashprog_flashctx *, enum preparation_steps);
+
int probe_opaque(struct flashprog_flashctx *);
int read_opaque(struct flashprog_flashctx *, uint8_t *buf, unsigned int start, unsigned int len);
int write_opaque(struct flashprog_flashctx *, const uint8_t *buf, unsigned int start, unsigned int len);