drivers/spi: spi_context.h: Update to new GPIO API
Update to new GPIO API. Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
This commit is contained in:
parent
f8988808ff
commit
361b55d4cb
1 changed files with 10 additions and 10 deletions
|
@ -169,10 +169,10 @@ static inline void spi_context_cs_configure(struct spi_context *ctx)
|
||||||
{
|
{
|
||||||
if (ctx->config->cs && ctx->config->cs->gpio_dev) {
|
if (ctx->config->cs && ctx->config->cs->gpio_dev) {
|
||||||
gpio_pin_configure(ctx->config->cs->gpio_dev,
|
gpio_pin_configure(ctx->config->cs->gpio_dev,
|
||||||
ctx->config->cs->gpio_pin, GPIO_DIR_OUT);
|
ctx->config->cs->gpio_pin, GPIO_OUTPUT);
|
||||||
gpio_pin_write(ctx->config->cs->gpio_dev,
|
gpio_pin_set(ctx->config->cs->gpio_dev,
|
||||||
ctx->config->cs->gpio_pin,
|
ctx->config->cs->gpio_pin,
|
||||||
spi_context_cs_inactive_value(ctx));
|
spi_context_cs_inactive_value(ctx));
|
||||||
} else {
|
} else {
|
||||||
LOG_INF("CS control inhibited (no GPIO device)");
|
LOG_INF("CS control inhibited (no GPIO device)");
|
||||||
}
|
}
|
||||||
|
@ -183,9 +183,9 @@ static inline void _spi_context_cs_control(struct spi_context *ctx,
|
||||||
{
|
{
|
||||||
if (ctx->config && ctx->config->cs && ctx->config->cs->gpio_dev) {
|
if (ctx->config && ctx->config->cs && ctx->config->cs->gpio_dev) {
|
||||||
if (on) {
|
if (on) {
|
||||||
gpio_pin_write(ctx->config->cs->gpio_dev,
|
gpio_pin_set(ctx->config->cs->gpio_dev,
|
||||||
ctx->config->cs->gpio_pin,
|
ctx->config->cs->gpio_pin,
|
||||||
spi_context_cs_active_value(ctx));
|
spi_context_cs_active_value(ctx));
|
||||||
k_busy_wait(ctx->config->cs->delay);
|
k_busy_wait(ctx->config->cs->delay);
|
||||||
} else {
|
} else {
|
||||||
if (!force_off &&
|
if (!force_off &&
|
||||||
|
@ -194,9 +194,9 @@ static inline void _spi_context_cs_control(struct spi_context *ctx,
|
||||||
}
|
}
|
||||||
|
|
||||||
k_busy_wait(ctx->config->cs->delay);
|
k_busy_wait(ctx->config->cs->delay);
|
||||||
gpio_pin_write(ctx->config->cs->gpio_dev,
|
gpio_pin_set(ctx->config->cs->gpio_dev,
|
||||||
ctx->config->cs->gpio_pin,
|
ctx->config->cs->gpio_pin,
|
||||||
spi_context_cs_inactive_value(ctx));
|
spi_context_cs_inactive_value(ctx));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue