#include <linux/bitfield.h>
#include <linux/clk.h>
#include <linux/device.h>
#include <linux/io.h>
#include <linux/iopoll.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/spi/spi.h>
#include <linux/spi/spi-mem.h>
#include <linux/types.h>
#define SPIFC_A1_AHB_CTRL_REG …
#define SPIFC_A1_AHB_BUS_EN …
#define SPIFC_A1_USER_CTRL0_REG …
#define SPIFC_A1_USER_REQUEST_ENABLE …
#define SPIFC_A1_USER_REQUEST_FINISH …
#define SPIFC_A1_USER_DATA_UPDATED …
#define SPIFC_A1_USER_CTRL1_REG …
#define SPIFC_A1_USER_CMD_ENABLE …
#define SPIFC_A1_USER_CMD_MODE …
#define SPIFC_A1_USER_CMD_CODE …
#define SPIFC_A1_USER_ADDR_ENABLE …
#define SPIFC_A1_USER_ADDR_MODE …
#define SPIFC_A1_USER_ADDR_BYTES …
#define SPIFC_A1_USER_DOUT_ENABLE …
#define SPIFC_A1_USER_DOUT_MODE …
#define SPIFC_A1_USER_DOUT_BYTES …
#define SPIFC_A1_USER_CTRL2_REG …
#define SPIFC_A1_USER_DUMMY_ENABLE …
#define SPIFC_A1_USER_DUMMY_MODE …
#define SPIFC_A1_USER_DUMMY_CLK_SYCLES …
#define SPIFC_A1_USER_CTRL3_REG …
#define SPIFC_A1_USER_DIN_ENABLE …
#define SPIFC_A1_USER_DIN_MODE …
#define SPIFC_A1_USER_DIN_BYTES …
#define SPIFC_A1_USER_ADDR_REG …
#define SPIFC_A1_AHB_REQ_CTRL_REG …
#define SPIFC_A1_AHB_REQ_ENABLE …
#define SPIFC_A1_ACTIMING0_REG …
#define SPIFC_A1_TSLCH …
#define SPIFC_A1_TCLSH …
#define SPIFC_A1_TSHWL …
#define SPIFC_A1_TSHSL2 …
#define SPIFC_A1_TSHSL1 …
#define SPIFC_A1_TWHSL …
#define SPIFC_A1_DBUF_CTRL_REG …
#define SPIFC_A1_DBUF_DIR …
#define SPIFC_A1_DBUF_AUTO_UPDATE_ADDR …
#define SPIFC_A1_DBUF_ADDR …
#define SPIFC_A1_DBUF_DATA_REG …
#define SPIFC_A1_USER_DBUF_ADDR_REG …
#define SPIFC_A1_BUFFER_SIZE …
#define SPIFC_A1_MAX_HZ …
#define SPIFC_A1_MIN_HZ …
#define SPIFC_A1_USER_CMD(op) …
#define SPIFC_A1_USER_ADDR(op) …
#define SPIFC_A1_USER_DUMMY(op) …
#define SPIFC_A1_TSLCH_VAL …
#define SPIFC_A1_TCLSH_VAL …
#define SPIFC_A1_TSHWL_VAL …
#define SPIFC_A1_TSHSL2_VAL …
#define SPIFC_A1_TSHSL1_VAL …
#define SPIFC_A1_TWHSL_VAL …
#define SPIFC_A1_ACTIMING0_VAL …
struct amlogic_spifc_a1 { … };
static int amlogic_spifc_a1_request(struct amlogic_spifc_a1 *spifc, bool read)
{ … }
static void amlogic_spifc_a1_drain_buffer(struct amlogic_spifc_a1 *spifc,
char *buf, u32 len)
{ … }
static void amlogic_spifc_a1_fill_buffer(struct amlogic_spifc_a1 *spifc,
const char *buf, u32 len)
{ … }
static void amlogic_spifc_a1_user_init(struct amlogic_spifc_a1 *spifc)
{ … }
static void amlogic_spifc_a1_set_cmd(struct amlogic_spifc_a1 *spifc,
u32 cmd_cfg)
{ … }
static void amlogic_spifc_a1_set_addr(struct amlogic_spifc_a1 *spifc, u32 addr,
u32 addr_cfg)
{ … }
static void amlogic_spifc_a1_set_dummy(struct amlogic_spifc_a1 *spifc,
u32 dummy_cfg)
{ … }
static int amlogic_spifc_a1_read(struct amlogic_spifc_a1 *spifc, void *buf,
u32 size, u32 mode)
{ … }
static int amlogic_spifc_a1_write(struct amlogic_spifc_a1 *spifc,
const void *buf, u32 size, u32 mode)
{ … }
static int amlogic_spifc_a1_set_freq(struct amlogic_spifc_a1 *spifc, u32 freq)
{ … }
static int amlogic_spifc_a1_exec_op(struct spi_mem *mem,
const struct spi_mem_op *op)
{ … }
static int amlogic_spifc_a1_adjust_op_size(struct spi_mem *mem,
struct spi_mem_op *op)
{ … }
static void amlogic_spifc_a1_hw_init(struct amlogic_spifc_a1 *spifc)
{ … }
static const struct spi_controller_mem_ops amlogic_spifc_a1_mem_ops = …;
static int amlogic_spifc_a1_probe(struct platform_device *pdev)
{ … }
#ifdef CONFIG_PM_SLEEP
static int amlogic_spifc_a1_suspend(struct device *dev)
{ … }
static int amlogic_spifc_a1_resume(struct device *dev)
{ … }
#endif
#ifdef CONFIG_PM
static int amlogic_spifc_a1_runtime_suspend(struct device *dev)
{ … }
static int amlogic_spifc_a1_runtime_resume(struct device *dev)
{ … }
#endif
static const struct dev_pm_ops amlogic_spifc_a1_pm_ops = …;
#ifdef CONFIG_OF
static const struct of_device_id amlogic_spifc_a1_dt_match[] = …;
MODULE_DEVICE_TABLE(of, amlogic_spifc_a1_dt_match);
#endif
static struct platform_driver amlogic_spifc_a1_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;