serial: introduce SERIAL_SUPPORT_INTERRUPT Kconfig option

As not all drivers support interrupts we don't have a means to know if
we can allow UART_INTERRUPT_DRIVEN to be enabled and thus various
Kconfig options that select UART_INTERRUPT_DRIVEN.  Some drivers have a
interrupts, however not all do.  So introduce a Kconfig option to let us
know what the driver actually supports.

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
Kumar Gala 2017-06-22 11:26:58 -05:00 committed by Anas Nashif
parent fe882f407d
commit 461b5018d3
15 changed files with 19 additions and 13 deletions

View file

@ -25,10 +25,18 @@ config SERIAL_HAS_DRIVER
to signal that there is a serial driver. This is being used to signal that there is a serial driver. This is being used
by other drivers which are dependent on serial. by other drivers which are dependent on serial.
config SERIAL_SUPPORT_INTERRUPT
bool
default n
help
This is an option to be enabled by individual serial driver
to signal that the driver and hardware supports interrupts.
config UART_INTERRUPT_DRIVEN config UART_INTERRUPT_DRIVEN
bool bool
prompt "Enable UART Interrupt support" prompt "Enable UART Interrupt support"
default n default n
depends on SERIAL_SUPPORT_INTERRUPT
help help
This option enables interrupt support for UART allowing console This option enables interrupt support for UART allowing console
input and other UART based drivers. input and other UART based drivers.

View file

@ -3,6 +3,7 @@ menuconfig UART_CC32XX
bool "CC32XX UART driver" bool "CC32XX UART driver"
default n default n
select SERIAL_HAS_DRIVER select SERIAL_HAS_DRIVER
select SERIAL_SUPPORT_INTERRUPT
depends on SOC_FAMILY_TISIMPLELINK depends on SOC_FAMILY_TISIMPLELINK
help help
This option enables the CC32XX UART driver, for UART_0. This option enables the CC32XX UART driver, for UART_0.

View file

@ -10,6 +10,7 @@ menuconfig UART_CMSDK_APB
bool "ARM CMSDK APB UART driver" bool "ARM CMSDK APB UART driver"
default n default n
select SERIAL_HAS_DRIVER select SERIAL_HAS_DRIVER
select SERIAL_SUPPORT_INTERRUPT
depends on SOC_FAMILY_ARM depends on SOC_FAMILY_ARM
help help
This option enables the UART driver for ARM CMSDK APB UART. This option enables the UART driver for ARM CMSDK APB UART.

View file

@ -10,6 +10,7 @@ menuconfig UART_FE310
depends on SOC_RISCV32_FE310 depends on SOC_RISCV32_FE310
default n default n
select SERIAL_HAS_DRIVER select SERIAL_HAS_DRIVER
select SERIAL_SUPPORT_INTERRUPT
help help
This option enables the SiFive Freedom E310 serial driver. This option enables the SiFive Freedom E310 serial driver.

View file

@ -10,6 +10,7 @@ menuconfig UART_MCUX
depends on HAS_MCUX depends on HAS_MCUX
default n default n
select SERIAL_HAS_DRIVER select SERIAL_HAS_DRIVER
select SERIAL_SUPPORT_INTERRUPT
help help
Enable the MCUX uart driver. Enable the MCUX uart driver.

View file

@ -10,6 +10,7 @@ menuconfig UART_MCUX_LPSCI
depends on HAS_MCUX && HAS_LPSCI depends on HAS_MCUX && HAS_LPSCI
default n default n
select SERIAL_HAS_DRIVER select SERIAL_HAS_DRIVER
select SERIAL_SUPPORT_INTERRUPT
help help
Enable the MCUX LPSCI driver. Enable the MCUX LPSCI driver.

View file

@ -10,6 +10,7 @@ menuconfig UART_MCUX_LPUART
depends on HAS_MCUX && HAS_LPUART depends on HAS_MCUX && HAS_LPUART
default n default n
select SERIAL_HAS_DRIVER select SERIAL_HAS_DRIVER
select SERIAL_SUPPORT_INTERRUPT
help help
Enable the MCUX LPUART driver. Enable the MCUX LPUART driver.

View file

