linux/drivers/tty/serial/8250/8250_bcm2835aux.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Serial port driver for BCM2835AUX UART
 *
 * Copyright (C) 2016 Martin Sperl <[email protected]>
 *
 * Based on 8250_lpc18xx.c:
 * Copyright (C) 2015 Joachim Eastwood <[email protected]>
 *
 * The bcm2835aux is capable of RTS auto flow-control, but this driver doesn't
 * take advantage of it yet.  When adding support, be sure not to enable it
 * simultaneously to rs485.
 */

#include <linux/clk.h>
#include <linux/console.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/property.h>

#include "8250.h"

#define BCM2835_AUX_UART_CNTL
#define BCM2835_AUX_UART_CNTL_RXEN
#define BCM2835_AUX_UART_CNTL_TXEN
#define BCM2835_AUX_UART_CNTL_AUTORTS
#define BCM2835_AUX_UART_CNTL_AUTOCTS
#define BCM2835_AUX_UART_CNTL_RTS3
#define BCM2835_AUX_UART_CNTL_RTS2
#define BCM2835_AUX_UART_CNTL_RTS1
#define BCM2835_AUX_UART_CNTL_RTS4
#define BCM2835_AUX_UART_CNTL_RTSINV
#define BCM2835_AUX_UART_CNTL_CTSINV

/**
 * struct bcm2835aux_data - driver private data of BCM2835 auxiliary UART
 * @clk: clock producer of the port's uartclk
 * @line: index of the port's serial8250_ports[] entry
 * @cntl: cached copy of CNTL register
 */
struct bcm2835aux_data {};

static void bcm2835aux_rs485_start_tx(struct uart_8250_port *up)
{}

static void bcm2835aux_rs485_stop_tx(struct uart_8250_port *up)
{}

static int bcm2835aux_serial_probe(struct platform_device *pdev)
{}

static void bcm2835aux_serial_remove(struct platform_device *pdev)
{}

/*
 * Some UEFI implementations (e.g. tianocore/edk2 for the Raspberry Pi)
 * describe the miniuart with a base address that encompasses the auxiliary
 * registers shared between the miniuart and spi.
 *
 * This is due to historical reasons, see discussion here:
 * https://edk2.groups.io/g/devel/topic/87501357#84349
 *
 * We need to add the offset between the miniuart and auxiliary registers
 * to get the real miniuart base address.
 */
static const struct property_entry bcm2835_acpi_properties[] =;

static const struct software_node bcm2835_acpi_node =;

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

static const struct acpi_device_id bcm2835aux_serial_acpi_match[] =;
MODULE_DEVICE_TABLE(acpi, bcm2835aux_serial_acpi_match);

static bool bcm2835aux_can_disable_clock(struct device *dev)
{}

static int bcm2835aux_suspend(struct device *dev)
{}

static int bcm2835aux_resume(struct device *dev)
{}

static DEFINE_SIMPLE_DEV_PM_OPS(bcm2835aux_dev_pm_ops, bcm2835aux_suspend, bcm2835aux_resume);

static struct platform_driver bcm2835aux_serial_driver =;
module_platform_driver();

#ifdef CONFIG_SERIAL_8250_CONSOLE

static int __init early_bcm2835aux_setup(struct earlycon_device *device,
					const char *options)
{}

OF_EARLYCON_DECLARE();
#endif

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