drivers/uart: introduce SERIAL_SUPPORT_ASYNC option

Not all serial drivers support ASYNC operation and if they do,
they might not support it on every SoC.

Add the SERIAL_SUPPORT_ASYNC option to indicate ASYNC operation
is availiable.

Signed-off-by: Benjamin Valentin <benjamin.valentin@ml-pa.com>
This commit is contained in:
Benjamin Valentin 2019-06-03 14:06:38 +02:00 committed by Anas Nashif
commit 4d89ff1232
3 changed files with 10 additions and 0 deletions

View file

@ -22,6 +22,12 @@ config SERIAL_HAS_DRIVER
to signal that there is a serial driver. This is being used
by other drivers which are dependent on serial.
config SERIAL_SUPPORT_ASYNC
bool
help
This is an option to be enabled by individual serial driver
to signal that the driver and hardware supports async operation.
config SERIAL_SUPPORT_INTERRUPT
bool
help
@ -30,6 +36,7 @@ config SERIAL_SUPPORT_INTERRUPT
config UART_ASYNC_API
bool "Enable new asynchronous UART API [EXPERIMENTAL]"
depends on SERIAL_SUPPORT_ASYNC
help
This option enables new asynchronous UART API.

View file

@ -10,6 +10,7 @@ menuconfig UART_NRFX
default y
select SERIAL_HAS_DRIVER
select SERIAL_SUPPORT_INTERRUPT
select SERIAL_SUPPORT_ASYNC
depends on SOC_FAMILY_NRF
help
Enable support for nrfx UART drivers for nRF MCU series.

View file

@ -9,6 +9,8 @@ menuconfig UART_SAM0
depends on SOC_FAMILY_SAM0
select SERIAL_HAS_DRIVER
select SERIAL_SUPPORT_INTERRUPT
# the ASYNC implementation requires a DMA controller
select SERIAL_SUPPORT_ASYNC if ($(dt_int_val,DT_ATMEL_SAM0_DMAC_0) != 0)
select DMA if UART_ASYNC_API
help
This option enables the SERCOMx USART driver for Atmel SAM0 MCUs.