#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/io.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/err.h>
#include <linux/interrupt.h>
#include <linux/spi/spi.h>
#include <linux/mutex.h>
#include <linux/of.h>
#include <linux/spi/spi-mem.h>
#include <linux/mtd/spi-nor.h>
#include <linux/reset.h>
#include <linux/pm_runtime.h>
#define HSSPI_GLOBAL_CTRL_REG …
#define GLOBAL_CTRL_CS_POLARITY_SHIFT …
#define GLOBAL_CTRL_CS_POLARITY_MASK …
#define GLOBAL_CTRL_PLL_CLK_CTRL_SHIFT …
#define GLOBAL_CTRL_PLL_CLK_CTRL_MASK …
#define GLOBAL_CTRL_CLK_GATE_SSOFF …
#define GLOBAL_CTRL_CLK_POLARITY …
#define GLOBAL_CTRL_MOSI_IDLE …
#define HSSPI_GLOBAL_EXT_TRIGGER_REG …
#define HSSPI_INT_STATUS_REG …
#define HSSPI_INT_STATUS_MASKED_REG …
#define HSSPI_INT_MASK_REG …
#define HSSPI_PINGx_CMD_DONE(i) …
#define HSSPI_PINGx_RX_OVER(i) …
#define HSSPI_PINGx_TX_UNDER(i) …
#define HSSPI_PINGx_POLL_TIMEOUT(i) …
#define HSSPI_PINGx_CTRL_INVAL(i) …
#define HSSPI_INT_CLEAR_ALL …
#define HSSPI_PINGPONG_COMMAND_REG(x) …
#define PINGPONG_CMD_COMMAND_MASK …
#define PINGPONG_COMMAND_NOOP …
#define PINGPONG_COMMAND_START_NOW …
#define PINGPONG_COMMAND_START_TRIGGER …
#define PINGPONG_COMMAND_HALT …
#define PINGPONG_COMMAND_FLUSH …
#define PINGPONG_CMD_PROFILE_SHIFT …
#define PINGPONG_CMD_SS_SHIFT …
#define HSSPI_PINGPONG_STATUS_REG(x) …
#define HSSPI_PINGPONG_STATUS_SRC_BUSY …
#define HSSPI_PROFILE_CLK_CTRL_REG(x) …
#define CLK_CTRL_FREQ_CTRL_MASK …
#define CLK_CTRL_SPI_CLK_2X_SEL …
#define CLK_CTRL_ACCUM_RST_ON_LOOP …
#define HSSPI_PROFILE_SIGNAL_CTRL_REG(x) …
#define SIGNAL_CTRL_LATCH_RISING …
#define SIGNAL_CTRL_LAUNCH_RISING …
#define SIGNAL_CTRL_ASYNC_INPUT_PATH …
#define HSSPI_PROFILE_MODE_CTRL_REG(x) …
#define MODE_CTRL_MULTIDATA_RD_STRT_SHIFT …
#define MODE_CTRL_MULTIDATA_WR_STRT_SHIFT …
#define MODE_CTRL_MULTIDATA_RD_SIZE_SHIFT …
#define MODE_CTRL_MULTIDATA_WR_SIZE_SHIFT …
#define MODE_CTRL_MODE_3WIRE …
#define MODE_CTRL_PREPENDBYTE_CNT_SHIFT …
#define HSSPI_FIFO_REG(x) …
#define HSSPI_OP_MULTIBIT …
#define HSSPI_OP_CODE_SHIFT …
#define HSSPI_OP_SLEEP …
#define HSSPI_OP_READ_WRITE …
#define HSSPI_OP_WRITE …
#define HSSPI_OP_READ …
#define HSSPI_OP_SETIRQ …
#define HSSPI_BUFFER_LEN …
#define HSSPI_OPCODE_LEN …
#define HSSPI_MAX_PREPEND_LEN …
#define HSSPI_MAX_SYNC_CLOCK …
#define HSSPI_SPI_MAX_CS …
#define HSSPI_BUS_NUM …
#define HSSPI_POLL_STATUS_TIMEOUT_MS …
#define HSSPI_WAIT_MODE_POLLING …
#define HSSPI_WAIT_MODE_INTR …
#define HSSPI_WAIT_MODE_MAX …
#define HSSPI_XFER_MODE_AUTO …
#define HSSPI_XFER_MODE_PREPEND …
#define HSSPI_XFER_MODE_DUMMYCS …
#define HSSPI_XFER_MODE_MAX …
#define bcm63xx_prepend_printk_on_checkfail(bs, fmt, ...) …
struct bcm63xx_hsspi { … };
static ssize_t wait_mode_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t wait_mode_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR_RW(wait_mode);
static ssize_t xfer_mode_show(struct device *dev, struct device_attribute *attr,
char *buf)
{ … }
static ssize_t xfer_mode_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR_RW(xfer_mode);
static struct attribute *bcm63xx_hsspi_attrs[] = …;
static const struct attribute_group bcm63xx_hsspi_group = …;
static void bcm63xx_hsspi_set_clk(struct bcm63xx_hsspi *bs,
struct spi_device *spi, int hz);
static size_t bcm63xx_hsspi_max_message_size(struct spi_device *spi)
{ … }
static int bcm63xx_hsspi_wait_cmd(struct bcm63xx_hsspi *bs)
{ … }
static bool bcm63xx_prepare_prepend_transfer(struct spi_controller *host,
struct spi_message *msg,
struct spi_transfer *t_prepend)
{ … }
static int bcm63xx_hsspi_do_prepend_txrx(struct spi_device *spi,
struct spi_transfer *t)
{ … }
static void bcm63xx_hsspi_set_cs(struct bcm63xx_hsspi *bs, unsigned int cs,
bool active)
{ … }
static void bcm63xx_hsspi_set_clk(struct bcm63xx_hsspi *bs,
struct spi_device *spi, int hz)
{ … }
static int bcm63xx_hsspi_do_txrx(struct spi_device *spi, struct spi_transfer *t)
{ … }
static int bcm63xx_hsspi_setup(struct spi_device *spi)
{ … }
static int bcm63xx_hsspi_do_dummy_cs_txrx(struct spi_device *spi,
struct spi_message *msg)
{ … }
static int bcm63xx_hsspi_transfer_one(struct spi_controller *host,
struct spi_message *msg)
{ … }
static bool bcm63xx_hsspi_mem_supports_op(struct spi_mem *mem,
const struct spi_mem_op *op)
{ … }
static const struct spi_controller_mem_ops bcm63xx_hsspi_mem_ops = …;
static irqreturn_t bcm63xx_hsspi_interrupt(int irq, void *dev_id)
{ … }
static int bcm63xx_hsspi_probe(struct platform_device *pdev)
{ … }
static void bcm63xx_hsspi_remove(struct platform_device *pdev)
{ … }
#ifdef CONFIG_PM_SLEEP
static int bcm63xx_hsspi_suspend(struct device *dev)
{ … }
static int bcm63xx_hsspi_resume(struct device *dev)
{ … }
#endif
static SIMPLE_DEV_PM_OPS(bcm63xx_hsspi_pm_ops, bcm63xx_hsspi_suspend,
bcm63xx_hsspi_resume);
static const struct of_device_id bcm63xx_hsspi_of_match[] = …;
MODULE_DEVICE_TABLE(of, bcm63xx_hsspi_of_match);
static struct platform_driver bcm63xx_hsspi_driver = …;
module_platform_driver(…) …;
MODULE_ALIAS(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;