]> git.baikalelectronics.ru Git - uboot.git/commit
spi: prevent overriding established bus settings
authorMarcin Wojtas <mw@semihalf.com>
Thu, 21 Nov 2019 04:38:47 +0000 (05:38 +0100)
committerJagan Teki <jagan@amarulasolutions.com>
Mon, 27 Jan 2020 16:57:22 +0000 (22:27 +0530)
commit0f3839b4c7c1e49b973a87a555a2705c08348af7
treef53543a131106d6b7f096342c456dceca70f022c
parentd790d93f81dd712220a6bd96d18326c39699822e
spi: prevent overriding established bus settings

The SPI stack relies on a proper bus speed/mode configuration
by calling dm_spi_claim_bus(). However the hitherto code
allowed to accidentally override those settings in
the spi_get_bus_and_cs() routine.

The initially established speed could be discarded by using
the slave platdata, which turned out to be an issue on
the platforms whose slave maximum supported frequency
is not on par with the maximum frequency of the bus controller.

This patch fixes above issue by configuring the bus from
spi_get_bus_and_cs() only in case it was not done before.

Signed-off-by: Marcin Wojtas <mw@semihalf.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Acked-by: Jagan Teki <jagan@amarulasolutions.com>
drivers/spi/spi-uclass.c