zephyr/drivers/serial
Erwan Gouriou a3de3df5dc drivers/uart: stm32: Fix pm_constraint handling
Introduce new logic to set/release pm_constraint during serial TX
transactions.

First change is to introduce an internal flag and utility functions
to control the set/release constraint balancing per uart device.
This way, whatever the mix of transactions or API calls, we
ensure a single uart device can only do 1 or 0 to the PM state
constraint. Constraint can't then be set more than once, released w/o
having been set or released more than it was set.

The last part of the change reworks the triggers for constraints
set/release operations.
In order not to disturb driver operations, if irq driven mode or PM is
enabled, don't enable TC interrupt handling by default.
Instead, map the pm_constraint setting to the way TC flag is handled
in normal mode of operations (irq driven or async).
As a consequence, in irq driven mode, pm_constraint is set/released on
tx_enable/tx_disable api calls, which gives API user full control
on transaction protection vs low power operations.
Finally, we emulate the same behavior on TX poll transaction, by
enabling TC irq at the start of a stream and disabling TC irq once
stream is completed. This is controlled with a dedicated device flag.


Signed-off-by: Erwan Gouriou <erwan.gouriou@linaro.org>
2021-09-21 10:47:56 -04:00
..
CMakeLists.txt Microchip: MEC172x: Add UART driver 2021-08-09 16:21:33 -04:00
Kconfig Microchip: MEC172x: Add UART driver 2021-08-09 16:21:33 -04:00
Kconfig.altera_jtag drivers: uart_altera_jtag_hal: use DEVICE_DT_INST_DEFINE() 2021-08-23 18:53:47 -04:00
Kconfig.apbuart serial: apbuart interrupt support 2020-11-13 14:53:55 -08:00
Kconfig.b91 drivers: serial: introduce new Telink B91 Serial driver 2021-07-21 05:37:12 -04:00
Kconfig.cc13xx_cc26xx drivers: cc13xx_cc26xx: use DT_INST_FOREACH to reduce code duplication 2020-04-23 17:29:53 -05:00
Kconfig.cc32xx kconfig: Turn pointless/confusing 'menuconfig's into 'config's 2019-10-22 13:53:06 -05:00
Kconfig.cmsdk_apb kconfig: Clean up header comments and make them consistent 2019-11-04 17:31:27 -05:00
Kconfig.esp32 kconfig: Turn pointless/confusing 'menuconfig's into 'config's 2019-10-22 13:53:06 -05:00
Kconfig.esp32c3_rom drivers: serial: added minimal uart driver for esp32c3 2021-08-03 11:20:06 -05:00
Kconfig.esp32s2_rom esp32s2: drivers: serial: add minimal uart driver 2021-08-09 13:03:14 -04:00
Kconfig.gecko kconfig: Clean up header comments and make them consistent 2019-11-04 17:31:27 -05:00
Kconfig.imx drivers: serial: uart_imx: Convert driver to new DT_INST macros 2020-04-04 09:34:00 -05:00
Kconfig.leuart_gecko kconfig: Clean up header comments and make them consistent 2019-11-04 17:31:27 -05:00
Kconfig.litex kconfig: Clean up header comments and make them consistent 2019-11-04 17:31:27 -05:00
Kconfig.lpc11u6x drivers: serial: Add support for LPC11U6X UART controllers 2020-07-29 20:12:24 +02:00
Kconfig.mcux drivers: serial: uart_mcux: Convert to DT_INST 2020-04-14 17:52:31 -05:00
Kconfig.mcux_flexcomm drivers: uart: mcux_flexcomm: Convert to DT_INST 2020-04-28 16:54:30 -05:00
Kconfig.mcux_iuart drivers: serial: Add NXP IUART driver 2020-08-14 14:51:50 -05:00
Kconfig.mcux_lpsci drivers: uart: mcux_lpsci: Convert to DT_INST 2020-04-28 16:54:30 -05:00
Kconfig.mcux_lpuart drivers: uart: mcux_lpuart: Convert to DT_INST 2020-04-20 15:50:45 -05:00
Kconfig.miv drivers: serial: uart_miv: Fix build errors 2021-05-10 13:15:50 -05:00
Kconfig.msp432p4xx kconfig: Turn pointless/confusing 'menuconfig's into 'config's 2019-10-22 13:53:06 -05:00
Kconfig.native_posix drivers: serial: native_posix: Convert 2nd UART to be devicetree based 2021-02-18 09:06:21 +01:00
Kconfig.npcx driver: npcx7: fixed typo in Kconfig.npcx files. 2020-12-07 12:11:17 -05:00
Kconfig.nrfx drivers: serial: nrf_uarte: Conditionally call PPI driver 2021-05-07 12:11:32 +02:00
Kconfig.ns16550 drivers: uart_ns16550: Remove CMake-based templating 2021-04-22 15:30:24 -05:00
Kconfig.numicro driver: serial: replace suffix nuvoton with numicro 2021-08-07 20:37:24 -04:00
Kconfig.pl011 drivers: pl011: add SBSA mode 2021-01-24 13:59:55 -05:00
Kconfig.psoc6 drivers: serial: psoc6: Add interrupts support 2021-04-27 09:27:45 -05:00
Kconfig.rcar drivers: uart: Add "Interrupt driven" to R-Car 2021-07-13 09:42:22 -04:00
Kconfig.rtt tracing: fix conflict with RTT locking 2021-05-25 07:36:38 -05:00
Kconfig.rv32m1_lpuart kconfig: Clean up header comments and make them consistent 2019-11-04 17:31:27 -05:00
Kconfig.sam0 kconfig: Clean up header comments and make them consistent 2019-11-04 17:31:27 -05:00
Kconfig.sifive drivers: serial: sifive: support SiFive Freedom series SoCs 2021-09-03 09:52:26 -04:00
Kconfig.stellaris arm: Removed support for CC2650 2020-01-18 09:27:55 -06:00
Kconfig.stm32 drivers: dma: stm32 dma driver for a new dma version 2021-07-22 04:52:53 -04:00
Kconfig.test drivers: serial: add a dummy driver for vnd,serial 2021-07-14 11:10:08 -05:00
Kconfig.uart_sam drivers: serial: uart_sam: rework device tree support 2020-04-18 17:04:08 -05:00
Kconfig.usart_sam drivers: serial: usart_sam: rework device tree support 2020-04-18 17:04:08 -05:00
Kconfig.xec Microchip: MEC172x: Add UART driver 2021-08-09 16:21:33 -04:00
Kconfig.xlnx drivers: serial: add driver for the Xilinx UART Lite IP 2020-08-14 13:35:39 -05:00
Kconfig.xmc4xxx drivers: serial: add XMC seris UART support 2020-05-09 14:21:44 +02:00
leuart_gecko.c drivers: serial: remove usage of device_pm_control_nop 2021-04-28 12:25:39 -04:00
serial_test.c drivers: serial: add a dummy driver for vnd,serial 2021-07-14 11:10:08 -05:00
uart_altera_jtag_hal.c drivers: uart_altera_jtag_hal: use DEVICE_DT_INST_DEFINE() 2021-08-23 18:53:47 -04:00
uart_apbuart.c serial: introduce CONFIG_UART_USE_RUNTIME_CONFIGURE 2021-06-07 12:09:01 +02:00
uart_b91.c drivers: serial: b91: full duplex mode support 2021-08-20 06:23:24 -04:00
uart_cc13xx_cc26xx.c pm: use actions for device PM control 2021-08-04 08:23:01 -04:00
uart_cc32xx.c drivers: serial: remove usage of device_pm_control_nop 2021-04-28 12:25:39 -04:00
uart_cmsdk_apb.c drivers: serial: remove usage of device_pm_control_nop 2021-04-28 12:25:39 -04:00
uart_esp32.c esp32: drivers: interrupt_controller: review UART interrupt usage 2021-07-16 07:19:28 -04:00
uart_gecko.c drivers: serial: remove usage of device_pm_control_nop 2021-04-28 12:25:39 -04:00
uart_handlers.c device: Const-ify all device driver instance pointers 2020-09-02 13:48:13 +02:00
uart_imx.c drivers: serial: remove usage of device_pm_control_nop 2021-04-28 12:25:39 -04:00
uart_liteuart.c drivers: serial: remove usage of device_pm_control_nop 2021-04-28 12:25:39 -04:00
uart_lpc11u6x.c serial: introduce CONFIG_UART_USE_RUNTIME_CONFIGURE 2021-06-07 12:09:01 +02:00
uart_lpc11u6x.h device: Const-ify all device driver instance pointers 2020-09-02 13:48:13 +02:00
uart_mchp_xec.c Microchip: MEC172x: Add UART driver 2021-08-09 16:21:33 -04:00
uart_mcux.c serial: introduce CONFIG_UART_USE_RUNTIME_CONFIGURE 2021-06-07 12:09:01 +02:00
uart_mcux_flexcomm.c driver/uart: add enum parity element on devicetree bindings 2021-06-11 08:53:10 -05:00
uart_mcux_iuart.c drivers: serial: remove usage of device_pm_control_nop 2021-04-28 12:25:39 -04:00
uart_mcux_lpsci.c drivers: serial: remove usage of device_pm_control_nop 2021-04-28 12:25:39 -04:00
uart_mcux_lpuart.c drivers: serial: NXP: Enable flow control for uart_mcux_lpuart 2021-08-12 14:49:09 -05:00
uart_miv.c drivers: serial: uart_miv: Fix build errors 2021-05-10 13:15:50 -05:00
uart_msp432p4xx.c drivers: serial: remove usage of device_pm_control_nop 2021-04-28 12:25:39 -04:00
uart_native_posix.c drivers: Fix missing auto_attach_cmd 2021-06-09 16:18:17 +02:00
uart_npcx.c pm: use actions for device PM control 2021-08-04 08:23:01 -04:00
uart_nrfx_uart.c drivers: serial: nrf: Make pull-ups on UART pins configurable 2021-08-06 19:17:26 -04:00
uart_nrfx_uarte.c drivers: serial: nrf: Make pull-ups on UART pins configurable 2021-08-06 19:17:26 -04:00
uart_ns16550.c drivers: serial: ns16550: fix uart initialization 2021-09-13 07:06:33 -04:00
uart_ns16550.h drivers: serial: ns16550: move header from /include/ 2019-06-25 15:27:00 -04:00
uart_numicro.c driver: serial: replace suffix nuvoton with numicro 2021-08-07 20:37:24 -04:00
uart_pl011.c drivers: serial: remove usage of device_pm_control_nop 2021-04-28 12:25:39 -04:00
uart_psoc6.c drivers: serial: remove usage of device_pm_control_nop 2021-04-28 12:25:39 -04:00
uart_rcar.c drivers: uart: Add "Interrupt driven" to R-Car 2021-07-13 09:42:22 -04:00
uart_rom_esp32c3.c drivers: serial: added minimal uart driver for esp32c3 2021-08-03 11:20:06 -05:00
uart_rom_esp32s2.c esp32s2: drivers: serial: add minimal uart driver 2021-08-09 13:03:14 -04:00
uart_rtt.c drivers: serial: remove usage of device_pm_control_nop 2021-04-28 12:25:39 -04:00
uart_rv32m1_lpuart.c drivers: serial: remove usage of device_pm_control_nop 2021-04-28 12:25:39 -04:00
uart_sam.c soc: atmel_sam: Add _INST to ATMEL_SAM_DT_PIN* macros 2021-06-14 09:50:41 -05:00
uart_sam0.c drivers: serial: uart_sam0: Fix async tx done event triggering to early. 2021-09-19 19:31:25 -04:00
uart_sifive.c drivers: serial: remove usage of device_pm_control_nop 2021-04-28 12:25:39 -04:00
uart_stellaris.c drivers: serial: remove usage of device_pm_control_nop 2021-04-28 12:25:39 -04:00
uart_stm32.c drivers/uart: stm32: Fix pm_constraint handling 2021-09-21 10:47:56 -04:00
uart_stm32.h drivers/uart: stm32: Fix pm_constraint handling 2021-09-21 10:47:56 -04:00
uart_xlnx_ps.c serial: introduce CONFIG_UART_USE_RUNTIME_CONFIGURE 2021-06-07 12:09:01 +02:00
uart_xlnx_uartlite.c drivers: serial: remove usage of device_pm_control_nop 2021-04-28 12:25:39 -04:00
uart_xmc4xxx.c drivers: serial: remove usage of device_pm_control_nop 2021-04-28 12:25:39 -04:00
usart_sam.c soc: atmel_sam: Add _INST to ATMEL_SAM_DT_PIN* macros 2021-06-14 09:50:41 -05:00