dts: Convert new/missed DT_<COMPAT>_<INSTANCE>_<PROP> to DT_INST...

Change code from using now deprecated DT_<COMPAT>_<INSTANCE>_<PROP>
defines to using DT_INST_<INSTANCE>_<COMPAT>_<PROP>.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
Kumar Gala 2019-06-14 08:03:10 -05:00 committed by Anas Nashif
commit d4a0c3a2aa
11 changed files with 167 additions and 167 deletions

View file

@ -255,22 +255,22 @@ static const struct adc_driver_api mcux_adc12_driver_api = {
#if CONFIG_ADC_0 #if CONFIG_ADC_0
static void mcux_adc12_config_func_0(struct device *dev); static void mcux_adc12_config_func_0(struct device *dev);
ASSERT_WITHIN_RANGE(DT_NXP_KINETIS_ADC12_ADC_0_CLK_SOURCE, 0, 3, ASSERT_WITHIN_RANGE(DT_INST_0_NXP_KINETIS_ADC12_ADC_CLK_SOURCE, 0, 3,
"Invalid clock source"); "Invalid clock source");
ASSERT_ADC12_CLK_DIV_VALID(DT_NXP_KINETIS_ADC12_ADC_0_CLK_DIVIDER, ASSERT_ADC12_CLK_DIV_VALID(DT_INST_0_NXP_KINETIS_ADC12_ADC_CLK_DIVIDER,
"Invalid clock divider"); "Invalid clock divider");
ASSERT_WITHIN_RANGE(DT_NXP_KINETIS_ADC12_ADC_0_SAMPLE_TIME, 2, 256, ASSERT_WITHIN_RANGE(DT_INST_0_NXP_KINETIS_ADC12_ADC_SAMPLE_TIME, 2, 256,
"Invalid sample time"); "Invalid sample time");
static const struct mcux_adc12_config mcux_adc12_config_0 = { static const struct mcux_adc12_config mcux_adc12_config_0 = {
.base = (ADC_Type *)DT_NXP_KINETIS_ADC12_ADC_0_BASE_ADDRESS, .base = (ADC_Type *)DT_INST_0_NXP_KINETIS_ADC12_ADC_BASE_ADDRESS,
.clock_src = TO_ADC12_CLOCK_SRC(DT_NXP_KINETIS_ADC12_ADC_0_CLK_SOURCE), .clock_src = TO_ADC12_CLOCK_SRC(DT_INST_0_NXP_KINETIS_ADC12_ADC_CLK_SOURCE),
.clock_div = TO_ADC12_CLOCK_DIV(DT_NXP_KINETIS_ADC12_ADC_0_CLK_DIVIDER), .clock_div = TO_ADC12_CLOCK_DIV(DT_INST_0_NXP_KINETIS_ADC12_ADC_CLK_DIVIDER),
#if DT_NXP_KINETIS_ADC12_ADC_0_ALTERNATE_VOLTAGE_REFERENCE == 1 #if DT_INST_0_NXP_KINETIS_ADC12_ADC_ALTERNATE_VOLTAGE_REFERENCE == 1
.ref_src = kADC12_ReferenceVoltageSourceValt, .ref_src = kADC12_ReferenceVoltageSourceValt,
#else #else
.ref_src = kADC12_ReferenceVoltageSourceVref, .ref_src = kADC12_ReferenceVoltageSourceVref,
#endif #endif
.sample_clk_count = DT_NXP_KINETIS_ADC12_ADC_0_SAMPLE_TIME, .sample_clk_count = DT_INST_0_NXP_KINETIS_ADC12_ADC_SAMPLE_TIME,
.irq_config_func = mcux_adc12_config_func_0, .irq_config_func = mcux_adc12_config_func_0,
}; };
@ -280,40 +280,40 @@ static struct mcux_adc12_data mcux_adc12_data_0 = {
ADC_CONTEXT_INIT_SYNC(mcux_adc12_data_0, ctx), ADC_CONTEXT_INIT_SYNC(mcux_adc12_data_0, ctx),
}; };
DEVICE_AND_API_INIT(mcux_adc12_0, DT_NXP_KINETIS_ADC12_ADC_0_LABEL, DEVICE_AND_API_INIT(mcux_adc12_0, DT_INST_0_NXP_KINETIS_ADC12_ADC_LABEL,
&mcux_adc12_init, &mcux_adc12_data_0, &mcux_adc12_config_0, &mcux_adc12_init, &mcux_adc12_data_0, &mcux_adc12_config_0,
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&mcux_adc12_driver_api); &mcux_adc12_driver_api);
static void mcux_adc12_config_func_0(struct device *dev) static void mcux_adc12_config_func_0(struct device *dev)
{ {
IRQ_CONNECT(DT_NXP_KINETIS_ADC12_ADC_0_IRQ, IRQ_CONNECT(DT_INST_0_NXP_KINETIS_ADC12_ADC_IRQ,
DT_NXP_KINETIS_ADC12_ADC_0_IRQ_PRIORITY, mcux_adc12_isr, DT_INST_0_NXP_KINETIS_ADC12_ADC_IRQ_PRIORITY, mcux_adc12_isr,
DEVICE_GET(mcux_adc12_0), 0); DEVICE_GET(mcux_adc12_0), 0);
irq_enable(DT_NXP_KINETIS_ADC12_ADC_0_IRQ); irq_enable(DT_INST_0_NXP_KINETIS_ADC12_ADC_IRQ);
} }
#endif /* CONFIG_ADC_0 */ #endif /* CONFIG_ADC_0 */
#if CONFIG_ADC_1 #if CONFIG_ADC_1
static void mcux_adc12_config_func_1(struct device *dev); static void mcux_adc12_config_func_1(struct device *dev);
ASSERT_WITHIN_RANGE(DT_NXP_KINETIS_ADC12_ADC_1_CLK_SOURCE, 0, 3, ASSERT_WITHIN_RANGE(DT_INST_1_NXP_KINETIS_ADC12_ADC_CLK_SOURCE, 0, 3,
"Invalid clock source"); "Invalid clock source");
ASSERT_ADC12_CLK_DIV_VALID(DT_NXP_KINETIS_ADC12_ADC_1_CLK_DIVIDER, ASSERT_ADC12_CLK_DIV_VALID(DT_INST_1_NXP_KINETIS_ADC12_ADC_CLK_DIVIDER,
"Invalid clock divider"); "Invalid clock divider");
ASSERT_WITHIN_RANGE(DT_NXP_KINETIS_ADC12_ADC_1_SAMPLE_TIME, 2, 256, ASSERT_WITHIN_RANGE(DT_INST_1_NXP_KINETIS_ADC12_ADC_SAMPLE_TIME, 2, 256,
"Invalid sample time"); "Invalid sample time");
static const struct mcux_adc12_config mcux_adc12_config_1 = { static const struct mcux_adc12_config mcux_adc12_config_1 = {
.base = (ADC_Type *)DT_NXP_KINETIS_ADC12_ADC_1_BASE_ADDRESS, .base = (ADC_Type *)DT_INST_1_NXP_KINETIS_ADC12_ADC_BASE_ADDRESS,
.clock_src = TO_ADC12_CLOCK_SRC(DT_NXP_KINETIS_ADC12_ADC_1_CLK_SOURCE), .clock_src = TO_ADC12_CLOCK_SRC(DT_INST_1_NXP_KINETIS_ADC12_ADC_CLK_SOURCE),
.clock_div = TO_ADC12_CLOCK_DIV(DT_NXP_KINETIS_ADC12_ADC_1_CLK_DIVIDER), .clock_div = TO_ADC12_CLOCK_DIV(DT_INST_1_NXP_KINETIS_ADC12_ADC_CLK_DIVIDER),
#if DT_NXP_KINETIS_ADC12_ADC_1_ALTERNATE_VOLTAGE_REFERENCE == 1 #if DT_INST_1_NXP_KINETIS_ADC12_ADC_ALTERNATE_VOLTAGE_REFERENCE == 1
.ref_src = kADC12_ReferenceVoltageSourceValt, .ref_src = kADC12_ReferenceVoltageSourceValt,
#else #else
.ref_src = kADC12_ReferenceVoltageSourceVref, .ref_src = kADC12_ReferenceVoltageSourceVref,
#endif #endif
.sample_clk_count = DT_NXP_KINETIS_ADC12_ADC_1_SAMPLE_TIME, .sample_clk_count = DT_INST_1_NXP_KINETIS_ADC12_ADC_SAMPLE_TIME,
.irq_config_func = mcux_adc12_config_func_1, .irq_config_func = mcux_adc12_config_func_1,
}; };
@ -323,40 +323,40 @@ static struct mcux_adc12_data mcux_adc12_data_1 = {
ADC_CONTEXT_INIT_SYNC(mcux_adc12_data_1, ctx), ADC_CONTEXT_INIT_SYNC(mcux_adc12_data_1, ctx),
}; };
DEVICE_AND_API_INIT(mcux_adc12_1, DT_NXP_KINETIS_ADC12_ADC_1_LABEL, DEVICE_AND_API_INIT(mcux_adc12_1, DT_INST_1_NXP_KINETIS_ADC12_ADC_LABEL,
&mcux_adc12_init, &mcux_adc12_data_1, &mcux_adc12_config_1, &mcux_adc12_init, &mcux_adc12_data_1, &mcux_adc12_config_1,
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&mcux_adc12_driver_api); &mcux_adc12_driver_api);
static void mcux_adc12_config_func_1(struct device *dev) static void mcux_adc12_config_func_1(struct device *dev)
{ {
IRQ_CONNECT(DT_NXP_KINETIS_ADC12_ADC_1_IRQ, IRQ_CONNECT(DT_INST_1_NXP_KINETIS_ADC12_ADC_IRQ,
DT_NXP_KINETIS_ADC12_ADC_1_IRQ_PRIORITY, mcux_adc12_isr, DT_INST_1_NXP_KINETIS_ADC12_ADC_IRQ_PRIORITY, mcux_adc12_isr,
DEVICE_GET(mcux_adc12_1), 0); DEVICE_GET(mcux_adc12_1), 0);
irq_enable(DT_NXP_KINETIS_ADC12_ADC_1_IRQ); irq_enable(DT_INST_1_NXP_KINETIS_ADC12_ADC_IRQ);
} }
#endif /* CONFIG_ADC_1 */ #endif /* CONFIG_ADC_1 */
#if CONFIG_ADC_2 #if CONFIG_ADC_2
static void mcux_adc12_config_func_2(struct device *dev); static void mcux_adc12_config_func_2(struct device *dev);
ASSERT_WITHIN_RANGE(DT_NXP_KINETIS_ADC12_ADC_2_CLK_SOURCE, 0, 3, ASSERT_WITHIN_RANGE(DT_INST_2_NXP_KINETIS_ADC12_ADC_CLK_SOURCE, 0, 3,
"Invalid clock source"); "Invalid clock source");
ASSERT_ADC12_CLK_DIV_VALID(DT_NXP_KINETIS_ADC12_ADC_2_CLK_DIVIDER, ASSERT_ADC12_CLK_DIV_VALID(DT_INST_2_NXP_KINETIS_ADC12_ADC_CLK_DIVIDER,
"Invalid clock divider"); "Invalid clock divider");
ASSERT_WITHIN_RANGE(DT_NXP_KINETIS_ADC12_ADC_2_SAMPLE_TIME, 2, 256, ASSERT_WITHIN_RANGE(DT_INST_2_NXP_KINETIS_ADC12_ADC_SAMPLE_TIME, 2, 256,
"Invalid sample time"); "Invalid sample time");
static const struct mcux_adc12_config mcux_adc12_config_2 = { static const struct mcux_adc12_config mcux_adc12_config_2 = {
.base = (ADC_Type *)DT_NXP_KINETIS_ADC12_ADC_2_BASE_ADDRESS, .base = (ADC_Type *)DT_INST_2_NXP_KINETIS_ADC12_ADC_BASE_ADDRESS,
.clock_src = TO_ADC12_CLOCK_SRC(DT_NXP_KINETIS_ADC12_ADC_2_CLK_SOURCE), .clock_src = TO_ADC12_CLOCK_SRC(DT_INST_2_NXP_KINETIS_ADC12_ADC_CLK_SOURCE),
.clock_div = TO_ADC12_CLOCK_DIV(DT_NXP_KINETIS_ADC12_ADC_2_CLK_DIVIDER), .clock_div = TO_ADC12_CLOCK_DIV(DT_INST_2_NXP_KINETIS_ADC12_ADC_CLK_DIVIDER),
#if DT_NXP_KINETIS_ADC12_ADC_2_ALTERNATE_VOLTAGE_REFERENCE == 1 #if DT_INST_2_NXP_KINETIS_ADC12_ADC_ALTERNATE_VOLTAGE_REFERENCE == 1
.ref_src = kADC12_ReferenceVoltageSourceValt, .ref_src = kADC12_ReferenceVoltageSourceValt,
#else #else
.ref_src = kADC12_ReferenceVoltageSourceVref, .ref_src = kADC12_ReferenceVoltageSourceVref,
#endif #endif
.sample_clk_count = DT_NXP_KINETIS_ADC12_ADC_2_SAMPLE_TIME, .sample_clk_count = DT_INST_2_NXP_KINETIS_ADC12_ADC_SAMPLE_TIME,
.irq_config_func = mcux_adc12_config_func_2, .irq_config_func = mcux_adc12_config_func_2,
}; };
@ -366,17 +366,17 @@ static struct mcux_adc12_data mcux_adc12_data_2 = {
ADC_CONTEXT_INIT_SYNC(mcux_adc12_data_2, ctx), ADC_CONTEXT_INIT_SYNC(mcux_adc12_data_2, ctx),
}; };
DEVICE_AND_API_INIT(mcux_adc12_2, DT_NXP_KINETIS_ADC12_ADC_2_LABEL, DEVICE_AND_API_INIT(mcux_adc12_2, DT_INST_2_NXP_KINETIS_ADC12_ADC_LABEL,
&mcux_adc12_init, &mcux_adc12_data_2, &mcux_adc12_config_2, &mcux_adc12_init, &mcux_adc12_data_2, &mcux_adc12_config_2,
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&mcux_adc12_driver_api); &mcux_adc12_driver_api);
static void mcux_adc12_config_func_2(struct device *dev) static void mcux_adc12_config_func_2(struct device *dev)
{ {
IRQ_CONNECT(DT_NXP_KINETIS_ADC12_ADC_2_IRQ, IRQ_CONNECT(DT_INST_2_NXP_KINETIS_ADC12_ADC_IRQ,
DT_NXP_KINETIS_ADC12_ADC_2_IRQ_PRIORITY, mcux_adc12_isr, DT_INST_2_NXP_KINETIS_ADC12_ADC_IRQ_PRIORITY, mcux_adc12_isr,
DEVICE_GET(mcux_adc12_2), 0); DEVICE_GET(mcux_adc12_2), 0);
irq_enable(DT_NXP_KINETIS_ADC12_ADC_2_IRQ); irq_enable(DT_INST_2_NXP_KINETIS_ADC12_ADC_IRQ);
} }
#endif /* CONFIG_ADC_2 */ #endif /* CONFIG_ADC_2 */

View file

@ -41,12 +41,12 @@ struct codec_driver_data {
static struct codec_driver_config codec_device_config = { static struct codec_driver_config codec_device_config = {
.i2c_device = NULL, .i2c_device = NULL,
.i2c_dev_name = DT_TI_TLV320DAC_0_BUS_NAME, .i2c_dev_name = DT_INST_0_TI_TLV320DAC_BUS_NAME,
.i2c_address = DT_TI_TLV320DAC_0_BASE_ADDRESS, .i2c_address = DT_INST_0_TI_TLV320DAC_BASE_ADDRESS,
.gpio_device = NULL, .gpio_device = NULL,
.gpio_dev_name = DT_TI_TLV320DAC_0_RESET_GPIOS_CONTROLLER, .gpio_dev_name = DT_INST_0_TI_TLV320DAC_RESET_GPIOS_CONTROLLER,
.gpio_pin = DT_TI_TLV320DAC_0_RESET_GPIOS_PIN, .gpio_pin = DT_INST_0_TI_TLV320DAC_RESET_GPIOS_PIN,
.gpio_flags = DT_TI_TLV320DAC_0_RESET_GPIOS_FLAGS, .gpio_flags = DT_INST_0_TI_TLV320DAC_RESET_GPIOS_FLAGS,
}; };
static struct codec_driver_data codec_device_data; static struct codec_driver_data codec_device_data;
@ -538,6 +538,6 @@ static const struct audio_codec_api codec_driver_api = {
.apply_properties = codec_apply_properties, .apply_properties = codec_apply_properties,
}; };
DEVICE_AND_API_INIT(tlv320dac310x, DT_TI_TLV320DAC_0_LABEL, codec_initialize, DEVICE_AND_API_INIT(tlv320dac310x, DT_INST_0_TI_TLV320DAC_LABEL, codec_initialize,
&codec_device_data, &codec_device_config, POST_KERNEL, &codec_device_data, &codec_device_config, POST_KERNEL,
CONFIG_AUDIO_CODEC_INIT_PRIORITY, &codec_driver_api); CONFIG_AUDIO_CODEC_INIT_PRIORITY, &codec_driver_api);

View file

@ -531,7 +531,7 @@ static int mcp2515_init(struct device *dev)
return -EINVAL; return -EINVAL;
} }
#ifdef DT_MICROCHIP_MCP2515_0_CS_GPIO_PIN #ifdef DT_INST_0_MICROCHIP_MCP2515_CS_GPIO_PIN
dev_data->spi_cs_ctrl.gpio_dev = dev_data->spi_cs_ctrl.gpio_dev =
device_get_binding(dev_cfg->spi_cs_port); device_get_binding(dev_cfg->spi_cs_port);
if (!dev_data->spi_cs_ctrl.gpio_dev) { if (!dev_data->spi_cs_ctrl.gpio_dev) {
@ -545,7 +545,7 @@ static int mcp2515_init(struct device *dev)
dev_data->spi_cfg.cs = &dev_data->spi_cs_ctrl; dev_data->spi_cfg.cs = &dev_data->spi_cs_ctrl;
#else #else
dev_data->spi_cfg.cs = NULL; dev_data->spi_cfg.cs = NULL;
#endif /* DT_MICROCHIP_MCP2515_0_CS_GPIO_PIN */ #endif /* DT_INST_0_MICROCHIP_MCP2515_CS_GPIO_PIN */
/* Reset MCP2515 */ /* Reset MCP2515 */
if (mcp2515_cmd_soft_reset(dev)) { if (mcp2515_cmd_soft_reset(dev)) {
@ -607,25 +607,25 @@ static struct mcp2515_data mcp2515_data_1 = {
}; };
static const struct mcp2515_config mcp2515_config_1 = { static const struct mcp2515_config mcp2515_config_1 = {
.spi_port = DT_MICROCHIP_MCP2515_0_BUS_NAME, .spi_port = DT_INST_0_MICROCHIP_MCP2515_BUS_NAME,
.spi_freq = DT_MICROCHIP_MCP2515_0_SPI_MAX_FREQUENCY, .spi_freq = DT_INST_0_MICROCHIP_MCP2515_SPI_MAX_FREQUENCY,
.spi_slave = DT_MICROCHIP_MCP2515_0_BASE_ADDRESS, .spi_slave = DT_INST_0_MICROCHIP_MCP2515_BASE_ADDRESS,
.int_pin = DT_MICROCHIP_MCP2515_0_INT_GPIOS_PIN, .int_pin = DT_INST_0_MICROCHIP_MCP2515_INT_GPIOS_PIN,
.int_port = DT_MICROCHIP_MCP2515_0_INT_GPIOS_CONTROLLER, .int_port = DT_INST_0_MICROCHIP_MCP2515_INT_GPIOS_CONTROLLER,
.int_thread_stack_size = CONFIG_CAN_MCP2515_INT_THREAD_STACK_SIZE, .int_thread_stack_size = CONFIG_CAN_MCP2515_INT_THREAD_STACK_SIZE,
.int_thread_priority = CONFIG_CAN_MCP2515_INT_THREAD_PRIO, .int_thread_priority = CONFIG_CAN_MCP2515_INT_THREAD_PRIO,
#ifdef DT_MICROCHIP_MCP2515_0_CS_GPIO_PIN #ifdef DT_INST_0_MICROCHIP_MCP2515_CS_GPIO_PIN
.spi_cs_pin = DT_MICROCHIP_MCP2515_0_CS_GPIO_PIN, .spi_cs_pin = DT_INST_0_MICROCHIP_MCP2515_CS_GPIO_PIN,
.spi_cs_port = DT_MICROCHIP_MCP2515_0_CS_GPIO_CONTROLLER, .spi_cs_port = DT_INST_0_MICROCHIP_MCP2515_CS_GPIO_CONTROLLER,
#endif /* DT_MICROCHIP_MCP2515_0_CS_GPIO_PIN */ #endif /* DT_INST_0_MICROCHIP_MCP2515_CS_GPIO_PIN */
.tq_sjw = CONFIG_CAN_SJW, .tq_sjw = CONFIG_CAN_SJW,
.tq_prop = CONFIG_CAN_PROP_SEG, .tq_prop = CONFIG_CAN_PROP_SEG,
.tq_bs1 = CONFIG_CAN_PHASE_SEG1, .tq_bs1 = CONFIG_CAN_PHASE_SEG1,
.tq_bs2 = CONFIG_CAN_PHASE_SEG2, .tq_bs2 = CONFIG_CAN_PHASE_SEG2,
.bus_speed = DT_MICROCHIP_MCP2515_0_BUS_SPEED, .bus_speed = DT_INST_0_MICROCHIP_MCP2515_BUS_SPEED,
}; };
DEVICE_AND_API_INIT(can_mcp2515_1, DT_MICROCHIP_MCP2515_0_LABEL, &mcp2515_init, DEVICE_AND_API_INIT(can_mcp2515_1, DT_INST_0_MICROCHIP_MCP2515_LABEL, &mcp2515_init,
&mcp2515_data_1, &mcp2515_config_1, POST_KERNEL, &mcp2515_data_1, &mcp2515_config_1, POST_KERNEL,
CONFIG_CAN_MCP2515_INIT_PRIORITY, &can_api_funcs); CONFIG_CAN_MCP2515_INIT_PRIORITY, &can_api_funcs);

View file

@ -27,9 +27,9 @@ struct mcp2515_data {
/* spi device data */ /* spi device data */
struct device *spi; struct device *spi;
struct spi_config spi_cfg; struct spi_config spi_cfg;
#ifdef DT_MICROCHIP_MCP2515_0_CS_GPIO_PIN #ifdef DT_INST_0_MICROCHIP_MCP2515_CS_GPIO_PIN
struct spi_cs_control spi_cs_ctrl; struct spi_cs_control spi_cs_ctrl;
#endif /* DT_MICROCHIP_MCP2515_0_CS_GPIO_PIN */ #endif /* DT_INST_0_MICROCHIP_MCP2515_CS_GPIO_PIN */
/* interrupt data */ /* interrupt data */
struct device *int_gpio; struct device *int_gpio;

View file

@ -381,11 +381,11 @@ static void eth_enc28j60_init_mac(struct device *dev)
/* Configure MAC address */ /* Configure MAC address */
eth_enc28j60_set_bank(dev, ENC28J60_REG_MAADR0); eth_enc28j60_set_bank(dev, ENC28J60_REG_MAADR0);
eth_enc28j60_write_reg(dev, ENC28J60_REG_MAADR0, eth_enc28j60_write_reg(dev, ENC28J60_REG_MAADR0,
DT_MICROCHIP_ENC28J60_0_LOCAL_MAC_ADDRESS_5); DT_INST_0_MICROCHIP_ENC28J60_LOCAL_MAC_ADDRESS_5);
eth_enc28j60_write_reg(dev, ENC28J60_REG_MAADR1, eth_enc28j60_write_reg(dev, ENC28J60_REG_MAADR1,
DT_MICROCHIP_ENC28J60_0_LOCAL_MAC_ADDRESS_4); DT_INST_0_MICROCHIP_ENC28J60_LOCAL_MAC_ADDRESS_4);
eth_enc28j60_write_reg(dev, ENC28J60_REG_MAADR2, eth_enc28j60_write_reg(dev, ENC28J60_REG_MAADR2,
DT_MICROCHIP_ENC28J60_0_LOCAL_MAC_ADDRESS_3); DT_INST_0_MICROCHIP_ENC28J60_LOCAL_MAC_ADDRESS_3);
eth_enc28j60_write_reg(dev, ENC28J60_REG_MAADR3, MICROCHIP_OUI_B2); eth_enc28j60_write_reg(dev, ENC28J60_REG_MAADR3, MICROCHIP_OUI_B2);
eth_enc28j60_write_reg(dev, ENC28J60_REG_MAADR4, MICROCHIP_OUI_B1); eth_enc28j60_write_reg(dev, ENC28J60_REG_MAADR4, MICROCHIP_OUI_B1);
eth_enc28j60_write_reg(dev, ENC28J60_REG_MAADR5, MICROCHIP_OUI_B0); eth_enc28j60_write_reg(dev, ENC28J60_REG_MAADR5, MICROCHIP_OUI_B0);
@ -747,9 +747,9 @@ static struct eth_enc28j60_runtime eth_enc28j60_0_runtime = {
MICROCHIP_OUI_B0, MICROCHIP_OUI_B0,
MICROCHIP_OUI_B1, MICROCHIP_OUI_B1,
MICROCHIP_OUI_B2, MICROCHIP_OUI_B2,
DT_MICROCHIP_ENC28J60_0_LOCAL_MAC_ADDRESS_3, DT_INST_0_MICROCHIP_ENC28J60_LOCAL_MAC_ADDRESS_3,
DT_MICROCHIP_ENC28J60_0_LOCAL_MAC_ADDRESS_4, DT_INST_0_MICROCHIP_ENC28J60_LOCAL_MAC_ADDRESS_4,
DT_MICROCHIP_ENC28J60_0_LOCAL_MAC_ADDRESS_5 DT_INST_0_MICROCHIP_ENC28J60_LOCAL_MAC_ADDRESS_5
}, },
.tx_rx_sem = Z_SEM_INITIALIZER(eth_enc28j60_0_runtime.tx_rx_sem, .tx_rx_sem = Z_SEM_INITIALIZER(eth_enc28j60_0_runtime.tx_rx_sem,
1, UINT_MAX), 1, UINT_MAX),
@ -758,20 +758,20 @@ static struct eth_enc28j60_runtime eth_enc28j60_0_runtime = {
}; };
static const struct eth_enc28j60_config eth_enc28j60_0_config = { static const struct eth_enc28j60_config eth_enc28j60_0_config = {
.gpio_port = DT_MICROCHIP_ENC28J60_0_INT_GPIOS_CONTROLLER, .gpio_port = DT_INST_0_MICROCHIP_ENC28J60_INT_GPIOS_CONTROLLER,
.gpio_pin = DT_MICROCHIP_ENC28J60_0_INT_GPIOS_PIN, .gpio_pin = DT_INST_0_MICROCHIP_ENC28J60_INT_GPIOS_PIN,
.spi_port = DT_MICROCHIP_ENC28J60_0_BUS_NAME, .spi_port = DT_INST_0_MICROCHIP_ENC28J60_BUS_NAME,
.spi_freq = DT_MICROCHIP_ENC28J60_0_SPI_MAX_FREQUENCY, .spi_freq = DT_INST_0_MICROCHIP_ENC28J60_SPI_MAX_FREQUENCY,
.spi_slave = DT_MICROCHIP_ENC28J60_0_BASE_ADDRESS, .spi_slave = DT_INST_0_MICROCHIP_ENC28J60_BASE_ADDRESS,
#ifdef CONFIG_ETH_ENC28J60_0_GPIO_SPI_CS #ifdef CONFIG_ETH_ENC28J60_0_GPIO_SPI_CS
.spi_cs_port = DT_MICROCHIP_ENC28J60_0_CS_GPIO_CONTROLLER, .spi_cs_port = DT_INST_0_MICROCHIP_ENC28J60_CS_GPIO_CONTROLLER,
.spi_cs_pin = DT_MICROCHIP_ENC28J60_0_CS_GPIO_PIN, .spi_cs_pin = DT_INST_0_MICROCHIP_ENC28J60_CS_GPIO_PIN,
#endif /* CONFIG_ETH_ENC28J60_0_GPIO_SPI_CS */ #endif /* CONFIG_ETH_ENC28J60_0_GPIO_SPI_CS */
.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,
}; };
NET_DEVICE_INIT(enc28j60_0, DT_MICROCHIP_ENC28J60_0_LABEL, NET_DEVICE_INIT(enc28j60_0, DT_INST_0_MICROCHIP_ENC28J60_LABEL,
eth_enc28j60_init, &eth_enc28j60_0_runtime, eth_enc28j60_init, &eth_enc28j60_0_runtime,
&eth_enc28j60_0_config, CONFIG_ETH_INIT_PRIORITY, &api_funcs, &eth_enc28j60_0_config, CONFIG_ETH_INIT_PRIORITY, &api_funcs,
ETHERNET_L2, NET_L2_GET_CTX_TYPE(ETHERNET_L2), ETHERNET_L2, NET_L2_GET_CTX_TYPE(ETHERNET_L2),

View file

@ -106,13 +106,13 @@ DEVICE_AND_API_INIT(sam_pwm_0, DT_INST_0_ATMEL_SAM_PWM_LABEL, &sam_pwm_init,
#ifdef DT_ATMEL_SAM_PWM_1 #ifdef DT_ATMEL_SAM_PWM_1
static const struct sam_pwm_config sam_pwm_config_1 = { static const struct sam_pwm_config sam_pwm_config_1 = {
.regs = (Pwm *)DT_ATMEL_SAM_PWM_1_BASE_ADDRESS, .regs = (Pwm *)DT_INST_1_ATMEL_SAM_PWM_BASE_ADDRESS,
.id = DT_ATMEL_SAM_PWM_1_PERIPHERAL_ID, .id = DT_INST_1_ATMEL_SAM_PWM_PERIPHERAL_ID,
.prescaler = DT_ATMEL_SAM_PWM_1_PRESCALER, .prescaler = DT_INST_1_ATMEL_SAM_PWM_PRESCALER,
.divider = DT_ATMEL_SAM_PWM_1_DIVIDER, .divider = DT_INST_1_ATMEL_SAM_PWM_DIVIDER,
}; };
DEVICE_AND_API_INIT(sam_pwm_1, DT_ATMEL_SAM_PWM_1_LABEL, &sam_pwm_init, DEVICE_AND_API_INIT(sam_pwm_1, DT_INST_1_ATMEL_SAM_PWM_LABEL, &sam_pwm_init,
NULL, &sam_pwm_config_1, NULL, &sam_pwm_config_1,
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&sam_pwm_driver_api); &sam_pwm_driver_api);

View file

@ -397,7 +397,7 @@ static const struct leuart_gecko_config leuart_gecko_1_config = {
static struct leuart_gecko_data leuart_gecko_1_data; static struct leuart_gecko_data leuart_gecko_1_data;
DEVICE_AND_API_INIT(leuart_1, DT_SILABS_GECKO_LEUART_1_LABEL, DEVICE_AND_API_INIT(leuart_1, DT_INST_1_SILABS_GECKO_LEUART_LABEL,
&leuart_gecko_init, &leuart_gecko_1_data, &leuart_gecko_init, &leuart_gecko_1_data,
&leuart_gecko_1_config, PRE_KERNEL_1, &leuart_gecko_1_config, PRE_KERNEL_1,
CONFIG_KERNEL_INIT_PRIORITY_DEVICE, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,

View file

@ -351,30 +351,30 @@ static void uart_gecko_config_func_0(struct device *dev)
#ifdef DT_SILABS_GECKO_UART_1 #ifdef DT_SILABS_GECKO_UART_1
#define PIN_UART1_RXD {DT_SILABS_GECKO_UART_1_LOCATION_RX_1, \ #define PIN_UART1_RXD {DT_INST_1_SILABS_GECKO_UART_LOCATION_RX_1, \
DT_SILABS_GECKO_UART_1_LOCATION_RX_2, gpioModeInput, 1} DT_INST_1_SILABS_GECKO_UART_LOCATION_RX_2, gpioModeInput, 1}
#define PIN_UART1_TXD {DT_SILABS_GECKO_UART_1_LOCATION_TX_1, \ #define PIN_UART1_TXD {DT_INST_1_SILABS_GECKO_UART_LOCATION_TX_1, \
DT_SILABS_GECKO_UART_1_LOCATION_TX_2, gpioModePushPull, 1} DT_INST_1_SILABS_GECKO_UART_LOCATION_TX_2, gpioModePushPull, 1}
#ifdef CONFIG_UART_INTERRUPT_DRIVEN #ifdef CONFIG_UART_INTERRUPT_DRIVEN
static void uart_gecko_config_func_1(struct device *dev); static void uart_gecko_config_func_1(struct device *dev);
#endif #endif
static const struct uart_gecko_config uart_gecko_1_config = { static const struct uart_gecko_config uart_gecko_1_config = {
.base = (USART_TypeDef *)DT_SILABS_GECKO_UART_1_BASE_ADDRESS, .base = (USART_TypeDef *)DT_INST_1_SILABS_GECKO_UART_BASE_ADDRESS,
.clock = cmuClock_UART1, .clock = cmuClock_UART1,
.baud_rate = DT_SILABS_GECKO_UART_1_CURRENT_SPEED, .baud_rate = DT_INST_1_SILABS_GECKO_UART_CURRENT_SPEED,
.pin_rx = PIN_UART1_RXD, .pin_rx = PIN_UART1_RXD,
.pin_tx = PIN_UART1_TXD, .pin_tx = PIN_UART1_TXD,
#ifdef CONFIG_SOC_GECKO_HAS_INDIVIDUAL_PIN_LOCATION #ifdef CONFIG_SOC_GECKO_HAS_INDIVIDUAL_PIN_LOCATION
.loc_rx = DT_SILABS_GECKO_UART_1_LOCATION_RX_0, .loc_rx = DT_INST_1_SILABS_GECKO_UART_LOCATION_RX_0,
.loc_tx = DT_SILABS_GECKO_UART_1_LOCATION_TX_0, .loc_tx = DT_INST_1_SILABS_GECKO_UART_LOCATION_TX_0,
#else #else
#if DT_SILABS_GECKO_UART_1_LOCATION_RX_0 \ #if DT_INST_1_SILABS_GECKO_UART_LOCATION_RX_0 \
!= DT_SILABS_GECKO_UART_1_LOCATION_TX_0 != DT_INST_1_SILABS_GECKO_UART_LOCATION_TX_0
#error UART_1 DTS location-* properties must have identical value #error UART_1 DTS location-* properties must have identical value
#endif #endif
.loc = DT_SILABS_GECKO_UART_1_LOCATION_RX_0, .loc = DT_INST_1_SILABS_GECKO_UART_LOCATION_RX_0,
#endif #endif
#ifdef CONFIG_UART_INTERRUPT_DRIVEN #ifdef CONFIG_UART_INTERRUPT_DRIVEN
.irq_config_func = uart_gecko_config_func_1, .irq_config_func = uart_gecko_config_func_1,
@ -383,22 +383,22 @@ static const struct uart_gecko_config uart_gecko_1_config = {
static struct uart_gecko_data uart_gecko_1_data; static struct uart_gecko_data uart_gecko_1_data;
DEVICE_AND_API_INIT(uart_1, DT_SILABS_GECKO_UART_1_LABEL, &uart_gecko_init, DEVICE_AND_API_INIT(uart_1, DT_INST_1_SILABS_GECKO_UART_LABEL, &uart_gecko_init,
&uart_gecko_1_data, &uart_gecko_1_config, PRE_KERNEL_1, &uart_gecko_1_data, &uart_gecko_1_config, PRE_KERNEL_1,
CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &uart_gecko_driver_api); CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &uart_gecko_driver_api);
#ifdef CONFIG_UART_INTERRUPT_DRIVEN #ifdef CONFIG_UART_INTERRUPT_DRIVEN
static void uart_gecko_config_func_1(struct device *dev) static void uart_gecko_config_func_1(struct device *dev)
{ {
IRQ_CONNECT(DT_SILABS_GECKO_UART_1_IRQ_RX, IRQ_CONNECT(DT_INST_1_SILABS_GECKO_UART_IRQ_RX,
DT_SILABS_GECKO_UART_1_IRQ_RX_PRIORITY, uart_gecko_isr, DT_INST_1_SILABS_GECKO_UART_IRQ_RX_PRIORITY, uart_gecko_isr,
DEVICE_GET(uart_1), 0); DEVICE_GET(uart_1), 0);
IRQ_CONNECT(DT_SILABS_GECKO_UART_1_IRQ_TX, IRQ_CONNECT(DT_INST_1_SILABS_GECKO_UART_IRQ_TX,
DT_SILABS_GECKO_UART_1_IRQ_TX_PRIORITY, uart_gecko_isr, DT_INST_1_SILABS_GECKO_UART_IRQ_TX_PRIORITY, uart_gecko_isr,
DEVICE_GET(uart_1), 0); DEVICE_GET(uart_1), 0);
irq_enable(DT_SILABS_GECKO_UART_1_IRQ_RX); irq_enable(DT_INST_1_SILABS_GECKO_UART_IRQ_RX);
irq_enable(DT_SILABS_GECKO_UART_1_IRQ_TX); irq_enable(DT_INST_1_SILABS_GECKO_UART_IRQ_TX);
} }
#endif #endif
@ -462,30 +462,30 @@ static void usart_gecko_config_func_0(struct device *dev)
#ifdef DT_SILABS_GECKO_USART_1 #ifdef DT_SILABS_GECKO_USART_1
#define PIN_USART1_RXD {DT_SILABS_GECKO_USART_1_LOCATION_RX_1, \ #define PIN_USART1_RXD {DT_INST_1_SILABS_GECKO_USART_LOCATION_RX_1, \
DT_SILABS_GECKO_USART_1_LOCATION_RX_2, gpioModeInput, 1} DT_INST_1_SILABS_GECKO_USART_LOCATION_RX_2, gpioModeInput, 1}
#define PIN_USART1_TXD {DT_SILABS_GECKO_USART_1_LOCATION_TX_1, \ #define PIN_USART1_TXD {DT_INST_1_SILABS_GECKO_USART_LOCATION_TX_1, \
DT_SILABS_GECKO_USART_1_LOCATION_TX_2, gpioModePushPull, 1} DT_INST_1_SILABS_GECKO_USART_LOCATION_TX_2, gpioModePushPull, 1}
#ifdef CONFIG_UART_INTERRUPT_DRIVEN #ifdef CONFIG_UART_INTERRUPT_DRIVEN
static void usart_gecko_config_func_1(struct device *dev); static void usart_gecko_config_func_1(struct device *dev);
#endif #endif
static const struct uart_gecko_config usart_gecko_1_config = { static const struct uart_gecko_config usart_gecko_1_config = {
.base = (USART_TypeDef *)DT_SILABS_GECKO_USART_1_BASE_ADDRESS, .base = (USART_TypeDef *)DT_INST_1_SILABS_GECKO_USART_BASE_ADDRESS,
.clock = cmuClock_USART1, .clock = cmuClock_USART1,
.baud_rate = DT_SILABS_GECKO_USART_1_CURRENT_SPEED, .baud_rate = DT_INST_1_SILABS_GECKO_USART_CURRENT_SPEED,
.pin_rx = PIN_USART1_RXD, .pin_rx = PIN_USART1_RXD,
.pin_tx = PIN_USART1_TXD, .pin_tx = PIN_USART1_TXD,
#ifdef CONFIG_SOC_GECKO_HAS_INDIVIDUAL_PIN_LOCATION #ifdef CONFIG_SOC_GECKO_HAS_INDIVIDUAL_PIN_LOCATION
.loc_rx = DT_SILABS_GECKO_USART_1_LOCATION_RX_0, .loc_rx = DT_INST_1_SILABS_GECKO_USART_LOCATION_RX_0,
.loc_tx = DT_SILABS_GECKO_USART_1_LOCATION_TX_0, .loc_tx = DT_INST_1_SILABS_GECKO_USART_LOCATION_TX_0,
#else #else
#if DT_SILABS_GECKO_USART_1_LOCATION_RX_0 \ #if DT_INST_1_SILABS_GECKO_USART_LOCATION_RX_0 \
!= DT_SILABS_GECKO_USART_1_LOCATION_TX_0 != DT_INST_1_SILABS_GECKO_USART_LOCATION_TX_0
#error USART_1 DTS location-* properties must have identical value #error USART_1 DTS location-* properties must have identical value
#endif #endif
.loc = DT_SILABS_GECKO_USART_1_LOCATION_RX_0, .loc = DT_INST_1_SILABS_GECKO_USART_LOCATION_RX_0,
#endif #endif
#ifdef CONFIG_UART_INTERRUPT_DRIVEN #ifdef CONFIG_UART_INTERRUPT_DRIVEN
.irq_config_func = usart_gecko_config_func_1, .irq_config_func = usart_gecko_config_func_1,
@ -494,7 +494,7 @@ static const struct uart_gecko_config usart_gecko_1_config = {
static struct uart_gecko_data usart_gecko_1_data; static struct uart_gecko_data usart_gecko_1_data;
DEVICE_AND_API_INIT(usart_1, DT_SILABS_GECKO_USART_1_LABEL, DEVICE_AND_API_INIT(usart_1, DT_INST_1_SILABS_GECKO_USART_LABEL,
&uart_gecko_init, &usart_gecko_1_data, &uart_gecko_init, &usart_gecko_1_data,
&usart_gecko_1_config, PRE_KERNEL_1, &usart_gecko_1_config, PRE_KERNEL_1,
CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &uart_gecko_driver_api); CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &uart_gecko_driver_api);
@ -502,15 +502,15 @@ DEVICE_AND_API_INIT(usart_1, DT_SILABS_GECKO_USART_1_LABEL,
#ifdef CONFIG_UART_INTERRUPT_DRIVEN #ifdef CONFIG_UART_INTERRUPT_DRIVEN
static void usart_gecko_config_func_1(struct device *dev) static void usart_gecko_config_func_1(struct device *dev)
{ {
IRQ_CONNECT(DT_SILABS_GECKO_USART_1_IRQ_RX, IRQ_CONNECT(DT_INST_1_SILABS_GECKO_USART_IRQ_RX,
DT_SILABS_GECKO_USART_1_IRQ_RX_PRIORITY, DT_INST_1_SILABS_GECKO_USART_IRQ_RX_PRIORITY,
uart_gecko_isr, DEVICE_GET(usart_1), 0); uart_gecko_isr, DEVICE_GET(usart_1), 0);
IRQ_CONNECT(DT_SILABS_GECKO_USART_1_IRQ_TX, IRQ_CONNECT(DT_INST_1_SILABS_GECKO_USART_IRQ_TX,
DT_SILABS_GECKO_USART_1_IRQ_TX_PRIORITY, DT_INST_1_SILABS_GECKO_USART_IRQ_TX_PRIORITY,
uart_gecko_isr, DEVICE_GET(usart_1), 0); uart_gecko_isr, DEVICE_GET(usart_1), 0);
irq_enable(DT_SILABS_GECKO_USART_1_IRQ_RX); irq_enable(DT_INST_1_SILABS_GECKO_USART_IRQ_RX);
irq_enable(DT_SILABS_GECKO_USART_1_IRQ_TX); irq_enable(DT_INST_1_SILABS_GECKO_USART_IRQ_TX);
} }
#endif #endif
@ -518,30 +518,30 @@ static void usart_gecko_config_func_1(struct device *dev)
#ifdef DT_SILABS_GECKO_USART_2 #ifdef DT_SILABS_GECKO_USART_2
#define PIN_USART2_RXD {DT_SILABS_GECKO_USART_2_LOCATION_RX_1, \ #define PIN_USART2_RXD {DT_INST_2_SILABS_GECKO_USART_LOCATION_RX_1, \
DT_SILABS_GECKO_USART_2_LOCATION_RX_2, gpioModeInput, 1} DT_INST_2_SILABS_GECKO_USART_LOCATION_RX_2, gpioModeInput, 1}
#define PIN_USART2_TXD {DT_SILABS_GECKO_USART_2_LOCATION_TX_1, \ #define PIN_USART2_TXD {DT_INST_2_SILABS_GECKO_USART_LOCATION_TX_1, \
DT_SILABS_GECKO_USART_2_LOCATION_TX_2, gpioModePushPull, 1} DT_INST_2_SILABS_GECKO_USART_LOCATION_TX_2, gpioModePushPull, 1}
#ifdef CONFIG_UART_INTERRUPT_DRIVEN #ifdef CONFIG_UART_INTERRUPT_DRIVEN
static void usart_gecko_config_func_2(struct device *dev); static void usart_gecko_config_func_2(struct device *dev);
#endif #endif
static const struct uart_gecko_config usart_gecko_2_config = { static const struct uart_gecko_config usart_gecko_2_config = {
.base = (USART_TypeDef *)DT_SILABS_GECKO_USART_2_BASE_ADDRESS, .base = (USART_TypeDef *)DT_INST_2_SILABS_GECKO_USART_BASE_ADDRESS,
.clock = cmuClock_USART2, .clock = cmuClock_USART2,
.baud_rate = DT_SILABS_GECKO_USART_2_CURRENT_SPEED, .baud_rate = DT_INST_2_SILABS_GECKO_USART_CURRENT_SPEED,
.pin_rx = PIN_USART2_RXD, .pin_rx = PIN_USART2_RXD,
.pin_tx = PIN_USART2_TXD, .pin_tx = PIN_USART2_TXD,
#ifdef CONFIG_SOC_GECKO_HAS_INDIVIDUAL_PIN_LOCATION #ifdef CONFIG_SOC_GECKO_HAS_INDIVIDUAL_PIN_LOCATION
.loc_rx = DT_SILABS_GECKO_USART_2_LOCATION_RX_0, .loc_rx = DT_INST_2_SILABS_GECKO_USART_LOCATION_RX_0,
.loc_tx = DT_SILABS_GECKO_USART_2_LOCATION_TX_0, .loc_tx = DT_INST_2_SILABS_GECKO_USART_LOCATION_TX_0,
#else #else
#if DT_SILABS_GECKO_USART_2_LOCATION_RX_0 \ #if DT_INST_2_SILABS_GECKO_USART_LOCATION_RX_0 \
!= DT_SILABS_GECKO_USART_2_LOCATION_TX_0 != DT_INST_2_SILABS_GECKO_USART_LOCATION_TX_0
#error USART_2 DTS location-* properties must have identical value #error USART_2 DTS location-* properties must have identical value
#endif #endif
.loc = DT_SILABS_GECKO_USART_2_LOCATION_RX_0, .loc = DT_INST_2_SILABS_GECKO_USART_LOCATION_RX_0,
#endif #endif
#ifdef CONFIG_UART_INTERRUPT_DRIVEN #ifdef CONFIG_UART_INTERRUPT_DRIVEN
.irq_config_func = usart_gecko_config_func_2, .irq_config_func = usart_gecko_config_func_2,
@ -550,7 +550,7 @@ static const struct uart_gecko_config usart_gecko_2_config = {
static struct uart_gecko_data usart_gecko_2_data; static struct uart_gecko_data usart_gecko_2_data;
DEVICE_AND_API_INIT(usart_2, DT_SILABS_GECKO_USART_2_LABEL, DEVICE_AND_API_INIT(usart_2, DT_INST_2_SILABS_GECKO_USART_LABEL,
&uart_gecko_init, &usart_gecko_2_data, &uart_gecko_init, &usart_gecko_2_data,
&usart_gecko_2_config, PRE_KERNEL_1, &usart_gecko_2_config, PRE_KERNEL_1,
CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &uart_gecko_driver_api); CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &uart_gecko_driver_api);
@ -558,15 +558,15 @@ DEVICE_AND_API_INIT(usart_2, DT_SILABS_GECKO_USART_2_LABEL,
#ifdef CONFIG_UART_INTERRUPT_DRIVEN #ifdef CONFIG_UART_INTERRUPT_DRIVEN
static void usart_gecko_config_func_2(struct device *dev) static void usart_gecko_config_func_2(struct device *dev)
{ {
IRQ_CONNECT(DT_SILABS_GECKO_USART_2_IRQ_RX, IRQ_CONNECT(DT_INST_2_SILABS_GECKO_USART_IRQ_RX,
DT_SILABS_GECKO_USART_2_IRQ_RX_PRIORITY, DT_INST_2_SILABS_GECKO_USART_IRQ_RX_PRIORITY,
uart_gecko_isr, DEVICE_GET(usart_2), 0); uart_gecko_isr, DEVICE_GET(usart_2), 0);
IRQ_CONNECT(DT_SILABS_GECKO_USART_2_IRQ_TX, IRQ_CONNECT(DT_INST_2_SILABS_GECKO_USART_IRQ_TX,
DT_SILABS_GECKO_USART_2_IRQ_TX_PRIORITY, DT_INST_2_SILABS_GECKO_USART_IRQ_TX_PRIORITY,
uart_gecko_isr, DEVICE_GET(usart_2), 0); uart_gecko_isr, DEVICE_GET(usart_2), 0);
irq_enable(DT_SILABS_GECKO_USART_2_IRQ_RX); irq_enable(DT_INST_2_SILABS_GECKO_USART_IRQ_RX);
irq_enable(DT_SILABS_GECKO_USART_2_IRQ_TX); irq_enable(DT_INST_2_SILABS_GECKO_USART_IRQ_TX);
} }
#endif #endif
@ -574,30 +574,30 @@ static void usart_gecko_config_func_2(struct device *dev)
#ifdef DT_SILABS_GECKO_USART_3 #ifdef DT_SILABS_GECKO_USART_3
#define PIN_USART3_RXD {DT_SILABS_GECKO_USART_3_LOCATION_RX_1, \ #define PIN_USART3_RXD {DT_INST_3_SILABS_GECKO_USART_LOCATION_RX_1, \
DT_SILABS_GECKO_USART_3_LOCATION_RX_2, gpioModeInput, 1} DT_INST_3_SILABS_GECKO_USART_LOCATION_RX_2, gpioModeInput, 1}
#define PIN_USART3_TXD {DT_SILABS_GECKO_USART_3_LOCATION_TX_1, \ #define PIN_USART3_TXD {DT_INST_3_SILABS_GECKO_USART_LOCATION_TX_1, \
DT_SILABS_GECKO_USART_3_LOCATION_TX_2, gpioModePushPull, 1} DT_INST_3_SILABS_GECKO_USART_LOCATION_TX_2, gpioModePushPull, 1}
#ifdef CONFIG_UART_INTERRUPT_DRIVEN #ifdef CONFIG_UART_INTERRUPT_DRIVEN
static void usart_gecko_config_func_3(struct device *dev); static void usart_gecko_config_func_3(struct device *dev);
#endif #endif
static const struct uart_gecko_config usart_gecko_3_config = { static const struct uart_gecko_config usart_gecko_3_config = {
.base = (USART_TypeDef *)DT_SILABS_GECKO_USART_3_BASE_ADDRESS, .base = (USART_TypeDef *)DT_INST_3_SILABS_GECKO_USART_BASE_ADDRESS,
.clock = cmuClock_USART3, .clock = cmuClock_USART3,
.baud_rate = DT_SILABS_GECKO_USART_3_CURRENT_SPEED, .baud_rate = DT_INST_3_SILABS_GECKO_USART_CURRENT_SPEED,
.pin_rx = PIN_USART3_RXD, .pin_rx = PIN_USART3_RXD,
.pin_tx = PIN_USART3_TXD, .pin_tx = PIN_USART3_TXD,
#ifdef CONFIG_SOC_GECKO_HAS_INDIVIDUAL_PIN_LOCATION #ifdef CONFIG_SOC_GECKO_HAS_INDIVIDUAL_PIN_LOCATION
.loc_rx = DT_SILABS_GECKO_USART_3_LOCATION_RX_0, .loc_rx = DT_INST_3_SILABS_GECKO_USART_LOCATION_RX_0,
.loc_tx = DT_SILABS_GECKO_USART_3_LOCATION_TX_0, .loc_tx = DT_INST_3_SILABS_GECKO_USART_LOCATION_TX_0,
#else #else
#if DT_SILABS_GECKO_USART_3_LOCATION_RX_0 \ #if DT_INST_3_SILABS_GECKO_USART_LOCATION_RX_0 \
!= DT_SILABS_GECKO_USART_3_LOCATION_TX_0 != DT_INST_3_SILABS_GECKO_USART_LOCATION_TX_0
#error USART_3 DTS location-* properties must have identical value #error USART_3 DTS location-* properties must have identical value
#endif #endif
.loc = DT_SILABS_GECKO_USART_3_LOCATION_RX_0, .loc = DT_INST_3_SILABS_GECKO_USART_LOCATION_RX_0,
#endif #endif
#ifdef CONFIG_UART_INTERRUPT_DRIVEN #ifdef CONFIG_UART_INTERRUPT_DRIVEN
.irq_config_func = usart_gecko_config_func_3, .irq_config_func = usart_gecko_config_func_3,
@ -606,7 +606,7 @@ static const struct uart_gecko_config usart_gecko_3_config = {
static struct uart_gecko_data usart_gecko_3_data; static struct uart_gecko_data usart_gecko_3_data;
DEVICE_AND_API_INIT(usart_3, DT_SILABS_GECKO_USART_3_LABEL, DEVICE_AND_API_INIT(usart_3, DT_INST_3_SILABS_GECKO_USART_LABEL,
&uart_gecko_init, &usart_gecko_3_data, &uart_gecko_init, &usart_gecko_3_data,
&usart_gecko_3_config, PRE_KERNEL_1, &usart_gecko_3_config, PRE_KERNEL_1,
CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &uart_gecko_driver_api); CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &uart_gecko_driver_api);
@ -614,15 +614,15 @@ DEVICE_AND_API_INIT(usart_3, DT_SILABS_GECKO_USART_3_LABEL,
#ifdef CONFIG_UART_INTERRUPT_DRIVEN #ifdef CONFIG_UART_INTERRUPT_DRIVEN
static void usart_gecko_config_func_3(struct device *dev) static void usart_gecko_config_func_3(struct device *dev)
{ {
IRQ_CONNECT(DT_SILABS_GECKO_USART_3_IRQ_RX, IRQ_CONNECT(DT_INST_3_SILABS_GECKO_USART_IRQ_RX,
DT_SILABS_GECKO_USART_3_IRQ_RX_PRIORITY, DT_INST_3_SILABS_GECKO_USART_IRQ_RX_PRIORITY,
uart_gecko_isr, DEVICE_GET(usart_3), 0); uart_gecko_isr, DEVICE_GET(usart_3), 0);
IRQ_CONNECT(DT_SILABS_GECKO_USART_3_IRQ_TX, IRQ_CONNECT(DT_INST_3_SILABS_GECKO_USART_IRQ_TX,
DT_SILABS_GECKO_USART_3_IRQ_TX_PRIORITY, DT_INST_3_SILABS_GECKO_USART_IRQ_TX_PRIORITY,
uart_gecko_isr, DEVICE_GET(usart_3), 0); uart_gecko_isr, DEVICE_GET(usart_3), 0);
irq_enable(DT_SILABS_GECKO_USART_3_IRQ_RX); irq_enable(DT_INST_3_SILABS_GECKO_USART_IRQ_RX);
irq_enable(DT_SILABS_GECKO_USART_3_IRQ_TX); irq_enable(DT_INST_3_SILABS_GECKO_USART_IRQ_TX);
} }
#endif #endif

View file

@ -303,9 +303,9 @@ static void audio_driver_config_periph_streams(void)
return; return;
} }
codec_dev = device_get_binding(DT_TI_TLV320DAC_0_LABEL); codec_dev = device_get_binding(DT_INST_0_TI_TLV320DAC_LABEL);
if (!codec_dev) { if (!codec_dev) {
LOG_ERR("unable to find device %s", DT_TI_TLV320DAC_0_LABEL); LOG_ERR("unable to find device %s", DT_INST_0_TI_TLV320DAC_LABEL);
return; return;
} }

View file

@ -140,9 +140,9 @@ static void i2s_audio_init(void)
return; return;
} }
codec_device = device_get_binding(DT_TI_TLV320DAC_0_LABEL); codec_device = device_get_binding(DT_INST_0_TI_TLV320DAC_LABEL);
if (!codec_device) { if (!codec_device) {
LOG_ERR("unable to find " DT_TI_TLV320DAC_0_LABEL " device"); LOG_ERR("unable to find " DT_INST_0_TI_TLV320DAC_LABEL " device");
return; return;
} }

View file

@ -276,20 +276,20 @@
#define DT_ST_LIS2DW12_BUS_SPI 1 #define DT_ST_LIS2DW12_BUS_SPI 1
#endif #endif
#ifndef DT_MICROCHIP_ENC28J60_0_LABEL #ifndef DT_INST_0_MICROCHIP_ENC28J60_LABEL
#define DT_MICROCHIP_ENC28J60_0_BASE_ADDRESS 0 #define DT_INST_0_MICROCHIP_ENC28J60_BASE_ADDRESS 0
#define DT_MICROCHIP_ENC28J60_0_BUS_NAME "" #define DT_INST_0_MICROCHIP_ENC28J60_BUS_NAME ""
#define DT_MICROCHIP_ENC28J60_0_INT_GPIOS_CONTROLLER "" #define DT_INST_0_MICROCHIP_ENC28J60_INT_GPIOS_CONTROLLER ""
#define DT_MICROCHIP_ENC28J60_0_INT_GPIOS_FLAGS 0 #define DT_INST_0_MICROCHIP_ENC28J60_INT_GPIOS_FLAGS 0
#define DT_MICROCHIP_ENC28J60_0_INT_GPIOS_PIN 0 #define DT_INST_0_MICROCHIP_ENC28J60_INT_GPIOS_PIN 0
#define DT_MICROCHIP_ENC28J60_0_LABEL "" #define DT_INST_0_MICROCHIP_ENC28J60_LABEL ""
#define DT_MICROCHIP_ENC28J60_0_LOCAL_MAC_ADDRESS_0 0 #define DT_INST_0_MICROCHIP_ENC28J60_LOCAL_MAC_ADDRESS_0 0
#define DT_MICROCHIP_ENC28J60_0_LOCAL_MAC_ADDRESS_1 0 #define DT_INST_0_MICROCHIP_ENC28J60_LOCAL_MAC_ADDRESS_1 0
#define DT_MICROCHIP_ENC28J60_0_LOCAL_MAC_ADDRESS_2 0 #define DT_INST_0_MICROCHIP_ENC28J60_LOCAL_MAC_ADDRESS_2 0
#define DT_MICROCHIP_ENC28J60_0_LOCAL_MAC_ADDRESS_3 0 #define DT_INST_0_MICROCHIP_ENC28J60_LOCAL_MAC_ADDRESS_3 0
#define DT_MICROCHIP_ENC28J60_0_LOCAL_MAC_ADDRESS_4 0 #define DT_INST_0_MICROCHIP_ENC28J60_LOCAL_MAC_ADDRESS_4 0
#define DT_MICROCHIP_ENC28J60_0_LOCAL_MAC_ADDRESS_5 0 #define DT_INST_0_MICROCHIP_ENC28J60_LOCAL_MAC_ADDRESS_5 0
#define DT_MICROCHIP_ENC28J60_0_SPI_MAX_FREQUENCY 0 #define DT_INST_0_MICROCHIP_ENC28J60_SPI_MAX_FREQUENCY 0
#endif #endif
#endif /* CONFIG_HAS_DTS_SPI */ #endif /* CONFIG_HAS_DTS_SPI */