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

// SPDX-License-Identifier: GPL-2.0+
//
// Freescale i.MX7ULP LPSPI driver
//
// Copyright 2016 Freescale Semiconductor, Inc.
// Copyright 2018 NXP Semiconductors

#include <linux/clk.h>
#include <linux/completion.h>
#include <linux/delay.h>
#include <linux/dmaengine.h>
#include <linux/dma-mapping.h>
#include <linux/err.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/irq.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/pinctrl/consumer.h>
#include <linux/platform_device.h>
#include <linux/dma/imx-dma.h>
#include <linux/pm_runtime.h>
#include <linux/slab.h>
#include <linux/spi/spi.h>
#include <linux/spi/spi_bitbang.h>
#include <linux/types.h>

#define DRIVER_NAME

#define FSL_LPSPI_RPM_TIMEOUT

/* The maximum bytes that edma can transfer once.*/
#define FSL_LPSPI_MAX_EDMA_BYTES

/* i.MX7ULP LPSPI registers */
#define IMX7ULP_VERID
#define IMX7ULP_PARAM
#define IMX7ULP_CR
#define IMX7ULP_SR
#define IMX7ULP_IER
#define IMX7ULP_DER
#define IMX7ULP_CFGR0
#define IMX7ULP_CFGR1
#define IMX7ULP_DMR0
#define IMX7ULP_DMR1
#define IMX7ULP_CCR
#define IMX7ULP_FCR
#define IMX7ULP_FSR
#define IMX7ULP_TCR
#define IMX7ULP_TDR
#define IMX7ULP_RSR
#define IMX7ULP_RDR

/* General control register field define */
#define CR_RRF
#define CR_RTF
#define CR_RST
#define CR_MEN
#define SR_MBF
#define SR_TCF
#define SR_FCF
#define SR_RDF
#define SR_TDF
#define IER_TCIE
#define IER_FCIE
#define IER_RDIE
#define IER_TDIE
#define DER_RDDE
#define DER_TDDE
#define CFGR1_PCSCFG
#define CFGR1_PINCFG
#define CFGR1_PCSPOL
#define CFGR1_NOSTALL
#define CFGR1_HOST
#define FSR_TXCOUNT
#define RSR_RXEMPTY
#define TCR_CPOL
#define TCR_CPHA
#define TCR_CONT
#define TCR_CONTC
#define TCR_RXMSK
#define TCR_TXMSK

struct lpspi_config {};

struct fsl_lpspi_data {};

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

#define LPSPI_BUF_RX(type)

#define LPSPI_BUF_TX(type)

LPSPI_BUF_RX()
LPSPI_BUF_TX()
LPSPI_BUF_RX()
LPSPI_BUF_TX()
LPSPI_BUF_RX()
LPSPI_BUF_TX()

static void fsl_lpspi_intctrl(struct fsl_lpspi_data *fsl_lpspi,
			      unsigned int enable)
{}

static int fsl_lpspi_bytes_per_word(const int bpw)
{}

static bool fsl_lpspi_can_dma(struct spi_controller *controller,
			      struct spi_device *spi,
			      struct spi_transfer *transfer)
{}

static int lpspi_prepare_xfer_hardware(struct spi_controller *controller)
{}

static int lpspi_unprepare_xfer_hardware(struct spi_controller *controller)
{}

static void fsl_lpspi_write_tx_fifo(struct fsl_lpspi_data *fsl_lpspi)
{}

static void fsl_lpspi_read_rx_fifo(struct fsl_lpspi_data *fsl_lpspi)
{}

static void fsl_lpspi_set_cmd(struct fsl_lpspi_data *fsl_lpspi)
{}

static void fsl_lpspi_set_watermark(struct fsl_lpspi_data *fsl_lpspi)
{}

static int fsl_lpspi_set_bitrate(struct fsl_lpspi_data *fsl_lpspi)
{}

static int fsl_lpspi_dma_configure(struct spi_controller *controller)
{}

static int fsl_lpspi_config(struct fsl_lpspi_data *fsl_lpspi)
{}

static int fsl_lpspi_setup_transfer(struct spi_controller *controller,
				     struct spi_device *spi,
				     struct spi_transfer *t)
{}

static int fsl_lpspi_target_abort(struct spi_controller *controller)
{}

static int fsl_lpspi_wait_for_completion(struct spi_controller *controller)
{}

static int fsl_lpspi_reset(struct fsl_lpspi_data *fsl_lpspi)
{}

static void fsl_lpspi_dma_rx_callback(void *cookie)
{}

static void fsl_lpspi_dma_tx_callback(void *cookie)
{}

static int fsl_lpspi_calculate_timeout(struct fsl_lpspi_data *fsl_lpspi,
				       int size)
{}

static int fsl_lpspi_dma_transfer(struct spi_controller *controller,
				struct fsl_lpspi_data *fsl_lpspi,
				struct spi_transfer *transfer)
{}

static void fsl_lpspi_dma_exit(struct spi_controller *controller)
{}

static int fsl_lpspi_dma_init(struct device *dev,
			      struct fsl_lpspi_data *fsl_lpspi,
			      struct spi_controller *controller)
{}

static int fsl_lpspi_pio_transfer(struct spi_controller *controller,
				  struct spi_transfer *t)
{}

static int fsl_lpspi_transfer_one(struct spi_controller *controller,
				  struct spi_device *spi,
				  struct spi_transfer *t)
{}

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

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

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

static int fsl_lpspi_init_rpm(struct fsl_lpspi_data *fsl_lpspi)
{}

static int fsl_lpspi_probe(struct platform_device *pdev)
{}

static void fsl_lpspi_remove(struct platform_device *pdev)
{}

static int fsl_lpspi_suspend(struct device *dev)
{}

static int fsl_lpspi_resume(struct device *dev)
{}

static const struct dev_pm_ops fsl_lpspi_pm_ops =;

static struct platform_driver fsl_lpspi_driver =;
module_platform_driver();

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