uart: logging: Add configurable log level to UART drivers

This change adds compile-time selection of log level for
the UART drivers.

Signed-off-by: Pete Dietl <petedietl@gmail.com>
This commit is contained in:
Pete Dietl 2022-03-04 12:56:05 -08:00 committed by Anas Nashif
commit 060e39e75a
7 changed files with 13 additions and 8 deletions

View file

@ -37,6 +37,10 @@ config SERIAL_INIT_PRIORITY
help
Serial driver device initialization priority.
module = UART
module-str = uart
source "subsys/logging/Kconfig.template.log_config"
config SERIAL_SUPPORT_WIDE_DATA
bool
help

View file

@ -16,10 +16,10 @@
#include <device.h>
#include <init.h>
#include <kernel.h>
#include <logging/log.h>
#include <sys/device_mmio.h>
LOG_MODULE_REGISTER(uart_hvc_xen);
#include <logging/log.h>
LOG_MODULE_REGISTER(uart_hvc_xen, CONFIG_UART_LOG_LEVEL);
static struct hvc_xen_data hvc_data = {0};

View file

@ -16,7 +16,7 @@
#include <soc.h>
#include <logging/log.h>
LOG_MODULE_REGISTER(uart_ite_it8xxx2, LOG_LEVEL_ERR);
LOG_MODULE_REGISTER(uart_ite_it8xxx2, CONFIG_UART_LOG_LEVEL);
#if defined(CONFIG_PM_DEVICE) && defined(CONFIG_UART_CONSOLE_INPUT_EXPIRED)
static struct uart_it8xxx2_data *uart_console_data;

View file

@ -13,7 +13,7 @@
#include <sys/sys_io.h>
#include <logging/log.h>
LOG_MODULE_REGISTER(uart_neorv32, CONFIG_LOG_DEFAULT_LEVEL);
LOG_MODULE_REGISTER(uart_neorv32, CONFIG_UART_LOG_LEVEL);
/* NEORV32 UART registers offsets */
#define NEORV32_UART_CTRL_OFFSET 0x00

View file

@ -18,7 +18,7 @@
#include "soc_power.h"
#include <logging/log.h>
LOG_MODULE_REGISTER(uart_npcx, LOG_LEVEL_ERR);
LOG_MODULE_REGISTER(uart_npcx, CONFIG_UART_LOG_LEVEL);
/* Driver config */
struct uart_npcx_config {

View file

@ -15,9 +15,10 @@
#include <sys/util.h>
#include <kernel.h>
#include <soc.h>
#include <logging/log.h>
#include <helpers/nrfx_gppi.h>
LOG_MODULE_REGISTER(uart_nrfx_uarte, LOG_LEVEL_ERR);
#include <logging/log.h>
LOG_MODULE_REGISTER(uart_nrfx_uarte, CONFIG_UART_LOG_LEVEL);
#ifdef CONFIG_PINCTRL
#include <drivers/pinctrl.h>

View file

@ -36,7 +36,7 @@
#include <stm32_ll_lpuart.h>
#include <logging/log.h>
LOG_MODULE_REGISTER(uart_stm32);
LOG_MODULE_REGISTER(uart_stm32, CONFIG_UART_LOG_LEVEL);
#define HAS_LPUART_1 (DT_NODE_HAS_COMPAT_STATUS(DT_NODELABEL(lpuart1), \
st_stm32_lpuart, okay))