#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/io.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/regmap.h>
#include <linux/spi/spi.h>
#include <linux/types.h>
#define REG_CMD …
#define REG_ADDR …
#define REG_CTRL …
#define REG_CTRL1 …
#define REG_STATUS …
#define REG_CTRL2 …
#define REG_CLOCK …
#define REG_USER …
#define REG_USER1 …
#define REG_USER2 …
#define REG_USER3 …
#define REG_USER4 …
#define REG_SLAVE …
#define REG_SLAVE1 …
#define REG_SLAVE2 …
#define REG_SLAVE3 …
#define REG_C0 …
#define REG_B8 …
#define REG_MAX …
#define CMD_USER …
#define CTRL_ENABLE_AHB …
#define CLOCK_SOURCE …
#define CLOCK_DIV_SHIFT …
#define CLOCK_DIV_MASK …
#define CLOCK_CNT_HIGH_SHIFT …
#define CLOCK_CNT_HIGH_MASK …
#define CLOCK_CNT_LOW_SHIFT …
#define CLOCK_CNT_LOW_MASK …
#define USER_DIN_EN_MS …
#define USER_CMP_MODE …
#define USER_UC_DOUT_SEL …
#define USER_UC_DIN_SEL …
#define USER_UC_MASK …
#define USER1_BN_UC_DOUT_SHIFT …
#define USER1_BN_UC_DOUT_MASK …
#define USER1_BN_UC_DIN_SHIFT …
#define USER1_BN_UC_DIN_MASK …
#define USER4_CS_ACT …
#define SLAVE_TRST_DONE …
#define SLAVE_OP_MODE …
#define SLAVE_SW_RST …
#define SPIFC_BUFFER_SIZE …
struct meson_spifc { … };
static const struct regmap_config spifc_regmap_config = …;
static int meson_spifc_wait_ready(struct meson_spifc *spifc)
{ … }
static void meson_spifc_drain_buffer(struct meson_spifc *spifc, u8 *buf,
int len)
{ … }
static void meson_spifc_fill_buffer(struct meson_spifc *spifc, const u8 *buf,
int len)
{ … }
static void meson_spifc_setup_speed(struct meson_spifc *spifc, u32 speed)
{ … }
static int meson_spifc_txrx(struct meson_spifc *spifc,
struct spi_transfer *xfer,
int offset, int len, bool last_xfer,
bool last_chunk)
{ … }
static int meson_spifc_transfer_one(struct spi_controller *host,
struct spi_device *spi,
struct spi_transfer *xfer)
{ … }
static void meson_spifc_hw_init(struct meson_spifc *spifc)
{ … }
static int meson_spifc_probe(struct platform_device *pdev)
{ … }
static void meson_spifc_remove(struct platform_device *pdev)
{ … }
#ifdef CONFIG_PM_SLEEP
static int meson_spifc_suspend(struct device *dev)
{ … }
static int meson_spifc_resume(struct device *dev)
{ … }
#endif
#ifdef CONFIG_PM
static int meson_spifc_runtime_suspend(struct device *dev)
{ … }
static int meson_spifc_runtime_resume(struct device *dev)
{ … }
#endif
static const struct dev_pm_ops meson_spifc_pm_ops = …;
static const struct of_device_id meson_spifc_dt_match[] = …;
MODULE_DEVICE_TABLE(of, meson_spifc_dt_match);
static struct platform_driver meson_spifc_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;