aboutsummaryrefslogtreecommitdiff
path: root/drivers/mmc/mmc_spi.c
diff options
context:
space:
mode:
authorOvidiu Panait <ovidiu.panait@windriver.com>2020-12-14 19:06:50 +0200
committerSimon Glass <sjg@chromium.org>2020-12-22 20:39:26 -0700
commit741280e9accd3da20650a04f716538944d878482 (patch)
treeddec056c419202cb15154211ac5f3c063dc5bb5a /drivers/mmc/mmc_spi.c
parentadd685fb6d8de91723d006a0382f76041320b529 (diff)
downloadu-boot-741280e9accd3da20650a04f716538944d878482.zip
u-boot-741280e9accd3da20650a04f716538944d878482.tar.gz
u-boot-741280e9accd3da20650a04f716538944d878482.tar.bz2
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>
Diffstat (limited to 'drivers/mmc/mmc_spi.c')
-rw-r--r--drivers/mmc/mmc_spi.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/mmc/mmc_spi.c b/drivers/mmc/mmc_spi.c
index 51b1aa4..46800bb 100644
--- a/drivers/mmc/mmc_spi.c
+++ b/drivers/mmc/mmc_spi.c
@@ -418,7 +418,6 @@ static int mmc_spi_probe(struct udevice *dev)
priv->spi = dev_get_parent_priv(dev);
if (!priv->spi->max_hz)
priv->spi->max_hz = MMC_SPI_MAX_CLOCK;
- priv->spi->speed = 0;
priv->spi->mode = SPI_MODE_0;
priv->spi->wordlen = 8;