drivers: clock_control: Convert drivers to new DT device macros
Convert clock_control drivers from: DEVICE_AND_API_INIT -> DEVICE_DT{_INST}_DEFINE Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
parent
d1cc8357d8
commit
57a402cd0a
10 changed files with 22 additions and 11 deletions
|
@ -308,8 +308,9 @@ static const struct esp32_clock_config esp32_clock_config0 = {
|
|||
.xtal_div = DT_INST_PROP(0, xtal_div),
|
||||
};
|
||||
|
||||
DEVICE_AND_API_INIT(clk_esp32, DT_INST_LABEL(0),
|
||||
DEVICE_DT_INST_DEFINE(0,
|
||||
&clock_control_esp32_init,
|
||||
device_pm_control_nop,
|
||||
NULL, &esp32_clock_config0,
|
||||
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_OBJECTS,
|
||||
&clock_control_esp32_api);
|
||||
|
|
|
@ -1786,6 +1786,6 @@ static const struct litex_clk_device ldev_init = {
|
|||
.nclkout = NCLKOUT
|
||||
};
|
||||
|
||||
DEVICE_AND_API_INIT(clock, MMCM_NAME,
|
||||
&litex_clk_init, NULL, &ldev_init, POST_KERNEL,
|
||||
DEVICE_DT_DEFINE(DT_NODELABEL(clock0), &litex_clk_init, device_pm_control_nop,
|
||||
NULL, &ldev_init, POST_KERNEL,
|
||||
CONFIG_KERNEL_INIT_PRIORITY_DEVICE, &litex_clk_api);
|
||||
|
|
|
@ -393,8 +393,9 @@ static const struct lpc11u6x_syscon_config syscon_config = {
|
|||
|
||||
static struct lpc11u6x_syscon_data syscon_data;
|
||||
|
||||
DEVICE_AND_API_INIT(lpc11u6x_syscon, DT_INST_LABEL(0),
|
||||
DEVICE_DT_INST_DEFINE(0,
|
||||
&lpc11u6x_syscon_init,
|
||||
device_pm_control_nop,
|
||||
&syscon_data, &syscon_config,
|
||||
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_OBJECTS,
|
||||
&lpc11u6x_clock_control_api);
|
||||
|
|
|
@ -144,8 +144,9 @@ static const struct clock_control_driver_api mcux_ccm_driver_api = {
|
|||
.get_rate = mcux_ccm_get_subsys_rate,
|
||||
};
|
||||
|
||||
DEVICE_AND_API_INIT(mcux_ccm, DT_INST_LABEL(0),
|
||||
DEVICE_DT_INST_DEFINE(0,
|
||||
&mcux_ccm_init,
|
||||
device_pm_control_nop,
|
||||
NULL, NULL,
|
||||
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
|
||||
&mcux_ccm_driver_api);
|
||||
|
|
|
@ -61,8 +61,9 @@ static const struct clock_control_driver_api mcux_mcg_driver_api = {
|
|||
.get_rate = mcux_mcg_get_rate,
|
||||
};
|
||||
|
||||
DEVICE_AND_API_INIT(mcux_mcg, DT_INST_LABEL(0),
|
||||
DEVICE_DT_INST_DEFINE(0,
|
||||
&mcux_mcg_init,
|
||||
device_pm_control_nop,
|
||||
NULL, NULL,
|
||||
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
|
||||
&mcux_mcg_driver_api);
|
||||
|
|
|
@ -74,8 +74,9 @@ static const struct clock_control_driver_api mcux_pcc_api = {
|
|||
.base_address = DT_INST_REG_ADDR(inst) \
|
||||
}; \
|
||||
\
|
||||
DEVICE_AND_API_INIT(mcux_pcc##inst, DT_INST_LABEL(inst), \
|
||||
DEVICE_DT_INST_DEFINE(inst, \
|
||||
&mcux_pcc_init, \
|
||||
device_pm_control_nop, \
|
||||
NULL, &mcux_pcc##inst##_config, \
|
||||
PRE_KERNEL_1, \
|
||||
CONFIG_KERNEL_INIT_PRIORITY_OBJECTS, \
|
||||
|
|
|
@ -109,8 +109,9 @@ static const struct clock_control_driver_api mcux_scg_driver_api = {
|
|||
.get_rate = mcux_scg_get_rate,
|
||||
};
|
||||
|
||||
DEVICE_AND_API_INIT(mcux_scg, DT_INST_LABEL(0),
|
||||
DEVICE_DT_INST_DEFINE(0,
|
||||
&mcux_scg_init,
|
||||
device_pm_control_nop,
|
||||
NULL, NULL,
|
||||
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
|
||||
&mcux_scg_driver_api);
|
||||
|
|
|
@ -56,6 +56,7 @@ static int mcux_sim_get_subsys_rate(const struct device *dev,
|
|||
}
|
||||
|
||||
#if DT_NODE_HAS_STATUS(DT_INST(0, nxp_kinetis_ke1xf_sim), okay)
|
||||
#define NXP_KINETIS_SIM_NODE DT_INST(0, nxp_kinetis_ke1xf_sim)
|
||||
#define NXP_KINETIS_SIM_LABEL DT_LABEL(DT_INST(0, nxp_kinetis_ke1xf_sim))
|
||||
#if DT_NODE_HAS_PROP(DT_INST(0, nxp_kinetis_ke1xf_sim), clkout_source)
|
||||
#define NXP_KINETIS_SIM_CLKOUT_SOURCE \
|
||||
|
@ -67,6 +68,7 @@ static int mcux_sim_get_subsys_rate(const struct device *dev,
|
|||
#endif
|
||||
#else
|
||||
#define NXP_KINETIS_SIM_LABEL DT_LABEL(DT_INST(0, nxp_kinetis_sim))
|
||||
#define NXP_KINETIS_SIM_NODE DT_INST(0, nxp_kinetis_sim)
|
||||
#if DT_NODE_HAS_PROP(DT_INST(0, nxp_kinetis_sim), clkout_source)
|
||||
#define NXP_KINETIS_SIM_CLKOUT_SOURCE \
|
||||
DT_PROP(DT_INST(0, nxp_kinetis_sim), clkout_source)
|
||||
|
@ -97,8 +99,9 @@ static const struct clock_control_driver_api mcux_sim_driver_api = {
|
|||
.get_rate = mcux_sim_get_subsys_rate,
|
||||
};
|
||||
|
||||
DEVICE_AND_API_INIT(mcux_sim, NXP_KINETIS_SIM_LABEL,
|
||||
DEVICE_DT_DEFINE(NXP_KINETIS_SIM_NODE,
|
||||
&mcux_sim_init,
|
||||
device_pm_control_nop,
|
||||
NULL, NULL,
|
||||
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
|
||||
&mcux_sim_driver_api);
|
||||
|
|
|
@ -91,8 +91,9 @@ static const struct clock_control_driver_api mcux_lpc_syscon_api = {
|
|||
|
||||
#define LPC_CLOCK_INIT(n) \
|
||||
\
|
||||
DEVICE_AND_API_INIT(mcux_lpc_syscon_##n, DT_INST_LABEL(n), \
|
||||
DEVICE_DT_INST_DEFINE(n, \
|
||||
&mcux_lpc_syscon_clock_control_init, \
|
||||
device_pm_control_nop, \
|
||||
NULL, NULL, \
|
||||
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, \
|
||||
&mcux_lpc_syscon_api);
|
||||
|
|
|
@ -67,8 +67,9 @@ static const struct clock_control_driver_api rv32m1_pcc_api = {
|
|||
.base_address = DT_INST_REG_ADDR(inst) \
|
||||
}; \
|
||||
\
|
||||
DEVICE_AND_API_INIT(rv32m1_pcc##inst, DT_INST_LABEL(inst), \
|
||||
DEVICE_DT_INST_DEFINE(inst, \
|
||||
&rv32m1_pcc_init, \
|
||||
device_pm_control_nop, \
|
||||
NULL, &rv32m1_pcc##inst##_config, \
|
||||
PRE_KERNEL_1, \
|
||||
CONFIG_KERNEL_INIT_PRIORITY_OBJECTS, \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue