aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBoris Brezillon <boris.brezillon@bootlin.com>2018-05-15 11:08:21 -0400
committerBoris Brezillon <boris.brezillon@bootlin.com>2018-06-01 08:53:50 -0400
commitf567c71f4f91d173795a2f46d6fc493387ce084d (patch)
treee03928046ae2279a0fa50843439b4505073aa2c9
parent782d1967d0479ffd59412b2f3179c8bb35f50ff6 (diff)
mtd: nand: Pass mode information to nand_page_io_req
The NAND sub-layers are likely to need the MTD_OPS_XXX mode information in order to decide if they should enable/disable ECC or how they should place the OOB bytes in the provided OOB buffer. Add a field to nand_page_io_req to pass this information. Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com> Tested-by: Frieder Schrempf <frieder.schrempf@exceet.de> Reviewed-by: Frieder Schrempf <frieder.schrempf@exceet.de>
-rw-r--r--include/linux/mtd/nand.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 792ea5c26329..abe975c87b90 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -86,6 +86,7 @@ struct nand_pos {
86 * @ooboffs: the OOB offset within the page 86 * @ooboffs: the OOB offset within the page
87 * @ooblen: the number of OOB bytes to read from/write to this page 87 * @ooblen: the number of OOB bytes to read from/write to this page
88 * @oobbuf: buffer to store OOB data in or get OOB data from 88 * @oobbuf: buffer to store OOB data in or get OOB data from
89 * @mode: one of the %MTD_OPS_XXX mode
89 * 90 *
90 * This object is used to pass per-page I/O requests to NAND sub-layers. This 91 * This object is used to pass per-page I/O requests to NAND sub-layers. This
91 * way all useful information are already formatted in a useful way and 92 * way all useful information are already formatted in a useful way and
@@ -106,6 +107,7 @@ struct nand_page_io_req {
106 const void *out; 107 const void *out;
107 void *in; 108 void *in;
108 } oobbuf; 109 } oobbuf;
110 int mode;
109}; 111};
110 112
111/** 113/**
@@ -599,6 +601,7 @@ static inline void nanddev_io_iter_init(struct nand_device *nand,
599{ 601{
600 struct mtd_info *mtd = nanddev_to_mtd(nand); 602 struct mtd_info *mtd = nanddev_to_mtd(nand);
601 603
604 iter->req.mode = req->mode;
602 iter->req.dataoffs = nanddev_offs_to_pos(nand, offs, &iter->req.pos); 605 iter->req.dataoffs = nanddev_offs_to_pos(nand, offs, &iter->req.pos);
603 iter->req.ooboffs = req->ooboffs; 606 iter->req.ooboffs = req->ooboffs;
604 iter->oobbytes_per_page = mtd_oobavail(mtd, req); 607 iter->oobbytes_per_page = mtd_oobavail(mtd, req);