#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/dmaengine.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/irq.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/scatterlist.h>
#include <linux/slab.h>
#include <linux/spi/spi.h>
#include <linux/spinlock.h>
#define SPFI_DEVICE_PARAMETER(x) …
#define SPFI_DEVICE_PARAMETER_BITCLK_SHIFT …
#define SPFI_DEVICE_PARAMETER_BITCLK_MASK …
#define SPFI_DEVICE_PARAMETER_CSSETUP_SHIFT …
#define SPFI_DEVICE_PARAMETER_CSSETUP_MASK …
#define SPFI_DEVICE_PARAMETER_CSHOLD_SHIFT …
#define SPFI_DEVICE_PARAMETER_CSHOLD_MASK …
#define SPFI_DEVICE_PARAMETER_CSDELAY_SHIFT …
#define SPFI_DEVICE_PARAMETER_CSDELAY_MASK …
#define SPFI_CONTROL …
#define SPFI_CONTROL_CONTINUE …
#define SPFI_CONTROL_SOFT_RESET …
#define SPFI_CONTROL_SEND_DMA …
#define SPFI_CONTROL_GET_DMA …
#define SPFI_CONTROL_SE …
#define SPFI_CONTROL_TMODE_SHIFT …
#define SPFI_CONTROL_TMODE_MASK …
#define SPFI_CONTROL_TMODE_SINGLE …
#define SPFI_CONTROL_TMODE_DUAL …
#define SPFI_CONTROL_TMODE_QUAD …
#define SPFI_CONTROL_SPFI_EN …
#define SPFI_TRANSACTION …
#define SPFI_TRANSACTION_TSIZE_SHIFT …
#define SPFI_TRANSACTION_TSIZE_MASK …
#define SPFI_PORT_STATE …
#define SPFI_PORT_STATE_DEV_SEL_SHIFT …
#define SPFI_PORT_STATE_DEV_SEL_MASK …
#define SPFI_PORT_STATE_CK_POL(x) …
#define SPFI_PORT_STATE_CK_PHASE(x) …
#define SPFI_TX_32BIT_VALID_DATA …
#define SPFI_TX_8BIT_VALID_DATA …
#define SPFI_RX_32BIT_VALID_DATA …
#define SPFI_RX_8BIT_VALID_DATA …
#define SPFI_INTERRUPT_STATUS …
#define SPFI_INTERRUPT_ENABLE …
#define SPFI_INTERRUPT_CLEAR …
#define SPFI_INTERRUPT_IACCESS …
#define SPFI_INTERRUPT_GDEX8BIT …
#define SPFI_INTERRUPT_ALLDONETRIG …
#define SPFI_INTERRUPT_GDFUL …
#define SPFI_INTERRUPT_GDHF …
#define SPFI_INTERRUPT_GDEX32BIT …
#define SPFI_INTERRUPT_GDTRIG …
#define SPFI_INTERRUPT_SDFUL …
#define SPFI_INTERRUPT_SDHF …
#define SPFI_INTERRUPT_SDE …
#define SPFI_INTERRUPT_SDTRIG …
#define SPFI_32BIT_FIFO_SIZE …
#define SPFI_8BIT_FIFO_SIZE …
struct img_spfi { … };
static inline u32 spfi_readl(struct img_spfi *spfi, u32 reg)
{ … }
static inline void spfi_writel(struct img_spfi *spfi, u32 val, u32 reg)
{ … }
static inline void spfi_start(struct img_spfi *spfi)
{ … }
static inline void spfi_reset(struct img_spfi *spfi)
{ … }
static int spfi_wait_all_done(struct img_spfi *spfi)
{ … }
static unsigned int spfi_pio_write32(struct img_spfi *spfi, const u32 *buf,
unsigned int max)
{ … }
static unsigned int spfi_pio_write8(struct img_spfi *spfi, const u8 *buf,
unsigned int max)
{ … }
static unsigned int spfi_pio_read32(struct img_spfi *spfi, u32 *buf,
unsigned int max)
{ … }
static unsigned int spfi_pio_read8(struct img_spfi *spfi, u8 *buf,
unsigned int max)
{ … }
static int img_spfi_start_pio(struct spi_controller *host,
struct spi_device *spi,
struct spi_transfer *xfer)
{ … }
static void img_spfi_dma_rx_cb(void *data)
{ … }
static void img_spfi_dma_tx_cb(void *data)
{ … }
static int img_spfi_start_dma(struct spi_controller *host,
struct spi_device *spi,
struct spi_transfer *xfer)
{ … }
static void img_spfi_handle_err(struct spi_controller *host,
struct spi_message *msg)
{ … }
static int img_spfi_prepare(struct spi_controller *host, struct spi_message *msg)
{ … }
static int img_spfi_unprepare(struct spi_controller *host,
struct spi_message *msg)
{ … }
static void img_spfi_config(struct spi_controller *host, struct spi_device *spi,
struct spi_transfer *xfer)
{ … }
static int img_spfi_transfer_one(struct spi_controller *host,
struct spi_device *spi,
struct spi_transfer *xfer)
{ … }
static bool img_spfi_can_dma(struct spi_controller *host, struct spi_device *spi,
struct spi_transfer *xfer)
{ … }
static irqreturn_t img_spfi_irq(int irq, void *dev_id)
{ … }
static int img_spfi_probe(struct platform_device *pdev)
{ … }
static void img_spfi_remove(struct platform_device *pdev)
{ … }
#ifdef CONFIG_PM
static int img_spfi_runtime_suspend(struct device *dev)
{ … }
static int img_spfi_runtime_resume(struct device *dev)
{ … }
#endif
#ifdef CONFIG_PM_SLEEP
static int img_spfi_suspend(struct device *dev)
{ … }
static int img_spfi_resume(struct device *dev)
{ … }
#endif
static const struct dev_pm_ops img_spfi_pm_ops = …;
static const struct of_device_id img_spfi_of_match[] = …;
MODULE_DEVICE_TABLE(of, img_spfi_of_match);
static struct platform_driver img_spfi_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;