lkml.org 
[lkml]   [2019]   [Jun]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v3 08/12] mtd: spinand: add parameter page fixup function
Date
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
\
 
 \ /
  Last update: 2019-06-03 14:44    [W:0.060 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site