linux/drivers/tty/serial/rda-uart.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * RDA8810PL serial device driver
 *
 * Copyright RDA Microelectronics Company Limited
 * Copyright (c) 2017 Andreas Färber
 * Copyright (c) 2018 Manivannan Sadhasivam
 */

#include <linux/clk.h>
#include <linux/console.h>
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/serial.h>
#include <linux/serial_core.h>
#include <linux/tty.h>
#include <linux/tty_flip.h>

#define RDA_UART_PORT_NUM
#define RDA_UART_DEV_NAME

#define RDA_UART_CTRL
#define RDA_UART_STATUS
#define RDA_UART_RXTX_BUFFER
#define RDA_UART_IRQ_MASK
#define RDA_UART_IRQ_CAUSE
#define RDA_UART_IRQ_TRIGGERS
#define RDA_UART_CMD_SET
#define RDA_UART_CMD_CLR

/* UART_CTRL Bits */
#define RDA_UART_ENABLE
#define RDA_UART_DBITS_8
#define RDA_UART_TX_SBITS_2
#define RDA_UART_PARITY_EN
#define RDA_UART_PARITY(x)
#define RDA_UART_PARITY_ODD
#define RDA_UART_PARITY_EVEN
#define RDA_UART_PARITY_SPACE
#define RDA_UART_PARITY_MARK
#define RDA_UART_DIV_MODE
#define RDA_UART_IRDA_EN
#define RDA_UART_DMA_EN
#define RDA_UART_FLOW_CNT_EN
#define RDA_UART_LOOP_BACK_EN
#define RDA_UART_RX_LOCK_ERR
#define RDA_UART_RX_BREAK_LEN(x)

/* UART_STATUS Bits */
#define RDA_UART_RX_FIFO(x)
#define RDA_UART_RX_FIFO_MASK
#define RDA_UART_TX_FIFO(x)
#define RDA_UART_TX_FIFO_MASK
#define RDA_UART_TX_ACTIVE
#define RDA_UART_RX_ACTIVE
#define RDA_UART_RX_OVERFLOW_ERR
#define RDA_UART_TX_OVERFLOW_ERR
#define RDA_UART_RX_PARITY_ERR
#define RDA_UART_RX_FRAMING_ERR
#define RDA_UART_RX_BREAK_INT
#define RDA_UART_DCTS
#define RDA_UART_CTS
#define RDA_UART_DTR
#define RDA_UART_CLK_ENABLED

/* UART_RXTX_BUFFER Bits */
#define RDA_UART_RX_DATA(x)
#define RDA_UART_TX_DATA(x)

/* UART_IRQ_MASK Bits */
#define RDA_UART_TX_MODEM_STATUS
#define RDA_UART_RX_DATA_AVAILABLE
#define RDA_UART_TX_DATA_NEEDED
#define RDA_UART_RX_TIMEOUT
#define RDA_UART_RX_LINE_ERR
#define RDA_UART_TX_DMA_DONE
#define RDA_UART_RX_DMA_DONE
#define RDA_UART_RX_DMA_TIMEOUT
#define RDA_UART_DTR_RISE
#define RDA_UART_DTR_FALL

/* UART_IRQ_CAUSE Bits */
#define RDA_UART_TX_MODEM_STATUS_U
#define RDA_UART_RX_DATA_AVAILABLE_U
#define RDA_UART_TX_DATA_NEEDED_U
#define RDA_UART_RX_TIMEOUT_U
#define RDA_UART_RX_LINE_ERR_U
#define RDA_UART_TX_DMA_DONE_U
#define RDA_UART_RX_DMA_DONE_U
#define RDA_UART_RX_DMA_TIMEOUT_U
#define RDA_UART_DTR_RISE_U
#define RDA_UART_DTR_FALL_U

/* UART_TRIGGERS Bits */
#define RDA_UART_RX_TRIGGER(x)
#define RDA_UART_TX_TRIGGER(x)
#define RDA_UART_AFC_LEVEL(x)

/* UART_CMD_SET Bits */
#define RDA_UART_RI
#define RDA_UART_DCD
#define RDA_UART_DSR
#define RDA_UART_TX_BREAK_CONTROL
#define RDA_UART_TX_FINISH_N_WAIT
#define RDA_UART_RTS
#define RDA_UART_RX_FIFO_RESET
#define RDA_UART_TX_FIFO_RESET

#define RDA_UART_TX_FIFO_SIZE

static struct uart_driver rda_uart_driver;

struct rda_uart_port {};

#define to_rda_uart_port(port)

static struct rda_uart_port *rda_uart_ports[RDA_UART_PORT_NUM];

static inline void rda_uart_write(struct uart_port *port, u32 val,
				  unsigned int off)
{}

static inline u32 rda_uart_read(struct uart_port *port, unsigned int off)
{}

static unsigned int rda_uart_tx_empty(struct uart_port *port)
{}

static unsigned int rda_uart_get_mctrl(struct uart_port *port)
{}

static void rda_uart_set_mctrl(struct uart_port *port, unsigned int mctrl)
{}

static void rda_uart_stop_tx(struct uart_port *port)
{}

static void rda_uart_stop_rx(struct uart_port *port)
{}

static void rda_uart_start_tx(struct uart_port *port)
{}

static void rda_uart_change_baudrate(struct rda_uart_port *rda_port,
				     unsigned long baud)
{}

static void rda_uart_set_termios(struct uart_port *port,
				 struct ktermios *termios,
				 const struct ktermios *old)
{}

static void rda_uart_send_chars(struct uart_port *port)
{}

static void rda_uart_receive_chars(struct uart_port *port)
{}

static irqreturn_t rda_interrupt(int irq, void *dev_id)
{}

static int rda_uart_startup(struct uart_port *port)
{}

static void rda_uart_shutdown(struct uart_port *port)
{}

static const char *rda_uart_type(struct uart_port *port)
{}

static int rda_uart_request_port(struct uart_port *port)
{}

static void rda_uart_config_port(struct uart_port *port, int flags)
{}

static void rda_uart_release_port(struct uart_port *port)
{}

static int rda_uart_verify_port(struct uart_port *port,
				struct serial_struct *ser)
{}

static const struct uart_ops rda_uart_ops =;

#ifdef CONFIG_SERIAL_RDA_CONSOLE

static void rda_console_putchar(struct uart_port *port, unsigned char ch)
{}

static void rda_uart_port_write(struct uart_port *port, const char *s,
				u_int count)
{}

static void rda_uart_console_write(struct console *co, const char *s,
				   u_int count)
{}

static int rda_uart_console_setup(struct console *co, char *options)
{}

static struct console rda_uart_console =;

static int __init rda_uart_console_init(void)
{}
console_initcall(rda_uart_console_init);

static void rda_uart_early_console_write(struct console *co,
					 const char *s,
					 u_int count)
{}

static int __init
rda_uart_early_console_setup(struct earlycon_device *device, const char *opt)
{}

OF_EARLYCON_DECLARE();

#define RDA_UART_CONSOLE
#else
#define RDA_UART_CONSOLE
#endif /* CONFIG_SERIAL_RDA_CONSOLE */

static struct uart_driver rda_uart_driver =;

static const struct of_device_id rda_uart_dt_matches[] =;
MODULE_DEVICE_TABLE(of, rda_uart_dt_matches);

static int rda_uart_probe(struct platform_device *pdev)
{}

static void rda_uart_remove(struct platform_device *pdev)
{}

static struct platform_driver rda_uart_platform_driver =;

static int __init rda_uart_init(void)
{}

static void __exit rda_uart_exit(void)
{}

module_init();
module_exit(rda_uart_exit);

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();