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);
}

View file

@ -30,7 +30,6 @@
pwm-1 = &pwm1;
pwm-2 = &pwm2;
pwm-3 = &pwm3;
rtc-0 = &rtc0;
spi-0 = &spi0;
spi-1 = &spi1;
spi-2 = &spi2;

View file

@ -31,7 +31,6 @@
pwm-1 = &pwm1;
pwm-2 = &pwm2;
pwm-3 = &pwm3;
rtc-0 = &rtc;
spi-0 = &spi0;
spi-1 = &spi1;
spi-2 = &spi2;

View file

@ -12,7 +12,6 @@
/ {
aliases {
rtc-0 = &rtc0;
watchdog0 = &wdog0;
uart-0 = &uart0;
uart-1 = &uart1;

View file

@ -19,7 +19,6 @@
pwm-0 = &pwm0;
pwm-1 = &pwm1;
pwm-2 = &pwm2;
rtc-0 = &rtc0;
spi-0 = &spi0;
spi-1 = &spi1;
uart-0 = &lpuart0;

View file

@ -13,7 +13,7 @@
#define DT_ADC_1_IRQ_PRI DT_NXP_KINETIS_ADC16_400BB000_IRQ_0_PRIORITY
#define DT_ADC_1_NAME DT_NXP_KINETIS_ADC16_400BB000_LABEL
#define DT_RTC_0_NAME DT_NXP_KINETIS_RTC_4003D000_LABEL
#define DT_RTC_0_NAME DT_INST_0_NXP_KINETIS_RTC_LABEL
#define DT_FLASH_DEV_BASE_ADDRESS DT_NXP_KINETIS_FTFE_40020000_BASE_ADDRESS
#define DT_FLASH_DEV_NAME DT_NXP_KINETIS_FTFE_40020000_LABEL

View file

@ -17,7 +17,7 @@
#define CONFIG_ENTROPY_NAME DT_NXP_KINETIS_TRNG_400A0000_LABEL
#define DT_RTC_0_NAME DT_NXP_KINETIS_RTC_4003D000_LABEL
#define DT_RTC_0_NAME DT_INST_0_NXP_KINETIS_RTC_LABEL
#define DT_USBD_KINETIS_NAME DT_NXP_KINETIS_USBD_40072000_LABEL
#define DT_USBD_KINETIS_IRQ DT_NXP_KINETIS_USBD_40072000_IRQ_USB_OTG

View file

@ -7,7 +7,7 @@
/* SoC level DTS fixup file */
#define DT_NUM_IRQ_PRIO_BITS DT_ARM_V7M_NVIC_E000E100_ARM_NUM_IRQ_PRIORITY_BITS
#define DT_RTC_0_NAME DT_NXP_KINETIS_RTC_4003D000_LABEL
#define DT_RTC_0_NAME DT_INST_0_NXP_KINETIS_RTC_LABEL
#define DT_FLASH_DEV_BASE_ADDRESS DT_NXP_KINETIS_FTFE_40020000_BASE_ADDRESS
#define DT_FLASH_DEV_NAME DT_NXP_KINETIS_FTFE_40020000_LABEL

View file

@ -7,7 +7,7 @@
#define DT_ADC_0_IRQ_PRI DT_NXP_KINETIS_ADC16_4003B000_IRQ_0_PRIORITY
#define DT_ADC_0_NAME DT_NXP_KINETIS_ADC16_4003B000_LABEL
#define DT_RTC_0_NAME DT_NXP_KINETIS_RTC_4003D000_LABEL
#define DT_RTC_0_NAME DT_INST_0_NXP_KINETIS_RTC_LABEL
#if defined(CONFIG_SOC_MKW22D5) || defined(CONFIG_SOC_MKW24D5)
#define DT_NUM_IRQ_PRIO_BITS DT_ARM_V7M_NVIC_E000E100_ARM_NUM_IRQ_PRIORITY_BITS