drivers: i2s: Convert drivers to new DT device macros

Convert i2s drivers from:

    DEVICE_AND_API_INIT -> DEVICE_DT{_INST}_DEFINE
    DEVICE_GET -> DEVICE_DT_INST_GET
    DEVICE_DECLARE -> DEVICE_DT_INST_DECLARE

etc..

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
Kumar Gala 2020-12-16 07:02:14 -06:00 committed by Anas Nashif
commit 8e55cfab96
3 changed files with 12 additions and 12 deletions

View file

@ -898,7 +898,7 @@ static const struct device *get_dev_from_tx_dma_channel(uint32_t dma_channel)
}
#define I2S_INIT(index, clk_sel) \
DEVICE_DECLARE(i2s_stm32_##index); \
DEVICE_DT_DECLARE(DT_NODELABEL(i2s##index)); \
\
static const struct soc_gpio_pinctrl i2s_pins_##index[] = \
ST_STM32_DT_INST_PINCTRL(index, 0);\
@ -926,9 +926,9 @@ static struct i2s_stm32_data i2s_stm32_data_##index = { \
UTIL_AND(DT_DMAS_HAS_NAME(DT_NODELABEL(i2s##index), tx), \
I2S_DMA_CHANNEL_INIT(index, tx, TX, MEMORY, PERIPHERAL)),\
}; \
DEVICE_AND_API_INIT(i2s_stm32_##index, \
DT_LABEL(DT_NODELABEL(i2s##index)), \
&i2s_stm32_initialize, &i2s_stm32_data_##index, \
DEVICE_DT_DEFINE(DT_NODELABEL(i2s##index), \
&i2s_stm32_initialize, device_pm_control_nop, \
&i2s_stm32_data_##index, \
&i2s_stm32_config_##index, POST_KERNEL, \
CONFIG_I2S_INIT_PRIORITY, &i2s_stm32_driver_api); \
\
@ -936,7 +936,7 @@ static void i2s_stm32_irq_config_func_##index(const struct device *dev) \
{ \
IRQ_CONNECT(DT_IRQN(DT_NODELABEL(i2s##index)), \
DT_IRQ(DT_NODELABEL(i2s##index), priority), \
i2s_stm32_isr, DEVICE_GET(i2s_stm32_##index), 0); \
i2s_stm32_isr, DEVICE_DT_GET(DT_NODELABEL(i2s##index)), 0);\
irq_enable(DT_IRQN(DT_NODELABEL(i2s##index))); \
}