spi: axi-spi-engine: populate xfer->effective_speed_hz
authorDavid Lechner <dlechner@baylibre.com>
Mon, 4 Dec 2023 17:33:28 +0000 (11:33 -0600)
committerMark Brown <broonie@kernel.org>
Wed, 6 Dec 2023 14:19:30 +0000 (14:19 +0000)
commit9d023ecc31859c7f7c8ca27b5fec52b2dbb8086f
tree6f3905e804724f952544b02339ea0f78db3496b8
parent2e0d75f8dd9e31b3fb175f780494dd7dd988ceae
spi: axi-spi-engine: populate xfer->effective_speed_hz

This adds a new spi_engine_precompile_message() function to the ADI AXI
SPI Engine driver to populate the xfer->effective_speed_hz field since
the SPI core doesn't/can't do this for us.

This driver is already using spi_delay_to_ns() which depends on
effective_speed_hz to get an accurate value in some cases.
Having an effective_speed_hz value can also be used in future changes
to simplify other code.

Signed-off-by: David Lechner <dlechner@baylibre.com>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Acked-by: Nuno Sa <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20231204-axi-spi-engine-series-2-v1-2-063672323fce@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-axi-spi-engine.c