#include <linux/kernel.h>
#include <linux/clk.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/delay.h>
#include <linux/dma-mapping.h>
#include <linux/dmaengine.h>
#include <linux/err.h>
#include <linux/interrupt.h>
#include <linux/spi/spi.h>
#include <linux/slab.h>
#include <linux/of.h>
#include <linux/io.h>
#include <linux/gpio/consumer.h>
#include <linux/pinctrl/consumer.h>
#include <linux/pm_runtime.h>
#include <linux/iopoll.h>
#include <trace/events/spi.h>
#define SPI_CR …
#define SPI_MR …
#define SPI_RDR …
#define SPI_TDR …
#define SPI_SR …
#define SPI_IER …
#define SPI_IDR …
#define SPI_IMR …
#define SPI_CSR0 …
#define SPI_CSR1 …
#define SPI_CSR2 …
#define SPI_CSR3 …
#define SPI_FMR …
#define SPI_FLR …
#define SPI_VERSION …
#define SPI_RPR …
#define SPI_RCR …
#define SPI_TPR …
#define SPI_TCR …
#define SPI_RNPR …
#define SPI_RNCR …
#define SPI_TNPR …
#define SPI_TNCR …
#define SPI_PTCR …
#define SPI_PTSR …
#define SPI_SPIEN_OFFSET …
#define SPI_SPIEN_SIZE …
#define SPI_SPIDIS_OFFSET …
#define SPI_SPIDIS_SIZE …
#define SPI_SWRST_OFFSET …
#define SPI_SWRST_SIZE …
#define SPI_LASTXFER_OFFSET …
#define SPI_LASTXFER_SIZE …
#define SPI_TXFCLR_OFFSET …
#define SPI_TXFCLR_SIZE …
#define SPI_RXFCLR_OFFSET …
#define SPI_RXFCLR_SIZE …
#define SPI_FIFOEN_OFFSET …
#define SPI_FIFOEN_SIZE …
#define SPI_FIFODIS_OFFSET …
#define SPI_FIFODIS_SIZE …
#define SPI_MSTR_OFFSET …
#define SPI_MSTR_SIZE …
#define SPI_PS_OFFSET …
#define SPI_PS_SIZE …
#define SPI_PCSDEC_OFFSET …
#define SPI_PCSDEC_SIZE …
#define SPI_FDIV_OFFSET …
#define SPI_FDIV_SIZE …
#define SPI_MODFDIS_OFFSET …
#define SPI_MODFDIS_SIZE …
#define SPI_WDRBT_OFFSET …
#define SPI_WDRBT_SIZE …
#define SPI_LLB_OFFSET …
#define SPI_LLB_SIZE …
#define SPI_PCS_OFFSET …
#define SPI_PCS_SIZE …
#define SPI_DLYBCS_OFFSET …
#define SPI_DLYBCS_SIZE …
#define SPI_RD_OFFSET …
#define SPI_RD_SIZE …
#define SPI_TD_OFFSET …
#define SPI_TD_SIZE …
#define SPI_RDRF_OFFSET …
#define SPI_RDRF_SIZE …
#define SPI_TDRE_OFFSET …
#define SPI_TDRE_SIZE …
#define SPI_MODF_OFFSET …
#define SPI_MODF_SIZE …
#define SPI_OVRES_OFFSET …
#define SPI_OVRES_SIZE …
#define SPI_ENDRX_OFFSET …
#define SPI_ENDRX_SIZE …
#define SPI_ENDTX_OFFSET …
#define SPI_ENDTX_SIZE …
#define SPI_RXBUFF_OFFSET …
#define SPI_RXBUFF_SIZE …
#define SPI_TXBUFE_OFFSET …
#define SPI_TXBUFE_SIZE …
#define SPI_NSSR_OFFSET …
#define SPI_NSSR_SIZE …
#define SPI_TXEMPTY_OFFSET …
#define SPI_TXEMPTY_SIZE …
#define SPI_SPIENS_OFFSET …
#define SPI_SPIENS_SIZE …
#define SPI_TXFEF_OFFSET …
#define SPI_TXFEF_SIZE …
#define SPI_TXFFF_OFFSET …
#define SPI_TXFFF_SIZE …
#define SPI_TXFTHF_OFFSET …
#define SPI_TXFTHF_SIZE …
#define SPI_RXFEF_OFFSET …
#define SPI_RXFEF_SIZE …
#define SPI_RXFFF_OFFSET …
#define SPI_RXFFF_SIZE …
#define SPI_RXFTHF_OFFSET …
#define SPI_RXFTHF_SIZE …
#define SPI_TXFPTEF_OFFSET …
#define SPI_TXFPTEF_SIZE …
#define SPI_RXFPTEF_OFFSET …
#define SPI_RXFPTEF_SIZE …
#define SPI_CPOL_OFFSET …
#define SPI_CPOL_SIZE …
#define SPI_NCPHA_OFFSET …
#define SPI_NCPHA_SIZE …
#define SPI_CSAAT_OFFSET …
#define SPI_CSAAT_SIZE …
#define SPI_BITS_OFFSET …
#define SPI_BITS_SIZE …
#define SPI_SCBR_OFFSET …
#define SPI_SCBR_SIZE …
#define SPI_DLYBS_OFFSET …
#define SPI_DLYBS_SIZE …
#define SPI_DLYBCT_OFFSET …
#define SPI_DLYBCT_SIZE …
#define SPI_RXCTR_OFFSET …
#define SPI_RXCTR_SIZE …
#define SPI_TXCTR_OFFSET …
#define SPI_TXCTR_SIZE …
#define SPI_RXNCR_OFFSET …
#define SPI_RXNCR_SIZE …
#define SPI_TXNCR_OFFSET …
#define SPI_TXNCR_SIZE …
#define SPI_RXTEN_OFFSET …
#define SPI_RXTEN_SIZE …
#define SPI_RXTDIS_OFFSET …
#define SPI_RXTDIS_SIZE …
#define SPI_TXTEN_OFFSET …
#define SPI_TXTEN_SIZE …
#define SPI_TXTDIS_OFFSET …
#define SPI_TXTDIS_SIZE …
#define SPI_TXRDYM_OFFSET …
#define SPI_TXRDYM_SIZE …
#define SPI_RXRDYM_OFFSET …
#define SPI_RXRDYM_SIZE …
#define SPI_TXFTHRES_OFFSET …
#define SPI_TXFTHRES_SIZE …
#define SPI_RXFTHRES_OFFSET …
#define SPI_RXFTHRES_SIZE …
#define SPI_TXFL_OFFSET …
#define SPI_TXFL_SIZE …
#define SPI_RXFL_OFFSET …
#define SPI_RXFL_SIZE …
#define SPI_BITS_8_BPT …
#define SPI_BITS_9_BPT …
#define SPI_BITS_10_BPT …
#define SPI_BITS_11_BPT …
#define SPI_BITS_12_BPT …
#define SPI_BITS_13_BPT …
#define SPI_BITS_14_BPT …
#define SPI_BITS_15_BPT …
#define SPI_BITS_16_BPT …
#define SPI_ONE_DATA …
#define SPI_TWO_DATA …
#define SPI_FOUR_DATA …
#define SPI_BIT(name) …
#define SPI_BF(name, value) …
#define SPI_BFEXT(name, value) …
#define SPI_BFINS(name, value, old) …
#define spi_readl(port, reg) …
#define spi_writel(port, reg, value) …
#define spi_writew(port, reg, value) …
#define DMA_MIN_BYTES …
#define AUTOSUSPEND_TIMEOUT …
struct atmel_spi_caps { … };
struct atmel_spi { … };
struct atmel_spi_device { … };
#define SPI_MAX_DMA_XFER …
#define INVALID_DMA_ADDRESS …
#define DUMMY_MSG_FREQUENCY …
#define DUMMY_MSG …
static bool atmel_spi_is_v2(struct atmel_spi *as)
{ … }
static void atmel_spi_send_dummy(struct atmel_spi *as, struct spi_device *spi, int chip_select)
{ … }
static void cs_activate(struct atmel_spi *as, struct spi_device *spi)
{ … }
static void cs_deactivate(struct atmel_spi *as, struct spi_device *spi)
{ … }
static void atmel_spi_lock(struct atmel_spi *as) __acquires(&as->lock)
{ … }
static void atmel_spi_unlock(struct atmel_spi *as) __releases(&as->lock)
{ … }
static inline bool atmel_spi_is_vmalloc_xfer(struct spi_transfer *xfer)
{ … }
static inline bool atmel_spi_use_dma(struct atmel_spi *as,
struct spi_transfer *xfer)
{ … }
static bool atmel_spi_can_dma(struct spi_controller *host,
struct spi_device *spi,
struct spi_transfer *xfer)
{ … }
static int atmel_spi_dma_slave_config(struct atmel_spi *as, u8 bits_per_word)
{ … }
static int atmel_spi_configure_dma(struct spi_controller *host,
struct atmel_spi *as)
{ … }
static void atmel_spi_stop_dma(struct spi_controller *host)
{ … }
static void atmel_spi_release_dma(struct spi_controller *host)
{ … }
static void dma_callback(void *data)
{ … }
static void atmel_spi_next_xfer_single(struct spi_controller *host,
struct spi_transfer *xfer)
{ … }
static void atmel_spi_next_xfer_fifo(struct spi_controller *host,
struct spi_transfer *xfer)
{ … }
static void atmel_spi_next_xfer_pio(struct spi_controller *host,
struct spi_transfer *xfer)
{ … }
static int atmel_spi_next_xfer_dma_submit(struct spi_controller *host,
struct spi_transfer *xfer,
u32 *plen)
{ … }
static void atmel_spi_next_xfer_data(struct spi_controller *host,
struct spi_transfer *xfer,
dma_addr_t *tx_dma,
dma_addr_t *rx_dma,
u32 *plen)
{ … }
static int atmel_spi_set_xfer_speed(struct atmel_spi *as,
struct spi_device *spi,
struct spi_transfer *xfer)
{ … }
static void atmel_spi_pdc_next_xfer(struct spi_controller *host,
struct spi_transfer *xfer)
{ … }
static int
atmel_spi_dma_map_xfer(struct atmel_spi *as, struct spi_transfer *xfer)
{ … }
static void atmel_spi_dma_unmap_xfer(struct spi_controller *host,
struct spi_transfer *xfer)
{ … }
static void atmel_spi_disable_pdc_transfer(struct atmel_spi *as)
{ … }
static void
atmel_spi_pump_single_data(struct atmel_spi *as, struct spi_transfer *xfer)
{ … }
static void
atmel_spi_pump_fifo_data(struct atmel_spi *as, struct spi_transfer *xfer)
{ … }
static void
atmel_spi_pump_pio_data(struct atmel_spi *as, struct spi_transfer *xfer)
{ … }
static irqreturn_t
atmel_spi_pio_interrupt(int irq, void *dev_id)
{ … }
static irqreturn_t
atmel_spi_pdc_interrupt(int irq, void *dev_id)
{ … }
static int atmel_word_delay_csr(struct spi_device *spi, struct atmel_spi *as)
{ … }
static void initialize_native_cs_for_gpio(struct atmel_spi *as)
{ … }
static int atmel_spi_setup(struct spi_device *spi)
{ … }
static void atmel_spi_set_cs(struct spi_device *spi, bool enable)
{ … }
static int atmel_spi_one_transfer(struct spi_controller *host,
struct spi_device *spi,
struct spi_transfer *xfer)
{ … }
static void atmel_spi_cleanup(struct spi_device *spi)
{ … }
static inline unsigned int atmel_get_version(struct atmel_spi *as)
{ … }
static void atmel_get_caps(struct atmel_spi *as)
{ … }
static void atmel_spi_init(struct atmel_spi *as)
{ … }
static int atmel_spi_probe(struct platform_device *pdev)
{ … }
static void atmel_spi_remove(struct platform_device *pdev)
{ … }
static int atmel_spi_runtime_suspend(struct device *dev)
{ … }
static int atmel_spi_runtime_resume(struct device *dev)
{ … }
static int atmel_spi_suspend(struct device *dev)
{ … }
static int atmel_spi_resume(struct device *dev)
{ … }
static const struct dev_pm_ops atmel_spi_pm_ops = …;
static const struct of_device_id atmel_spi_dt_ids[] = …;
MODULE_DEVICE_TABLE(of, atmel_spi_dt_ids);
static struct platform_driver atmel_spi_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;
MODULE_ALIAS(…) …;