Skip to content
Commit 741280e9 authored by Ovidiu Panait's avatar Ovidiu Panait Committed by Simon Glass
Browse files

spi: spi-uclass: Fix spi_claim_bus() speed/mode setup logic



Currently, when different spi slaves claim the bus consecutively using
spi_claim_bus(), spi_set_speed_mode() will only be executed on the first
two calls, leaving the bus in a bad state starting with the third call.

This patch drops spi_slave->speed member and adds caching of bus
speed/mode in dm_spi_bus struct. It also updates spi_claim_bus() to call
spi_set_speed_mode() if either speed or mode is different from what the
bus is currently configured for. Current behavior is to only take into
account the speed, but not the mode, which seems wrong.

Fixes: 60e2809a ("dm: spi: Avoid setting the speed with every transfer")
Reviewed-by: default avatarSimon Glass <sjg@chromium.org>
Reported-by: default avatarRasmus Villemoes <rasmus.villemoes@prevas.dk>
Reported-by: default avatarMoshe, Yaniv <yanivmo@amazon.com>
Signed-off-by: default avatarOvidiu Panait <ovidiu.panait@windriver.com>
parent add685fb
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment