linux/drivers/spi/spi-tegra20-slink.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * SPI driver for Nvidia's Tegra20/Tegra30 SLINK Controller.
 *
 * Copyright (c) 2012, NVIDIA CORPORATION.  All rights reserved.
 */

#include <linux/clk.h>
#include <linux/completion.h>
#include <linux/delay.h>
#include <linux/dmaengine.h>
#include <linux/dma-mapping.h>
#include <linux/dmapool.h>
#include <linux/err.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/kthread.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/pm_opp.h>
#include <linux/pm_runtime.h>
#include <linux/of.h>
#include <linux/reset.h>
#include <linux/spi/spi.h>

#include <soc/tegra/common.h>

#define SLINK_COMMAND
#define SLINK_BIT_LENGTH(x)
#define SLINK_WORD_SIZE(x)
#define SLINK_BOTH_EN
#define SLINK_CS_SW
#define SLINK_CS_VALUE
#define SLINK_CS_POLARITY
#define SLINK_IDLE_SDA_DRIVE_LOW
#define SLINK_IDLE_SDA_DRIVE_HIGH
#define SLINK_IDLE_SDA_PULL_LOW
#define SLINK_IDLE_SDA_PULL_HIGH
#define SLINK_IDLE_SDA_MASK
#define SLINK_CS_POLARITY1
#define SLINK_CK_SDA
#define SLINK_CS_POLARITY2
#define SLINK_CS_POLARITY3
#define SLINK_IDLE_SCLK_DRIVE_LOW
#define SLINK_IDLE_SCLK_DRIVE_HIGH
#define SLINK_IDLE_SCLK_PULL_LOW
#define SLINK_IDLE_SCLK_PULL_HIGH
#define SLINK_IDLE_SCLK_MASK
#define SLINK_M_S
#define SLINK_WAIT
#define SLINK_GO
#define SLINK_ENB

#define SLINK_MODES

#define SLINK_COMMAND2
#define SLINK_LSBFE
#define SLINK_SSOE
#define SLINK_SPIE
#define SLINK_BIDIROE
#define SLINK_MODFEN
#define SLINK_INT_SIZE(x)
#define SLINK_CS_ACTIVE_BETWEEN
#define SLINK_SS_EN_CS(x)
#define SLINK_SS_SETUP(x)
#define SLINK_FIFO_REFILLS_0
#define SLINK_FIFO_REFILLS_1
#define SLINK_FIFO_REFILLS_2
#define SLINK_FIFO_REFILLS_3
#define SLINK_FIFO_REFILLS_MASK
#define SLINK_WAIT_PACK_INT(x)
#define SLINK_SPC0
#define SLINK_TXEN
#define SLINK_RXEN

#define SLINK_STATUS
#define SLINK_COUNT(val)
#define SLINK_WORD(val)
#define SLINK_BLK_CNT(val)
#define SLINK_MODF
#define SLINK_RX_UNF
#define SLINK_TX_OVF
#define SLINK_TX_FULL
#define SLINK_TX_EMPTY
#define SLINK_RX_FULL
#define SLINK_RX_EMPTY
#define SLINK_TX_UNF
#define SLINK_RX_OVF
#define SLINK_TX_FLUSH
#define SLINK_RX_FLUSH
#define SLINK_SCLK
#define SLINK_ERR
#define SLINK_RDY
#define SLINK_BSY
#define SLINK_FIFO_ERROR

#define SLINK_FIFO_EMPTY

#define SLINK_MAS_DATA
#define SLINK_SLAVE_DATA

#define SLINK_DMA_CTL
#define SLINK_DMA_BLOCK_SIZE(x)
#define SLINK_TX_TRIG_1
#define SLINK_TX_TRIG_4
#define SLINK_TX_TRIG_8
#define SLINK_TX_TRIG_16
#define SLINK_TX_TRIG_MASK
#define SLINK_RX_TRIG_1
#define SLINK_RX_TRIG_4
#define SLINK_RX_TRIG_8
#define SLINK_RX_TRIG_16
#define SLINK_RX_TRIG_MASK
#define SLINK_PACKED
#define SLINK_PACK_SIZE_4
#define SLINK_PACK_SIZE_8
#define SLINK_PACK_SIZE_16
#define SLINK_PACK_SIZE_32
#define SLINK_PACK_SIZE_MASK
#define SLINK_IE_TXC
#define SLINK_IE_RXC
#define SLINK_DMA_EN

#define SLINK_STATUS2
#define SLINK_TX_FIFO_EMPTY_COUNT(val)
#define SLINK_RX_FIFO_FULL_COUNT(val)
#define SLINK_SS_HOLD_TIME(val)

#define SLINK_TX_FIFO
#define SLINK_RX_FIFO

#define DATA_DIR_TX
#define DATA_DIR_RX

#define SLINK_DMA_TIMEOUT

#define DEFAULT_SPI_DMA_BUF_LEN
#define TX_FIFO_EMPTY_COUNT_MAX
#define RX_FIFO_FULL_COUNT_ZERO

#define SLINK_STATUS2_RESET

#define MAX_CHIP_SELECT
#define SLINK_FIFO_DEPTH

struct tegra_slink_chip_data {};

struct tegra_slink_data {};

static inline u32 tegra_slink_readl(struct tegra_slink_data *tspi,
		unsigned long reg)
{}

static inline void tegra_slink_writel(struct tegra_slink_data *tspi,
		u32 val, unsigned long reg)
{}

static void tegra_slink_clear_status(struct tegra_slink_data *tspi)
{}

static u32 tegra_slink_get_packed_size(struct tegra_slink_data *tspi,
				  struct spi_transfer *t)
{}

static unsigned tegra_slink_calculate_curr_xfer_param(
	struct spi_device *spi, struct tegra_slink_data *tspi,
	struct spi_transfer *t)
{}

static unsigned tegra_slink_fill_tx_fifo_from_client_txbuf(
	struct tegra_slink_data *tspi, struct spi_transfer *t)
{}

static unsigned int tegra_slink_read_rx_fifo_to_client_rxbuf(
		struct tegra_slink_data *tspi, struct spi_transfer *t)
{}

static void tegra_slink_copy_client_txbuf_to_spi_txbuf(
		struct tegra_slink_data *tspi, struct spi_transfer *t)
{}

static void tegra_slink_copy_spi_rxbuf_to_client_rxbuf(
		struct tegra_slink_data *tspi, struct spi_transfer *t)
{}

static void tegra_slink_dma_complete(void *args)
{}

static int tegra_slink_start_tx_dma(struct tegra_slink_data *tspi, int len)
{}

static int tegra_slink_start_rx_dma(struct tegra_slink_data *tspi, int len)
{}

static int tegra_slink_start_dma_based_transfer(
		struct tegra_slink_data *tspi, struct spi_transfer *t)
{}

static int tegra_slink_start_cpu_based_transfer(
		struct tegra_slink_data *tspi, struct spi_transfer *t)
{}

static int tegra_slink_init_dma_param(struct tegra_slink_data *tspi,
			bool dma_to_memory)
{}

static void tegra_slink_deinit_dma_param(struct tegra_slink_data *tspi,
	bool dma_to_memory)
{}

static int tegra_slink_start_transfer_one(struct spi_device *spi,
		struct spi_transfer *t)
{}

static int tegra_slink_setup(struct spi_device *spi)
{}

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

static int tegra_slink_transfer_one(struct spi_controller *host,
				    struct spi_device *spi,
				    struct spi_transfer *xfer)
{}

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

static irqreturn_t handle_cpu_based_xfer(struct tegra_slink_data *tspi)
{}

static irqreturn_t handle_dma_based_xfer(struct tegra_slink_data *tspi)
{}

static irqreturn_t tegra_slink_isr_thread(int irq, void *context_data)
{}

static irqreturn_t tegra_slink_isr(int irq, void *context_data)
{}

static const struct tegra_slink_chip_data tegra30_spi_cdata =;

static const struct tegra_slink_chip_data tegra20_spi_cdata =;

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

static int tegra_slink_probe(struct platform_device *pdev)
{}

static void tegra_slink_remove(struct platform_device *pdev)
{}

#ifdef CONFIG_PM_SLEEP
static int tegra_slink_suspend(struct device *dev)
{}

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

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

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

static const struct dev_pm_ops slink_pm_ops =;
static struct platform_driver tegra_slink_driver =;
module_platform_driver();

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