libflashprog: Introduce new probing API flashprog_flash_probe_chip()

This new probing API acts about the same as the old one, except that
it accepts a `struct flashprog_chip *` handle instead of a chip name.
Under the hood, however, it uses our new bus probing directly.

We introduce a new function, flashprog_flash_prepare_context(), that
creates a flash context from a probed chip, and the bus it was found
on. This will be the single place that creates flash contexts in the
future.

Change-Id: I1a344aedf573d92f8f297e6eed8daadb511ebc10
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/484
diff --git a/include/chipdrivers/probing.h b/include/chipdrivers/probing.h
index 090f2ab..2e081d1 100644
--- a/include/chipdrivers/probing.h
+++ b/include/chipdrivers/probing.h
@@ -88,4 +88,10 @@
 void flashprog_bus_probe(struct registered_master *, const struct flashchip *);
 bool flashprog_chip_match(struct registered_master *, const struct flashchip *);
 
+struct flashprog_chips;
+struct flashprog_flashctx;
+struct flashprog_programmer;
+const struct master_common *flashprog_chip_probe(const struct flashprog_programmer *, const struct flashchip *);
+int flashprog_flash_prepare_context(struct flashprog_flashctx **, const struct flashprog_programmer *, const struct master_common *, const struct flashchip *);
+
 #endif /* !__PROBING_H__ */