#include <linux/bitfield.h>
#include <linux/clk.h>
#include <linux/dmaengine.h>
#include <linux/dma-mapping.h>
#include <linux/errno.h>
#include <linux/gpio/consumer.h>
#include <linux/io.h>
#include <linux/iopoll.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/of.h>
#include <linux/pinctrl/consumer.h>
#include <linux/pm_runtime.h>
#include <linux/platform_device.h>
#include <linux/reset.h>
#include <linux/sizes.h>
#include <linux/spi/spi-mem.h>
#define QSPI_CR …
#define CR_EN …
#define CR_ABORT …
#define CR_DMAEN …
#define CR_TCEN …
#define CR_SSHIFT …
#define CR_DFM …
#define CR_FSEL …
#define CR_FTHRES_SHIFT …
#define CR_TEIE …
#define CR_TCIE …
#define CR_FTIE …
#define CR_SMIE …
#define CR_TOIE …
#define CR_APMS …
#define CR_PRESC_MASK …
#define QSPI_DCR …
#define DCR_FSIZE_MASK …
#define QSPI_SR …
#define SR_TEF …
#define SR_TCF …
#define SR_FTF …
#define SR_SMF …
#define SR_TOF …
#define SR_BUSY …
#define SR_FLEVEL_MASK …
#define QSPI_FCR …
#define FCR_CTEF …
#define FCR_CTCF …
#define FCR_CSMF …
#define QSPI_DLR …
#define QSPI_CCR …
#define CCR_INST_MASK …
#define CCR_IMODE_MASK …
#define CCR_ADMODE_MASK …
#define CCR_ADSIZE_MASK …
#define CCR_DCYC_MASK …
#define CCR_DMODE_MASK …
#define CCR_FMODE_MASK …
#define CCR_FMODE_INDW …
#define CCR_FMODE_INDR …
#define CCR_FMODE_APM …
#define CCR_FMODE_MM …
#define CCR_BUSWIDTH_0 …
#define CCR_BUSWIDTH_1 …
#define CCR_BUSWIDTH_2 …
#define CCR_BUSWIDTH_4 …
#define QSPI_AR …
#define QSPI_ABR …
#define QSPI_DR …
#define QSPI_PSMKR …
#define QSPI_PSMAR …
#define QSPI_PIR …
#define QSPI_LPTR …
#define STM32_QSPI_MAX_MMAP_SZ …
#define STM32_QSPI_MAX_NORCHIP …
#define STM32_FIFO_TIMEOUT_US …
#define STM32_BUSY_TIMEOUT_US …
#define STM32_ABT_TIMEOUT_US …
#define STM32_COMP_TIMEOUT_MS …
#define STM32_AUTOSUSPEND_DELAY …
struct stm32_qspi_flash { … };
struct stm32_qspi { … };
static irqreturn_t stm32_qspi_irq(int irq, void *dev_id)
{ … }
static void stm32_qspi_read_fifo(u8 *val, void __iomem *addr)
{ … }
static void stm32_qspi_write_fifo(u8 *val, void __iomem *addr)
{ … }
static int stm32_qspi_tx_poll(struct stm32_qspi *qspi,
const struct spi_mem_op *op)
{ … }
static int stm32_qspi_tx_mm(struct stm32_qspi *qspi,
const struct spi_mem_op *op)
{ … }
static void stm32_qspi_dma_callback(void *arg)
{ … }
static int stm32_qspi_tx_dma(struct stm32_qspi *qspi,
const struct spi_mem_op *op)
{ … }
static int stm32_qspi_tx(struct stm32_qspi *qspi, const struct spi_mem_op *op)
{ … }
static int stm32_qspi_wait_nobusy(struct stm32_qspi *qspi)
{ … }
static int stm32_qspi_wait_cmd(struct stm32_qspi *qspi)
{ … }
static int stm32_qspi_wait_poll_status(struct stm32_qspi *qspi)
{ … }
static int stm32_qspi_get_mode(u8 buswidth)
{ … }
static int stm32_qspi_send(struct spi_device *spi, const struct spi_mem_op *op)
{ … }
static int stm32_qspi_poll_status(struct spi_mem *mem, const struct spi_mem_op *op,
u16 mask, u16 match,
unsigned long initial_delay_us,
unsigned long polling_rate_us,
unsigned long timeout_ms)
{ … }
static int stm32_qspi_exec_op(struct spi_mem *mem, const struct spi_mem_op *op)
{ … }
static int stm32_qspi_dirmap_create(struct spi_mem_dirmap_desc *desc)
{ … }
static ssize_t stm32_qspi_dirmap_read(struct spi_mem_dirmap_desc *desc,
u64 offs, size_t len, void *buf)
{ … }
static int stm32_qspi_transfer_one_message(struct spi_controller *ctrl,
struct spi_message *msg)
{ … }
static int stm32_qspi_setup(struct spi_device *spi)
{ … }
static int stm32_qspi_dma_setup(struct stm32_qspi *qspi)
{ … }
static void stm32_qspi_dma_free(struct stm32_qspi *qspi)
{ … }
static const struct spi_controller_mem_ops stm32_qspi_mem_ops = …;
static int stm32_qspi_probe(struct platform_device *pdev)
{ … }
static void stm32_qspi_remove(struct platform_device *pdev)
{ … }
static int __maybe_unused stm32_qspi_runtime_suspend(struct device *dev)
{ … }
static int __maybe_unused stm32_qspi_runtime_resume(struct device *dev)
{ … }
static int __maybe_unused stm32_qspi_suspend(struct device *dev)
{ … }
static int __maybe_unused stm32_qspi_resume(struct device *dev)
{ … }
static const struct dev_pm_ops stm32_qspi_pm_ops = …;
static const struct of_device_id stm32_qspi_match[] = …;
MODULE_DEVICE_TABLE(of, stm32_qspi_match);
static struct platform_driver stm32_qspi_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;