#include <linux/module.h>
#include <linux/slab.h>
#include <linux/i2c.h>
#include <linux/mutex.h>
#include <linux/delay.h>
#define ISL29003_DRV_NAME …
#define DRIVER_VERSION …
#define ISL29003_REG_COMMAND …
#define ISL29003_ADC_ENABLED …
#define ISL29003_ADC_PD …
#define ISL29003_TIMING_INT …
#define ISL29003_MODE_SHIFT …
#define ISL29003_MODE_MASK …
#define ISL29003_RES_SHIFT …
#define ISL29003_RES_MASK …
#define ISL29003_REG_CONTROL …
#define ISL29003_INT_FLG …
#define ISL29003_RANGE_SHIFT …
#define ISL29003_RANGE_MASK …
#define ISL29003_INT_PERSISTS_SHIFT …
#define ISL29003_INT_PERSISTS_MASK …
#define ISL29003_REG_IRQ_THRESH_HI …
#define ISL29003_REG_IRQ_THRESH_LO …
#define ISL29003_REG_LSB_SENSOR …
#define ISL29003_REG_MSB_SENSOR …
#define ISL29003_REG_LSB_TIMER …
#define ISL29003_REG_MSB_TIMER …
#define ISL29003_NUM_CACHABLE_REGS …
struct isl29003_data { … };
static int gain_range[] = …;
static int __isl29003_read_reg(struct i2c_client *client,
u32 reg, u8 mask, u8 shift)
{ … }
static int __isl29003_write_reg(struct i2c_client *client,
u32 reg, u8 mask, u8 shift, u8 val)
{ … }
static int isl29003_get_range(struct i2c_client *client)
{ … }
static int isl29003_set_range(struct i2c_client *client, int range)
{ … }
static int isl29003_get_resolution(struct i2c_client *client)
{ … }
static int isl29003_set_resolution(struct i2c_client *client, int res)
{ … }
static int isl29003_get_mode(struct i2c_client *client)
{ … }
static int isl29003_set_mode(struct i2c_client *client, int mode)
{ … }
static int isl29003_set_power_state(struct i2c_client *client, int state)
{ … }
static int isl29003_get_power_state(struct i2c_client *client)
{ … }
static int isl29003_get_adc_value(struct i2c_client *client)
{ … }
static ssize_t isl29003_show_range(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t isl29003_store_range(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR(range, S_IWUSR | S_IRUGO,
isl29003_show_range, isl29003_store_range);
static ssize_t isl29003_show_resolution(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t isl29003_store_resolution(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR(resolution, S_IWUSR | S_IRUGO,
isl29003_show_resolution, isl29003_store_resolution);
static ssize_t isl29003_show_mode(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t isl29003_store_mode(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{ … }
static DEVICE_ATTR(mode, S_IWUSR | S_IRUGO,
isl29003_show_mode, isl29003_store_mode);
static ssize_t isl29003_show_power_state(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t isl29003_store_power_state(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR(power_state, S_IWUSR | S_IRUGO,
isl29003_show_power_state, isl29003_store_power_state);
static ssize_t isl29003_show_lux(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR(lux, S_IRUGO, isl29003_show_lux, NULL);
static struct attribute *isl29003_attributes[] = …;
static const struct attribute_group isl29003_attr_group = …;
static int isl29003_init_client(struct i2c_client *client)
{ … }
static int isl29003_probe(struct i2c_client *client)
{ … }
static void isl29003_remove(struct i2c_client *client)
{ … }
#ifdef CONFIG_PM_SLEEP
static int isl29003_suspend(struct device *dev)
{ … }
static int isl29003_resume(struct device *dev)
{ … }
static SIMPLE_DEV_PM_OPS(isl29003_pm_ops, isl29003_suspend, isl29003_resume);
#define ISL29003_PM_OPS …
#else
#define ISL29003_PM_OPS …
#endif
static const struct i2c_device_id isl29003_id[] = …;
MODULE_DEVICE_TABLE(i2c, isl29003_id);
static struct i2c_driver isl29003_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_VERSION(…);