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:
parent
0938ccbbc1
commit
649795a7cb
1 changed files with 4 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue