From: Jaime Liao <jaimeliao.tw@gmail.com>
To: linux-mtd@lists.infradead.org, miquel.raynal@bootlin.com, richard@nod.at
Cc: jaimeliao@mxic.com.tw, jaimeliao.tw@gmail.com
Subject: [PATCH v2 2/4] mtd: spinand: Add continuous read state
Date: Thu, 9 Feb 2023 20:08:51 +0800 [thread overview]
Message-ID: <20230209120853.660564-3-jaimeliao.tw@gmail.com> (raw)
In-Reply-To: <20230209120853.660564-1-jaimeliao.tw@gmail.com>
Add continuous read state and initialize state to
default false.
Signed-off-by: Jaime Liao <jaimeliao.tw@gmail.com>
---
drivers/mtd/nand/spi/core.c | 8 ++++++++
include/linux/mtd/spinand.h | 2 ++
2 files changed, 10 insertions(+)
diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
index c13374933372..aa57d5b0a3dc 100644
--- a/drivers/mtd/nand/spi/core.c
+++ b/drivers/mtd/nand/spi/core.c
@@ -193,6 +193,11 @@ static int spinand_init_quad_enable(struct spinand_device *spinand)
enable ? CFG_QUAD_ENABLE : 0);
}
+static void spinand_init_continuous_read(struct spinand_device *spinand)
+{
+ spinand->use_continuous_read = false;
+}
+
static int spinand_continuous_read_enable(struct spinand_device *spinand)
{
return spinand_upd_cfg(spinand, CFG_CONT_READ_ENABLE,
@@ -1304,6 +1309,9 @@ static int spinand_init(struct spinand_device *spinand)
goto err_cleanup_ecc_engine;
}
+ /* Init continuous read */
+ spinand_init_continuous_read(spinand);
+
return 0;
err_cleanup_ecc_engine:
diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h
index e98d770173dc..f598a0c5a376 100644
--- a/include/linux/mtd/spinand.h
+++ b/include/linux/mtd/spinand.h
@@ -419,6 +419,7 @@ struct spinand_dirmap {
* because the spi-mem interface explicitly requests that buffers
* passed in spi_mem_op be DMA-able, so we can't based the bufs on
* the stack
+ * @use_continuous_read: record the continuous read status
* @manufacturer: SPI NAND manufacturer information
* @priv: manufacturer private data
*/
@@ -447,6 +448,7 @@ struct spinand_device {
u8 *databuf;
u8 *oobbuf;
u8 *scratchbuf;
+ bool use_continuous_read;
const struct spinand_manufacturer *manufacturer;
void *priv;
};
--
2.34.1
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2023-02-09 12:09 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-09 12:08 [PATCH v2 0/4] mtd: spinand: Add continuous read mode support Jaime Liao
2023-02-09 12:08 ` [PATCH v2 1/4] mtd: spinand: Add support continuous read mode Jaime Liao
2023-02-09 12:08 ` Jaime Liao [this message]
2023-02-09 12:08 ` [PATCH v2 3/4] mtd: spinand: Add support continuous read operation Jaime Liao
2023-02-15 6:51 ` Chuanhong Guo
2023-04-27 9:58 ` liao jaime
2023-02-09 12:08 ` [PATCH v2 4/4] mtd: spinand: macronix: Add continuous read support for Macronix Flash Jaime Liao
-- strict thread matches above, loose matches on Subject: below --
2022-02-09 9:10 [PATCH v2 0/4] mtd: spinand: Add continuous read mode support Zhengxun
2022-02-09 9:10 ` [PATCH v2 2/4] mtd: spinand: Add continuous read state Zhengxun
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230209120853.660564-3-jaimeliao.tw@gmail.com \
--to=jaimeliao.tw@gmail.com \
--cc=jaimeliao@mxic.com.tw \
--cc=linux-mtd@lists.infradead.org \
--cc=miquel.raynal@bootlin.com \
--cc=richard@nod.at \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox