can: mcp2515: Add chip select flags
Adds the chip select devicetree flags to the spi_cs_control instance. Signed-off-by: Jordan Yates <jordan.yates@data61.csiro.au>
This commit is contained in:
parent
a04d2f3989
commit
750ccd39dc
2 changed files with 3 additions and 0 deletions
|
@ -772,6 +772,7 @@ static int mcp2515_init(struct device *dev)
|
|||
}
|
||||
|
||||
dev_data->spi_cs_ctrl.gpio_pin = dev_cfg->spi_cs_pin;
|
||||
dev_data->spi_cs_ctrl.gpio_dt_flags = dev_cfg->spi_cs_flags;
|
||||
dev_data->spi_cs_ctrl.delay = 0U;
|
||||
|
||||
dev_data->spi_cfg.cs = &dev_data->spi_cs_ctrl;
|
||||
|
@ -851,6 +852,7 @@ static const struct mcp2515_config mcp2515_config_1 = {
|
|||
#if DT_INST_SPI_DEV_HAS_CS_GPIOS(0)
|
||||
.spi_cs_pin = DT_INST_SPI_DEV_CS_GPIOS_PIN(0),
|
||||
.spi_cs_port = DT_INST_SPI_DEV_CS_GPIOS_LABEL(0),
|
||||
.spi_cs_flags = DT_INST_SPI_DEV_CS_GPIOS_FLAGS(0),
|
||||
#endif /* DT_INST_SPI_DEV_HAS_CS_GPIOS(0) */
|
||||
.tq_sjw = DT_INST_PROP(0, sjw),
|
||||
.tq_prop = DT_INST_PROP(0, prop_seg),
|
||||
|
|
|
@ -60,6 +60,7 @@ struct mcp2515_config {
|
|||
/* spi configuration */
|
||||
const char *spi_port;
|
||||
uint8_t spi_cs_pin;
|
||||
uint8_t spi_cs_flags;
|
||||
const char *spi_cs_port;
|
||||
uint32_t spi_freq;
|
||||
uint8_t spi_slave;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue