#include <linux/console.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <linux/tty.h>
#include <linux/tty_flip.h>
#include <linux/slab.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/mod_devicetable.h>
#include <linux/goldfish.h>
#include <linux/mm.h>
#include <linux/dma-mapping.h>
#include <linux/serial_core.h>
#define GOLDFISH_TTY_REG_BYTES_READY …
#define GOLDFISH_TTY_REG_CMD …
#define GOLDFISH_TTY_REG_DATA_PTR …
#define GOLDFISH_TTY_REG_DATA_LEN …
#define GOLDFISH_TTY_REG_DATA_PTR_HIGH …
#define GOLDFISH_TTY_REG_VERSION …
#define GOLDFISH_TTY_CMD_INT_DISABLE …
#define GOLDFISH_TTY_CMD_INT_ENABLE …
#define GOLDFISH_TTY_CMD_WRITE_BUFFER …
#define GOLDFISH_TTY_CMD_READ_BUFFER …
struct goldfish_tty { … };
static DEFINE_MUTEX(goldfish_tty_lock);
static struct tty_driver *goldfish_tty_driver;
static u32 goldfish_tty_line_count = …;
static u32 goldfish_tty_current_line_count;
static struct goldfish_tty *goldfish_ttys;
static void do_rw_io(struct goldfish_tty *qtty, unsigned long address,
size_t count, bool is_write)
{ … }
static void goldfish_tty_rw(struct goldfish_tty *qtty, unsigned long addr,
size_t count, bool is_write)
{ … }
static void goldfish_tty_do_write(int line, const u8 *buf, size_t count)
{ … }
static irqreturn_t goldfish_tty_interrupt(int irq, void *dev_id)
{ … }
static int goldfish_tty_activate(struct tty_port *port, struct tty_struct *tty)
{ … }
static void goldfish_tty_shutdown(struct tty_port *port)
{ … }
static int goldfish_tty_open(struct tty_struct *tty, struct file *filp)
{ … }
static void goldfish_tty_close(struct tty_struct *tty, struct file *filp)
{ … }
static void goldfish_tty_hangup(struct tty_struct *tty)
{ … }
static ssize_t goldfish_tty_write(struct tty_struct *tty, const u8 *buf,
size_t count)
{ … }
static unsigned int goldfish_tty_write_room(struct tty_struct *tty)
{ … }
static unsigned int goldfish_tty_chars_in_buffer(struct tty_struct *tty)
{ … }
static void goldfish_tty_console_write(struct console *co, const char *b,
unsigned count)
{ … }
static struct tty_driver *goldfish_tty_console_device(struct console *c,
int *index)
{ … }
static int goldfish_tty_console_setup(struct console *co, char *options)
{ … }
static const struct tty_port_operations goldfish_port_ops = …;
static const struct tty_operations goldfish_tty_ops = …;
static int goldfish_tty_create_driver(void)
{ … }
static void goldfish_tty_delete_driver(void)
{ … }
static int goldfish_tty_probe(struct platform_device *pdev)
{ … }
static void goldfish_tty_remove(struct platform_device *pdev)
{ … }
#ifdef CONFIG_GOLDFISH_TTY_EARLY_CONSOLE
static void gf_early_console_putchar(struct uart_port *port, unsigned char ch)
{ … }
static void gf_early_write(struct console *con, const char *s, unsigned int n)
{ … }
static int __init gf_earlycon_setup(struct earlycon_device *device,
const char *opt)
{ … }
OF_EARLYCON_DECLARE(…);
#endif
static const struct of_device_id goldfish_tty_of_match[] = …;
MODULE_DEVICE_TABLE(of, goldfish_tty_of_match);
static struct platform_driver goldfish_tty_platform_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;