#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/errno.h>
#include <linux/timer.h>
#include <linux/delay.h>
#include <linux/list.h>
#include <linux/workqueue.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <linux/io.h>
#include <linux/spi/spi.h>
#define SPI_SH_TBR …
#define SPI_SH_RBR …
#define SPI_SH_CR1 …
#define SPI_SH_CR2 …
#define SPI_SH_CR3 …
#define SPI_SH_CR4 …
#define SPI_SH_CR5 …
#define SPI_SH_TBE …
#define SPI_SH_TBF …
#define SPI_SH_RBE …
#define SPI_SH_RBF …
#define SPI_SH_PFONRD …
#define SPI_SH_SSDB …
#define SPI_SH_SSD …
#define SPI_SH_SSA …
#define SPI_SH_RSTF …
#define SPI_SH_LOOPBK …
#define SPI_SH_CPOL …
#define SPI_SH_CPHA …
#define SPI_SH_L1M0 …
#define SPI_SH_MAX_BYTE …
#define SPI_SH_TBEI …
#define SPI_SH_TBFI …
#define SPI_SH_RBEI …
#define SPI_SH_RBFI …
#define SPI_SH_WPABRT …
#define SPI_SH_SSS …
#define SPI_SH_P1L0 …
#define SPI_SH_PP1L0 …
#define SPI_SH_MUXI …
#define SPI_SH_MUXIRQ …
#define SPI_SH_FIFO_SIZE …
#define SPI_SH_SEND_TIMEOUT …
#define SPI_SH_RECEIVE_TIMEOUT …
#undef DEBUG
struct spi_sh_data { … };
static void spi_sh_write(struct spi_sh_data *ss, unsigned long data,
unsigned long offset)
{ … }
static unsigned long spi_sh_read(struct spi_sh_data *ss, unsigned long offset)
{ … }
static void spi_sh_set_bit(struct spi_sh_data *ss, unsigned long val,
unsigned long offset)
{ … }
static void spi_sh_clear_bit(struct spi_sh_data *ss, unsigned long val,
unsigned long offset)
{ … }
static void clear_fifo(struct spi_sh_data *ss)
{ … }
static int spi_sh_wait_receive_buffer(struct spi_sh_data *ss)
{ … }
static int spi_sh_wait_write_buffer_empty(struct spi_sh_data *ss)
{ … }
static int spi_sh_send(struct spi_sh_data *ss, struct spi_message *mesg,
struct spi_transfer *t)
{ … }
static int spi_sh_receive(struct spi_sh_data *ss, struct spi_message *mesg,
struct spi_transfer *t)
{ … }
static int spi_sh_transfer_one_message(struct spi_controller *ctlr,
struct spi_message *mesg)
{ … }
static int spi_sh_setup(struct spi_device *spi)
{ … }
static void spi_sh_cleanup(struct spi_device *spi)
{ … }
static irqreturn_t spi_sh_irq(int irq, void *_ss)
{ … }
static void spi_sh_remove(struct platform_device *pdev)
{ … }
static int spi_sh_probe(struct platform_device *pdev)
{ … }
static struct platform_driver spi_sh_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_ALIAS(…) …;