[PATCH v1 2/5] mtd: spinand: Add continuous read mode initialization

Leo Yu liangyanyu13 at gmail.com
Wed Nov 2 02:04:41 CET 2022


Add continuous read mode status and initialize the default status
to false.

Signed-off-by: Leo Yu <liangyanyu13 at gmail.com>
---
 drivers/mtd/nand/spi/core.c | 8 ++++++++
 include/linux/mtd/spinand.h | 3 +++
 2 files changed, 11 insertions(+)

diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
index 2419c267d6..9d628f6f26 100644
--- a/drivers/mtd/nand/spi/core.c
+++ b/drivers/mtd/nand/spi/core.c
@@ -216,6 +216,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,
 					  bool enable)
 {
@@ -1126,6 +1131,9 @@ static int spinand_init(struct spinand_device *spinand)

 	mtd->oobavail = ret;

+	/* Init continuous read mode */
+	spinand_init_continuous_read(spinand);
+
 	return 0;

 err_cleanup_nanddev:
diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h
index e6a5478b0a..f3a77ea317 100644
--- a/include/linux/mtd/spinand.h
+++ b/include/linux/mtd/spinand.h
@@ -337,6 +337,7 @@ struct spinand_info {
  *		the stack
  * @manufacturer: SPI NAND manufacturer information
  * @priv: manufacturer private data
+ * @use_continuous_read: indicate the continuous read mode status
  */
 struct spinand_device {
 	struct nand_device base;
@@ -367,6 +368,8 @@ struct spinand_device {
 	u8 *scratchbuf;
 	const struct spinand_manufacturer *manufacturer;
 	void *priv;
+
+	bool use_continuous_read;
 };

 /**
--
2.17.1



More information about the U-Boot mailing list