spi: fix locking for SPI_LOCK_ON using synchronous API

Keep locking for SPI_LOCK_ON from the first call of transceive until
spi_release release the lock. Use owner parameter to in the spi_context
to store the owner of the lock.
The locking is in line with the SPI_HOLD_ON_CS

Signed-off-by: Stefan Bigler <stefan@bigler.io>
This commit is contained in:
Stefan Bigler 2020-10-19 08:52:29 +02:00 committed by Carles Cufí
commit 596cad8231
17 changed files with 35 additions and 20 deletions

View file

@ -214,7 +214,7 @@ static int transceive(const struct device *dev,
struct spi_mcux_data *data = dev->data;
int ret;
spi_context_lock(&data->ctx, asynchronous, signal);
spi_context_lock(&data->ctx, asynchronous, signal, spi_cfg);
ret = spi_mcux_configure(dev, spi_cfg);
if (ret) {