#include <linux/slab.h>
#include <linux/tty.h>
#include <linux/tty_flip.h>
#include <linux/usb.h>
#include <linux/usb/serial.h>
#include <linux/serial_reg.h>
#include <linux/module.h>
#include <linux/uaccess.h>
#define F81534_UART_BASE_ADDRESS …
#define F81534_UART_OFFSET …
#define F81534_DIVISOR_LSB_REG …
#define F81534_DIVISOR_MSB_REG …
#define F81534_INTERRUPT_ENABLE_REG …
#define F81534_FIFO_CONTROL_REG …
#define F81534_LINE_CONTROL_REG …
#define F81534_MODEM_CONTROL_REG …
#define F81534_LINE_STATUS_REG …
#define F81534_MODEM_STATUS_REG …
#define F81534_CLOCK_REG …
#define F81534_CONFIG1_REG …
#define F81534_DEF_CONF_ADDRESS_START …
#define F81534_DEF_CONF_SIZE …
#define F81534_CUSTOM_ADDRESS_START …
#define F81534_CUSTOM_DATA_SIZE …
#define F81534_CUSTOM_NO_CUSTOM_DATA …
#define F81534_CUSTOM_VALID_TOKEN …
#define F81534_CONF_OFFSET …
#define F81534_CONF_INIT_GPIO_OFFSET …
#define F81534_CONF_WORK_GPIO_OFFSET …
#define F81534_CONF_GPIO_SHUTDOWN …
#define F81534_CONF_GPIO_RS232 …
#define F81534_MAX_DATA_BLOCK …
#define F81534_MAX_BUS_RETRY …
#define F81534_USB_MAX_RETRY …
#define F81534_USB_TIMEOUT …
#define F81534_SET_GET_REGISTER …
#define F81534_NUM_PORT …
#define F81534_UNUSED_PORT …
#define F81534_WRITE_BUFFER_SIZE …
#define DRIVER_DESC …
#define FINTEK_VENDOR_ID_1 …
#define FINTEK_VENDOR_ID_2 …
#define FINTEK_DEVICE_ID …
#define F81534_MAX_TX_SIZE …
#define F81534_MAX_RX_SIZE …
#define F81534_RECEIVE_BLOCK_SIZE …
#define F81534_MAX_RECEIVE_BLOCK_SIZE …
#define F81534_TOKEN_RECEIVE …
#define F81534_TOKEN_WRITE …
#define F81534_TOKEN_TX_EMPTY …
#define F81534_TOKEN_MSR_CHANGE …
#define F81534_BUS_BUSY …
#define F81534_BUS_IDLE …
#define F81534_BUS_READ_DATA …
#define F81534_BUS_REG_STATUS …
#define F81534_BUS_REG_START …
#define F81534_BUS_REG_END …
#define F81534_CMD_READ …
#define F81534_DEFAULT_BAUD_RATE …
#define F81534_PORT_CONF_RS232 …
#define F81534_PORT_CONF_RS485 …
#define F81534_PORT_CONF_RS485_INVERT …
#define F81534_PORT_CONF_MODE_MASK …
#define F81534_PORT_CONF_DISABLE_PORT …
#define F81534_PORT_CONF_NOT_EXIST_PORT …
#define F81534_PORT_UNAVAILABLE …
#define F81534_1X_RXTRIGGER …
#define F81534_8X_RXTRIGGER …
#define F81534_UART_EN …
#define F81534_CLK_1_846_MHZ …
#define F81534_CLK_18_46_MHZ …
#define F81534_CLK_24_MHZ …
#define F81534_CLK_14_77_MHZ …
#define F81534_CLK_MASK …
#define F81534_CLK_TX_DELAY_1BIT …
#define F81534_CLK_RS485_MODE …
#define F81534_CLK_RS485_INVERT …
static const struct usb_device_id f81534_id_table[] = …;
#define F81534_TX_EMPTY_BIT …
struct f81534_serial_private { … };
struct f81534_port_private { … };
struct f81534_pin_data { … };
struct f81534_port_out_pin { … };
static const struct f81534_port_out_pin f81534_port_out_pins[] = …;
static u32 const baudrate_table[] = …;
static u8 const clock_table[] = …;
static int f81534_logic_to_phy_port(struct usb_serial *serial,
struct usb_serial_port *port)
{ … }
static int f81534_set_register(struct usb_serial *serial, u16 reg, u8 data)
{ … }
static int f81534_get_register(struct usb_serial *serial, u16 reg, u8 *data)
{ … }
static int f81534_set_mask_register(struct usb_serial *serial, u16 reg,
u8 mask, u8 data)
{ … }
static int f81534_set_phy_port_register(struct usb_serial *serial, int phy,
u16 reg, u8 data)
{ … }
static int f81534_get_phy_port_register(struct usb_serial *serial, int phy,
u16 reg, u8 *data)
{ … }
static int f81534_set_port_register(struct usb_serial_port *port, u16 reg,
u8 data)
{ … }
static int f81534_get_port_register(struct usb_serial_port *port, u16 reg,
u8 *data)
{ … }
static int f81534_wait_for_spi_idle(struct usb_serial *serial)
{ … }
static int f81534_get_spi_register(struct usb_serial *serial, u16 reg,
u8 *data)
{ … }
static int f81534_set_spi_register(struct usb_serial *serial, u16 reg, u8 data)
{ … }
static int f81534_read_flash(struct usb_serial *serial, u32 address,
size_t size, u8 *buf)
{ … }
static void f81534_prepare_write_buffer(struct usb_serial_port *port, u8 *buf)
{ … }
static int f81534_submit_writer(struct usb_serial_port *port, gfp_t mem_flags)
{ … }
static u32 f81534_calc_baud_divisor(u32 baudrate, u32 clockrate)
{ … }
static int f81534_find_clk(u32 baudrate)
{ … }
static int f81534_set_port_config(struct usb_serial_port *port,
struct tty_struct *tty, u32 baudrate, u32 old_baudrate, u8 lcr)
{ … }
static int f81534_break_ctl(struct tty_struct *tty, int break_state)
{ … }
static int f81534_update_mctrl(struct usb_serial_port *port, unsigned int set,
unsigned int clear)
{ … }
static int f81534_find_config_idx(struct usb_serial *serial, u8 *index)
{ … }
static bool f81534_check_port_hw_disabled(struct usb_serial *serial, int phy)
{ … }
static int f81534_calc_num_ports(struct usb_serial *serial,
struct usb_serial_endpoints *epds)
{ … }
static void f81534_set_termios(struct tty_struct *tty,
struct usb_serial_port *port,
const struct ktermios *old_termios)
{ … }
static int f81534_submit_read_urb(struct usb_serial *serial, gfp_t flags)
{ … }
static void f81534_msr_changed(struct usb_serial_port *port, u8 msr)
{ … }
static int f81534_read_msr(struct usb_serial_port *port)
{ … }
static int f81534_open(struct tty_struct *tty, struct usb_serial_port *port)
{ … }
static void f81534_close(struct usb_serial_port *port)
{ … }
static void f81534_get_serial_info(struct tty_struct *tty, struct serial_struct *ss)
{ … }
static void f81534_process_per_serial_block(struct usb_serial_port *port,
u8 *data)
{ … }
static void f81534_process_read_urb(struct urb *urb)
{ … }
static void f81534_write_usb_callback(struct urb *urb)
{ … }
static void f81534_lsr_worker(struct work_struct *work)
{ … }
static int f81534_set_port_output_pin(struct usb_serial_port *port)
{ … }
static int f81534_port_probe(struct usb_serial_port *port)
{ … }
static void f81534_port_remove(struct usb_serial_port *port)
{ … }
static int f81534_tiocmget(struct tty_struct *tty)
{ … }
static int f81534_tiocmset(struct tty_struct *tty, unsigned int set,
unsigned int clear)
{ … }
static void f81534_dtr_rts(struct usb_serial_port *port, int on)
{ … }
static int f81534_write(struct tty_struct *tty, struct usb_serial_port *port,
const u8 *buf, int count)
{ … }
static bool f81534_tx_empty(struct usb_serial_port *port)
{ … }
static int f81534_resume(struct usb_serial *serial)
{ … }
static struct usb_serial_driver f81534_device = …;
static struct usb_serial_driver *const serial_drivers[] = …;
module_usb_serial_driver(…);
MODULE_DEVICE_TABLE(usb, f81534_id_table);
MODULE_DESCRIPTION(…);
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;