linux/drivers/usb/serial/f81232.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Fintek F81232 USB to serial adaptor driver
 * Fintek F81532A/534A/535/536 USB to 2/4/8/12 serial adaptor driver
 *
 * Copyright (C) 2012 Greg Kroah-Hartman ([email protected])
 * Copyright (C) 2012 Linux Foundation
 */

#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/slab.h>
#include <linux/tty.h>
#include <linux/tty_driver.h>
#include <linux/tty_flip.h>
#include <linux/serial.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/mutex.h>
#include <linux/uaccess.h>
#include <linux/usb.h>
#include <linux/usb/serial.h>
#include <linux/serial_reg.h>

#define F81232_ID

#define F81534A_SERIES_ID

#define F81534A_CTRL_ID

static const struct usb_device_id f81232_id_table[] =;

static const struct usb_device_id f81534a_id_table[] =;

static const struct usb_device_id f81534a_ctrl_id_table[] =;

static const struct usb_device_id combined_id_table[] =;
MODULE_DEVICE_TABLE(usb, combined_id_table);

/* Maximum baudrate for F81232 */
#define F81232_MAX_BAUDRATE
#define F81232_DEF_BAUDRATE

/* USB Control EP parameter */
#define F81232_REGISTER_REQUEST
#define F81232_GET_REGISTER
#define F81232_SET_REGISTER
#define F81534A_ACCESS_REG_RETRY

#define SERIAL_BASE_ADDRESS
#define RECEIVE_BUFFER_REGISTER
#define INTERRUPT_ENABLE_REGISTER
#define FIFO_CONTROL_REGISTER
#define LINE_CONTROL_REGISTER
#define MODEM_CONTROL_REGISTER
#define LINE_STATUS_REGISTER
#define MODEM_STATUS_REGISTER

/*
 * F81232 Clock registers (106h)
 *
 * Bit1-0:	Clock source selector
 *			00: 1.846MHz.
 *			01: 18.46MHz.
 *			10: 24MHz.
 *			11: 14.77MHz.
 */
#define F81232_CLK_REGISTER
#define F81232_CLK_1_846_MHZ
#define F81232_CLK_18_46_MHZ
#define F81232_CLK_24_MHZ
#define F81232_CLK_14_77_MHZ
#define F81232_CLK_MASK

#define F81534A_MODE_REG
#define F81534A_TRIGGER_MASK
#define F81534A_TRIGGER_MULTIPLE_4X
#define F81534A_FIFO_128BYTE

/* Serial port self GPIO control, 2bytes [control&output data][input data] */
#define F81534A_GPIO_REG
#define F81534A_GPIO_MODE2_DIR
#define F81534A_GPIO_MODE1_DIR
#define F81534A_GPIO_MODE0_DIR
#define F81534A_GPIO_MODE2_OUTPUT
#define F81534A_GPIO_MODE1_OUTPUT
#define F81534A_GPIO_MODE0_OUTPUT

#define F81534A_CTRL_CMD_ENABLE_PORT

struct f81232_private {};

static u32 const baudrate_table[] =;
static u8 const clock_table[] =;

static int calc_baud_divisor(speed_t baudrate, speed_t clockrate)
{}

static int f81232_get_register(struct usb_serial_port *port, u16 reg, u8 *val)
{}

static int f81232_set_register(struct usb_serial_port *port, u16 reg, u8 val)
{}

static int f81232_set_mask_register(struct usb_serial_port *port, u16 reg,
					u8 mask, u8 val)
{}

static void f81232_read_msr(struct usb_serial_port *port)
{}

static int f81232_set_mctrl(struct usb_serial_port *port,
					   unsigned int set, unsigned int clear)
{}

static void f81232_update_line_status(struct usb_serial_port *port,
				      unsigned char *data,
				      size_t actual_length)
{}

static void f81232_read_int_callback(struct urb *urb)
{}

static char f81232_handle_lsr(struct usb_serial_port *port, u8 lsr)
{}

static void f81232_process_read_urb(struct urb *urb)
{}

static void f81534a_process_read_urb(struct urb *urb)
{}

static int f81232_break_ctl(struct tty_struct *tty, int break_state)
{}

static int f81232_find_clk(speed_t baudrate)
{}

static void f81232_set_baudrate(struct tty_struct *tty,
				struct usb_serial_port *port, speed_t baudrate,
				speed_t old_baudrate)
{}

static int f81232_port_enable(struct usb_serial_port *port)
{}

static int f81232_port_disable(struct usb_serial_port *port)
{}

static void f81232_set_termios(struct tty_struct *tty,
			       struct usb_serial_port *port,
			       const struct ktermios *old_termios)
{}

static int f81232_tiocmget(struct tty_struct *tty)
{}

static int f81232_tiocmset(struct tty_struct *tty,
			unsigned int set, unsigned int clear)
{}

static int f81232_open(struct tty_struct *tty, struct usb_serial_port *port)
{}

static int f81534a_open(struct tty_struct *tty, struct usb_serial_port *port)
{}

static void f81232_close(struct usb_serial_port *port)
{}

static void f81232_dtr_rts(struct usb_serial_port *port, int on)
{}

static bool f81232_tx_empty(struct usb_serial_port *port)
{}

static int f81232_carrier_raised(struct usb_serial_port *port)
{}

static void f81232_get_serial(struct tty_struct *tty, struct serial_struct *ss)
{}

static void  f81232_interrupt_work(struct work_struct *work)
{}

static void f81232_lsr_worker(struct work_struct *work)
{}

static int f81534a_ctrl_set_register(struct usb_interface *intf, u16 reg,
					u16 size, void *val)
{}

static int f81534a_ctrl_enable_all_ports(struct usb_interface *intf, bool en)
{}

static int f81534a_ctrl_probe(struct usb_interface *intf,
				const struct usb_device_id *id)
{}

static void f81534a_ctrl_disconnect(struct usb_interface *intf)
{}

static int f81534a_ctrl_resume(struct usb_interface *intf)
{}

static int f81232_port_probe(struct usb_serial_port *port)
{}

static int f81534a_port_probe(struct usb_serial_port *port)
{}

static int f81232_suspend(struct usb_serial *serial, pm_message_t message)
{}

static int f81232_resume(struct usb_serial *serial)
{}

static struct usb_serial_driver f81232_device =;

static struct usb_serial_driver f81534a_device =;

static struct usb_serial_driver * const serial_drivers[] =;

static struct usb_driver f81534a_ctrl_driver =;

static int __init f81232_init(void)
{}

static void __exit f81232_exit(void)
{}

module_init();
module_exit(f81232_exit);

MODULE_DESCRIPTION();
MODULE_AUTHOR();
MODULE_AUTHOR();
MODULE_LICENSE();