#include <linux/hrtimer.h>
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/ioport.h>
#include <linux/irq.h>
#include <linux/init.h>
#include <linux/console.h>
#include <linux/platform_device.h>
#include <linux/tty.h>
#include <linux/tty_flip.h>
#include <linux/serial_core.h>
#include <linux/serial.h>
#include <linux/slab.h>
#include <linux/clk.h>
#include <linux/of.h>
#include <linux/err.h>
#define VT8500_URTDR …
#define VT8500_URRDR …
#define VT8500_URDIV …
#define VT8500_URLCR …
#define VT8500_URICR …
#define VT8500_URIER …
#define VT8500_URISR …
#define VT8500_URUSR …
#define VT8500_URFCR …
#define VT8500_URFIDX …
#define VT8500_URBKR …
#define VT8500_URTOD …
#define VT8500_TXFIFO …
#define VT8500_RXFIFO …
#define TXDE …
#define RXDF …
#define TXFAE …
#define TXFE …
#define RXFAF …
#define RXFF …
#define TXUDR …
#define RXOVER …
#define PER …
#define FER …
#define TCTS …
#define RXTOUT …
#define BKDONE …
#define ERR …
#define RX_FIFO_INTS …
#define TX_FIFO_INTS …
#define VT8500_TXEN …
#define VT8500_RXEN …
#define VT8500_CS8 …
#define VT8500_CSTOPB …
#define VT8500_PARENB …
#define VT8500_PARODD …
#define VT8500_RTS …
#define VT8500_LOOPBK …
#define VT8500_DMA …
#define VT8500_BREAK …
#define VT8500_PSLVERR …
#define VT8500_SWRTSCTS …
#define VT8500_HAS_SWRTSCTS_SWITCH …
#define VT8500_RECOMMENDED_CLK …
#define VT8500_OVERSAMPLING_DIVISOR …
#define VT8500_MAX_PORTS …
struct vt8500_port { … };
static DECLARE_BITMAP(vt8500_ports_in_use, VT8500_MAX_PORTS);
static inline void vt8500_write(struct uart_port *port, unsigned int val,
unsigned int off)
{ … }
static inline unsigned int vt8500_read(struct uart_port *port, unsigned int off)
{ … }
static void vt8500_stop_tx(struct uart_port *port)
{ … }
static void vt8500_stop_rx(struct uart_port *port)
{ … }
static void vt8500_enable_ms(struct uart_port *port)
{ … }
static void handle_rx(struct uart_port *port)
{ … }
static unsigned int vt8500_tx_empty(struct uart_port *port)
{ … }
static void handle_tx(struct uart_port *port)
{ … }
static void vt8500_start_tx(struct uart_port *port)
{ … }
static void handle_delta_cts(struct uart_port *port)
{ … }
static irqreturn_t vt8500_irq(int irq, void *dev_id)
{ … }
static unsigned int vt8500_get_mctrl(struct uart_port *port)
{ … }
static void vt8500_set_mctrl(struct uart_port *port, unsigned int mctrl)
{ … }
static void vt8500_break_ctl(struct uart_port *port, int break_ctl)
{ … }
static int vt8500_set_baud_rate(struct uart_port *port, unsigned int baud)
{ … }
static int vt8500_startup(struct uart_port *port)
{ … }
static void vt8500_shutdown(struct uart_port *port)
{ … }
static void vt8500_set_termios(struct uart_port *port,
struct ktermios *termios,
const struct ktermios *old)
{ … }
static const char *vt8500_type(struct uart_port *port)
{ … }
static void vt8500_release_port(struct uart_port *port)
{ … }
static int vt8500_request_port(struct uart_port *port)
{ … }
static void vt8500_config_port(struct uart_port *port, int flags)
{ … }
static int vt8500_verify_port(struct uart_port *port,
struct serial_struct *ser)
{ … }
static struct vt8500_port *vt8500_uart_ports[VT8500_MAX_PORTS];
static struct uart_driver vt8500_uart_driver;
#ifdef CONFIG_SERIAL_VT8500_CONSOLE
static void wait_for_xmitr(struct uart_port *port)
{ … }
static void vt8500_console_putchar(struct uart_port *port, unsigned char c)
{ … }
static void vt8500_console_write(struct console *co, const char *s,
unsigned int count)
{ … }
static int __init vt8500_console_setup(struct console *co, char *options)
{ … }
static struct console vt8500_console = …;
#define VT8500_CONSOLE …
#else
#define VT8500_CONSOLE …
#endif
#ifdef CONFIG_CONSOLE_POLL
static int vt8500_get_poll_char(struct uart_port *port)
{ … }
static void vt8500_put_poll_char(struct uart_port *port, unsigned char c)
{ … }
#endif
static const struct uart_ops vt8500_uart_pops = …;
static struct uart_driver vt8500_uart_driver = …;
static unsigned int vt8500_flags;
static unsigned int wm8880_flags = …;
static const struct of_device_id wmt_dt_ids[] = …;
static int vt8500_serial_probe(struct platform_device *pdev)
{ … }
static struct platform_driver vt8500_platform_driver = …;
static int __init vt8500_serial_init(void)
{ … }
device_initcall(vt8500_serial_init);