drivers: uart_mcux_flexcomm: Merge conditions for enabling ISR

Merges the condition for `UART_INTERRUPT_DRIVEN || UART_ASYNC_API` into
`UART_MCUX_FLEXCOMM_ISR_SUPPORT`.

Signed-off-by: Alp Sayin <alpsayin@gmail.com>
This commit is contained in:
Alp Sayin 2023-07-03 19:00:52 +01:00 committed by Carles Cufí
parent 657cbe3a8f
commit 3a4419eff0
2 changed files with 14 additions and 7 deletions

View file

@ -14,3 +14,10 @@ config UART_MCUX_FLEXCOMM
select PINCTRL
help
Enable the MCUX USART driver.
config UART_MCUX_FLEXCOMM_ISR_SUPPORT
bool
depends on UART_MCUX_FLEXCOMM
default y if UART_INTERRUPT_DRIVEN || UART_ASYNC_API
help
Enable UART interrupt service routine.

View file

@ -39,7 +39,7 @@ struct mcux_flexcomm_config {
clock_control_subsys_t clock_subsys;
uint32_t baud_rate;
uint8_t parity;
#if defined(CONFIG_UART_INTERRUPT_DRIVEN) || defined(CONFIG_UART_ASYNC_API)
#ifdef CONFIG_UART_MCUX_FLEXCOMM_ISR_SUPPORT
void (*irq_config_func)(const struct device *dev);
#endif
const struct pinctrl_dev_config *pincfg;
@ -916,7 +916,7 @@ static int flexcomm_uart_async_init(const struct device *dev)
#endif /* CONFIG_UART_ASYNC_API */
#if defined(CONFIG_UART_INTERRUPT_DRIVEN) || defined(CONFIG_UART_ASYNC_API)
#ifdef CONFIG_UART_MCUX_FLEXCOMM_ISR_SUPPORT
static void mcux_flexcomm_isr(const struct device *dev)
{
struct mcux_flexcomm_data *data = dev->data;
@ -985,9 +985,9 @@ static void mcux_flexcomm_isr(const struct device *dev)
}
}
#endif
#endif /* CONFIG_UART_ASYNC_API */
}
#endif
#endif /* CONFIG_UART_MCUX_FLEXCOMM_ISR_SUPPORT */
static int mcux_flexcomm_init(const struct device *dev)
@ -1042,7 +1042,7 @@ static int mcux_flexcomm_init(const struct device *dev)
USART_Init(config->base, &usart_config, clock_freq);
#if defined(CONFIG_UART_INTERRUPT_DRIVEN) || defined(CONFIG_UART_ASYNC_API)
#ifdef CONFIG_UART_MCUX_FLEXCOMM_ISR_SUPPORT
config->irq_config_func(dev);
#endif
@ -1091,7 +1091,7 @@ static const struct uart_driver_api mcux_flexcomm_driver_api = {
};
#if defined(CONFIG_UART_INTERRUPT_DRIVEN) || defined(CONFIG_UART_ASYNC_API)
#ifdef CONFIG_UART_MCUX_FLEXCOMM_ISR_SUPPORT
#define UART_MCUX_FLEXCOMM_IRQ_CFG_FUNC(n) \
static void mcux_flexcomm_irq_config_func_##n(const struct device *dev) \
{ \
@ -1106,7 +1106,7 @@ static const struct uart_driver_api mcux_flexcomm_driver_api = {
#else
#define UART_MCUX_FLEXCOMM_IRQ_CFG_FUNC(n)
#define UART_MCUX_FLEXCOMM_IRQ_CFG_FUNC_INIT(n)
#endif /* defined(CONFIG_UART_INTERRUPT_DRIVEN) || defined(CONFIG_UART_ASYNC_API) */
#endif /* CONFIG_UART_MCUX_FLEXCOMM_ISR_SUPPORT */
#ifdef CONFIG_UART_ASYNC_API
#define UART_MCUX_FLEXCOMM_TX_TIMEOUT_FUNC(n) \