ieee802154: mcr20a: Fixup SPI CS handling

Replace undefined Kconfig SPI CS defines with DTS based defines.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
Kumar Gala 2019-01-31 03:55:53 -06:00 committed by Kumar Gala
commit b5a86baa57
2 changed files with 7 additions and 7 deletions

View file

@ -1384,23 +1384,23 @@ static inline int configure_spi(struct device *dev)
return -ENODEV;
}
#if defined(CONFIG_IEEE802154_MCR20A_GPIO_SPI_CS)
#if defined(DT_NXP_MCR20A_0_CS_GPIO_CONTROLLER)
mcr20a->cs_ctrl.gpio_dev = device_get_binding(
DT_NXP_MCR20A_0_GPIO_SPI_CS_DRV_NAME);
DT_NXP_MCR20A_0_CS_GPIO_CONTROLLER);
if (!mcr20a->cs_ctrl.gpio_dev) {
LOG_ERR("Unable to get GPIO SPI CS device");
return -ENODEV;
}
mcr20a->cs_ctrl.gpio_pin = DT_NXP_MCR20A_0_GPIO_SPI_CS_PIN;
mcr20a->cs_ctrl.gpio_pin = DT_NXP_MCR20A_0_CS_GPIO_PIN;
mcr20a->cs_ctrl.delay = 0;
mcr20a->spi_cfg.cs = &mcr20a->cs_ctrl;
LOG_DBG("SPI GPIO CS configured on %s:%u",
DT_NXP_MCR20A_0_GPIO_SPI_CS_DRV_NAME,
DT_NXP_MCR20A_0_GPIO_SPI_CS_PIN);
#endif /* CONFIG_IEEE802154_MCR20A_GPIO_SPI_CS */
DT_NXP_MCR20A_0_CS_GPIO_CONTROLLER,
DT_NXP_MCR20A_0_CS_GPIO_PIN);
#endif /* DT_NXP_MCR20A_0_CS_GPIO_CONTROLLER */
mcr20a->spi_cfg.frequency = DT_NXP_MCR20A_0_SPI_MAX_FREQUENCY;
mcr20a->spi_cfg.operation = SPI_WORD_SET(8);

View file

@ -25,7 +25,7 @@ struct mcr20a_context {
struct gpio_callback irqb_cb;
struct device *spi;
struct spi_config spi_cfg;
#if defined(CONFIG_IEEE802154_MCR20A_GPIO_SPI_CS)
#if defined(DT_NXP_MCR20A_0_CS_GPIO_CONTROLLER)
struct spi_cs_control cs_ctrl;
#endif
u8_t mac_addr[8];