#include <linux/module.h>
#include <linux/ioport.h>
#include <linux/init.h>
#include <linux/console.h>
#include <linux/sysrq.h>
#include <linux/device.h>
#include <linux/tty.h>
#include <linux/tty_flip.h>
#include <linux/serial_core.h>
#include <linux/serial.h>
#include <linux/amba/bus.h>
#include <linux/amba/serial.h>
#include <linux/clk.h>
#include <linux/slab.h>
#include <linux/io.h>
#define UART_NR …
#define SERIAL_AMBA_MAJOR …
#define SERIAL_AMBA_MINOR …
#define SERIAL_AMBA_NR …
#define AMBA_ISR_PASS_LIMIT …
#define UART_RX_DATA(s) …
#define UART_TX_READY(s) …
#define UART_DUMMY_RSR_RX …
#define UART_PORT_SIZE …
struct uart_amba_port { … };
static void pl010_stop_tx(struct uart_port *port)
{ … }
static void pl010_start_tx(struct uart_port *port)
{ … }
static void pl010_stop_rx(struct uart_port *port)
{ … }
static void pl010_disable_ms(struct uart_port *port)
{ … }
static void pl010_enable_ms(struct uart_port *port)
{ … }
static void pl010_rx_chars(struct uart_port *port)
{ … }
static void pl010_tx_chars(struct uart_port *port)
{ … }
static void pl010_modem_status(struct uart_amba_port *uap)
{ … }
static irqreturn_t pl010_int(int irq, void *dev_id)
{ … }
static unsigned int pl010_tx_empty(struct uart_port *port)
{ … }
static unsigned int pl010_get_mctrl(struct uart_port *port)
{ … }
static void pl010_set_mctrl(struct uart_port *port, unsigned int mctrl)
{ … }
static void pl010_break_ctl(struct uart_port *port, int break_state)
{ … }
static int pl010_startup(struct uart_port *port)
{ … }
static void pl010_shutdown(struct uart_port *port)
{ … }
static void
pl010_set_termios(struct uart_port *port, struct ktermios *termios,
const struct ktermios *old)
{ … }
static void pl010_set_ldisc(struct uart_port *port, struct ktermios *termios)
{ … }
static const char *pl010_type(struct uart_port *port)
{ … }
static void pl010_release_port(struct uart_port *port)
{ … }
static int pl010_request_port(struct uart_port *port)
{ … }
static void pl010_config_port(struct uart_port *port, int flags)
{ … }
static int pl010_verify_port(struct uart_port *port, struct serial_struct *ser)
{ … }
static const struct uart_ops amba_pl010_pops = …;
static struct uart_amba_port *amba_ports[UART_NR];
#ifdef CONFIG_SERIAL_AMBA_PL010_CONSOLE
static void pl010_console_putchar(struct uart_port *port, unsigned char ch)
{ … }
static void
pl010_console_write(struct console *co, const char *s, unsigned int count)
{ … }
static void __init
pl010_console_get_options(struct uart_amba_port *uap, int *baud,
int *parity, int *bits)
{ … }
static int __init pl010_console_setup(struct console *co, char *options)
{ … }
static struct uart_driver amba_reg;
static struct console amba_console = …;
#define AMBA_CONSOLE …
#else
#define AMBA_CONSOLE …
#endif
static DEFINE_MUTEX(amba_reg_lock);
static struct uart_driver amba_reg = …;
static int pl010_probe(struct amba_device *dev, const struct amba_id *id)
{ … }
static void pl010_remove(struct amba_device *dev)
{ … }
#ifdef CONFIG_PM_SLEEP
static int pl010_suspend(struct device *dev)
{ … }
static int pl010_resume(struct device *dev)
{ … }
#endif
static SIMPLE_DEV_PM_OPS(pl010_dev_pm_ops, pl010_suspend, pl010_resume);
static const struct amba_id pl010_ids[] = …;
MODULE_DEVICE_TABLE(amba, pl010_ids);
static struct amba_driver pl010_driver = …;
static int __init pl010_init(void)
{ … }
static void __exit pl010_exit(void)
{ … }
module_init(…) …;
module_exit(pl010_exit);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;