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

// SPDX-License-Identifier: GPL-2.0-only
/*
 * SPI driver for Nvidia's Tegra20 Serial Flash Controller.
 *
 * Copyright (c) 2012, NVIDIA CORPORATION.  All rights reserved.
 *
 * Author: Laxman Dewangan <[email protected]>
 */

#include <linux/clk.h>
#include <linux/completion.h>
#include <linux/delay.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_runtime.h>
#include <linux/of.h>
#include <linux/of_device.h>
#include <linux/reset.h>
#include <linux/spi/spi.h>

#define SPI_COMMAND
#define SPI_GO
#define SPI_M_S
#define SPI_ACTIVE_SCLK_MASK
#define SPI_ACTIVE_SCLK_DRIVE_LOW
#define SPI_ACTIVE_SCLK_DRIVE_HIGH
#define SPI_ACTIVE_SCLK_PULL_LOW
#define SPI_ACTIVE_SCLK_PULL_HIGH

#define SPI_CK_SDA_FALLING
#define SPI_CK_SDA_RISING
#define SPI_CK_SDA_MASK
#define SPI_ACTIVE_SDA
#define SPI_ACTIVE_SDA_DRIVE_LOW
#define SPI_ACTIVE_SDA_DRIVE_HIGH
#define SPI_ACTIVE_SDA_PULL_LOW
#define SPI_ACTIVE_SDA_PULL_HIGH

#define SPI_CS_POL_INVERT
#define SPI_TX_EN
#define SPI_RX_EN
#define SPI_CS_VAL_HIGH
#define SPI_CS_VAL_LOW
#define SPI_CS_SW
#define SPI_CS_HW
#define SPI_CS_DELAY_MASK
#define SPI_CS3_EN
#define SPI_CS2_EN
#define SPI_CS1_EN
#define SPI_CS0_EN

#define SPI_CS_MASK
#define SPI_BIT_LENGTH(x)

#define SPI_MODES

#define SPI_STATUS
#define SPI_BSY
#define SPI_RDY
#define SPI_TXF_FLUSH
#define SPI_RXF_FLUSH
#define SPI_RX_UNF
#define SPI_TX_OVF
#define SPI_RXF_EMPTY
#define SPI_RXF_FULL
#define SPI_TXF_EMPTY
#define SPI_TXF_FULL
#define SPI_BLK_CNT(count)

#define SPI_FIFO_ERROR
#define SPI_FIFO_EMPTY

#define SPI_RX_CMP
#define SPI_DMA_CTL
#define SPI_DMA_EN
#define SPI_IE_RXC
#define SPI_IE_TXC
#define SPI_PACKED
#define SPI_RX_TRIG_MASK
#define SPI_RX_TRIG_1W
#define SPI_RX_TRIG_4W
#define SPI_TX_TRIG_MASK
#define SPI_TX_TRIG_1W
#define SPI_TX_TRIG_4W
#define SPI_DMA_BLK_COUNT(count)

#define SPI_TX_FIFO
#define SPI_RX_FIFO

#define DATA_DIR_TX
#define DATA_DIR_RX

#define MAX_CHIP_SELECT
#define SPI_FIFO_DEPTH
#define SPI_DMA_TIMEOUT

struct tegra_sflash_data {};

static int tegra_sflash_runtime_suspend(struct device *dev);
static int tegra_sflash_runtime_resume(struct device *dev);

static inline u32 tegra_sflash_readl(struct tegra_sflash_data *tsd,
		unsigned long reg)
{}

static inline void tegra_sflash_writel(struct tegra_sflash_data *tsd,
		u32 val, unsigned long reg)
{}

static void tegra_sflash_clear_status(struct tegra_sflash_data *tsd)
{}

static unsigned tegra_sflash_calculate_curr_xfer_param(
	struct spi_device *spi, struct tegra_sflash_data *tsd,
	struct spi_transfer *t)
{}

static unsigned tegra_sflash_fill_tx_fifo_from_client_txbuf(
	struct tegra_sflash_data *tsd, struct spi_transfer *t)
{}

static int tegra_sflash_read_rx_fifo_to_client_rxbuf(
		struct tegra_sflash_data *tsd, struct spi_transfer *t)
{}

static int tegra_sflash_start_cpu_based_transfer(
		struct tegra_sflash_data *tsd, struct spi_transfer *t)
{}

static int tegra_sflash_start_transfer_one(struct spi_device *spi,
		struct spi_transfer *t, bool is_first_of_msg,
		bool is_single_xfer)
{}

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

static irqreturn_t handle_cpu_based_xfer(struct tegra_sflash_data *tsd)
{}

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

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

static int tegra_sflash_probe(struct platform_device *pdev)
{}

static void tegra_sflash_remove(struct platform_device *pdev)
{}

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

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

static int tegra_sflash_runtime_suspend(struct device *dev)
{}

static int tegra_sflash_runtime_resume(struct device *dev)
{}

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

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