writeprotect: Hook wp functions into the chip driver
Change-Id: I17a06210ec329aba337cf459d581463827182108
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.sourcearcade.org/c/flashprog/+/72532
diff --git a/include/flash.h b/include/flash.h
index 561a597..340af59 100644
--- a/include/flash.h
+++ b/include/flash.h
@@ -323,6 +323,12 @@
struct reg_bit_info wps;
} reg_bits;
+ /* Write WP configuration to the chip */
+ enum flashprog_wp_result (*wp_write_cfg)(struct flashctx *, const struct flashprog_wp_cfg *);
+ /* Read WP configuration from the chip */
+ enum flashprog_wp_result (*wp_read_cfg)(struct flashprog_wp_cfg *, struct flashctx *);
+ /* Get a list of protection ranges supported by the chip */
+ enum flashprog_wp_result (*wp_get_ranges)(struct flashprog_wp_ranges **, struct flashctx *);
/* Function that takes a set of WP config bits (e.g. BP, SEC, TB, etc) */
/* and determines what protection range they select. */
void (*decode_range)(size_t *start, size_t *len, const struct wp_bits *, size_t chip_len);
diff --git a/include/writeprotect.h b/include/writeprotect.h
index 0e5a86e..356ffb2 100644
--- a/include/writeprotect.h
+++ b/include/writeprotect.h
@@ -78,12 +78,12 @@
struct flashprog_flashctx;
/* Write WP configuration to the chip */
-enum flashprog_wp_result wp_write_cfg(struct flashprog_flashctx *, const struct flashprog_wp_cfg *);
+enum flashprog_wp_result spi_wp_write_cfg(struct flashprog_flashctx *, const struct flashprog_wp_cfg *);
/* Read WP configuration from the chip */
-enum flashprog_wp_result wp_read_cfg(struct flashprog_wp_cfg *, struct flashprog_flashctx *);
+enum flashprog_wp_result spi_wp_read_cfg(struct flashprog_wp_cfg *, struct flashprog_flashctx *);
/* Get a list of protection ranges supported by the chip */
-enum flashprog_wp_result wp_get_available_ranges(struct flashprog_wp_ranges **, struct flashprog_flashctx *);
+enum flashprog_wp_result spi_wp_get_available_ranges(struct flashprog_wp_ranges **, struct flashprog_flashctx *);
#endif /* !__WRITEPROTECT_H__ */