linux/drivers/spi/spi-microchip-core.c

// SPDX-License-Identifier: (GPL-2.0)
/*
 * Microchip CoreSPI SPI controller driver
 *
 * Copyright (c) 2018-2022 Microchip Technology Inc. and its subsidiaries
 *
 * Author: Daire McNamara <[email protected]>
 * Author: Conor Dooley <[email protected]>
 *
 */

#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/err.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/spi/spi.h>

#define MAX_LEN
#define MAX_CS
#define DEFAULT_FRAMESIZE
#define FIFO_DEPTH
#define CLK_GEN_MODE1_MAX
#define CLK_GEN_MODE0_MAX
#define CLK_GEN_MIN
#define MODE_X_MASK_SHIFT

#define CONTROL_ENABLE
#define CONTROL_MASTER
#define CONTROL_RX_DATA_INT
#define CONTROL_TX_DATA_INT
#define CONTROL_RX_OVER_INT
#define CONTROL_TX_UNDER_INT
#define CONTROL_SPO
#define CONTROL_SPH
#define CONTROL_SPS
#define CONTROL_FRAMEURUN
#define CONTROL_CLKMODE
#define CONTROL_BIGFIFO
#define CONTROL_OENOFF
#define CONTROL_RESET

#define CONTROL_MODE_MASK
#define MOTOROLA_MODE
#define CONTROL_FRAMECNT_MASK
#define CONTROL_FRAMECNT_SHIFT

#define STATUS_ACTIVE
#define STATUS_SSEL
#define STATUS_FRAMESTART
#define STATUS_TXFIFO_EMPTY_NEXT_READ
#define STATUS_TXFIFO_EMPTY
#define STATUS_TXFIFO_FULL_NEXT_WRITE
#define STATUS_TXFIFO_FULL
#define STATUS_RXFIFO_EMPTY_NEXT_READ
#define STATUS_RXFIFO_EMPTY
#define STATUS_RXFIFO_FULL_NEXT_WRITE
#define STATUS_RXFIFO_FULL
#define STATUS_TX_UNDERRUN
#define STATUS_RX_OVERFLOW
#define STATUS_RXDAT_RXED
#define STATUS_TXDAT_SENT

#define INT_TXDONE
#define INT_RXRDY
#define INT_RX_CHANNEL_OVERFLOW
#define INT_TX_CHANNEL_UNDERRUN

#define INT_ENABLE_MASK

#define REG_CONTROL
#define REG_FRAME_SIZE
#define FRAME_SIZE_MASK
#define REG_STATUS
#define REG_INT_CLEAR
#define REG_RX_DATA
#define REG_TX_DATA
#define REG_CLK_GEN
#define REG_SLAVE_SELECT
#define SSEL_MASK
#define SSEL_DIRECT
#define SSELOUT_SHIFT
#define SSELOUT
#define REG_MIS
#define REG_RIS
#define REG_CONTROL2
#define REG_COMMAND
#define COMMAND_CLRFRAMECNT
#define COMMAND_TXFIFORST
#define COMMAND_RXFIFORST
#define REG_PKTSIZE
#define REG_CMD_SIZE
#define REG_HWSTATUS
#define REG_STAT8
#define REG_CTRL2
#define REG_FRAMESUP

struct mchp_corespi {};

static inline u32 mchp_corespi_read(struct mchp_corespi *spi, unsigned int reg)
{}

static inline void mchp_corespi_write(struct mchp_corespi *spi, unsigned int reg, u32 val)
{}

static inline void mchp_corespi_disable(struct mchp_corespi *spi)
{}

static inline void mchp_corespi_read_fifo(struct mchp_corespi *spi)
{}

static void mchp_corespi_enable_ints(struct mchp_corespi *spi)
{}

static void mchp_corespi_disable_ints(struct mchp_corespi *spi)
{}

static inline void mchp_corespi_set_xfer_size(struct mchp_corespi *spi, int len)
{}

static inline void mchp_corespi_write_fifo(struct mchp_corespi *spi)
{}

static inline void mchp_corespi_set_framesize(struct mchp_corespi *spi, int bt)
{}

static void mchp_corespi_set_cs(struct spi_device *spi, bool disable)
{}

static int mchp_corespi_setup(struct spi_device *spi)
{}

static void mchp_corespi_init(struct spi_controller *host, struct mchp_corespi *spi)
{}

static inline void mchp_corespi_set_clk_gen(struct mchp_corespi *spi)
{}

static inline void mchp_corespi_set_mode(struct mchp_corespi *spi, unsigned int mode)
{}

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

static int mchp_corespi_calculate_clkgen(struct mchp_corespi *spi,
					 unsigned long target_hz)
{}

static int mchp_corespi_transfer_one(struct spi_controller *host,
				     struct spi_device *spi_dev,
				     struct spi_transfer *xfer)
{}

static int mchp_corespi_prepare_message(struct spi_controller *host,
					struct spi_message *msg)
{}

static int mchp_corespi_probe(struct platform_device *pdev)
{}

static void mchp_corespi_remove(struct platform_device *pdev)
{}

#define MICROCHIP_SPI_PM_OPS

/*
 * Platform driver data structure
 */

#if defined(CONFIG_OF)
static const struct of_device_id mchp_corespi_dt_ids[] =;
MODULE_DEVICE_TABLE(of, mchp_corespi_dt_ids);
#endif

static struct platform_driver mchp_corespi_driver =;
module_platform_driver();
MODULE_DESCRIPTION();
MODULE_AUTHOR();
MODULE_AUTHOR();
MODULE_LICENSE();