drivers: eth_enc28j60: respect devicetree cs-gpios flags
Forward flags cell from cs-gpios devicetree property into device SPI configuration. Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
This commit is contained in:
parent
ceb5c751b3
commit
598f4e242d
2 changed files with 4 additions and 1 deletions
|
@ -742,6 +742,7 @@ static int eth_enc28j60_init(struct device *dev)
|
||||||
}
|
}
|
||||||
|
|
||||||
context->spi_cs.gpio_pin = config->spi_cs_pin;
|
context->spi_cs.gpio_pin = config->spi_cs_pin;
|
||||||
|
context->spi_cs.gpio_dt_flags = config->spi_cs_dt_flags;
|
||||||
context->spi_cfg.cs = &context->spi_cs;
|
context->spi_cfg.cs = &context->spi_cs;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -827,6 +828,7 @@ static const struct eth_enc28j60_config eth_enc28j60_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_dt_flags = DT_INST_SPI_DEV_CS_GPIOS_FLAGS(0),
|
||||||
#endif
|
#endif
|
||||||
.full_duplex = IS_ENABLED(CONFIG_ETH_ENC28J60_0_FULL_DUPLEX),
|
.full_duplex = IS_ENABLED(CONFIG_ETH_ENC28J60_0_FULL_DUPLEX),
|
||||||
.timeout = CONFIG_ETH_ENC28J60_TIMEOUT,
|
.timeout = CONFIG_ETH_ENC28J60_TIMEOUT,
|
||||||
|
|
|
@ -218,7 +218,8 @@ struct eth_enc28j60_config {
|
||||||
uint8_t gpio_pin;
|
uint8_t gpio_pin;
|
||||||
gpio_dt_flags_t gpio_flags;
|
gpio_dt_flags_t gpio_flags;
|
||||||
const char *spi_port;
|
const char *spi_port;
|
||||||
uint8_t spi_cs_pin;
|
gpio_pin_t spi_cs_pin;
|
||||||
|
gpio_dt_flags_t spi_cs_dt_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;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue