Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1323733 > unrolled thread
| Started by | Bean Huo <jackyard88@gmail.com> |
|---|---|
| First post | 2016-02-02 03:40 +0100 |
| Last post | 2016-02-02 03:40 +0100 |
| Articles | 1 — 1 participant |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH v2 02/17] include:mtd:add multi-plane program in mtd_info Bean Huo <jackyard88@gmail.com> - 2016-02-02 03:40 +0100
| From | Bean Huo <jackyard88@gmail.com> |
|---|---|
| Date | 2016-02-02 03:40 +0100 |
| Subject | [PATCH v2 02/17] include:mtd:add multi-plane program in mtd_info |
| Message-ID | <qXz2P-3Wf-47@gated-at.bofh.it> |
From: Bean Huo <beanhuo@micron.com>
This patch file is to add support for multi-plane page program hook in mtd_info,
callback this in one new inline function mtd_write_dual_plane_oob.
Signed-off-by: BeanHuo <beanhuo@micron.com>
---
include/linux/mtd/mtd.h | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index f17fa75..cfcb3a68 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -204,6 +204,9 @@ struct mtd_info {
struct mtd_oob_ops *ops);
int (*_write_oob) (struct mtd_info *mtd, loff_t to,
struct mtd_oob_ops *ops);
+ int (*_dual_plane_write_oob) (struct mtd_info *mtd, loff_t to_plane0,
+ struct mtd_oob_ops *ops_plane0, loff_t to_plane1,
+ struct mtd_oob_ops *ops_plane1);
int (*_get_fact_prot_info) (struct mtd_info *mtd, size_t len,
size_t *retlen, struct otp_info *buf);
int (*_read_fact_prot_reg) (struct mtd_info *mtd, loff_t from,
@@ -280,6 +283,22 @@ static inline int mtd_write_oob(struct mtd_info *mtd, loff_t to,
return mtd->_write_oob(mtd, to, ops);
}
+static inline int mtd_write_dual_plane_oob(struct mtd_info *mtd,
+ loff_t to_plane0, struct mtd_oob_ops *ops0, loff_t to_plane1,
+ struct mtd_oob_ops *ops1)
+{
+ ops0->retlen = ops0->oobretlen = 0;
+ ops1->retlen = ops1->oobretlen = 0;
+
+ if (!mtd->_dual_plane_write_oob)
+ return -EOPNOTSUPP;
+ if (!(mtd->flags & MTD_WRITEABLE))
+ return -EROFS;
+
+ return mtd->_dual_plane_write_oob(mtd, to_plane0, ops0,
+ to_plane1, ops1);
+}
+
int mtd_get_fact_prot_info(struct mtd_info *mtd, size_t len, size_t *retlen,
struct otp_info *buf);
int mtd_read_fact_prot_reg(struct mtd_info *mtd, loff_t from, size_t len,
--
1.9.1
Back to top | Article view | linux.kernel
csiph-web