drivers: dw1000: fix SPI GPIO CS

Since commit 5963ebaf33
("drivers: spi: CS configuration through devicetree")
the SPI GPIO CS flags are obtained from DT,
but the patch series has missed the necessary changes
for the ieee802154_dw1000 driver and decawave_dwm1001_dev board.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
This commit is contained in:
Johann Fischer 2020-07-06 14:38:17 +02:00 committed by Carles Cufí
commit d261de8960
2 changed files with 4 additions and 1 deletions

View file

@ -124,7 +124,7 @@
sck-pin = <16>; sck-pin = <16>;
mosi-pin = <20>; mosi-pin = <20>;
miso-pin = <18>; miso-pin = <18>;
cs-gpios = <&gpio0 17 0>; cs-gpios = <&gpio0 17 GPIO_ACTIVE_LOW>;
dw1000@0 { dw1000@0 {
compatible = "decawave,dw1000"; compatible = "decawave,dw1000";

View file

@ -98,6 +98,7 @@ struct dwt_hi_cfg {
gpio_dt_flags_t rst_flags; gpio_dt_flags_t rst_flags;
const char *spi_port; const char *spi_port;
uint8_t spi_cs_pin; uint8_t spi_cs_pin;
gpio_dt_flags_t spi_cs_flags;
const char *spi_cs_port; const char *spi_cs_port;
uint32_t spi_freq; uint32_t spi_freq;
uint8_t spi_slave; uint8_t spi_slave;
@ -141,6 +142,7 @@ static const struct dwt_hi_cfg dw1000_0_config = {
#if DT_INST_SPI_DEV_HAS_CS_GPIOS(0) #if DT_INST_SPI_DEV_HAS_CS_GPIOS(0)
.spi_cs_port = DT_INST_SPI_DEV_CS_GPIOS_LABEL(0), .spi_cs_port = DT_INST_SPI_DEV_CS_GPIOS_LABEL(0),
.spi_cs_pin = DT_INST_SPI_DEV_CS_GPIOS_PIN(0), .spi_cs_pin = DT_INST_SPI_DEV_CS_GPIOS_PIN(0),
.spi_cs_flags = DT_INST_SPI_DEV_CS_GPIOS_FLAGS(0),
#endif #endif
}; };
@ -1517,6 +1519,7 @@ static int dw1000_init(struct device *dev)
} }
ctx->spi_cs.gpio_pin = hi_cfg->spi_cs_pin; ctx->spi_cs.gpio_pin = hi_cfg->spi_cs_pin;
ctx->spi_cs.gpio_dt_flags = hi_cfg->spi_cs_flags;
ctx->spi_cfg_slow.cs = &ctx->spi_cs; ctx->spi_cfg_slow.cs = &ctx->spi_cs;
ctx->spi_cfg_fast.cs = &ctx->spi_cs; ctx->spi_cfg_fast.cs = &ctx->spi_cs;
#endif #endif