All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 08/12] mtd: spinand: add parameter page fixup function
@ 2019-06-03 12:43 ` Shivamurthy Shastri (sshivamurthy)
  0 siblings, 0 replies; 2+ messages in thread
From: Shivamurthy Shastri (sshivamurthy) @ 2019-06-03 12:43 UTC (permalink / raw)
  To: Miquel Raynal, Richard Weinberger, David Woodhouse, Brian Norris,
	Marek Vasut, Vignesh Raghavendra, Boris Brezillon, Yixun Lan,
	Lucas Stach, Anders Roxell, Stefan Agner, Marcel Ziswiler,
	Bean Huo (beanhuo),
	Paul Cercueil, Frieder Schrempf, Chuanhong Guo, linux-mtd,
	linux-kernel

Parameter page not following any standard. Hence, manufacturers may
interpret parameters differently, and it is better to have a fixup
function.

Signed-off-by: Shivamurthy Shastri <sshivamurthy@micron.com>
---
 drivers/mtd/nand/spi/core.c | 6 ++++++
 include/linux/mtd/spinand.h | 2 ++
 2 files changed, 8 insertions(+)

diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
index b031c4a2cdf9..cdf578c45c08 100644
--- a/drivers/mtd/nand/spi/core.c
+++ b/drivers/mtd/nand/spi/core.c
@@ -479,6 +479,12 @@ static int check_version(struct nand_device *base,
 static int spinand_intf_data(struct nand_device *base,
 			     struct nand_onfi_params *p)
 {
+	struct spinand_device *spinand = nand_to_spinand(base);
+
+	/* Manufacturers may interpret the parameter page differently */
+	if (spinand->manufacturer->ops->fixup_param_page)
+		spinand->manufacturer->ops->fixup_param_page(spinand, p);
+
 	return 0;
 }
 
diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h
index 507f7e289bd1..41a03d59f003 100644
--- a/include/linux/mtd/spinand.h
+++ b/include/linux/mtd/spinand.h
@@ -179,6 +179,8 @@ struct spinand_manufacturer_ops {
 	int (*detect)(struct spinand_device *spinand);
 	int (*init)(struct spinand_device *spinand);
 	void (*cleanup)(struct spinand_device *spinand);
+	void (*fixup_param_page)(struct spinand_device *spinand,
+				 struct nand_onfi_params *p);
 };
 
 /**
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH v3 08/12] mtd: spinand: add parameter page fixup function
@ 2019-06-03 12:43 ` Shivamurthy Shastri (sshivamurthy)
  0 siblings, 0 replies; 2+ messages in thread
From: Shivamurthy Shastri (sshivamurthy) @ 2019-06-03 12:43 UTC (permalink / raw)
  To: Miquel Raynal, Richard Weinberger, David Woodhouse, Brian Norris,
	Marek Vasut, Vignesh Raghavendra, Boris Brezillon, Yixun Lan,
	Lucas Stach, Anders Roxell, Stefan Agner, Marcel Ziswiler,
	Bean Huo (beanhuo),
	Paul Cercueil, Frieder Schrempf, Chuanhong Guo, linux-mtd,
	linux-kernel

Parameter page not following any standard. Hence, manufacturers may
interpret parameters differently, and it is better to have a fixup
function.

Signed-off-by: Shivamurthy Shastri <sshivamurthy@micron.com>
---
 drivers/mtd/nand/spi/core.c | 6 ++++++
 include/linux/mtd/spinand.h | 2 ++
 2 files changed, 8 insertions(+)

diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
index b031c4a2cdf9..cdf578c45c08 100644
--- a/drivers/mtd/nand/spi/core.c
+++ b/drivers/mtd/nand/spi/core.c
@@ -479,6 +479,12 @@ static int check_version(struct nand_device *base,
 static int spinand_intf_data(struct nand_device *base,
 			     struct nand_onfi_params *p)
 {
+	struct spinand_device *spinand = nand_to_spinand(base);
+
+	/* Manufacturers may interpret the parameter page differently */
+	if (spinand->manufacturer->ops->fixup_param_page)
+		spinand->manufacturer->ops->fixup_param_page(spinand, p);
+
 	return 0;
 }
 
diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h
index 507f7e289bd1..41a03d59f003 100644
--- a/include/linux/mtd/spinand.h
+++ b/include/linux/mtd/spinand.h
@@ -179,6 +179,8 @@ struct spinand_manufacturer_ops {
 	int (*detect)(struct spinand_device *spinand);
 	int (*init)(struct spinand_device *spinand);
 	void (*cleanup)(struct spinand_device *spinand);
+	void (*fixup_param_page)(struct spinand_device *spinand,
+				 struct nand_onfi_params *p);
 };
 
 /**
-- 
2.17.1


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-06-03 12:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-03 12:43 [PATCH v3 08/12] mtd: spinand: add parameter page fixup function Shivamurthy Shastri (sshivamurthy)
2019-06-03 12:43 ` Shivamurthy Shastri (sshivamurthy)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.