drivers: serial: Add instances to mcux lpuart shim driver

Adds instances 2 and 3 to the mcux lpuart shim driver.

Signed-off-by: Maureen Helm <maureen.helm@nxp.com>
This commit is contained in:
Maureen Helm 2018-09-24 11:12:57 -05:00 committed by Anas Nashif
commit 00d60055fb
2 changed files with 86 additions and 0 deletions

View file

@ -25,4 +25,14 @@ menuconfig UART_MCUX_LPUART_1
help
Enable UART 1.
menuconfig UART_MCUX_LPUART_2
bool "UART 2"
help
Enable UART 2.
menuconfig UART_MCUX_LPUART_3
bool "UART 3"
help
Enable UART 3.
endif # UART_MCUX_LPUART

View file

@ -359,3 +359,79 @@ static void mcux_lpuart_config_func_1(struct device *dev)
#endif
#endif /* CONFIG_UART_MCUX_LPUART_1 */
#ifdef CONFIG_UART_MCUX_LPUART_2
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
static void mcux_lpuart_config_func_2(struct device *dev);
#endif
static const struct mcux_lpuart_config mcux_lpuart_2_config = {
.base = (LPUART_Type *) CONFIG_UART_MCUX_LPUART_2_BASE_ADDRESS,
.clock_name = CONFIG_UART_MCUX_LPUART_2_CLOCK_NAME,
.clock_subsys =
(clock_control_subsys_t)CONFIG_UART_MCUX_LPUART_2_CLOCK_SUBSYS,
.baud_rate = CONFIG_UART_MCUX_LPUART_2_BAUD_RATE,
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
.irq_config_func = mcux_lpuart_config_func_2,
#endif
};
static struct mcux_lpuart_data mcux_lpuart_2_data;
DEVICE_AND_API_INIT(uart_2, CONFIG_UART_MCUX_LPUART_2_NAME,
&mcux_lpuart_init,
&mcux_lpuart_2_data, &mcux_lpuart_2_config,
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&mcux_lpuart_driver_api);
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
static void mcux_lpuart_config_func_2(struct device *dev)
{
IRQ_CONNECT(CONFIG_UART_MCUX_LPUART_2_IRQ,
CONFIG_UART_MCUX_LPUART_2_IRQ_PRI,
mcux_lpuart_isr, DEVICE_GET(uart_2), 0);
irq_enable(CONFIG_UART_MCUX_LPUART_2_IRQ);
}
#endif
#endif /* CONFIG_UART_MCUX_LPUART_2 */
#ifdef CONFIG_UART_MCUX_LPUART_3
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
static void mcux_lpuart_config_func_3(struct device *dev);
#endif
static const struct mcux_lpuart_config mcux_lpuart_3_config = {
.base = (LPUART_Type *) CONFIG_UART_MCUX_LPUART_3_BASE_ADDRESS,
.clock_name = CONFIG_UART_MCUX_LPUART_3_CLOCK_NAME,
.clock_subsys =
(clock_control_subsys_t)CONFIG_UART_MCUX_LPUART_3_CLOCK_SUBSYS,
.baud_rate = CONFIG_UART_MCUX_LPUART_3_BAUD_RATE,
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
.irq_config_func = mcux_lpuart_config_func_3,
#endif
};
static struct mcux_lpuart_data mcux_lpuart_3_data;
DEVICE_AND_API_INIT(uart_3, CONFIG_UART_MCUX_LPUART_3_NAME,
&mcux_lpuart_init,
&mcux_lpuart_3_data, &mcux_lpuart_3_config,
PRE_KERNEL_1, CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&mcux_lpuart_driver_api);
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
static void mcux_lpuart_config_func_3(struct device *dev)
{
IRQ_CONNECT(CONFIG_UART_MCUX_LPUART_3_IRQ,
CONFIG_UART_MCUX_LPUART_3_IRQ_PRI,
mcux_lpuart_isr, DEVICE_GET(uart_3), 0);
irq_enable(CONFIG_UART_MCUX_LPUART_3_IRQ);
}
#endif
#endif /* CONFIG_UART_MCUX_LPUART_3 */