Skip to content

Commit 8e7face

Browse files
committed
mtd: spinand: Propagate the bus interface across core helpers
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@bootlin.com>
1 parent 20387f2 commit 8e7face

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

drivers/mtd/nand/spi/core.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1411,7 +1411,8 @@ static void spinand_init_ssdr_templates(struct spinand_device *spinand)
14111411
}
14121412

14131413
static int spinand_support_vendor_ops(struct spinand_device *spinand,
1414-
const struct spinand_info *info)
1414+
const struct spinand_info *info,
1415+
enum spinand_bus_interface iface)
14151416
{
14161417
int i;
14171418

@@ -1432,7 +1433,7 @@ static int spinand_support_vendor_ops(struct spinand_device *spinand,
14321433
}
14331434

14341435
static const struct spi_mem_op *
1435-
spinand_select_op_variant(struct spinand_device *spinand,
1436+
spinand_select_op_variant(struct spinand_device *spinand, enum spinand_bus_interface iface,
14361437
const struct spinand_op_variants *variants)
14371438
{
14381439
struct nand_device *nand = spinand_to_nand(spinand);
@@ -1522,28 +1523,28 @@ int spinand_match_and_init(struct spinand_device *spinand,
15221523
spinand->read_retries = table[i].read_retries;
15231524
spinand->set_read_retry = table[i].set_read_retry;
15241525

1525-
op = spinand_select_op_variant(spinand,
1526+
op = spinand_select_op_variant(spinand, SSDR,
15261527
info->op_variants.read_cache);
15271528
if (!op)
15281529
return -EOPNOTSUPP;
15291530

15301531
spinand->ssdr_op_templates.read_cache = op;
15311532

1532-
op = spinand_select_op_variant(spinand,
1533+
op = spinand_select_op_variant(spinand, SSDR,
15331534
info->op_variants.write_cache);
15341535
if (!op)
15351536
return -EOPNOTSUPP;
15361537

15371538
spinand->ssdr_op_templates.write_cache = op;
15381539

1539-
op = spinand_select_op_variant(spinand,
1540+
op = spinand_select_op_variant(spinand, SSDR,
15401541
info->op_variants.update_cache);
15411542
if (!op)
15421543
return -EOPNOTSUPP;
15431544

15441545
spinand->ssdr_op_templates.update_cache = op;
15451546

1546-
ret = spinand_support_vendor_ops(spinand, info);
1547+
ret = spinand_support_vendor_ops(spinand, info, SSDR);
15471548
if (ret)
15481549
return ret;
15491550

0 commit comments

Comments
 (0)