drivers: mcux_rtc: convert to DT_INST defines

Convert driver to use DT_INST_ defines.  Replace dts_fixup.h use
for DT_RTC_0_NAME with DT_INST_0_NXP_KINETIS_RTC_LABEL to be
consistent.  Also, remove the aliases that had been used for this
driver in various nxp_k*.dtsi.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
Kumar Gala 2020-02-13 12:15:50 -06:00 committed by Kumar Gala
commit e04a367408
9 changed files with 11 additions and 15 deletions

View file

@ -265,26 +265,26 @@ static struct mcux_rtc_data mcux_rtc_data_0;
static void mcux_rtc_irq_config_0(struct device *dev);
static struct mcux_rtc_config mcux_rtc_config_0 = {
.base = (RTC_Type *)DT_NXP_KINETIS_RTC_RTC_0_BASE_ADDRESS,
.base = (RTC_Type *)DT_INST_0_NXP_KINETIS_RTC_BASE_ADDRESS,
.irq_config_func = mcux_rtc_irq_config_0,
.info = {
.max_top_value = UINT32_MAX,
.freq = DT_NXP_KINETIS_RTC_RTC_0_CLOCK_FREQUENCY /
DT_NXP_KINETIS_RTC_RTC_0_PRESCALER,
.freq = DT_INST_0_NXP_KINETIS_RTC_CLOCK_FREQUENCY /
DT_INST_0_NXP_KINETIS_RTC_PRESCALER,
.flags = COUNTER_CONFIG_INFO_COUNT_UP,
.channels = 1,
},
};
DEVICE_AND_API_INIT(rtc, DT_NXP_KINETIS_RTC_RTC_0_LABEL, &mcux_rtc_init,
DEVICE_AND_API_INIT(rtc, DT_INST_0_NXP_KINETIS_RTC_LABEL, &mcux_rtc_init,
&mcux_rtc_data_0, &mcux_rtc_config_0.info,
POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&mcux_rtc_driver_api);
static void mcux_rtc_irq_config_0(struct device *dev)
{
IRQ_CONNECT(DT_NXP_KINETIS_RTC_RTC_0_IRQ_0,
DT_NXP_KINETIS_RTC_RTC_0_IRQ_0_PRIORITY,
IRQ_CONNECT(DT_INST_0_NXP_KINETIS_RTC_IRQ_0,
DT_INST_0_NXP_KINETIS_RTC_IRQ_0_PRIORITY,
mcux_rtc_isr, DEVICE_GET(rtc), 0);
irq_enable(DT_NXP_KINETIS_RTC_RTC_0_IRQ_0);
irq_enable(DT_INST_0_NXP_KINETIS_RTC_IRQ_0);
}