Skip to content

Commit a4f8e70

Browse files
Tianyu Xubroonie
authored andcommitted
spi: spi-mem: add spi_mem_adjust_op_freq() in spi_mem_supports_op()
The function spi_mem_adjust_op_freq() within spi_mem_exec_op() adjusts the op->max_freq, which will informs the SPI controller of the maximum frequency for each operation. This adjustment is based on combined information from the SPI device and the board's wiring conditions. Similarly, spi_mem_supports_op() will check the capabilities of the SPI controller. It also requires the combined information before it can accurately determine whether the SPI controller supports a given operation. Signed-off-by: Tianyu Xu <tianyxu@cisco.com> Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://patch.msgid.link/20250805015403.43928-1-tianyxu@cisco.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 7233243 commit a4f8e70

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

drivers/spi/spi-mem.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,9 @@ static bool spi_mem_internal_supports_op(struct spi_mem *mem,
265265
*/
266266
bool spi_mem_supports_op(struct spi_mem *mem, const struct spi_mem_op *op)
267267
{
268+
/* Make sure the operation frequency is correct before going futher */
269+
spi_mem_adjust_op_freq(mem, (struct spi_mem_op *)op);
270+
268271
if (spi_mem_check_op(op))
269272
return false;
270273

0 commit comments

Comments
 (0)