linux/drivers/spi/spi-sunplus-sp7021.c

// SPDX-License-Identifier: GPL-2.0-only
// Copyright (c) 2021 Sunplus Inc.
// Author: Li-hao Kuo <[email protected]>

#include <linux/bitfield.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/dma-mapping.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/reset.h>
#include <linux/spi/spi.h>

#define SP7021_DATA_RDY_REG
#define SP7021_SLAVE_DMA_CTRL_REG
#define SP7021_SLAVE_DMA_LENGTH_REG
#define SP7021_SLAVE_DMA_ADDR_REG

#define SP7021_SLAVE_DATA_RDY
#define SP7021_SLAVE_SW_RST
#define SP7021_SLA_DMA_W_INT
#define SP7021_SLAVE_CLR_INT
#define SP7021_SLAVE_DMA_EN
#define SP7021_SLAVE_DMA_RW
#define SP7021_SLAVE_DMA_CMD

#define SP7021_FIFO_REG
#define SP7021_SPI_STATUS_REG
#define SP7021_SPI_CONFIG_REG
#define SP7021_INT_BUSY_REG
#define SP7021_DMA_CTRL_REG

#define SP7021_SPI_START_FD
#define SP7021_FD_SW_RST
#define SP7021_TX_EMP_FLAG
#define SP7021_RX_EMP_FLAG
#define SP7021_RX_FULL_FLAG
#define SP7021_FINISH_FLAG

#define SP7021_TX_CNT_MASK
#define SP7021_RX_CNT_MASK
#define SP7021_TX_LEN_MASK
#define SP7021_GET_LEN_MASK
#define SP7021_SET_TX_LEN
#define SP7021_SET_XFER_LEN

#define SP7021_CPOL_FD
#define SP7021_CPHA_R
#define SP7021_CPHA_W
#define SP7021_LSB_SEL
#define SP7021_CS_POR
#define SP7021_FD_SEL

#define SP7021_RX_UNIT
#define SP7021_TX_UNIT
#define SP7021_TX_EMP_FLAG_MASK
#define SP7021_RX_FULL_FLAG_MASK
#define SP7021_FINISH_FLAG_MASK
#define SP7021_CLEAN_RW_BYTE
#define SP7021_CLEAN_FLUG_MASK
#define SP7021_CLK_MASK

#define SP7021_INT_BYPASS
#define SP7021_CLR_MASTER_INT

#define SP7021_SPI_DATA_SIZE
#define SP7021_FIFO_DATA_LEN

enum {};

struct sp7021_spi_ctlr {};

static irqreturn_t sp7021_spi_target_irq(int irq, void *dev)
{}

static int sp7021_spi_target_abort(struct spi_controller *ctlr)
{}

static int sp7021_spi_target_tx(struct spi_device *spi, struct spi_transfer *xfer)
{}

static int sp7021_spi_target_rx(struct spi_device *spi, struct spi_transfer *xfer)
{}

static void sp7021_spi_host_rb(struct sp7021_spi_ctlr *pspim, unsigned int len)
{}

static void sp7021_spi_host_wb(struct sp7021_spi_ctlr *pspim, unsigned int len)
{}

static irqreturn_t sp7021_spi_host_irq(int irq, void *dev)
{}

static void sp7021_prep_transfer(struct spi_controller *ctlr, struct spi_device *spi)
{}

// preliminary set CS, CPOL, CPHA and LSB
static int sp7021_spi_controller_prepare_message(struct spi_controller *ctlr,
						 struct spi_message *msg)
{}

static void sp7021_spi_setup_clk(struct spi_controller *ctlr, struct spi_transfer *xfer)
{}

static int sp7021_spi_host_transfer_one(struct spi_controller *ctlr, struct spi_device *spi,
				       struct spi_transfer *xfer)
{}

static int sp7021_spi_target_transfer_one(struct spi_controller *ctlr, struct spi_device *spi,
				       struct spi_transfer *xfer)
{}

static void sp7021_spi_disable_unprepare(void *data)
{}

static void sp7021_spi_reset_control_assert(void *data)
{}

static int sp7021_spi_controller_probe(struct platform_device *pdev)
{}

static void sp7021_spi_controller_remove(struct platform_device *pdev)
{}

static int __maybe_unused sp7021_spi_controller_suspend(struct device *dev)
{}

static int __maybe_unused sp7021_spi_controller_resume(struct device *dev)
{}

#ifdef CONFIG_PM
static int sp7021_spi_runtime_suspend(struct device *dev)
{}

static int sp7021_spi_runtime_resume(struct device *dev)
{}
#endif

static const struct dev_pm_ops sp7021_spi_pm_ops =;

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

static struct platform_driver sp7021_spi_controller_driver =;
module_platform_driver();

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