#include <linux/bitfield.h>
#include <linux/bits.h>
#include <linux/console.h>
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/irq.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/serial_core.h>
#include <linux/slab.h>
#include <linux/tty_flip.h>
#include <asm/serial.h>
#define DRIVER_NAME …
#define DEV_NAME …
#define UART_NR …
#define ESP32S3_ACM_TX_FIFO_SIZE …
#define USB_SERIAL_JTAG_EP1_REG …
#define USB_SERIAL_JTAG_EP1_CONF_REG …
#define USB_SERIAL_JTAG_WR_DONE …
#define USB_SERIAL_JTAG_SERIAL_IN_EP_DATA_FREE …
#define USB_SERIAL_JTAG_INT_ST_REG …
#define USB_SERIAL_JTAG_SERIAL_OUT_RECV_PKT_INT_ST …
#define USB_SERIAL_JTAG_SERIAL_IN_EMPTY_INT_ST …
#define USB_SERIAL_JTAG_INT_ENA_REG …
#define USB_SERIAL_JTAG_SERIAL_OUT_RECV_PKT_INT_ENA …
#define USB_SERIAL_JTAG_SERIAL_IN_EMPTY_INT_ENA …
#define USB_SERIAL_JTAG_INT_CLR_REG …
#define USB_SERIAL_JTAG_IN_EP1_ST_REG …
#define USB_SERIAL_JTAG_IN_EP1_WR_ADDR …
#define USB_SERIAL_JTAG_OUT_EP1_ST_REG …
#define USB_SERIAL_JTAG_OUT_EP1_REC_DATA_CNT …
static const struct of_device_id esp32s3_acm_dt_ids[] = …;
MODULE_DEVICE_TABLE(of, esp32s3_acm_dt_ids);
static struct uart_port *esp32s3_acm_ports[UART_NR];
static void esp32s3_acm_write(struct uart_port *port, unsigned long reg, u32 v)
{ … }
static u32 esp32s3_acm_read(struct uart_port *port, unsigned long reg)
{ … }
static u32 esp32s3_acm_tx_fifo_free(struct uart_port *port)
{ … }
static u32 esp32s3_acm_tx_fifo_cnt(struct uart_port *port)
{ … }
static u32 esp32s3_acm_rx_fifo_cnt(struct uart_port *port)
{ … }
static unsigned int esp32s3_acm_tx_empty(struct uart_port *port)
{ … }
static void esp32s3_acm_set_mctrl(struct uart_port *port, unsigned int mctrl)
{ … }
static unsigned int esp32s3_acm_get_mctrl(struct uart_port *port)
{ … }
static void esp32s3_acm_stop_tx(struct uart_port *port)
{ … }
static void esp32s3_acm_rxint(struct uart_port *port)
{ … }
static void esp32s3_acm_push(struct uart_port *port)
{ … }
static void esp32s3_acm_put_char(struct uart_port *port, u8 c)
{ … }
static void esp32s3_acm_put_char_sync(struct uart_port *port, u8 c)
{ … }
static void esp32s3_acm_transmit_buffer(struct uart_port *port)
{ … }
static void esp32s3_acm_txint(struct uart_port *port)
{ … }
static irqreturn_t esp32s3_acm_int(int irq, void *dev_id)
{ … }
static void esp32s3_acm_start_tx(struct uart_port *port)
{ … }
static void esp32s3_acm_stop_rx(struct uart_port *port)
{ … }
static int esp32s3_acm_startup(struct uart_port *port)
{ … }
static void esp32s3_acm_shutdown(struct uart_port *port)
{ … }
static void esp32s3_acm_set_termios(struct uart_port *port,
struct ktermios *termios,
const struct ktermios *old)
{ … }
static const char *esp32s3_acm_type(struct uart_port *port)
{ … }
static void esp32s3_acm_config_port(struct uart_port *port, int flags)
{ … }
#ifdef CONFIG_CONSOLE_POLL
static void esp32s3_acm_poll_put_char(struct uart_port *port, unsigned char c)
{ … }
static int esp32s3_acm_poll_get_char(struct uart_port *port)
{ … }
#endif
static const struct uart_ops esp32s3_acm_pops = …;
static void esp32s3_acm_string_write(struct uart_port *port, const char *s,
unsigned int count)
{ … }
static void
esp32s3_acm_console_write(struct console *co, const char *s, unsigned int count)
{ … }
static struct uart_driver esp32s3_acm_reg;
static struct console esp32s3_acm_console = …;
static void esp32s3_acm_earlycon_write(struct console *con, const char *s,
unsigned int n)
{ … }
#ifdef CONFIG_CONSOLE_POLL
static int esp32s3_acm_earlycon_read(struct console *con, char *s, unsigned int n)
{ … }
#endif
static int __init esp32s3_acm_early_console_setup(struct earlycon_device *device,
const char *options)
{ … }
OF_EARLYCON_DECLARE(…);
static struct uart_driver esp32s3_acm_reg = …;
static int esp32s3_acm_probe(struct platform_device *pdev)
{ … }
static void esp32s3_acm_remove(struct platform_device *pdev)
{ … }
static struct platform_driver esp32s3_acm_driver = …;
static int __init esp32s3_acm_init(void)
{ … }
static void __exit esp32s3_acm_exit(void)
{ … }
module_init(…) …;
module_exit(esp32s3_acm_exit);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;