linux/drivers/usb/serial/upd78f0730.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Renesas Electronics uPD78F0730 USB to serial converter driver
 *
 * Copyright (C) 2014,2016 Maksim Salau <[email protected]>
 *
 * Protocol of the adaptor is described in the application note U19660EJ1V0AN00
 * μPD78F0730 8-bit Single-Chip Microcontroller
 * USB-to-Serial Conversion Software
 * <https://www.renesas.com/en-eu/doc/DocumentServer/026/U19660EJ1V0AN00.pdf>
 *
 * The adaptor functionality is limited to the following:
 * - data bits: 7 or 8
 * - stop bits: 1 or 2
 * - parity: even, odd or none
 * - flow control: none
 * - baud rates: 0, 2400, 4800, 9600, 19200, 38400, 57600, 115200, 153600
 * - signals: DTR, RTS and BREAK
 */

#include <linux/module.h>
#include <linux/slab.h>
#include <linux/tty.h>
#include <linux/usb.h>
#include <linux/usb/serial.h>

#define DRIVER_DESC

#define DRIVER_AUTHOR

static const struct usb_device_id id_table[] =;

MODULE_DEVICE_TABLE(usb, id_table);

/*
 * Each adaptor is associated with a private structure, that holds the current
 * state of control signals (DTR, RTS and BREAK).
 */
struct upd78f0730_port_private {};

/* Op-codes of control commands */
#define UPD78F0730_CMD_LINE_CONTROL
#define UPD78F0730_CMD_SET_DTR_RTS
#define UPD78F0730_CMD_SET_XON_XOFF_CHR
#define UPD78F0730_CMD_OPEN_CLOSE
#define UPD78F0730_CMD_SET_ERR_CHR

/* Data sizes in UPD78F0730_CMD_LINE_CONTROL command */
#define UPD78F0730_DATA_SIZE_7_BITS
#define UPD78F0730_DATA_SIZE_8_BITS
#define UPD78F0730_DATA_SIZE_MASK

/* Stop-bit modes in UPD78F0730_CMD_LINE_CONTROL command */
#define UPD78F0730_STOP_BIT_1_BIT
#define UPD78F0730_STOP_BIT_2_BIT
#define UPD78F0730_STOP_BIT_MASK

/* Parity modes in UPD78F0730_CMD_LINE_CONTROL command */
#define UPD78F0730_PARITY_NONE
#define UPD78F0730_PARITY_EVEN
#define UPD78F0730_PARITY_ODD
#define UPD78F0730_PARITY_MASK

/* Flow control modes in UPD78F0730_CMD_LINE_CONTROL command */
#define UPD78F0730_FLOW_CONTROL_NONE
#define UPD78F0730_FLOW_CONTROL_HW
#define UPD78F0730_FLOW_CONTROL_SW
#define UPD78F0730_FLOW_CONTROL_MASK

/* Control signal bits in UPD78F0730_CMD_SET_DTR_RTS command */
#define UPD78F0730_RTS
#define UPD78F0730_DTR
#define UPD78F0730_BREAK

/* Port modes in UPD78F0730_CMD_OPEN_CLOSE command */
#define UPD78F0730_PORT_CLOSE
#define UPD78F0730_PORT_OPEN

/* Error character substitution modes in UPD78F0730_CMD_SET_ERR_CHR command */
#define UPD78F0730_ERR_CHR_DISABLED
#define UPD78F0730_ERR_CHR_ENABLED

/*
 * Declaration of command structures
 */

/* UPD78F0730_CMD_LINE_CONTROL command */
struct upd78f0730_line_control {} __packed;

/* UPD78F0730_CMD_SET_DTR_RTS command */
struct upd78f0730_set_dtr_rts {};

/* UPD78F0730_CMD_SET_XON_OFF_CHR command */
struct upd78f0730_set_xon_xoff_chr {};

/* UPD78F0730_CMD_OPEN_CLOSE command */
struct upd78f0730_open_close {};

/* UPD78F0730_CMD_SET_ERR_CHR command */
struct upd78f0730_set_err_chr {};

static int upd78f0730_send_ctl(struct usb_serial_port *port,
			const void *data, int size)
{}

static int upd78f0730_port_probe(struct usb_serial_port *port)
{}

static void upd78f0730_port_remove(struct usb_serial_port *port)
{}

static int upd78f0730_tiocmget(struct tty_struct *tty)
{}

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

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

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

static speed_t upd78f0730_get_baud_rate(struct tty_struct *tty)
{}

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

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

static void upd78f0730_close(struct usb_serial_port *port)
{}

static struct usb_serial_driver upd78f0730_device =;

static struct usb_serial_driver * const serial_drivers[] =;

module_usb_serial_driver();

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