#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/i2c.h>
#include <linux/platform_device.h>
#include <linux/completion.h>
#include <linux/io.h>
#include <linux/delay.h>
#include <linux/slab.h>
#define SMCR …
#define SMCR_START …
#define SMCR_IRIC …
#define SMCR_BBSY …
#define SMCR_ACKE …
#define SMCR_RST …
#define SMCR_IEIC …
#define SMSMADR …
#define SMMR …
#define SMMR_MODE0 …
#define SMMR_MODE1 …
#define SMMR_CAP …
#define SMMR_TMMD …
#define SMMR_SP …
#define SMSADR …
#define SMTRDR …
struct highlander_i2c_dev { … };
static bool iic_force_poll, iic_force_normal;
static int iic_timeout = …, iic_read_delay;
static inline void highlander_i2c_irq_enable(struct highlander_i2c_dev *dev)
{ … }
static inline void highlander_i2c_irq_disable(struct highlander_i2c_dev *dev)
{ … }
static inline void highlander_i2c_start(struct highlander_i2c_dev *dev)
{ … }
static inline void highlander_i2c_done(struct highlander_i2c_dev *dev)
{ … }
static void highlander_i2c_setup(struct highlander_i2c_dev *dev)
{ … }
static void smbus_write_data(u8 *src, u16 *dst, int len)
{ … }
static void smbus_read_data(u16 *src, u8 *dst, int len)
{ … }
static void highlander_i2c_command(struct highlander_i2c_dev *dev,
u8 command, int len)
{ … }
static int highlander_i2c_wait_for_bbsy(struct highlander_i2c_dev *dev)
{ … }
static int highlander_i2c_reset(struct highlander_i2c_dev *dev)
{ … }
static int highlander_i2c_wait_for_ack(struct highlander_i2c_dev *dev)
{ … }
static irqreturn_t highlander_i2c_irq(int irq, void *dev_id)
{ … }
static void highlander_i2c_poll(struct highlander_i2c_dev *dev)
{ … }
static inline int highlander_i2c_wait_xfer_done(struct highlander_i2c_dev *dev)
{ … }
static int highlander_i2c_read(struct highlander_i2c_dev *dev)
{ … }
static int highlander_i2c_write(struct highlander_i2c_dev *dev)
{ … }
static int highlander_i2c_smbus_xfer(struct i2c_adapter *adap, u16 addr,
unsigned short flags, char read_write,
u8 command, int size,
union i2c_smbus_data *data)
{ … }
static u32 highlander_i2c_func(struct i2c_adapter *adapter)
{ … }
static const struct i2c_algorithm highlander_i2c_algo = …;
static int highlander_i2c_probe(struct platform_device *pdev)
{ … }
static void highlander_i2c_remove(struct platform_device *pdev)
{ … }
static struct platform_driver highlander_i2c_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
module_param(iic_force_poll, bool, 0);
module_param(iic_force_normal, bool, 0);
module_param(iic_timeout, int, 0);
module_param(iic_read_delay, int, 0);
MODULE_PARM_DESC(…) …;
MODULE_PARM_DESC(…) …;
MODULE_PARM_DESC(…) …;
MODULE_PARM_DESC(…) …;