#include <linux/acpi.h>
#include <linux/init.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/delay.h>
#include <linux/spi/spi.h>
#include <linux/iopoll.h>
#include <linux/spi/spi-mem.h>
#define AMD_SPI_CTRL0_REG …
#define AMD_SPI_EXEC_CMD …
#define AMD_SPI_FIFO_CLEAR …
#define AMD_SPI_BUSY …
#define AMD_SPI_OPCODE_REG …
#define AMD_SPI_CMD_TRIGGER_REG …
#define AMD_SPI_TRIGGER_CMD …
#define AMD_SPI_OPCODE_MASK …
#define AMD_SPI_ALT_CS_REG …
#define AMD_SPI_ALT_CS_MASK …
#define AMD_SPI_FIFO_BASE …
#define AMD_SPI_TX_COUNT_REG …
#define AMD_SPI_RX_COUNT_REG …
#define AMD_SPI_STATUS_REG …
#define AMD_SPI_FIFO_SIZE …
#define AMD_SPI_MEM_SIZE …
#define AMD_SPI_MAX_DATA …
#define AMD_SPI_ENA_REG …
#define AMD_SPI_ALT_SPD_SHIFT …
#define AMD_SPI_ALT_SPD_MASK …
#define AMD_SPI_SPI100_SHIFT …
#define AMD_SPI_SPI100_MASK …
#define AMD_SPI_SPEED_REG …
#define AMD_SPI_SPD7_SHIFT …
#define AMD_SPI_SPD7_MASK …
#define AMD_SPI_MAX_HZ …
#define AMD_SPI_MIN_HZ …
enum amd_spi_versions { … };
enum amd_spi_speed { … };
struct amd_spi_freq { … };
struct amd_spi { … };
static inline u8 amd_spi_readreg8(struct amd_spi *amd_spi, int idx)
{ … }
static inline void amd_spi_writereg8(struct amd_spi *amd_spi, int idx, u8 val)
{ … }
static void amd_spi_setclear_reg8(struct amd_spi *amd_spi, int idx, u8 set, u8 clear)
{ … }
static inline u32 amd_spi_readreg32(struct amd_spi *amd_spi, int idx)
{ … }
static inline void amd_spi_writereg32(struct amd_spi *amd_spi, int idx, u32 val)
{ … }
static inline void amd_spi_setclear_reg32(struct amd_spi *amd_spi, int idx, u32 set, u32 clear)
{ … }
static void amd_spi_select_chip(struct amd_spi *amd_spi, u8 cs)
{ … }
static inline void amd_spi_clear_chip(struct amd_spi *amd_spi, u8 chip_select)
{ … }
static void amd_spi_clear_fifo_ptr(struct amd_spi *amd_spi)
{ … }
static int amd_spi_set_opcode(struct amd_spi *amd_spi, u8 cmd_opcode)
{ … }
static inline void amd_spi_set_rx_count(struct amd_spi *amd_spi, u8 rx_count)
{ … }
static inline void amd_spi_set_tx_count(struct amd_spi *amd_spi, u8 tx_count)
{ … }
static int amd_spi_busy_wait(struct amd_spi *amd_spi)
{ … }
static int amd_spi_execute_opcode(struct amd_spi *amd_spi)
{ … }
static int amd_spi_host_setup(struct spi_device *spi)
{ … }
static const struct amd_spi_freq amd_spi_freq[] = …;
static int amd_set_spi_freq(struct amd_spi *amd_spi, u32 speed_hz)
{ … }
static inline int amd_spi_fifo_xfer(struct amd_spi *amd_spi,
struct spi_controller *host,
struct spi_message *message)
{ … }
static bool amd_spi_supports_op(struct spi_mem *mem,
const struct spi_mem_op *op)
{ … }
static int amd_spi_adjust_op_size(struct spi_mem *mem, struct spi_mem_op *op)
{ … }
static void amd_spi_set_addr(struct amd_spi *amd_spi,
const struct spi_mem_op *op)
{ … }
static void amd_spi_mem_data_out(struct amd_spi *amd_spi,
const struct spi_mem_op *op)
{ … }
static void amd_spi_mem_data_in(struct amd_spi *amd_spi,
const struct spi_mem_op *op)
{ … }
static int amd_spi_exec_mem_op(struct spi_mem *mem,
const struct spi_mem_op *op)
{ … }
static const struct spi_controller_mem_ops amd_spi_mem_ops = …;
static int amd_spi_host_transfer(struct spi_controller *host,
struct spi_message *msg)
{ … }
static size_t amd_spi_max_transfer_size(struct spi_device *spi)
{ … }
static int amd_spi_probe(struct platform_device *pdev)
{ … }
#ifdef CONFIG_ACPI
static const struct acpi_device_id spi_acpi_match[] = …;
MODULE_DEVICE_TABLE(acpi, spi_acpi_match);
#endif
static struct platform_driver amd_spi_driver = …;
module_platform_driver(…) …;
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;