diff options
| author | Tianyu Xu <[email protected]> | 2025-08-05 01:54:03 +0000 |
|---|---|---|
| committer | Mark Brown <[email protected]> | 2025-08-06 12:31:31 +0000 |
| commit | a4f8e70d75dd11ab1a01894893e0b03f1d0b61fd (patch) | |
| tree | 6d14585a6bd75b38d00fee0c886c4a79b6c6c708 | |
| parent | spi: spi-mem: Add missing kdoc argument (diff) | |
| download | kernel-a4f8e70d75dd11ab1a01894893e0b03f1d0b61fd.tar.gz kernel-a4f8e70d75dd11ab1a01894893e0b03f1d0b61fd.zip | |
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 <[email protected]>
Reviewed-by: Miquel Raynal <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Mark Brown <[email protected]>
| -rw-r--r-- | drivers/spi/spi-mem.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c index dfa8ab1ec80f..a8f14c608d2d 100644 --- a/drivers/spi/spi-mem.c +++ b/drivers/spi/spi-mem.c @@ -265,6 +265,9 @@ static bool spi_mem_internal_supports_op(struct spi_mem *mem, */ bool spi_mem_supports_op(struct spi_mem *mem, const struct spi_mem_op *op) { + /* Make sure the operation frequency is correct before going futher */ + spi_mem_adjust_op_freq(mem, (struct spi_mem_op *)op); + if (spi_mem_check_op(op)) return false; |
