Home
last modified time | relevance | path

Searched hist:"9689 b7dd4f457171bf295756bb0fe433cbc03d7f" (Results 1 – 2 of 2) sorted by relevance

/rk3399_rockchip-uboot/drivers/spi/
H A Dspi-uclass.c9689b7dd4f457171bf295756bb0fe433cbc03d7f Mon Dec 14 17:06:50 UTC 2020 Ovidiu Panait <ovidiu.panait@windriver.com> UPSTREAM: 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: 60e2809a848 ("dm: spi: Avoid setting the speed with every transfer")
Reviewed-by: Simon Glass <sjg@chromium.org>
Reported-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reported-by: Moshe, Yaniv <yanivmo@amazon.com>
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
(cherry picked from commit 741280e9accd3da20650a04f716538944d878482)
Change-Id: I29912ceaf1e252fe6f124aea69190ef5e6160119
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>
/rk3399_rockchip-uboot/include/
H A Dspi.h9689b7dd4f457171bf295756bb0fe433cbc03d7f Mon Dec 14 17:06:50 UTC 2020 Ovidiu Panait <ovidiu.panait@windriver.com> UPSTREAM: 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: 60e2809a848 ("dm: spi: Avoid setting the speed with every transfer")
Reviewed-by: Simon Glass <sjg@chromium.org>
Reported-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Reported-by: Moshe, Yaniv <yanivmo@amazon.com>
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
(cherry picked from commit 741280e9accd3da20650a04f716538944d878482)
Change-Id: I29912ceaf1e252fe6f124aea69190ef5e6160119
Signed-off-by: Jon Lin <jon.lin@rock-chips.com>