#include <linux/io.h>
#include <linux/i2c.h>
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/gpio/consumer.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#define CBUS_ADDR_BITS …
#define CBUS_REG_BITS …
struct cbus_host { … };
static void cbus_send_bit(struct cbus_host *host, unsigned bit)
{ … }
static void cbus_send_data(struct cbus_host *host, unsigned data, unsigned len)
{ … }
static int cbus_receive_bit(struct cbus_host *host)
{ … }
static int cbus_receive_word(struct cbus_host *host)
{ … }
static int cbus_transfer(struct cbus_host *host, char rw, unsigned dev,
unsigned reg, unsigned data)
{ … }
static int cbus_i2c_smbus_xfer(struct i2c_adapter *adapter,
u16 addr,
unsigned short flags,
char read_write,
u8 command,
int size,
union i2c_smbus_data *data)
{ … }
static u32 cbus_i2c_func(struct i2c_adapter *adapter)
{ … }
static const struct i2c_algorithm cbus_i2c_algo = …;
static void cbus_i2c_remove(struct platform_device *pdev)
{ … }
static int cbus_i2c_probe(struct platform_device *pdev)
{ … }
#if defined(CONFIG_OF)
static const struct of_device_id i2c_cbus_dt_ids[] = …;
MODULE_DEVICE_TABLE(of, i2c_cbus_dt_ids);
#endif
static struct platform_driver cbus_i2c_driver = …;
module_platform_driver(…) …;
MODULE_ALIAS(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;