drivers: spi: nrfx: Deactivate CS from thread context
... so that it is possible to use a GPIO expander pin as the CS line. Communication with the expander may involve an operation that cannot be done from the interrupt context (e.g. an I2C transaction). Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
This commit is contained in:
parent
3f6373eb36
commit
db4344b659
|
@ -161,8 +161,6 @@ static void finish_transaction(const struct device *dev, int error)
|
|||
struct spi_nrfx_data *dev_data = dev->data;
|
||||
struct spi_context *ctx = &dev_data->ctx;
|
||||
|
||||
spi_context_cs_control(ctx, false);
|
||||
|
||||
LOG_DBG("Transaction finished with status %d", error);
|
||||
|
||||
spi_context_complete(ctx, dev, error);
|
||||
|
@ -277,6 +275,8 @@ static int transceive(const struct device *dev,
|
|||
/* Clean up the driver state. */
|
||||
k_sem_reset(&dev_data->ctx.sync);
|
||||
}
|
||||
|
||||
spi_context_cs_control(&dev_data->ctx, false);
|
||||
}
|
||||
|
||||
spi_context_release(&dev_data->ctx, error);
|
||||
|
|
|
@ -294,8 +294,6 @@ static void finish_transaction(const struct device *dev, int error)
|
|||
struct spi_nrfx_data *dev_data = dev->data;
|
||||
struct spi_context *ctx = &dev_data->ctx;
|
||||
|
||||
spi_context_cs_control(ctx, false);
|
||||
|
||||
LOG_DBG("Transaction finished with status %d", error);
|
||||
|
||||
spi_context_complete(ctx, dev, error);
|
||||
|
@ -470,6 +468,8 @@ static int transceive(const struct device *dev,
|
|||
anomaly_58_workaround_clear(dev_data);
|
||||
#endif
|
||||
}
|
||||
|
||||
spi_context_cs_control(&dev_data->ctx, false);
|
||||
}
|
||||
|
||||
spi_context_release(&dev_data->ctx, error);
|
||||
|
|
Loading…
Reference in a new issue