linux/drivers/spi/spi-fsl-dspi.c

// SPDX-License-Identifier: GPL-2.0+
//
// Copyright 2013 Freescale Semiconductor, Inc.
// Copyright 2020 NXP
//
// Freescale DSPI driver
// This file contains a driver for the Freescale DSPI

#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/dmaengine.h>
#include <linux/dma-mapping.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/pinctrl/consumer.h>
#include <linux/regmap.h>
#include <linux/spi/spi.h>
#include <linux/spi/spi-fsl-dspi.h>

#define DRIVER_NAME

#define SPI_MCR
#define SPI_MCR_HOST
#define SPI_MCR_PCSIS(x)
#define SPI_MCR_CLR_TXF
#define SPI_MCR_CLR_RXF
#define SPI_MCR_XSPI
#define SPI_MCR_DIS_TXF
#define SPI_MCR_DIS_RXF
#define SPI_MCR_HALT

#define SPI_TCR
#define SPI_TCR_GET_TCNT(x)

#define SPI_CTAR(x)
#define SPI_CTAR_FMSZ(x)
#define SPI_CTAR_CPOL
#define SPI_CTAR_CPHA
#define SPI_CTAR_LSBFE
#define SPI_CTAR_PCSSCK(x)
#define SPI_CTAR_PASC(x)
#define SPI_CTAR_PDT(x)
#define SPI_CTAR_PBR(x)
#define SPI_CTAR_CSSCK(x)
#define SPI_CTAR_ASC(x)
#define SPI_CTAR_DT(x)
#define SPI_CTAR_BR(x)
#define SPI_CTAR_SCALE_BITS

#define SPI_CTAR0_SLAVE

#define SPI_SR
#define SPI_SR_TCFQF
#define SPI_SR_TFUF
#define SPI_SR_TFFF
#define SPI_SR_CMDTCF
#define SPI_SR_SPEF
#define SPI_SR_RFOF
#define SPI_SR_TFIWF
#define SPI_SR_RFDF
#define SPI_SR_CMDFFF
#define SPI_SR_CLEAR

#define SPI_RSER_TFFFE
#define SPI_RSER_TFFFD
#define SPI_RSER_RFDFE
#define SPI_RSER_RFDFD

#define SPI_RSER
#define SPI_RSER_TCFQE
#define SPI_RSER_CMDTCFE

#define SPI_PUSHR
#define SPI_PUSHR_CMD_CONT
#define SPI_PUSHR_CMD_CTAS(x)
#define SPI_PUSHR_CMD_EOQ
#define SPI_PUSHR_CMD_CTCNT
#define SPI_PUSHR_CMD_PCS(x)

#define SPI_PUSHR_SLAVE

#define SPI_POPR

#define SPI_TXFR0
#define SPI_TXFR1
#define SPI_TXFR2
#define SPI_TXFR3
#define SPI_RXFR0
#define SPI_RXFR1
#define SPI_RXFR2
#define SPI_RXFR3

#define SPI_CTARE(x)
#define SPI_CTARE_FMSZE(x)
#define SPI_CTARE_DTCP(x)

#define SPI_SREX

#define SPI_FRAME_BITS(bits)
#define SPI_FRAME_EBITS(bits)

#define DMA_COMPLETION_TIMEOUT

struct chip_data {};

enum dspi_trans_mode {};

struct fsl_dspi_devtype_data {};

enum {};

static const struct fsl_dspi_devtype_data devtype_data[] =;

struct fsl_dspi_dma {};

struct fsl_dspi {};

static void dspi_native_host_to_dev(struct fsl_dspi *dspi, u32 *txdata)
{}

static void dspi_native_dev_to_host(struct fsl_dspi *dspi, u32 rxdata)
{}

static void dspi_8on32_host_to_dev(struct fsl_dspi *dspi, u32 *txdata)
{}

static void dspi_8on32_dev_to_host(struct fsl_dspi *dspi, u32 rxdata)
{}

