summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorApurva Nandan <a-nandan@ti.com>2023-01-23 23:13:19 +0530
committerPraneeth Bajjuri <praneeth@ti.com>2023-01-25 14:10:19 -0600
commitb84d96e0932aa016ab64d4b7ae0f66634cdc5035 (patch)
tree1f064162ad4cc036e7d78404263c831930c81256 /drivers
parent4c010588248d125631f2046c82858eee0e71e1c1 (diff)
mtd: spinand: Define default ctrl_ops in the core
Add default ctrl_ops in the core, which can be used when the op templates are commonly used ones. Till now, the core had used only fixed ctrl operations, so the default 'ctrl_ops' is just these ops macros initialized with default arguments. The default protocol is 1S-1S-1S. Signed-off-by: Apurva Nandan <a-nandan@ti.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mtd/nand/spi/core.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
index b2262c1ef1..712d7a92d0 100644
--- a/drivers/mtd/nand/spi/core.c
+++ b/drivers/mtd/nand/spi/core.c
@@ -831,6 +831,16 @@ static const struct spinand_manufacturer *spinand_manufacturers[] = {
&winbond_spinand_manufacturer,
};
+static const struct spinand_ctrl_ops spinand_default_ctrl_ops =
+ SPINAND_CTRL_OPS(SPINAND_1S,
+ SPINAND_RESET_OP,
+ SPINAND_GET_FEATURE_OP(0, NULL),
+ SPINAND_SET_FEATURE_OP(0, NULL),
+ SPINAND_WR_EN_DIS_OP(true),
+ SPINAND_BLK_ERASE_OP(0),
+ SPINAND_PAGE_READ_OP(0),
+ SPINAND_PROG_EXEC_OP(0));
+
static int spinand_manufacturer_detect(struct spinand_device *spinand)
{
unsigned int i;
@@ -1034,6 +1044,8 @@ static int spinand_init(struct spinand_device *spinand)
return -ENOMEM;
spinand->protocol = SPINAND_1S;
+ spinand->ctrl_ops = &spinand_default_ctrl_ops;
+
ret = spinand_detect(spinand);
if (ret)
goto err_free_bufs;