#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/i2c.h>
#include <linux/delay.h>
#include <linux/mfd/kempld.h>
#define KEMPLD_I2C_PRELOW …
#define KEMPLD_I2C_PREHIGH …
#define KEMPLD_I2C_DATA …
#define KEMPLD_I2C_CTRL …
#define I2C_CTRL_IEN …
#define I2C_CTRL_EN …
#define KEMPLD_I2C_STAT …
#define I2C_STAT_IF …
#define I2C_STAT_TIP …
#define I2C_STAT_ARBLOST …
#define I2C_STAT_BUSY …
#define I2C_STAT_NACK …
#define KEMPLD_I2C_CMD …
#define I2C_CMD_START …
#define I2C_CMD_STOP …
#define I2C_CMD_READ …
#define I2C_CMD_WRITE …
#define I2C_CMD_READ_ACK …
#define I2C_CMD_READ_NACK …
#define I2C_CMD_IACK …
#define KEMPLD_I2C_FREQ_MAX …
#define KEMPLD_I2C_FREQ_STD …
enum { … };
struct kempld_i2c_data { … };
static unsigned int bus_frequency = …;
module_param(bus_frequency, uint, 0);
MODULE_PARM_DESC(…) …;
static int i2c_bus = …;
module_param(i2c_bus, int, 0);
MODULE_PARM_DESC(…) …;
static bool i2c_gpio_mux;
module_param(i2c_gpio_mux, bool, 0);
MODULE_PARM_DESC(…) …;
static int kempld_i2c_process(struct kempld_i2c_data *i2c)
{ … }
static int kempld_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,
int num)
{ … }
static void kempld_i2c_device_init(struct kempld_i2c_data *i2c)
{ … }
static u32 kempld_i2c_func(struct i2c_adapter *adap)
{ … }
static const struct i2c_algorithm kempld_i2c_algorithm = …;
static const struct i2c_adapter kempld_i2c_adapter = …;
static int kempld_i2c_probe(struct platform_device *pdev)
{ … }
static void kempld_i2c_remove(struct platform_device *pdev)
{ … }
static int kempld_i2c_suspend(struct device *dev)
{ … }
static int kempld_i2c_resume(struct device *dev)
{ … }
static DEFINE_SIMPLE_DEV_PM_OPS(kempld_i2c_pm_ops,
kempld_i2c_suspend, kempld_i2c_resume);
static struct platform_driver kempld_i2c_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;
MODULE_ALIAS(…) …;