[PATCH 24/28] mtd: spinand: Propagate the bus interface across core helpers
Miquel Raynal
miquel.raynal at bootlin.com
Fri Oct 31 10:27:08 PDT 2025
For now all drivers provide SSDR variants only. When we add support for
ODTR modes, there will be a need to differentiate the type of variant we
target as well as the need to check if we support one or the other type
of operations.
Pass this parameter to lower level helpers, which for now is unused, in
order to simplify the patch introducing ODTR support.
Signed-off-by: Miquel Raynal <miquel.raynal at bootlin.com>
---
drivers/mtd/nand/spi/core.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c
index fc7263fad7afbd084ecf015dd1d764d6683b46a8..0d98cc1d987e1f6387f6bb243cd3720949b01b0b 100644
--- a/drivers/mtd/nand/spi/core.c
+++ b/drivers/mtd/nand/spi/core.c
@@ -1325,7 +1325,8 @@ static void spinand_init_ssdr_templates(struct spinand_device *spinand)
}
static int spinand_support_vendor_ops(struct spinand_device *spinand,
- const struct spinand_info *info)
+ const struct spinand_info *info,
+ enum spinand_bus_interface iface)
{
int i;
@@ -1346,7 +1347,7 @@ static int spinand_support_vendor_ops(struct spinand_device *spinand,
}
static const struct spi_mem_op *
-spinand_select_op_variant(struct spinand_device *spinand,
+spinand_select_op_variant(struct spinand_device *spinand, enum spinand_bus_interface iface,
const struct spinand_op_variants *variants)
{
struct nand_device *nand = spinand_to_nand(spinand);
@@ -1439,28 +1440,28 @@ int spinand_match_and_init(struct spinand_device *spinand,
spinand->read_retries = table[i].read_retries;
spinand->set_read_retry = table[i].set_read_retry;
- op = spinand_select_op_variant(spinand,
+ op = spinand_select_op_variant(spinand, SSDR,
info->op_variants.read_cache);
if (!op)
return -EOPNOTSUPP;
spinand->ssdr_op_templates.read_cache = op;
- op = spinand_select_op_variant(spinand,
+ op = spinand_select_op_variant(spinand, SSDR,
info->op_variants.write_cache);
if (!op)
return -EOPNOTSUPP;
spinand->ssdr_op_templates.write_cache = op;
- op = spinand_select_op_variant(spinand,
+ op = spinand_select_op_variant(spinand, SSDR,
info->op_variants.update_cache);
if (!op)
return -EOPNOTSUPP;
spinand->ssdr_op_templates.update_cache = op;
- ret = spinand_support_vendor_ops(spinand, info);
+ ret = spinand_support_vendor_ops(spinand, info, SSDR);
if (ret)
return ret;
--
2.51.0
More information about the linux-mtd
mailing list