Skip to content

Commit 67707cb

Browse files
miquelraynalbroonie
authored andcommitted
spi: mxic: Support per spi-mem operation frequency switches
Every ->exec_op() call correctly configures the spi bus speed to the maximum allowed frequency for the memory using the constant spi default parameter. Since we can now have per-operation constraints, let's use the value that comes from the spi-mem operation structure instead. In case there is no specific limitation for this operation, the default spi device value will be given anyway. The per-operation frequency capability is thus advertised to the spi-mem core. Signed-off-by: Miquel Raynal <[email protected]> Link: https://patch.msgid.link/20241224-winbond-6-11-rc1-quad-support-v2-11-ad218dbc406f@bootlin.com Signed-off-by: Mark Brown <[email protected]>
1 parent 13fd04b commit 67707cb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/spi/spi-mxic.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ static int mxic_spi_mem_exec_op(struct spi_mem *mem,
522522
int i, ret;
523523
u8 addr[8], cmd[2];
524524

525-
ret = mxic_spi_set_freq(mxic, mem->spi->max_speed_hz);
525+
ret = mxic_spi_set_freq(mxic, op->max_freq);
526526
if (ret)
527527
return ret;
528528

@@ -582,6 +582,7 @@ static const struct spi_controller_mem_caps mxic_spi_mem_caps = {
582582
.dtr = true,
583583
.ecc = true,
584584
.swap16 = true,
585+
.per_op_freq = true,
585586
};
586587

587588
static void mxic_spi_set_cs(struct spi_device *spi, bool lvl)

0 commit comments

Comments
 (0)