#include <linux/kernel.h>
#include <linux/clk.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/spi/spi.h>
#include <linux/completion.h>
#include <linux/err.h>
#include <linux/pm_runtime.h>
#include <linux/of.h>
#include <linux/reset.h>
#define SPI_6348_RSET_SIZE …
#define SPI_6348_CMD …
#define SPI_6348_INT_STATUS …
#define SPI_6348_INT_MASK_ST …
#define SPI_6348_INT_MASK …
#define SPI_6348_ST …
#define SPI_6348_CLK_CFG …
#define SPI_6348_FILL_BYTE …
#define SPI_6348_MSG_TAIL …
#define SPI_6348_RX_TAIL …
#define SPI_6348_MSG_CTL …
#define SPI_6348_MSG_CTL_WIDTH …
#define SPI_6348_MSG_DATA …
#define SPI_6348_MSG_DATA_SIZE …
#define SPI_6348_RX_DATA …
#define SPI_6348_RX_DATA_SIZE …
#define SPI_6358_RSET_SIZE …
#define SPI_6358_MSG_CTL …
#define SPI_6358_MSG_CTL_WIDTH …
#define SPI_6358_MSG_DATA …
#define SPI_6358_MSG_DATA_SIZE …
#define SPI_6358_RX_DATA …
#define SPI_6358_RX_DATA_SIZE …
#define SPI_6358_CMD …
#define SPI_6358_INT_STATUS …
#define SPI_6358_INT_MASK_ST …
#define SPI_6358_INT_MASK …
#define SPI_6358_ST …
#define SPI_6358_CLK_CFG …
#define SPI_6358_FILL_BYTE …
#define SPI_6358_MSG_TAIL …
#define SPI_6358_RX_TAIL …
#define SPI_FD_RW …
#define SPI_HD_W …
#define SPI_HD_R …
#define SPI_BYTE_CNT_SHIFT …
#define SPI_6348_MSG_TYPE_SHIFT …
#define SPI_6358_MSG_TYPE_SHIFT …
#define SPI_CMD_NOOP …
#define SPI_CMD_SOFT_RESET …
#define SPI_CMD_HARD_RESET …
#define SPI_CMD_START_IMMEDIATE …
#define SPI_CMD_COMMAND_SHIFT …
#define SPI_CMD_COMMAND_MASK …
#define SPI_CMD_DEVICE_ID_SHIFT …
#define SPI_CMD_PREPEND_BYTE_CNT_SHIFT …
#define SPI_CMD_ONE_BYTE_SHIFT …
#define SPI_CMD_ONE_WIRE_SHIFT …
#define SPI_DEV_ID_0 …
#define SPI_DEV_ID_1 …
#define SPI_DEV_ID_2 …
#define SPI_DEV_ID_3 …
#define SPI_INTR_CMD_DONE …
#define SPI_INTR_RX_OVERFLOW …
#define SPI_INTR_TX_UNDERFLOW …
#define SPI_INTR_TX_OVERFLOW …
#define SPI_INTR_RX_UNDERFLOW …
#define SPI_INTR_CLEAR_ALL …
#define SPI_RX_EMPTY …
#define SPI_CMD_BUSY …
#define SPI_SERIAL_BUSY …
#define SPI_CLK_20MHZ …
#define SPI_CLK_0_391MHZ …
#define SPI_CLK_0_781MHZ …
#define SPI_CLK_1_563MHZ …
#define SPI_CLK_3_125MHZ …
#define SPI_CLK_6_250MHZ …
#define SPI_CLK_12_50MHZ …
#define SPI_CLK_MASK …
#define SPI_SSOFFTIME_MASK …
#define SPI_SSOFFTIME_SHIFT …
#define SPI_BYTE_SWAP …
enum bcm63xx_regs_spi { … };
#define BCM63XX_SPI_MAX_PREPEND …
#define BCM63XX_SPI_MAX_CS …
#define BCM63XX_SPI_BUS_NUM …
struct bcm63xx_spi { … };
static inline u8 bcm_spi_readb(struct bcm63xx_spi *bs,
unsigned int offset)
{ … }
static inline void bcm_spi_writeb(struct bcm63xx_spi *bs,
u8 value, unsigned int offset)
{ … }
static inline void bcm_spi_writew(struct bcm63xx_spi *bs,
u16 value, unsigned int offset)
{ … }
static const unsigned int bcm63xx_spi_freq_table[SPI_CLK_MASK][2] = …;
static void bcm63xx_spi_setup_transfer(struct spi_device *spi,
struct spi_transfer *t)
{ … }
#define MODEBITS …
static int bcm63xx_txrx_bufs(struct spi_device *spi, struct spi_transfer *first,
unsigned int num_transfers)
{ … }
static int bcm63xx_spi_transfer_one(struct spi_controller *host,
struct spi_message *m)
{ … }
static irqreturn_t bcm63xx_spi_interrupt(int irq, void *dev_id)
{ … }
static size_t bcm63xx_spi_max_length(struct spi_device *spi)
{ … }
static const unsigned long bcm6348_spi_reg_offsets[] = …;
static const unsigned long bcm6358_spi_reg_offsets[] = …;
static const struct platform_device_id bcm63xx_spi_dev_match[] = …;
static const struct of_device_id bcm63xx_spi_of_match[] = …;
static int bcm63xx_spi_probe(struct platform_device *pdev)
{ … }
static void bcm63xx_spi_remove(struct platform_device *pdev)
{ … }
static int bcm63xx_spi_suspend(struct device *dev)
{ … }
static int bcm63xx_spi_resume(struct device *dev)
{ … }
static DEFINE_SIMPLE_DEV_PM_OPS(bcm63xx_spi_pm_ops, bcm63xx_spi_suspend, bcm63xx_spi_resume);
static struct platform_driver bcm63xx_spi_driver = …;
module_platform_driver(…) …;
MODULE_ALIAS(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;