From bbb2f8277a7e9320c9dee06e98cdb3801238f4dc Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Wed, 9 Nov 2022 12:49:28 -0800 Subject: [PATCH] uart: ns16550: move command macro to public header This moves the CMD_SET_DLF command macro to public header so application can use it without weird include path to include the "private" header file under drivers/serial. Signed-off-by: Daniel Leung --- drivers/serial/uart_ns16550.c | 2 +- drivers/serial/uart_ns16550.h | 4 +++- include/zephyr/drivers/serial/uart_ns16550.h | 23 ++++++++++++++++++++ 3 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 include/zephyr/drivers/serial/uart_ns16550.h diff --git a/drivers/serial/uart_ns16550.c b/drivers/serial/uart_ns16550.c index 45e325db9ec..ba2b22e24d0 100644 --- a/drivers/serial/uart_ns16550.c +++ b/drivers/serial/uart_ns16550.c @@ -34,7 +34,7 @@ #include #include -#include "uart_ns16550.h" +#include #define INST_HAS_PCP_HELPER(inst) DT_INST_NODE_HAS_PROP(inst, pcp) || #define INST_HAS_DLF_HELPER(inst) DT_INST_NODE_HAS_PROP(inst, dlf) || diff --git a/drivers/serial/uart_ns16550.h b/drivers/serial/uart_ns16550.h index de217dac5a8..97584c49ef1 100644 --- a/drivers/serial/uart_ns16550.h +++ b/drivers/serial/uart_ns16550.h @@ -11,6 +11,8 @@ #ifndef ZEPHYR_DRIVERS_SERIAL_UART_NS16550_H_ #define ZEPHYR_DRIVERS_SERIAL_UART_NS16550_H_ -#define CMD_SET_DLF 0x01 +#include + +#warning this header is deprecated, include instead #endif /* ZEPHYR_DRIVERS_SERIAL_UART_NS16550_H_ */ diff --git a/include/zephyr/drivers/serial/uart_ns16550.h b/include/zephyr/drivers/serial/uart_ns16550.h new file mode 100644 index 00000000000..797b29240cd --- /dev/null +++ b/include/zephyr/drivers/serial/uart_ns16550.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2015 Intel Corporation. + * + * SPDX-License-Identifier: Apache-2.0 + */ + +/** + * @file + * + * @brief Public header file for the NS16550 UART + */ + +#ifndef ZEPHYR_INCLUDE_DRIVERS_SERIAL_UART_NS16550_H_ +#define ZEPHYR_INCLUDE_DRIVERS_SERIAL_UART_NS16550_H_ + +/** + * @brief Set DLF + * + * @note This only applies to Synopsys Designware UART IP block. + */ +#define CMD_SET_DLF 0x01 + +#endif /* ZEPHYR_INCLUDE_DRIVERS_SERIAL_UART_NS16550_H_ */