summaryrefslogtreecommitdiff
path: root/include/ns16550.h
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-12-23 05:30:18 +0300
committerSimon Glass <sjg@chromium.org>2021-01-05 22:24:40 +0300
commitd30c7209dfb4c6e4f38f8b42354e44885b53f301 (patch)
treec530f264e978855ea1793787015a6051cf11884f /include/ns16550.h
parentaa88ac884c998ab521b3a433e963bc001d31e5d8 (diff)
downloadu-boot-d30c7209dfb4c6e4f38f8b42354e44885b53f301.tar.xz
serial: Update NS16550_t and struct NS16550
Typedefs should not be used in U-Boot and structs should be lower case. Update the code to use struct ns16550 consistently. Put a header guard on the file while we are here. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Diffstat (limited to 'include/ns16550.h')
-rw-r--r--include/ns16550.h21
1 files changed, 12 insertions, 9 deletions
diff --git a/include/ns16550.h b/include/ns16550.h
index bef2961032..75c5bf61fd 100644
--- a/include/ns16550.h
+++ b/include/ns16550.h
@@ -21,6 +21,9 @@
* will not allocate storage for arrays of size 0
*/
+#ifndef __ns16550_h
+#define __ns16550_h
+
#include <linux/types.h>
#ifdef CONFIG_DM_SERIAL
@@ -82,7 +85,7 @@ struct ns16550_plat {
struct udevice;
-struct NS16550 {
+struct ns16550 {
UART_REG(rbr); /* 0 */
UART_REG(ier); /* 1 */
UART_REG(fcr); /* 2 */
@@ -120,8 +123,6 @@ struct NS16550 {
#define dll rbr
#define dlm ier
-typedef struct NS16550 *NS16550_t;
-
/*
* These are the definitions for the FIFO Control Register
*/
@@ -221,11 +222,11 @@ typedef struct NS16550 *NS16550_t;
/* useful defaults for LCR */
#define UART_LCR_8N1 0x03
-void NS16550_init(NS16550_t com_port, int baud_divisor);
-void NS16550_putc(NS16550_t com_port, char c);
-char NS16550_getc(NS16550_t com_port);
-int NS16550_tstc(NS16550_t com_port);
-void NS16550_reinit(NS16550_t com_port, int baud_divisor);
+void NS16550_init(struct ns16550 *com_port, int baud_divisor);
+void NS16550_putc(struct ns16550 *com_port, char c);
+char NS16550_getc(struct ns16550 *com_port);
+int NS16550_tstc(struct ns16550 *com_port);
+void NS16550_reinit(struct ns16550 *com_port, int baud_divisor);
/**
* ns16550_calc_divisor() - calculate the divisor given clock and baud rate
@@ -238,7 +239,7 @@ void NS16550_reinit(NS16550_t com_port, int baud_divisor);
* @baudrate: Required baud rate
* @return baud rate divisor that should be used
*/
-int ns16550_calc_divisor(NS16550_t port, int clock, int baudrate);
+int ns16550_calc_divisor(struct ns16550 *port, int clock, int baudrate);
/**
* ns16550_serial_of_to_plat() - convert DT to platform data
@@ -266,3 +267,5 @@ int ns16550_serial_probe(struct udevice *dev);
* These should be used by the client driver for the driver's 'ops' member
*/
extern const struct dm_serial_ops ns16550_serial_ops;
+
+#endif /* __ns16550_h */