spi: axi-spi-engine: remove spi_engine_get_clk_div()
authorDavid Lechner <dlechner@baylibre.com>
Mon, 4 Dec 2023 17:33:29 +0000 (11:33 -0600)
committerMark Brown <broonie@kernel.org>
Wed, 6 Dec 2023 14:19:31 +0000 (14:19 +0000)
commit1fc8dc5721bbc7a21cb4cc60c35eb8031942542b
tree07231018945c2c81cf33b54a54340d1650c99d4c
parent9d023ecc31859c7f7c8ca27b5fec52b2dbb8086f
spi: axi-spi-engine: remove spi_engine_get_clk_div()

Now that host->max_speed_hz and xfer->effective_speed_hz are properly
set, we can use them instead of having to do more complex calculations
to get the clock divider for each transfer.

This removes the spi_engine_get_clk_div() function and replaces it with
just dividing the two clock rates. Since the hardware register value is
the divider minus one, we need to subtract one. Subtracting one was
previously done in the spi_engine_get_clk_div() function.

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-3-063672323fce@baylibre.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-axi-spi-engine.c