#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/ioport.h>
#include <linux/init.h>
#include <linux/irq.h>
#include <linux/console.h>
#include <linux/gpio/consumer.h>
#include <linux/sysrq.h>
#include <linux/delay.h>
#include <linux/platform_device.h>
#include <linux/tty.h>
#include <linux/ratelimit.h>
#include <linux/tty_flip.h>
#include <linux/serial.h>
#include <linux/serial_8250.h>
#include <linux/nmi.h>
#include <linux/mutex.h>
#include <linux/slab.h>
#include <linux/uaccess.h>
#include <linux/pm_runtime.h>
#include <linux/ktime.h>
#include <asm/io.h>
#include <asm/irq.h>
#include "8250.h"
#if 0
#define DEBUG_AUTOCONF …
#else
#define DEBUG_AUTOCONF(fmt...) …
#endif
static const struct serial8250_config uart_config[] = …;
static u32 default_serial_dl_read(struct uart_8250_port *up)
{ … }
static void default_serial_dl_write(struct uart_8250_port *up, u32 value)
{ … }
static unsigned int hub6_serial_in(struct uart_port *p, int offset)
{ … }
static void hub6_serial_out(struct uart_port *p, int offset, int value)
{ … }
static unsigned int mem_serial_in(struct uart_port *p, int offset)
{ … }
static void mem_serial_out(struct uart_port *p, int offset, int value)
{ … }
static void mem16_serial_out(struct uart_port *p, int offset, int value)
{ … }
static unsigned int mem16_serial_in(struct uart_port *p, int offset)
{ … }
static void mem32_serial_out(struct uart_port *p, int offset, int value)
{ … }
static unsigned int mem32_serial_in(struct uart_port *p, int offset)
{ … }
static void mem32be_serial_out(struct uart_port *p, int offset, int value)
{ … }
static unsigned int mem32be_serial_in(struct uart_port *p, int offset)
{ … }
static unsigned int io_serial_in(struct uart_port *p, int offset)
{ … }
static void io_serial_out(struct uart_port *p, int offset, int value)
{ … }
static int serial8250_default_handle_irq(struct uart_port *port);
static void set_io_from_upio(struct uart_port *p)
{ … }
static void
serial_port_out_sync(struct uart_port *p, int offset, int value)
{ … }
static void serial8250_clear_fifos(struct uart_8250_port *p)
{ … }
static enum hrtimer_restart serial8250_em485_handle_start_tx(struct hrtimer *t);
static enum hrtimer_restart serial8250_em485_handle_stop_tx(struct hrtimer *t);
void serial8250_clear_and_reinit_fifos(struct uart_8250_port *p)
{ … }
EXPORT_SYMBOL_GPL(…);
void serial8250_rpm_get(struct uart_8250_port *p)
{ … }
EXPORT_SYMBOL_GPL(…);
void serial8250_rpm_put(struct uart_8250_port *p)
{ … }
EXPORT_SYMBOL_GPL(…);
static int serial8250_em485_init(struct uart_8250_port *p)
{ … }
void serial8250_em485_destroy(struct uart_8250_port *p)
{ … }
EXPORT_SYMBOL_GPL(…);
struct serial_rs485 serial8250_em485_supported = …;
EXPORT_SYMBOL_GPL(…);
int serial8250_em485_config(struct uart_port *port, struct ktermios *termios,
struct serial_rs485 *rs485)
{ … }
EXPORT_SYMBOL_GPL(…);
void serial8250_rpm_get_tx(struct uart_8250_port *p)
{ … }
EXPORT_SYMBOL_GPL(…);
void serial8250_rpm_put_tx(struct uart_8250_port *p)
{ … }
EXPORT_SYMBOL_GPL(…);
static void serial8250_set_sleep(struct uart_8250_port *p, int sleep)
{ … }
static void serial8250_clear_IER(struct uart_8250_port *up)
{ … }
#ifdef CONFIG_SERIAL_8250_RSA
static int __enable_rsa(struct uart_8250_port *up)
{ … }
static void enable_rsa(struct uart_8250_port *up)
{ … }
static void disable_rsa(struct uart_8250_port *up)
{ … }
#endif
static int size_fifo(struct uart_8250_port *up)
{ … }
static unsigned int autoconfig_read_divisor_id(struct uart_8250_port *p)
{ … }
static void autoconfig_has_efr(struct uart_8250_port *up)
{ … }
static void autoconfig_8250(struct uart_8250_port *up)
{ … }
static int broken_efr(struct uart_8250_port *up)
{ … }
static void autoconfig_16550a(struct uart_8250_port *up)
{ … }
static void autoconfig(struct uart_8250_port *up)
{ … }
static void autoconfig_irq(struct uart_8250_port *up)
{ … }
static void serial8250_stop_rx(struct uart_port *port)
{ … }
void serial8250_em485_stop_tx(struct uart_8250_port *p)
{ … }
EXPORT_SYMBOL_GPL(…);
static enum hrtimer_restart serial8250_em485_handle_stop_tx(struct hrtimer *t)
{ … }
static void start_hrtimer_ms(struct hrtimer *hrt, unsigned long msec)
{ … }
static void __stop_tx_rs485(struct uart_8250_port *p, u64 stop_delay)
{ … }
static inline void __stop_tx(struct uart_8250_port *p)
{ … }
static void serial8250_stop_tx(struct uart_port *port)
{ … }
static inline void __start_tx(struct uart_port *port)
{ … }
void serial8250_em485_start_tx(struct uart_8250_port *up)
{ … }
EXPORT_SYMBOL_GPL(…);
static bool start_tx_rs485(struct uart_port *port)
{ … }
static enum hrtimer_restart serial8250_em485_handle_start_tx(struct hrtimer *t)
{ … }
static void serial8250_start_tx(struct uart_port *port)
{ … }
static void serial8250_throttle(struct uart_port *port)
{ … }
static void serial8250_unthrottle(struct uart_port *port)
{ … }
static void serial8250_disable_ms(struct uart_port *port)
{ … }
static void serial8250_enable_ms(struct uart_port *port)
{ … }
void serial8250_read_char(struct uart_8250_port *up, u16 lsr)
{ … }
EXPORT_SYMBOL_GPL(…);
u16 serial8250_rx_chars(struct uart_8250_port *up, u16 lsr)
{ … }
EXPORT_SYMBOL_GPL(…);
void serial8250_tx_chars(struct uart_8250_port *up)
{ … }
EXPORT_SYMBOL_GPL(…);
unsigned int serial8250_modem_status(struct uart_8250_port *up)
{ … }
EXPORT_SYMBOL_GPL(…);
static bool handle_rx_dma(struct uart_8250_port *up, unsigned int iir)
{ … }
int serial8250_handle_irq(struct uart_port *port, unsigned int iir)
{ … }
EXPORT_SYMBOL_GPL(…);
static int serial8250_default_handle_irq(struct uart_port *port)
{ … }
static int serial8250_tx_threshold_handle_irq(struct uart_port *port)
{ … }
static unsigned int serial8250_tx_empty(struct uart_port *port)
{ … }
unsigned int serial8250_do_get_mctrl(struct uart_port *port)
{ … }
EXPORT_SYMBOL_GPL(…);
static unsigned int serial8250_get_mctrl(struct uart_port *port)
{ … }
void serial8250_do_set_mctrl(struct uart_port *port, unsigned int mctrl)
{ … }
EXPORT_SYMBOL_GPL(…);
static void serial8250_set_mctrl(struct uart_port *port, unsigned int mctrl)
{ … }
static void serial8250_break_ctl(struct uart_port *port, int break_state)
{ … }
static void wait_for_lsr(struct uart_8250_port *up, int bits)
{ … }
static void wait_for_xmitr(struct uart_8250_port *up, int bits)
{ … }
#ifdef CONFIG_CONSOLE_POLL
static int serial8250_get_poll_char(struct uart_port *port)
{ … }
static void serial8250_put_poll_char(struct uart_port *port,
unsigned char c)
{ … }
#endif
int serial8250_do_startup(struct uart_port *port)
{ … }
EXPORT_SYMBOL_GPL(…);
static int serial8250_startup(struct uart_port *port)
{ … }
void serial8250_do_shutdown(struct uart_port *port)
{ … }
EXPORT_SYMBOL_GPL(…);
static void serial8250_shutdown(struct uart_port *port)
{ … }
static unsigned int serial8250_do_get_divisor(struct uart_port *port,
unsigned int baud,
unsigned int *frac)
{ … }
static unsigned int serial8250_get_divisor(struct uart_port *port,
unsigned int baud,
unsigned int *frac)
{ … }
static unsigned char serial8250_compute_lcr(struct uart_8250_port *up,
tcflag_t c_cflag)
{ … }
void serial8250_do_set_divisor(struct uart_port *port, unsigned int baud,
unsigned int quot)
{ … }
EXPORT_SYMBOL_GPL(…);
static void serial8250_set_divisor(struct uart_port *port, unsigned int baud,
unsigned int quot, unsigned int quot_frac)
{ … }
static unsigned int serial8250_get_baud_rate(struct uart_port *port,
struct ktermios *termios,
const struct ktermios *old)
{ … }
void serial8250_update_uartclk(struct uart_port *port, unsigned int uartclk)
{ … }
EXPORT_SYMBOL_GPL(…);
void
serial8250_do_set_termios(struct uart_port *port, struct ktermios *termios,
const struct ktermios *old)
{ … }
EXPORT_SYMBOL(…);
static void
serial8250_set_termios(struct uart_port *port, struct ktermios *termios,
const struct ktermios *old)
{ … }
void serial8250_do_set_ldisc(struct uart_port *port, struct ktermios *termios)
{ … }
EXPORT_SYMBOL_GPL(…);
static void
serial8250_set_ldisc(struct uart_port *port, struct ktermios *termios)
{ … }
void serial8250_do_pm(struct uart_port *port, unsigned int state,
unsigned int oldstate)
{ … }
EXPORT_SYMBOL(…);
static void
serial8250_pm(struct uart_port *port, unsigned int state,
unsigned int oldstate)
{ … }
static unsigned int serial8250_port_size(struct uart_8250_port *pt)
{ … }
static int serial8250_request_std_resource(struct uart_8250_port *up)
{ … }
static void serial8250_release_std_resource(struct uart_8250_port *up)
{ … }
static void serial8250_release_port(struct uart_port *port)
{ … }
static int serial8250_request_port(struct uart_port *port)
{ … }
static int fcr_get_rxtrig_bytes(struct uart_8250_port *up)
{ … }
static int bytes_to_fcr_rxtrig(struct uart_8250_port *up, unsigned char bytes)
{ … }
static int do_get_rxtrig(struct tty_port *port)
{ … }
static int do_serial8250_get_rxtrig(struct tty_port *port)
{ … }
static ssize_t rx_trig_bytes_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static int do_set_rxtrig(struct tty_port *port, unsigned char bytes)
{ … }
static int do_serial8250_set_rxtrig(struct tty_port *port, unsigned char bytes)
{ … }
static ssize_t rx_trig_bytes_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{ … }
static DEVICE_ATTR_RW(rx_trig_bytes);
static struct attribute *serial8250_dev_attrs[] = …;
static struct attribute_group serial8250_dev_attr_group = …;
static void register_dev_spec_attr_grp(struct uart_8250_port *up)
{ … }
static void serial8250_config_port(struct uart_port *port, int flags)
{ … }
static int
serial8250_verify_port(struct uart_port *port, struct serial_struct *ser)
{ … }
static const char *serial8250_type(struct uart_port *port)
{ … }
static const struct uart_ops serial8250_pops = …;
void serial8250_init_port(struct uart_8250_port *up)
{ … }
EXPORT_SYMBOL_GPL(…);
void serial8250_set_defaults(struct uart_8250_port *up)
{ … }
EXPORT_SYMBOL_GPL(…);
#ifdef CONFIG_SERIAL_8250_CONSOLE
static void serial8250_console_putchar(struct uart_port *port, unsigned char ch)
{ … }
static void serial8250_console_restore(struct uart_8250_port *up)
{ … }
static void serial8250_console_fifo_write(struct uart_8250_port *up,
const char *s, unsigned int count)
{ … }
void serial8250_console_write(struct uart_8250_port *up, const char *s,
unsigned int count)
{ … }
static unsigned int probe_baud(struct uart_port *port)
{ … }
int serial8250_console_setup(struct uart_port *port, char *options, bool probe)
{ … }
int serial8250_console_exit(struct uart_port *port)
{ … }
#endif
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;