drivers/spi: Handle SPI_HOLD_ON_CS in spi context through gpio

If CS is controlled over GPIO, it will be possible to keep the slave up
and running (though no transaction will be going on) using this
configuration bit.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit is contained in:
Tomasz Bursztyka 2017-05-15 11:34:04 +02:00 committed by Anas Nashif
commit 649795a7cb

View file

@ -132,6 +132,10 @@ static inline void spi_context_cs_control(struct spi_context *ctx, bool on)
ctx->config->cs->gpio_pin, 0);
k_busy_wait(ctx->config->cs->delay);
} else {
if (ctx->config->operation & SPI_HOLD_ON_CS) {
return;
}
k_busy_wait(ctx->config->cs->delay);
gpio_pin_write(ctx->config->cs->gpio_dev,
ctx->config->cs->gpio_pin, 1);