Attention is currently required from: Nikolai Artemiev, Sergii Dmytruk. Edward O'Callaghan has posted comments on this change. ( https://review.coreboot.org/c/flashrom/+/64375 )
Change subject: writeprotect.c: Allow opaque masters to hook spi_{rw}_register() ......................................................................
Patch Set 6:
(1 comment)
File include/programmer.h:
https://review.coreboot.org/c/flashrom/+/64375/comment/adbb6ce2_ca72ef45 PS6, Line 405: int (*read_register)(const struct flashctx *flash, enum flash_reg reg, uint8_t *value); : int (*write_register)(const struct flashctx *flash, enum flash_reg reg, uint8_t value);
If these are meant to stay WP only, they should have "wp_" prefix.
That is a fair point however this was intentional since r/w register is not necessarily specific to only writeprotect.c it is just that the use-case happens to be that right now.
The hooks are intended to be general purpose, another use-case I have potentially in mind is for libflashrom to facilitate dumping register state.