From 93b457f4dac3eae222f045004f3c5d70e7182fdc Mon Sep 17 00:00:00 2001 From: Maureen Helm Date: Fri, 3 Jan 2020 15:45:33 -0600 Subject: [PATCH] drivers: serial: Refactor mcux lpsci driver to use generated dts macros Refactors the mcux lpsci driver to use generated device tree macros directly. Removes now unused dts fixup macros from i.mx rt and kinetis socs. Signed-off-by: Maureen Helm --- drivers/serial/uart_mcux_lpsci.c | 14 +++++++------- soc/arm/nxp_kinetis/kl2x/dts_fixup.h | 3 --- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/drivers/serial/uart_mcux_lpsci.c b/drivers/serial/uart_mcux_lpsci.c index f3c79f53df..2573f4bc16 100644 --- a/drivers/serial/uart_mcux_lpsci.c +++ b/drivers/serial/uart_mcux_lpsci.c @@ -290,10 +290,10 @@ static void mcux_lpsci_config_func_0(struct device *dev); static const struct mcux_lpsci_config mcux_lpsci_0_config = { .base = UART0, - .clock_name = DT_UART_MCUX_LPSCI_0_CLOCK_NAME, + .clock_name = DT_NXP_KINETIS_LPSCI_UART_0_CLOCK_CONTROLLER, .clock_subsys = - (clock_control_subsys_t)DT_UART_MCUX_LPSCI_0_CLOCK_SUBSYS, - .baud_rate = DT_NXP_KINETIS_LPSCI_4006A000_CURRENT_SPEED, + (clock_control_subsys_t)DT_NXP_KINETIS_LPSCI_UART_0_CLOCK_NAME, + .baud_rate = DT_NXP_KINETIS_LPSCI_UART_0_CURRENT_SPEED, #ifdef CONFIG_UART_INTERRUPT_DRIVEN .irq_config_func = mcux_lpsci_config_func_0, #endif @@ -301,7 +301,7 @@ static const struct mcux_lpsci_config mcux_lpsci_0_config = { static struct mcux_lpsci_data mcux_lpsci_0_data; -DEVICE_AND_API_INIT(uart_0, DT_UART_MCUX_LPSCI_0_NAME, +DEVICE_AND_API_INIT(uart_0, DT_NXP_KINETIS_LPSCI_UART_0_LABEL, &mcux_lpsci_init, &mcux_lpsci_0_data, &mcux_lpsci_0_config, PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE, @@ -310,11 +310,11 @@ DEVICE_AND_API_INIT(uart_0, DT_UART_MCUX_LPSCI_0_NAME, #ifdef CONFIG_UART_INTERRUPT_DRIVEN static void mcux_lpsci_config_func_0(struct device *dev) { - IRQ_CONNECT(DT_NXP_KINETIS_LPSCI_4006A000_IRQ_0, - DT_NXP_KINETIS_LPSCI_4006A000_IRQ_0_PRIORITY, + IRQ_CONNECT(DT_NXP_KINETIS_LPSCI_UART_0_IRQ_0, + DT_NXP_KINETIS_LPSCI_UART_0_IRQ_0_PRIORITY, mcux_lpsci_isr, DEVICE_GET(uart_0), 0); - irq_enable(DT_NXP_KINETIS_LPSCI_4006A000_IRQ_0); + irq_enable(DT_NXP_KINETIS_LPSCI_UART_0_IRQ_0); } #endif diff --git a/soc/arm/nxp_kinetis/kl2x/dts_fixup.h b/soc/arm/nxp_kinetis/kl2x/dts_fixup.h index 5c6b3834ba..09998933eb 100644 --- a/soc/arm/nxp_kinetis/kl2x/dts_fixup.h +++ b/soc/arm/nxp_kinetis/kl2x/dts_fixup.h @@ -2,9 +2,6 @@ /* SoC level DTS fixup file */ #define DT_NUM_IRQ_PRIO_BITS DT_ARM_V6M_NVIC_E000E100_ARM_NUM_IRQ_PRIORITY_BITS -#define DT_UART_MCUX_LPSCI_0_NAME DT_NXP_KINETIS_LPSCI_4006A000_LABEL -#define DT_UART_MCUX_LPSCI_0_CLOCK_NAME DT_NXP_KINETIS_LPSCI_4006A000_CLOCK_CONTROLLER -#define DT_UART_MCUX_LPSCI_0_CLOCK_SUBSYS DT_NXP_KINETIS_LPSCI_4006A000_CLOCK_NAME #define DT_ADC_0_BASE_ADDRESS DT_NXP_KINETIS_ADC16_4003B000_BASE_ADDRESS #define DT_ADC_0_IRQ DT_NXP_KINETIS_ADC16_4003B000_IRQ_0