static void dspi_8on16_host_to_dev(struct fsl_dspi *dspi, u32 *txdata)
{}

static void dspi_8on16_dev_to_host(struct fsl_dspi *dspi, u32 rxdata)
{}

static void dspi_16on32_host_to_dev(struct fsl_dspi *dspi, u32 *txdata)
{}

static void dspi_16on32_dev_to_host(struct fsl_dspi *dspi, u32 rxdata)
{}

/*
 * Pop one word from the TX buffer for pushing into the
 * PUSHR register (TX FIFO)
 */
static u32 dspi_pop_tx(struct fsl_dspi *dspi)
{}

/* Prepare one TX FIFO entry (txdata plus cmd) */
static u32 dspi_pop_tx_pushr(struct fsl_dspi *dspi)
{}

/* Push one word to the RX buffer from the POPR register (RX FIFO) */
static void dspi_push_rx(struct fsl_dspi *dspi, u32 rxdata)
{}

static void dspi_tx_dma_callback(void *arg)
{}

static void dspi_rx_dma_callback(void *arg)
{}

static int dspi_next_xfer_dma_submit(struct fsl_dspi *dspi)
{}

static void dspi_setup_accel(struct fsl_dspi *dspi);

static int dspi_dma_xfer(struct fsl_dspi *dspi)
{}

static int dspi_request_dma(struct fsl_dspi *dspi, phys_addr_t phy_addr)
{}

static void dspi_release_dma(struct fsl_dspi *dspi)
{}

static void hz_to_spi_baud(char *pbr, char *br, int speed_hz,
			   unsigned long clkrate)
{}

static void ns_delay_scale(char *psc, char *sc, int delay_ns,
			   unsigned long clkrate)
{}

static void dspi_pushr_cmd_write(struct fsl_dspi *dspi, u16 cmd)
{}

static void dspi_pushr_txdata_write(struct fsl_dspi *dspi, u16 txdata)
{}

static void dspi_xspi_fifo_write(struct fsl_dspi *dspi, int num_words)
{}

static u32 dspi_popr_read(struct fsl_dspi *dspi)
{}

static void dspi_fifo_read(struct fsl_dspi *dspi)
{}

static void dspi_setup_accel(struct fsl_dspi *dspi)
{}

static void dspi_fifo_write(struct fsl_dspi *dspi)
{}

static int dspi_rxtx(struct fsl_dspi *dspi)
{}

static int dspi_poll(struct fsl_dspi *dspi)
{}

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

static void dspi_assert_cs(struct spi_device *spi, bool *cs)
{}

static void dspi_deassert_cs(struct spi_device *spi, bool *cs)
{}

static int dspi_transfer_one_message(struct spi_controller *ctlr,
				     struct spi_message *message)
{}

static int dspi_setup(struct spi_device *spi)
{}

static void dspi_cleanup(struct spi_device *spi)
{}

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

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

static int dspi_resume(struct device *dev)
{}
#endif /* CONFIG_PM_SLEEP */

static SIMPLE_DEV_PM_OPS(dspi_pm, dspi_suspend, dspi_resume);

static const struct regmap_range dspi_volatile_ranges[] =;

static const struct regmap_access_table dspi_volatile_table =;

static const struct regmap_config dspi_regmap_config =;

static const struct regmap_range dspi_xspi_volatile_ranges[] =;

static const struct regmap_access_table dspi_xspi_volatile_table =;

static const struct regmap_config dspi_xspi_regmap_config[] =;

static int dspi_init(struct fsl_dspi *dspi)
{}

static int dspi_target_abort(struct spi_controller *host)
{}

static int dspi_probe(struct platform_device *pdev)
{}

static void dspi_remove(struct platform_device *pdev)
{}

static void dspi_shutdown(struct platform_device *pdev)
{}

static struct platform_driver fsl_dspi_driver =;
module_platform_driver();

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