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 <maureen.helm@nxp.com>
This commit is contained in:
parent
5df8b5d63e
commit
93b457f4da
|
@ -290,10 +290,10 @@ static void mcux_lpsci_config_func_0(struct device *dev);
|
||||||
|
|
||||||
static const struct mcux_lpsci_config mcux_lpsci_0_config = {
|
static const struct mcux_lpsci_config mcux_lpsci_0_config = {
|
||||||
.base = UART0,
|
.base = UART0,
|
||||||
.clock_name = DT_UART_MCUX_LPSCI_0_CLOCK_NAME,
|
.clock_name = DT_NXP_KINETIS_LPSCI_UART_0_CLOCK_CONTROLLER,
|
||||||
.clock_subsys =
|
.clock_subsys =
|
||||||
(clock_control_subsys_t)DT_UART_MCUX_LPSCI_0_CLOCK_SUBSYS,
|
(clock_control_subsys_t)DT_NXP_KINETIS_LPSCI_UART_0_CLOCK_NAME,
|
||||||
.baud_rate = DT_NXP_KINETIS_LPSCI_4006A000_CURRENT_SPEED,
|
.baud_rate = DT_NXP_KINETIS_LPSCI_UART_0_CURRENT_SPEED,
|
||||||
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
|
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
|
||||||
.irq_config_func = mcux_lpsci_config_func_0,
|
.irq_config_func = mcux_lpsci_config_func_0,
|
||||||
#endif
|
#endif
|
||||||
|
@ -301,7 +301,7 @@ static const struct mcux_lpsci_config mcux_lpsci_0_config = {
|
||||||
|
|
||||||
static struct mcux_lpsci_data mcux_lpsci_0_data;
|
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_init,
|
||||||
&mcux_lpsci_0_data, &mcux_lpsci_0_config,
|
&mcux_lpsci_0_data, &mcux_lpsci_0_config,
|
||||||
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
|
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
|
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
|
||||||
static void mcux_lpsci_config_func_0(struct device *dev)
|
static void mcux_lpsci_config_func_0(struct device *dev)
|
||||||
{
|
{
|
||||||
IRQ_CONNECT(DT_NXP_KINETIS_LPSCI_4006A000_IRQ_0,
|
IRQ_CONNECT(DT_NXP_KINETIS_LPSCI_UART_0_IRQ_0,
|
||||||
DT_NXP_KINETIS_LPSCI_4006A000_IRQ_0_PRIORITY,
|
DT_NXP_KINETIS_LPSCI_UART_0_IRQ_0_PRIORITY,
|
||||||
mcux_lpsci_isr, DEVICE_GET(uart_0), 0);
|
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
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,6 @@
|
||||||
|
|
||||||
/* SoC level DTS fixup file */
|
/* SoC level DTS fixup file */
|
||||||
#define DT_NUM_IRQ_PRIO_BITS DT_ARM_V6M_NVIC_E000E100_ARM_NUM_IRQ_PRIORITY_BITS
|
#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_BASE_ADDRESS DT_NXP_KINETIS_ADC16_4003B000_BASE_ADDRESS
|
||||||
#define DT_ADC_0_IRQ DT_NXP_KINETIS_ADC16_4003B000_IRQ_0
|
#define DT_ADC_0_IRQ DT_NXP_KINETIS_ADC16_4003B000_IRQ_0
|
||||||
|
|
Loading…
Reference in a new issue