drivers: counter: Refactor mcux rtc driver to use generated dts macros
Refactors the mcux rtc driver to use generated device tree macros directly. Removes now unused dts fixup macros from kinetis socs. Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
This commit is contained in:
parent
94c5a75998
commit
9329c0db27
5 changed files with 8 additions and 21 deletions
|
@ -259,25 +259,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_RTC_MCUX_0_BASE_ADDRESS,
|
||||
.base = (RTC_Type *)DT_NXP_KINETIS_RTC_RTC_0_BASE_ADDRESS,
|
||||
.irq_config_func = mcux_rtc_irq_config_0,
|
||||
.info = {
|
||||
.max_top_value = UINT32_MAX,
|
||||
.freq = DT_INST_0_NXP_KINETIS_RTC_CLOCK_FREQUENCY /
|
||||
DT_INST_0_NXP_KINETIS_RTC_PRESCALER,
|
||||
.freq = DT_NXP_KINETIS_RTC_RTC_0_CLOCK_FREQUENCY /
|
||||
DT_NXP_KINETIS_RTC_RTC_0_PRESCALER,
|
||||
.flags = COUNTER_CONFIG_INFO_COUNT_UP,
|
||||
.channels = 1,
|
||||
},
|
||||
};
|
||||
|
||||
DEVICE_AND_API_INIT(rtc, DT_RTC_MCUX_0_NAME, &mcux_rtc_init,
|
||||
DEVICE_AND_API_INIT(rtc, DT_NXP_KINETIS_RTC_RTC_0_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_RTC_MCUX_0_IRQ, DT_RTC_MCUX_0_IRQ_PRI,
|
||||
IRQ_CONNECT(DT_NXP_KINETIS_RTC_RTC_0_IRQ_0,
|
||||
DT_NXP_KINETIS_RTC_RTC_0_IRQ_0_PRIORITY,
|
||||
mcux_rtc_isr, DEVICE_GET(rtc), 0);
|
||||
irq_enable(DT_RTC_MCUX_0_IRQ);
|
||||
irq_enable(DT_NXP_KINETIS_RTC_RTC_0_IRQ_0);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue