drivers: i2c: Convert drivers to new DT device macros

Convert i2c drivers from:

DEVICE_AND_API_INIT -> DEVICE_DT_INST_DEFINE
DEVICE_GET -> DEVICE_DT_INST_GET
DEVICE_DECLARE -> DEVICE_DT_INST_DECLARE

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
Kumar Gala 2020-12-09 11:00:35 -06:00 committed by Maureen Helm
parent b0db87193e
commit 071e7adefb
22 changed files with 67 additions and 65 deletions

View file

@ -23,7 +23,7 @@ LOG_MODULE_REGISTER(i2c_cc13xx_cc26xx);
#include "i2c-priv.h"
DEVICE_DECLARE(i2c_cc13xx_cc26xx);
DEVICE_DT_INST_DECLARE(0);
struct i2c_cc13xx_cc26xx_data {
struct k_sem lock;
@ -439,7 +439,7 @@ static int i2c_cc13xx_cc26xx_init(const struct device *dev)
IRQ_CONNECT(DT_INST_IRQN(0),
DT_INST_IRQ(0, priority),
i2c_cc13xx_cc26xx_isr, DEVICE_GET(i2c_cc13xx_cc26xx), 0);
i2c_cc13xx_cc26xx_isr, DEVICE_DT_INST_GET(0), 0);
irq_enable(DT_INST_IRQN(0));
/* Configure IOC module to route SDA and SCL signals */
@ -475,7 +475,7 @@ static struct i2c_cc13xx_cc26xx_data i2c_cc13xx_cc26xx_data = {
.error = I2C_MASTER_ERR_NONE
};
DEVICE_DEFINE(i2c_cc13xx_cc26xx, DT_INST_LABEL(0),
DEVICE_DT_INST_DEFINE(0,
i2c_cc13xx_cc26xx_init,
i2c_cc13xx_cc26xx_pm_control,
&i2c_cc13xx_cc26xx_data, &i2c_cc13xx_cc26xx_config,

View file

@ -382,7 +382,7 @@ static const struct i2c_cc32xx_config i2c_cc32xx_config = {
static struct i2c_cc32xx_data i2c_cc32xx_data;
DEVICE_AND_API_INIT(i2c_cc32xx, DT_INST_LABEL(0), &i2c_cc32xx_init,
DEVICE_DT_INST_DEFINE(0, &i2c_cc32xx_init, device_pm_control_nop,
&i2c_cc32xx_data, &i2c_cc32xx_config,
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&i2c_cc32xx_driver_api);
@ -391,7 +391,7 @@ static void configure_i2c_irq(const struct i2c_cc32xx_config *config)
{
IRQ_CONNECT(DT_INST_IRQN(0),
DT_INST_IRQ(0, priority),
i2c_cc32xx_isr, DEVICE_GET(i2c_cc32xx), 0);
i2c_cc32xx_isr, DEVICE_DT_INST_GET(0), 0);
irq_enable(config->irq_no);
}

View file

@ -22,8 +22,7 @@ static const struct i2c_dw_rom_config i2c_config_dw_@NUM@ = {
static struct i2c_dw_dev_config i2c_@NUM@_runtime;
DEVICE_AND_API_INIT(i2c_@NUM@, DT_INST_LABEL(@NUM@),
&i2c_dw_initialize,
DEVICE_DT_INST_DEFINE(@NUM@, &i2c_dw_initialize, device_pm_control_nop,
&i2c_@NUM@_runtime, &i2c_config_dw_@NUM@,
POST_KERNEL, CONFIG_I2C_INIT_PRIORITY,
&funcs);
@ -56,7 +55,7 @@ static void i2c_config_@NUM@(const struct device *port)
irq_connect_dynamic(irq,
DT_INST_IRQ(@NUM@, priority),
(void (*)(const void *))i2c_dw_isr,
DEVICE_GET(i2c_@NUM@), INST_@NUM@_IRQ_FLAGS);
DEVICE_DT_INST_GET(@NUM@), INST_@NUM@_IRQ_FLAGS);
pcie_irq_enable(DT_INST_REG_ADDR(@NUM@), irq);
#else
@ -65,7 +64,7 @@ static void i2c_config_@NUM@(const struct device *port)
IRQ_CONNECT(DT_INST_IRQN(@NUM@),
DT_INST_IRQ(@NUM@, priority),
i2c_dw_isr, DEVICE_GET(i2c_@NUM@),
i2c_dw_isr, DEVICE_DT_INST_GET(@NUM@),
INST_@NUM@_IRQ_FLAGS);
pcie_irq_enable(DT_INST_REG_ADDR(@NUM@),
DT_INST_IRQN(@NUM@));
@ -77,7 +76,7 @@ static void i2c_config_@NUM@(const struct device *port)
IRQ_CONNECT(DT_INST_IRQN(@NUM@),
DT_INST_IRQ(@NUM@, priority),
i2c_dw_isr, DEVICE_GET(i2c_@NUM@),
i2c_dw_isr, DEVICE_DT_INST_GET(@NUM@),
INST_@NUM@_IRQ_FLAGS);
irq_enable(DT_INST_IRQN(@NUM@));

View file

@ -143,9 +143,9 @@ static struct i2c_driver_api i2c_emul_api = {
.num_children = ARRAY_SIZE(emuls_##n), \
}; \
static struct i2c_emul_data i2c_emul_data_##n; \
DEVICE_AND_API_INIT(i2c_##n, \
DT_INST_LABEL(n), \
DEVICE_DT_INST_DEFINE(n, \
i2c_emul_init, \
device_pm_control_nop, \
&i2c_emul_data_##n, \
&i2c_emul_cfg_##n, \
POST_KERNEL, \

View file

@ -579,12 +579,12 @@ static const struct i2c_driver_api i2c_esp32_driver_api = {
};
#if DT_NODE_HAS_STATUS(DT_DRV_INST(0), okay)
DEVICE_DECLARE(i2c_esp32_0);
DEVICE_DT_INST_DECLARE(0);
static void i2c_esp32_connect_irq_0(void)
{
IRQ_CONNECT(CONFIG_I2C_ESP32_0_IRQ, 1, i2c_esp32_isr,
DEVICE_GET(i2c_esp32_0), 0);
DEVICE_DT_INST_GET(0), 0);
}
static const struct i2c_esp32_config i2c_esp32_config_0 = {
@ -618,19 +618,19 @@ static const struct i2c_esp32_config i2c_esp32_config_0 = {
static struct i2c_esp32_data i2c_esp32_data_0;
DEVICE_AND_API_INIT(i2c_esp32_0, DT_INST_LABEL(0), &i2c_esp32_init,
DEVICE_DT_INST_DEFINE(0, &i2c_esp32_init, device_pm_control_nop,
&i2c_esp32_data_0, &i2c_esp32_config_0,
POST_KERNEL, CONFIG_I2C_INIT_PRIORITY,
&i2c_esp32_driver_api);
#endif /* DT_NODE_HAS_STATUS(DT_DRV_INST(0), okay) */
#if DT_NODE_HAS_STATUS(DT_DRV_INST(1), okay)
DEVICE_DECLARE(i2c_esp32_1);
DEVICE_DT_INST_DECLARE(1);
static void i2c_esp32_connect_irq_1(void)
{
IRQ_CONNECT(CONFIG_I2C_ESP32_1_IRQ, 1, i2c_esp32_isr,
DEVICE_GET(i2c_esp32_1), 0);
DEVICE_DT_INST_GET(1), 0);
}
static const struct i2c_esp32_config i2c_esp32_config_1 = {
@ -664,7 +664,7 @@ static const struct i2c_esp32_config i2c_esp32_config_1 = {
static struct i2c_esp32_data i2c_esp32_data_1;
DEVICE_AND_API_INIT(i2c_esp32_1, DT_INST_LABEL(1), &i2c_esp32_init,
DEVICE_DT_INST_DEFINE(1, &i2c_esp32_init, device_pm_control_nop,
&i2c_esp32_data_1, &i2c_esp32_config_1,
POST_KERNEL, CONFIG_I2C_INIT_PRIORITY,
&i2c_esp32_driver_api);

View file

@ -224,8 +224,8 @@ static const struct i2c_gecko_config i2c_gecko_config_0 = {
static struct i2c_gecko_data i2c_gecko_data_0;
DEVICE_AND_API_INIT(i2c_gecko_0, DT_INST_LABEL(0),
&i2c_gecko_init, &i2c_gecko_data_0, &i2c_gecko_config_0,
DEVICE_DT_INST_DEFINE(0, &i2c_gecko_init, device_pm_control_nop,
&i2c_gecko_data_0, &i2c_gecko_config_0,
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&i2c_gecko_driver_api);
#endif /* DT_NODE_HAS_STATUS(DT_DRV_INST(0), okay) */
@ -257,8 +257,8 @@ static const struct i2c_gecko_config i2c_gecko_config_1 = {
static struct i2c_gecko_data i2c_gecko_data_1;
DEVICE_AND_API_INIT(i2c_gecko_1, DT_INST_LABEL(1),
&i2c_gecko_init, &i2c_gecko_data_1, &i2c_gecko_config_1,
DEVICE_DT_INST_DEFINE(1, &i2c_gecko_init, device_pm_control_nop,
&i2c_gecko_data_1, &i2c_gecko_config_1,
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&i2c_gecko_driver_api);
#endif /* DT_NODE_HAS_STATUS(DT_DRV_INST(1), okay) */

View file

@ -182,8 +182,9 @@ static const struct i2c_gpio_config i2c_gpio_dev_cfg_##_num = { \
.bitrate = DT_INST_PROP(_num, clock_frequency), \
}; \
\
DEVICE_AND_API_INIT(i2c_gpio_##_num, DT_INST_LABEL(_num), \
DEVICE_DT_INST_DEFINE(_num, \
i2c_gpio_init, \
device_pm_control_nop, \
&i2c_gpio_dev_data_##_num, \
&i2c_gpio_dev_cfg_##_num, \
POST_KERNEL, CONFIG_I2C_INIT_PRIORITY, &api);

View file

@ -371,8 +371,9 @@ static const struct i2c_driver_api i2c_imx_driver_api = {
\
static struct i2c_imx_data i2c_imx_data_##n; \
\
DEVICE_AND_API_INIT(i2c_imx_##n, DT_INST_LABEL(n), \
DEVICE_DT_INST_DEFINE(n, \
&i2c_imx_init, \
device_pm_control_nop, \
&i2c_imx_data_##n, &i2c_imx_config_##n, \
POST_KERNEL, \
CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \
@ -384,7 +385,7 @@ static const struct i2c_driver_api i2c_imx_driver_api = {
\
IRQ_CONNECT(DT_INST_IRQN(n), \
DT_INST_IRQ(n, priority), \
i2c_imx_isr, DEVICE_GET(i2c_imx_##n), 0); \
i2c_imx_isr, DEVICE_DT_INST_GET(n), 0); \
\
irq_enable(DT_INST_IRQN(n)); \
}

View file

@ -126,9 +126,9 @@ static const struct i2c_driver_api i2c_litex_driver_api = {
\
static struct i2c_bitbang i2c_bitbang_##n; \
\
DEVICE_AND_API_INIT(litex_i2c_##n, \
DT_INST_LABEL(n), \
DEVICE_DT_INST_DEFINE(n, \
i2c_litex_init, \
device_pm_control_nop, \
&i2c_bitbang_##n, \
&i2c_litex_cfg_##n, \
POST_KERNEL, \

View file

@ -401,8 +401,9 @@ static const struct lpc11u6x_i2c_config i2c_cfg_##idx = { \
\
static struct lpc11u6x_i2c_data i2c_data_##idx; \
\
DEVICE_AND_API_INIT(lpc11u6x_i2c_##idx, DT_INST_LABEL(idx), \
DEVICE_DT_INST_DEFINE(idx, \
&lpc11u6x_i2c_init, \
device_pm_control_nop, \
&i2c_data_##idx, &i2c_cfg_##idx, \
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_OBJECTS, \
&i2c_api); \
@ -411,7 +412,7 @@ static void lpc11u6x_i2c_isr_config_##idx(const struct device *dev) \
{ \
IRQ_CONNECT(DT_INST_IRQN(idx), \
DT_INST_IRQ(idx, priority), \
lpc11u6x_i2c_isr, DEVICE_GET(lpc11u6x_i2c_##idx), 0); \
lpc11u6x_i2c_isr, DEVICE_DT_INST_GET(idx), 0); \
\
irq_enable(DT_INST_IRQN(idx)); \
}

View file

@ -424,9 +424,8 @@ static int i2c_xec_init(const struct device *dev)
DT_INST_REG_ADDR(n), \
.port_sel = DT_INST_PROP(n, port_sel), \
}; \
DEVICE_AND_API_INIT(i2c_xec_##n, \
DT_INST_LABEL(n), \
&i2c_xec_init, &i2c_xec_data_##n, &i2c_xec_config_##n, \
DEVICE_DT_INST_DEFINE(n, &i2c_xec_init, device_pm_control_nop, \
&i2c_xec_data_##n, &i2c_xec_config_##n, \
POST_KERNEL, CONFIG_I2C_INIT_PRIORITY, \
&i2c_xec_driver_api);

View file

@ -230,9 +230,9 @@ static const struct i2c_driver_api i2c_mcux_driver_api = {
\
static struct i2c_mcux_data i2c_mcux_data_ ## n; \
\
DEVICE_AND_API_INIT(i2c_mcux_ ## n, \
DT_INST_LABEL(n), \
&i2c_mcux_init, &i2c_mcux_data_ ## n, \
DEVICE_DT_INST_DEFINE(n, \
&i2c_mcux_init, device_pm_control_nop, \
&i2c_mcux_data_ ## n, \
&i2c_mcux_config_ ## n, POST_KERNEL, \
CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \
&i2c_mcux_driver_api); \
@ -242,7 +242,7 @@ static const struct i2c_driver_api i2c_mcux_driver_api = {
IRQ_CONNECT(DT_INST_IRQN(n), \
DT_INST_IRQ(n, priority), \
i2c_mcux_isr, \
DEVICE_GET(i2c_mcux_ ## n), 0); \
DEVICE_DT_INST_GET(n), 0); \
\
irq_enable(DT_INST_IRQN(n)); \
}

View file

@ -232,9 +232,9 @@ static const struct i2c_driver_api mcux_flexcomm_driver_api = {
.bitrate = DT_INST_PROP(id, clock_frequency), \
}; \
static struct mcux_flexcomm_data mcux_flexcomm_data_##id; \
DEVICE_AND_API_INIT(mcux_flexcomm_##id, \
DT_INST_LABEL(id), \
DEVICE_DT_INST_DEFINE(id, \
&mcux_flexcomm_init, \
device_pm_control_nop, \
&mcux_flexcomm_data_##id, \
&mcux_flexcomm_config_##id, \
POST_KERNEL, \
@ -245,7 +245,7 @@ static const struct i2c_driver_api mcux_flexcomm_driver_api = {
IRQ_CONNECT(DT_INST_IRQN(id), \
DT_INST_IRQ(id, priority), \
mcux_flexcomm_isr, \
DEVICE_GET(mcux_flexcomm_##id), \
DEVICE_DT_INST_GET(id), \
0); \
irq_enable(DT_INST_IRQN(id)); \
} \

View file

@ -251,8 +251,8 @@ static const struct i2c_driver_api mcux_lpi2c_driver_api = {
\
static struct mcux_lpi2c_data mcux_lpi2c_data_##n; \
\
DEVICE_AND_API_INIT(mcux_lpi2c_##n, DT_INST_LABEL(n), \
&mcux_lpi2c_init, &mcux_lpi2c_data_##n, \
DEVICE_DT_INST_DEFINE(n, &mcux_lpi2c_init, device_pm_control_nop,\
&mcux_lpi2c_data_##n, \
&mcux_lpi2c_config_##n, POST_KERNEL, \
CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \
&mcux_lpi2c_driver_api); \
@ -262,7 +262,7 @@ static const struct i2c_driver_api mcux_lpi2c_driver_api = {
IRQ_CONNECT(DT_INST_IRQN(n), \
DT_INST_IRQ(n, priority), \
mcux_lpi2c_isr, \
DEVICE_GET(mcux_lpi2c_##n), 0); \
DEVICE_DT_INST_GET(n), 0); \
\
irq_enable(DT_INST_IRQN(n)); \
}

View file

@ -165,7 +165,7 @@ static struct i2c_nios2_config i2c_nios2_cfg = {
},
};
DEVICE_AND_API_INIT(i2c_nios2_0, DT_INST_LABEL(0), &i2c_nios2_init,
DEVICE_DT_INST_DEFINE(0, &i2c_nios2_init, device_pm_control_nop,
NULL, &i2c_nios2_cfg,
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&i2c_nios2_driver_api);
@ -190,7 +190,7 @@ static int i2c_nios2_init(const struct device *dev)
alt_avalon_i2c_int_clear(&config->i2c_dev,
ALT_AVALON_I2C_ISR_ALL_CLEARABLE_INTS_MSK);
IRQ_CONNECT(I2C_0_IRQ, CONFIG_I2C_0_IRQ_PRI,
i2c_nios2_isr, DEVICE_GET(i2c_nios2_0), 0);
i2c_nios2_isr, DEVICE_DT_INST_GET(0), 0);
irq_enable(I2C_0_IRQ);
return 0;
}

View file

@ -280,9 +280,9 @@ static const struct i2c_driver_api rv32m1_lpi2c_driver_api = {
.completion_sync = Z_SEM_INITIALIZER( \
rv32m1_lpi2c_##id##_data.completion_sync, 0, 1), \
}; \
DEVICE_AND_API_INIT(rv32m1_lpi2c_##id, \
DT_INST_LABEL(id), \
DEVICE_DT_INST_DEFINE(id, \
&rv32m1_lpi2c_init, \
device_pm_control_nop, \
&rv32m1_lpi2c_##id##_data, \
&rv32m1_lpi2c_##id##_config, \
POST_KERNEL, CONFIG_I2C_INIT_PRIORITY, \
@ -291,7 +291,7 @@ static const struct i2c_driver_api rv32m1_lpi2c_driver_api = {
{ \
IRQ_CONNECT(DT_INST_IRQN(id), \
0, \
rv32m1_lpi2c_isr, DEVICE_GET(rv32m1_lpi2c_##id), \
rv32m1_lpi2c_isr, DEVICE_DT_INST_GET(id), \
0); \
irq_enable(DT_INST_IRQN(id)); \
} \

View file

@ -751,7 +751,7 @@ static const struct i2c_driver_api i2c_sam0_driver_api = {
IRQ_CONNECT(DT_INST_IRQ_BY_IDX(n, m, irq), \
DT_INST_IRQ_BY_IDX(n, m, priority), \
i2c_sam0_isr, \
DEVICE_GET(i2c_sam0_##n), 0); \
DEVICE_DT_INST_GET(n), 0); \
irq_enable(DT_INST_IRQ_BY_IDX(n, m, irq)); \
} while (0)
@ -799,9 +799,9 @@ static const struct i2c_sam0_dev_config i2c_sam0_dev_config_##n = { \
static void i2c_sam0_irq_config_##n(const struct device *dev); \
I2C_SAM0_CONFIG(n); \
static struct i2c_sam0_dev_data i2c_sam0_dev_data_##n; \
DEVICE_AND_API_INIT(i2c_sam0_##n, \
DT_INST_LABEL(n), \
DEVICE_DT_INST_DEFINE(n, \
&i2c_sam0_initialize, \
device_pm_control_nop, \
&i2c_sam0_dev_data_##n, \
&i2c_sam0_dev_config_##n, POST_KERNEL, \
CONFIG_I2C_INIT_PRIORITY, \

View file

@ -607,13 +607,13 @@ static const struct i2c_driver_api i2c_sam_twim_driver_api = {
.hs_data_strength_low = DT_INST_ENUM_IDX(n, hs_data_strength_low)
#define I2C_TWIM_SAM_INIT(n) \
static const struct device DEVICE_NAME_GET(i2c##n##_sam); \
DEVICE_DT_INST_DECLARE(n); \
\
static void i2c##n##_sam_irq_config(void) \
{ \
IRQ_CONNECT(DT_INST_IRQN(n), DT_INST_IRQ(n, priority), \
i2c_sam_twim_isr, \
DEVICE_GET(i2c##n##_sam), 0); \
DEVICE_DT_INST_GET(n), 0); \
} \
\
static const struct soc_gpio_pin pins_twim##n[] = \
@ -633,8 +633,8 @@ static const struct i2c_driver_api i2c_sam_twim_driver_api = {
\
static struct i2c_sam_twim_dev_data i2c##n##_sam_data; \
\
DEVICE_AND_API_INIT(i2c##n##_sam, DT_INST_LABEL(n), \
&i2c_sam_twim_initialize, \
DEVICE_DT_INST_DEFINE(n, &i2c_sam_twim_initialize, \
device_pm_control_nop, \
&i2c##n##_sam_data, &i2c##n##_sam_config, \
POST_KERNEL, CONFIG_I2C_INIT_PRIORITY, \
&i2c_sam_twim_driver_api)

View file

@ -339,13 +339,13 @@ static const struct i2c_driver_api i2c_sam_twi_driver_api = {
};
#define I2C_TWI_SAM_INIT(n) \
DEVICE_DECLARE(i2c##n##_sam); \
DEVICE_DT_INST_DECLARE(n); \
\
static void i2c##n##_sam_irq_config(void) \
{ \
IRQ_CONNECT(DT_INST_IRQN(n), DT_INST_IRQ(n, priority), \
i2c_sam_twi_isr, \
DEVICE_GET(i2c##n##_sam), 0); \
DEVICE_DT_INST_GET(n), 0); \
} \
\
static const struct soc_gpio_pin pins_twi##n[] = \
@ -363,8 +363,8 @@ static const struct i2c_driver_api i2c_sam_twi_driver_api = {
\
static struct i2c_sam_twi_dev_data i2c##n##_sam_data; \
\
DEVICE_AND_API_INIT(i2c##n##_sam, DT_INST_LABEL(n), \
&i2c_sam_twi_initialize, \
DEVICE_DT_INST_DEFINE(n, &i2c_sam_twi_initialize, \
device_pm_control_nop, \
&i2c##n##_sam_data, &i2c##n##_sam_config, \
POST_KERNEL, CONFIG_I2C_INIT_PRIORITY, \
&i2c_sam_twi_driver_api);

View file

@ -326,13 +326,13 @@ static const struct i2c_driver_api i2c_sam_twihs_driver_api = {
};
#define I2C_TWIHS_SAM_INIT(n) \
DEVICE_DECLARE(i2c##n##_sam); \
DEVICE_DT_INST_DECLARE(n); \
\
static void i2c##n##_sam_irq_config(void) \
{ \
IRQ_CONNECT(DT_INST_IRQN(n), DT_INST_IRQ(n, priority), \
i2c_sam_twihs_isr, \
DEVICE_GET(i2c##n##_sam), 0); \
DEVICE_DT_INST_GET(n), 0); \
} \
\
static const struct soc_gpio_pin pins_twihs##n[] = \
@ -350,8 +350,8 @@ static const struct i2c_driver_api i2c_sam_twihs_driver_api = {
\
static struct i2c_sam_twihs_dev_data i2c##n##_sam_data; \
\
DEVICE_AND_API_INIT(i2c##n##_sam, DT_INST_LABEL(n), \
&i2c_sam_twihs_initialize, \
DEVICE_DT_INST_DEFINE(n, &i2c_sam_twihs_initialize, \
device_pm_control_nop, \
&i2c##n##_sam_data, &i2c##n##_sam_config, \
POST_KERNEL, CONFIG_I2C_INIT_PRIORITY, \
&i2c_sam_twihs_driver_api);

View file

@ -116,8 +116,9 @@ static const struct i2c_sbcon_config i2c_sbcon_dev_cfg_##_num = { \
.sbcon = (void *)DT_INST_REG_ADDR(_num), \
}; \
\
DEVICE_AND_API_INIT(i2c_sbcon_##_num, DT_INST_LABEL(_num), \
DEVICE_DT_INST_DEFINE(_num, \
i2c_sbcon_init, \
device_pm_control_nop, \
&i2c_sbcon_dev_data_##_num, \
&i2c_sbcon_dev_cfg_##_num, \
PRE_KERNEL_2, CONFIG_I2C_INIT_PRIORITY, &api);

View file

@ -329,9 +329,9 @@ static struct i2c_driver_api i2c_sifive_api = {
.f_sys = DT_INST_PROP(n, input_frequency), \
.f_bus = DT_INST_PROP(n, clock_frequency), \
}; \
DEVICE_AND_API_INIT(i2c_##n, \
DT_INST_LABEL(n), \
DEVICE_DT_INST_DEFINE(n \
i2c_sifive_init, \
device_pm_control_nop, \
NULL, \
&i2c_sifive_cfg_##n, \
POST_KERNEL, \