diff options
| author | Martin Kurbanov <mmkurbanov@salutedevices.com> | 2025-02-10 17:34:16 +0300 |
|---|---|---|
| committer | Miquel Raynal <miquel.raynal@bootlin.com> | 2025-02-10 17:52:59 +0300 |
| commit | 9ad2857c82d56017402256fd3e2ed401cc7f6fb9 (patch) | |
| tree | e6c7f4a5de4f43125af1ea96133c9b779f62080c /include | |
| parent | e278b8c73b0526f8e3ee22f4827c8fe07c2109ba (diff) | |
| download | linux-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')
| -rw-r--r-- | include/linux/mtd/spinand.h | 7 |
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 */ |