@ -9,6 +9,7 @@ menuconfig UART_NRF5
bool "Nordic Semiconductor NRF5 family processor UART driver" bool "Nordic Semiconductor NRF5 family processor UART driver"
default n default n
select SERIAL_HAS_DRIVER select SERIAL_HAS_DRIVER
select SERIAL_SUPPORT_INTERRUPT
depends on SOC_FAMILY_NRF5 depends on SOC_FAMILY_NRF5
select GPIO_NRF5 select GPIO_NRF5
help help

View file

@ -2,6 +2,7 @@ menuconfig UART_NS16550
bool "NS16550 serial driver" bool "NS16550 serial driver"
default n default n
select SERIAL_HAS_DRIVER select SERIAL_HAS_DRIVER
select SERIAL_SUPPORT_INTERRUPT
help help
This option enables the NS16550 serial driver. This option enables the NS16550 serial driver.
This driver can be used for the serial hardware This driver can be used for the serial hardware

View file

@ -3,6 +3,7 @@ menuconfig UART_QMSI
bool "QMSI UART driver" bool "QMSI UART driver"
default n default n
select SERIAL_HAS_DRIVER select SERIAL_HAS_DRIVER
select SERIAL_SUPPORT_INTERRUPT
help help
This option enables the QMSI UART driver. This option enables the QMSI UART driver.

View file

@ -2,6 +2,7 @@ menuconfig UART_STELLARIS
bool "Stellaris serial driver" bool "Stellaris serial driver"
default n default n
select SERIAL_HAS_DRIVER select SERIAL_HAS_DRIVER
select SERIAL_SUPPORT_INTERRUPT
help help
This option enables the Stellaris serial driver. This option enables the Stellaris serial driver.
This specific driver can be used for the serial hardware This specific driver can be used for the serial hardware

View file

@ -9,6 +9,7 @@ menuconfig UART_STM32
bool "STM32 MCU serial driver" bool "STM32 MCU serial driver"
default n default n
select SERIAL_HAS_DRIVER select SERIAL_HAS_DRIVER
select SERIAL_SUPPORT_INTERRUPT
depends on SOC_FAMILY_STM32 depends on SOC_FAMILY_STM32
help help
This option enables the UART driver for STM32F10x family of This option enables the UART driver for STM32F10x family of

View file

@ -85,11 +85,6 @@ static const struct uart_driver_api uart_altera_jtag_driver_api = {
.poll_in = NULL, .poll_in = NULL,
.poll_out = &uart_altera_jtag_poll_out, .poll_out = &uart_altera_jtag_poll_out,
.err_check = NULL, .err_check = NULL,
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
#error "Interrupt-driven Altera JTAG UART not implemented yet"
#endif
}; };
static const struct uart_device_config uart_altera_jtag_dev_cfg_0 = { static const struct uart_device_config uart_altera_jtag_dev_cfg_0 = {

View file

@ -52,11 +52,6 @@ static const struct uart_driver_api esp32_uart_api = {
.poll_in = &esp32_uart_rx, .poll_in = &esp32_uart_rx,
.poll_out = &esp32_uart_tx, .poll_out = &esp32_uart_tx,
.err_check = NULL, .err_check = NULL,
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
#error "Interrupt-driven ESP32 UART not implemented yet"
#endif
}; };
DEVICE_AND_API_INIT(esp32_uart, "ROMUART", DEVICE_AND_API_INIT(esp32_uart, "ROMUART",

View file

@ -38,9 +38,6 @@ static const struct uart_driver_api uart_riscv_qemu_driver_api = {
.poll_in = uart_riscv_qemu_poll_in, .poll_in = uart_riscv_qemu_poll_in,
.poll_out = uart_riscv_qemu_poll_out, .poll_out = uart_riscv_qemu_poll_out,
.err_check = NULL, .err_check = NULL,
#ifdef CONFIG_UART_INTERRUPT_DRIVEN
#error "Interrupt not available in uart riscv32-qemu"
#endif
}; };
static const struct uart_device_config uart_riscv_qemu_dev_cfg_0 = { static const struct uart_device_config uart_riscv_qemu_dev_cfg_0 = {