summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorMartin Kurbanov <mmkurbanov@salutedevices.com>2025-02-10 17:34:16 +0300
committerMiquel Raynal <miquel.raynal@bootlin.com>2025-02-10 17:52:59 +0300
commit9ad2857c82d56017402256fd3e2ed401cc7f6fb9 (patch)
treee6c7f4a5de4f43125af1ea96133c9b779f62080c /include/linux
parente278b8c73b0526f8e3ee22f4827c8fe07c2109ba (diff)
downloadlinux-9ad2857c82d56017402256fd3e2ed401cc7f6fb9.tar.xz
mtd: spinand: otp: add helpers functions
The global functions spinand_otp_read() and spinand_otp_write() have been introduced. Since most SPI-NAND flashes read/write OTP in the same way, let's define global functions to avoid code duplication. Signed-off-by: Martin Kurbanov <mmkurbanov@salutedevices.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/mtd/spinand.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h
index 597d28339d15..73424405232a 100644
--- a/include/linux/mtd/spinand.h
+++ b/include/linux/mtd/spinand.h
@@ -689,6 +689,13 @@ size_t spinand_otp_page_size(struct spinand_device *spinand);
size_t spinand_fact_otp_size(struct spinand_device *spinand);
size_t spinand_user_otp_size(struct spinand_device *spinand);
+int spinand_fact_otp_read(struct spinand_device *spinand, loff_t ofs,
+ size_t len, size_t *retlen, u8 *buf);
+int spinand_user_otp_read(struct spinand_device *spinand, loff_t ofs,
+ size_t len, size_t *retlen, u8 *buf);
+int spinand_user_otp_write(struct spinand_device *spinand, loff_t ofs,
+ size_t len, size_t *retlen, const u8 *buf);
+
int spinand_set_mtd_otp_ops(struct spinand_device *spinand);
#endif /* __LINUX_MTD_SPINAND_H */