#include <linux/module.h>
#include <linux/i2c.h>
#include <linux/interrupt.h>
#include <linux/sched.h>
#include <linux/mutex.h>
#include <linux/delay.h>
#include <linux/input.h>
#include <linux/leds.h>
#include <linux/platform_data/lm8323.h>
#include <linux/pm.h>
#include <linux/slab.h>
#define LM8323_CMD_READ_ID …
#define LM8323_CMD_WRITE_CFG …
#define LM8323_CMD_READ_INT …
#define LM8323_CMD_RESET …
#define LM8323_CMD_WRITE_PORT_SEL …
#define LM8323_CMD_WRITE_PORT_STATE …
#define LM8323_CMD_READ_PORT_SEL …
#define LM8323_CMD_READ_PORT_STATE …
#define LM8323_CMD_READ_FIFO …
#define LM8323_CMD_RPT_READ_FIFO …
#define LM8323_CMD_SET_ACTIVE …
#define LM8323_CMD_READ_ERR …
#define LM8323_CMD_READ_ROTATOR …
#define LM8323_CMD_SET_DEBOUNCE …
#define LM8323_CMD_SET_KEY_SIZE …
#define LM8323_CMD_READ_KEY_SIZE …
#define LM8323_CMD_READ_CFG …
#define LM8323_CMD_WRITE_CLOCK …
#define LM8323_CMD_READ_CLOCK …
#define LM8323_CMD_PWM_WRITE …
#define LM8323_CMD_START_PWM …
#define LM8323_CMD_STOP_PWM …
#define INT_KEYPAD …
#define INT_ROTATOR …
#define INT_ERROR …
#define INT_NOINIT …
#define INT_PWM1 …
#define INT_PWM2 …
#define INT_PWM3 …
#define ERR_BADPAR …
#define ERR_CMDUNK …
#define ERR_KEYOVR …
#define ERR_FIFOOVER …
#define CFG_MUX1SEL …
#define CFG_MUX1EN …
#define CFG_MUX2SEL …
#define CFG_MUX2EN …
#define CFG_PSIZE …
#define CFG_ROTEN …
#define CLK_RCPWM_INTERNAL …
#define CLK_RCPWM_EXTERNAL …
#define CLK_SLOWCLKEN …
#define CLK_SLOWCLKOUT …
#define LM8323_I2C_ADDR00 …
#define LM8323_I2C_ADDR01 …
#define LM8323_I2C_ADDR10 …
#define LM8323_I2C_ADDR11 …
#define LM8323_FIFO_LEN …
#define PWM_SET(v) …
#define PWM_GOTOSTART …
#define PWM_END(reset) …
#define PWM_RAMP(s, t, n, u) …
#define PWM_LOOP(cnt, pos) …
#define PWM_WAIT_TRIG(chans) …
#define PWM_SEND_TRIG(chans) …
struct lm8323_pwm { … };
struct lm8323_chip { … };
#define client_to_lm8323(c) …
#define dev_to_lm8323(d) …
#define cdev_to_pwm(c) …
#define work_to_pwm(w) …
#define LM8323_MAX_DATA …
static int lm8323_write(struct lm8323_chip *lm, int len, ...)
{ … }
static int lm8323_read(struct lm8323_chip *lm, u8 cmd, u8 *buf, int len)
{ … }
static void lm8323_set_active_time(struct lm8323_chip *lm, int time)
{ … }
static inline u8 lm8323_whichkey(u8 event)
{ … }
static inline int lm8323_ispress(u8 event)
{ … }
static void process_keys(struct lm8323_chip *lm)
{ … }
static void lm8323_process_error(struct lm8323_chip *lm)
{ … }
static void lm8323_reset(struct lm8323_chip *lm)
{ … }
static int lm8323_configure(struct lm8323_chip *lm)
{ … }
static void pwm_done(struct lm8323_pwm *pwm)
{ … }
static irqreturn_t lm8323_irq(int irq, void *_lm)
{ … }
static int lm8323_read_id(struct lm8323_chip *lm, u8 *buf)
{ … }
static void lm8323_write_pwm_one(struct lm8323_pwm *pwm, int pos, u16 cmd)
{ … }
static void lm8323_write_pwm(struct lm8323_pwm *pwm, int kill,
int len, const u16 *cmds)
{ … }
static void lm8323_pwm_work(struct work_struct *work)
{ … }
static void lm8323_pwm_set_brightness(struct led_classdev *led_cdev,
enum led_brightness brightness)
{ … }
static ssize_t lm8323_pwm_show_time(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t lm8323_pwm_store_time(struct device *dev,
struct device_attribute *attr, const char *buf, size_t len)
{ … }
static DEVICE_ATTR(time, 0644, lm8323_pwm_show_time, lm8323_pwm_store_time);
static struct attribute *lm8323_pwm_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static int init_pwm(struct lm8323_chip *lm, int id, struct device *dev,
const char *name)
{ … }
static ssize_t lm8323_show_disable(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t lm8323_set_disable(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR(disable_kp, 0644, lm8323_show_disable, lm8323_set_disable);
static struct attribute *lm8323_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static int lm8323_probe(struct i2c_client *client)
{ … }
static int lm8323_suspend(struct device *dev)
{ … }
static int lm8323_resume(struct device *dev)
{ … }
static DEFINE_SIMPLE_DEV_PM_OPS(lm8323_pm_ops, lm8323_suspend, lm8323_resume);
static const struct i2c_device_id lm8323_id[] = …;
static struct i2c_driver lm8323_i2c_driver = …;
MODULE_DEVICE_TABLE(i2c, lm8323_id);
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;