linux/drivers/tty/serial/max3100.c

// SPDX-License-Identifier: GPL-2.0+
/*
 *  Copyright (C) 2008 Christian Pellegrin <[email protected]>
 *
 * Notes: the MAX3100 doesn't provide an interrupt on CTS so we have
 * to use polling for flow control. TX empty IRQ is unusable, since
 * writing conf clears FIFO buffer and we cannot have this interrupt
 * always asking us for attention.
 *
 * The initial minor number is 209 in the low-density serial port:
 * mknod /dev/ttyMAX0 c 204 209
 */

#define MAX3100_MAJOR
#define MAX3100_MINOR
/* 4 MAX3100s should be enough for everyone */
#define MAX_MAX3100

#include <linux/container_of.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/freezer.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/pm.h>
#include <linux/property.h>
#include <linux/serial_core.h>
#include <linux/serial.h>
#include <linux/slab.h>
#include <linux/spi/spi.h>
#include <linux/tty_flip.h>
#include <linux/tty.h>
#include <linux/types.h>

#include <linux/unaligned.h>

#define MAX3100_C
#define MAX3100_D
#define MAX3100_W
#define MAX3100_RX

#define MAX3100_WC
#define MAX3100_RC
#define MAX3100_WD
#define MAX3100_RD
#define MAX3100_CMD

#define MAX3100_T
#define MAX3100_R

#define MAX3100_FEN
#define MAX3100_SHDN
#define MAX3100_TM
#define MAX3100_RM
#define MAX3100_PM
#define MAX3100_RAM
#define MAX3100_IR
#define MAX3100_ST
#define MAX3100_PE
#define MAX3100_L
#define MAX3100_BAUD

#define MAX3100_TE
#define MAX3100_RAFE
#define MAX3100_RTS
#define MAX3100_CTS
#define MAX3100_PT
#define MAX3100_DATA

#define MAX3100_RT
#define MAX3100_RTC

/* the following simulate a status reg for ignore_status_mask */
#define MAX3100_STATUS_PE
#define MAX3100_STATUS_FE
#define MAX3100_STATUS_OE

struct max3100_port {};

static inline struct max3100_port *to_max3100_port(struct uart_port *port)
{}

static struct max3100_port *max3100s[MAX_MAX3100]; /* the chips */
static DEFINE_MUTEX(max3100s_lock);		   /* race on probe */

static int max3100_do_parity(struct max3100_port *s, u16 c)
{}

static int max3100_check_parity(struct max3100_port *s, u16 c)
{}

static void max3100_calc_parity(struct max3100_port *s, u16 *c)
{}

static int max3100_sr(struct max3100_port *s, u16 tx, u16 *rx)
{}

static int max3100_handlerx_unlocked(struct max3100_port *s, u16 rx)
{}

static int max3100_handlerx(struct max3100_port *s, u16 rx)
{}

static void max3100_work(struct work_struct *w)
{}

static void max3100_dowork(struct max3100_port *s)
{}

static void max3100_timeout(struct timer_list *t)
{}

static irqreturn_t max3100_irq(int irqno, void *dev_id)
{}

static void max3100_enable_ms(struct uart_port *port)
{}

static void max3100_start_tx(struct uart_port *port)
{}

static void max3100_stop_rx(struct uart_port *port)
{}

static unsigned int max3100_tx_empty(struct uart_port *port)
{}

static unsigned int max3100_get_mctrl(struct uart_port *port)
{}

static void max3100_set_mctrl(struct uart_port *port, unsigned int mctrl)
{}

static void
max3100_set_termios(struct uart_port *port, struct ktermios *termios,
		    const struct ktermios *old)
{}

static void max3100_shutdown(struct uart_port *port)
{}

static int max3100_startup(struct uart_port *port)
{}

static const char *max3100_type(struct uart_port *port)
{}

static void max3100_release_port(struct uart_port *port)
{}

static void max3100_config_port(struct uart_port *port, int flags)
{}

static int max3100_verify_port(struct uart_port *port,
			       struct serial_struct *ser)
{}

static void max3100_stop_tx(struct uart_port *port)
{}

static int max3100_request_port(struct uart_port *port)
{}

static void max3100_break_ctl(struct uart_port *port, int break_state)
{}

static const struct uart_ops max3100_ops =;

static struct uart_driver max3100_uart_driver =;
static int uart_driver_registered;

static int max3100_probe(struct spi_device *spi)
{}

static void max3100_remove(struct spi_device *spi)
{}

static int max3100_suspend(struct device *dev)
{}

static int max3100_resume(struct device *dev)
{}

static DEFINE_SIMPLE_DEV_PM_OPS(max3100_pm_ops, max3100_suspend, max3100_resume);

static const struct spi_device_id max3100_spi_id[] =;
MODULE_DEVICE_TABLE(spi, max3100_spi_id);

static const struct of_device_id max3100_of_match[] =;
MODULE_DEVICE_TABLE(of, max3100_of_match);

static struct spi_driver max3100_driver =;

module_spi_driver();

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