gpio: mcp23s17: 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
667cc302fa
commit
ede1448b75
2 changed files with 5 additions and 0 deletions
|
@ -380,6 +380,7 @@ static int mcp23s17_init(struct device *dev)
|
||||||
}
|
}
|
||||||
|
|
||||||
drv_data->mcp23s17_cs_ctrl.gpio_pin = config->cs_pin;
|
drv_data->mcp23s17_cs_ctrl.gpio_pin = config->cs_pin;
|
||||||
|
drv_data->mcp23s17_cs_ctrl.gpio_dt_flags = config->cs_flags;
|
||||||
drv_data->mcp23s17_cs_ctrl.delay = 0;
|
drv_data->mcp23s17_cs_ctrl.delay = 0;
|
||||||
|
|
||||||
drv_data->spi_cfg.cs = &drv_data->mcp23s17_cs_ctrl;
|
drv_data->spi_cfg.cs = &drv_data->mcp23s17_cs_ctrl;
|
||||||
|
@ -415,6 +416,9 @@ static int mcp23s17_init(struct device *dev)
|
||||||
IF_ENABLED(DT_INST_SPI_DEV_HAS_CS_GPIOS(inst), \
|
IF_ENABLED(DT_INST_SPI_DEV_HAS_CS_GPIOS(inst), \
|
||||||
(.cs_pin = \
|
(.cs_pin = \
|
||||||
DT_INST_SPI_DEV_CS_GPIOS_PIN(inst),)) \
|
DT_INST_SPI_DEV_CS_GPIOS_PIN(inst),)) \
|
||||||
|
IF_ENABLED(DT_INST_SPI_DEV_HAS_CS_GPIOS(inst), \
|
||||||
|
(.cs_flags = \
|
||||||
|
DT_INST_SPI_DEV_CS_GPIOS_FLAGS(inst),)) \
|
||||||
}; \
|
}; \
|
||||||
\
|
\
|
||||||
static struct mcp23s17_drv_data mcp23s17_##inst##_drvdata = { \
|
static struct mcp23s17_drv_data mcp23s17_##inst##_drvdata = { \
|
||||||
|
|
|
@ -55,6 +55,7 @@ struct mcp23s17_config {
|
||||||
const uint32_t freq;
|
const uint32_t freq;
|
||||||
const char *const cs_dev;
|
const char *const cs_dev;
|
||||||
const uint32_t cs_pin;
|
const uint32_t cs_pin;
|
||||||
|
const uint8_t cs_flags;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Runtime driver data */
|
/** Runtime driver data */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue