#include <linux/kernel.h>
#include <linux/err.h>
#include <linux/module.h>
#include <linux/spi/spi.h>
#include <linux/i2c.h>
#include <linux/delay.h>
#include <linux/pm_runtime.h>
#include <linux/of.h>
#include <linux/platform_data/sc18is602.h>
#include <linux/gpio/consumer.h>
enum chips { … };
#define SC18IS602_BUFSIZ …
#define SC18IS602_CLOCK …
#define SC18IS602_MODE_CPHA …
#define SC18IS602_MODE_CPOL …
#define SC18IS602_MODE_LSB_FIRST …
#define SC18IS602_MODE_CLOCK_DIV_4 …
#define SC18IS602_MODE_CLOCK_DIV_16 …
#define SC18IS602_MODE_CLOCK_DIV_64 …
#define SC18IS602_MODE_CLOCK_DIV_128 …
struct sc18is602 { … };
static int sc18is602_wait_ready(struct sc18is602 *hw, int len)
{ … }
static int sc18is602_txrx(struct sc18is602 *hw, struct spi_message *msg,
struct spi_transfer *t, bool do_transfer)
{ … }
static int sc18is602_setup_transfer(struct sc18is602 *hw, u32 hz, u8 mode)
{ … }
static int sc18is602_check_transfer(struct spi_device *spi,
struct spi_transfer *t, int tlen)
{ … }
static int sc18is602_transfer_one(struct spi_controller *host,
struct spi_message *m)
{ … }
static size_t sc18is602_max_transfer_size(struct spi_device *spi)
{ … }
static int sc18is602_setup(struct spi_device *spi)
{ … }
static int sc18is602_probe(struct i2c_client *client)
{ … }
static const struct i2c_device_id sc18is602_id[] = …;
MODULE_DEVICE_TABLE(i2c, sc18is602_id);
static const struct of_device_id sc18is602_of_match[] __maybe_unused = …;
MODULE_DEVICE_TABLE(of, sc18is602_of_match);
static struct i2c_driver sc18is602_driver = …;
module_i2c_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;