linux/drivers/spi/spi-xlp.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (C) 2003-2015 Broadcom Corporation
 * All Rights Reserved
 */
#include <linux/acpi.h>
#include <linux/clk.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/spi/spi.h>
#include <linux/interrupt.h>

/* SPI Configuration Register */
#define XLP_SPI_CONFIG
#define XLP_SPI_CPHA
#define XLP_SPI_CPOL
#define XLP_SPI_CS_POL
#define XLP_SPI_TXMISO_EN
#define XLP_SPI_TXMOSI_EN
#define XLP_SPI_RXMISO_EN
#define XLP_SPI_CS_LSBFE
#define XLP_SPI_RXCAP_EN

/* SPI Frequency Divider Register */
#define XLP_SPI_FDIV

/* SPI Command Register */
#define XLP_SPI_CMD
#define XLP_SPI_CMD_IDLE_MASK
#define XLP_SPI_CMD_TX_MASK
#define XLP_SPI_CMD_RX_MASK
#define XLP_SPI_CMD_TXRX_MASK
#define XLP_SPI_CMD_CONT
#define XLP_SPI_XFR_BITCNT_SHIFT

/* SPI Status Register */
#define XLP_SPI_STATUS
#define XLP_SPI_XFR_PENDING
#define XLP_SPI_XFR_DONE
#define XLP_SPI_TX_INT
#define XLP_SPI_RX_INT
#define XLP_SPI_TX_UF
#define XLP_SPI_RX_OF
#define XLP_SPI_STAT_MASK

/* SPI Interrupt Enable Register */
#define XLP_SPI_INTR_EN
#define XLP_SPI_INTR_DONE
#define XLP_SPI_INTR_TXTH
#define XLP_SPI_INTR_RXTH
#define XLP_SPI_INTR_TXUF
#define XLP_SPI_INTR_RXOF

/* SPI FIFO Threshold Register */
#define XLP_SPI_FIFO_THRESH

/* SPI FIFO Word Count Register */
#define XLP_SPI_FIFO_WCNT
#define XLP_SPI_RXFIFO_WCNT_MASK
#define XLP_SPI_TXFIFO_WCNT_MASK
#define XLP_SPI_TXFIFO_WCNT_SHIFT

/* SPI Transmit Data FIFO Register */
#define XLP_SPI_TXDATA_FIFO

/* SPI Receive Data FIFO Register */
#define XLP_SPI_RXDATA_FIFO

/* SPI System Control Register */
#define XLP_SPI_SYSCTRL
#define XLP_SPI_SYS_RESET
#define XLP_SPI_SYS_CLKDIS
#define XLP_SPI_SYS_PMEN

#define SPI_CS_OFFSET
#define XLP_SPI_TXRXTH
#define XLP_SPI_FIFO_SIZE
#define XLP_SPI_MAX_CS
#define XLP_SPI_DEFAULT_FREQ
#define XLP_SPI_FDIV_MIN
#define XLP_SPI_FDIV_MAX
/*
 * SPI can transfer only 28 bytes properly at a time. So split the
 * transfer into 28 bytes size.
 */
#define XLP_SPI_XFER_SIZE

struct xlp_spi_priv {};

static inline u32 xlp_spi_reg_read(struct xlp_spi_priv *priv,
				int cs, int regoff)
{}

static inline void xlp_spi_reg_write(struct xlp_spi_priv *priv, int cs,
				int regoff, u32 val)
{}

static inline void xlp_spi_sysctl_write(struct xlp_spi_priv *priv,
				int regoff, u32 val)
{}

/*
 * Setup global SPI_SYSCTRL register for all SPI channels.
 */
static void xlp_spi_sysctl_setup(struct xlp_spi_priv *xspi)
{}

static int xlp_spi_setup(struct spi_device *spi)
{}

static void xlp_spi_read_rxfifo(struct xlp_spi_priv *xspi)
{}

static void xlp_spi_fill_txfifo(struct xlp_spi_priv *xspi)
{}

static irqreturn_t xlp_spi_interrupt(int irq, void *dev_id)
{}

static void xlp_spi_send_cmd(struct xlp_spi_priv *xspi, int xfer_len,
			int cmd_cont)
{}

static int xlp_spi_xfer_block(struct  xlp_spi_priv *xs,
		const unsigned char *tx_buf,
		unsigned char *rx_buf, int xfer_len, int cmd_cont)
{}

static int xlp_spi_txrx_bufs(struct xlp_spi_priv *xs, struct spi_transfer *t)
{}

static int xlp_spi_transfer_one(struct spi_controller *host,
					struct spi_device *spi,
					struct spi_transfer *t)
{}

static int xlp_spi_probe(struct platform_device *pdev)
{}

#ifdef CONFIG_ACPI
static const struct acpi_device_id xlp_spi_acpi_match[] =;
MODULE_DEVICE_TABLE(acpi, xlp_spi_acpi_match);
#endif

static struct platform_driver xlp_spi_driver =;
module_platform_driver();

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