#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/rmi.h>
#include <linux/slab.h>
#include <linux/spi/spi.h>
#include <linux/of.h>
#include "rmi_driver.h"
#define RMI_SPI_DEFAULT_XFER_BUF_SIZE …
#define RMI_PAGE_SELECT_REGISTER …
#define RMI_SPI_PAGE(addr) …
#define RMI_SPI_XFER_SIZE_LIMIT …
#define BUFFER_SIZE_INCREMENT …
enum rmi_spi_op { … };
struct rmi_spi_cmd { … };
struct rmi_spi_xport { … };
static int rmi_spi_manage_pools(struct rmi_spi_xport *rmi_spi, int len)
{ … }
static int rmi_spi_xfer(struct rmi_spi_xport *rmi_spi,
const struct rmi_spi_cmd *cmd, const u8 *tx_buf,
int tx_len, u8 *rx_buf, int rx_len)
{ … }
static int rmi_set_page(struct rmi_spi_xport *rmi_spi, u8 page)
{ … }
static int rmi_spi_write_block(struct rmi_transport_dev *xport, u16 addr,
const void *buf, size_t len)
{ … }
static int rmi_spi_read_block(struct rmi_transport_dev *xport, u16 addr,
void *buf, size_t len)
{ … }
static const struct rmi_transport_ops rmi_spi_ops = …;
#ifdef CONFIG_OF
static int rmi_spi_of_probe(struct spi_device *spi,
struct rmi_device_platform_data *pdata)
{ … }
static const struct of_device_id rmi_spi_of_match[] = …;
MODULE_DEVICE_TABLE(of, rmi_spi_of_match);
#else
static inline int rmi_spi_of_probe(struct spi_device *spi,
struct rmi_device_platform_data *pdata)
{
return -ENODEV;
}
#endif
static void rmi_spi_unregister_transport(void *data)
{ … }
static int rmi_spi_probe(struct spi_device *spi)
{ … }
static int rmi_spi_suspend(struct device *dev)
{ … }
static int rmi_spi_resume(struct device *dev)
{ … }
static int rmi_spi_runtime_suspend(struct device *dev)
{ … }
static int rmi_spi_runtime_resume(struct device *dev)
{ … }
static const struct dev_pm_ops rmi_spi_pm = …;
static const struct spi_device_id rmi_id[] = …;
MODULE_DEVICE_TABLE(spi, rmi_id);
static struct spi_driver rmi_spi_driver = …;
module_spi_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;