#include <linux/module.h>
#include <linux/init.h>
#include <linux/errno.h>
#include <linux/pm.h>
#include <linux/platform_device.h>
#include <linux/i2c.h>
#include <linux/fb.h>
#include <linux/backlight.h>
#include <linux/leds.h>
#include <linux/slab.h>
#include <linux/workqueue.h>
#include <linux/platform_data/adp8860.h>
#define ADP8860_EXT_FEATURES
#define ADP8860_USE_LEDS
#define ADP8860_MFDVID …
#define ADP8860_MDCR …
#define ADP8860_MDCR2 …
#define ADP8860_INTR_EN …
#define ADP8860_CFGR …
#define ADP8860_BLSEN …
#define ADP8860_BLOFF …
#define ADP8860_BLDIM …
#define ADP8860_BLFR …
#define ADP8860_BLMX1 …
#define ADP8860_BLDM1 …
#define ADP8860_BLMX2 …
#define ADP8860_BLDM2 …
#define ADP8860_BLMX3 …
#define ADP8860_BLDM3 …
#define ADP8860_ISCFR …
#define ADP8860_ISCC …
#define ADP8860_ISCT1 …
#define ADP8860_ISCT2 …
#define ADP8860_ISCF …
#define ADP8860_ISC7 …
#define ADP8860_ISC6 …
#define ADP8860_ISC5 …
#define ADP8860_ISC4 …
#define ADP8860_ISC3 …
#define ADP8860_ISC2 …
#define ADP8860_ISC1 …
#define ADP8860_CCFG …
#define ADP8860_CCFG2 …
#define ADP8860_L2_TRP …
#define ADP8860_L2_HYS …
#define ADP8860_L3_TRP …
#define ADP8860_L3_HYS …
#define ADP8860_PH1LEVL …
#define ADP8860_PH1LEVH …
#define ADP8860_PH2LEVL …
#define ADP8860_PH2LEVH …
#define ADP8860_MANUFID …
#define ADP8861_MANUFID …
#define ADP8863_MANUFID …
#define ADP8860_DEVID(x) …
#define ADP8860_MANID(x) …
#define INT_CFG …
#define NSTBY …
#define DIM_EN …
#define GDWN_DIS …
#define SIS_EN …
#define CMP_AUTOEN …
#define BLEN …
#define L3_EN …
#define L2_EN …
#define CFGR_BLV_SHIFT …
#define CFGR_BLV_MASK …
#define ADP8860_FLAG_LED_MASK …
#define FADE_VAL(in, out) …
#define BL_CFGR_VAL(law, blv) …
#define ALS_CCFG_VAL(filt) …
enum { … };
struct adp8860_led { … };
struct adp8860_bl { … };
static int adp8860_read(struct i2c_client *client, int reg, uint8_t *val)
{ … }
static int adp8860_write(struct i2c_client *client, u8 reg, u8 val)
{ … }
static int adp8860_set_bits(struct i2c_client *client, int reg, uint8_t bit_mask)
{ … }
static int adp8860_clr_bits(struct i2c_client *client, int reg, uint8_t bit_mask)
{ … }
#if defined(ADP8860_USE_LEDS)
static void adp8860_led_work(struct work_struct *work)
{ … }
static void adp8860_led_set(struct led_classdev *led_cdev,
enum led_brightness value)
{ … }
static int adp8860_led_setup(struct adp8860_led *led)
{ … }
static int adp8860_led_probe(struct i2c_client *client)
{ … }
static int adp8860_led_remove(struct i2c_client *client)
{ … }
#else
static int adp8860_led_probe(struct i2c_client *client)
{
return 0;
}
static int adp8860_led_remove(struct i2c_client *client)
{
return 0;
}
#endif
static int adp8860_bl_set(struct backlight_device *bl, int brightness)
{ … }
static int adp8860_bl_update_status(struct backlight_device *bl)
{ … }
static int adp8860_bl_get_brightness(struct backlight_device *bl)
{ … }
static const struct backlight_ops adp8860_bl_ops = …;
static int adp8860_bl_setup(struct backlight_device *bl)
{ … }
static ssize_t adp8860_show(struct device *dev, char *buf, int reg)
{ … }
static ssize_t adp8860_store(struct device *dev, const char *buf,
size_t count, int reg)
{ … }
static ssize_t adp8860_bl_l3_dark_max_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t adp8860_bl_l3_dark_max_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{ … }
static DEVICE_ATTR(l3_dark_max, 0664, adp8860_bl_l3_dark_max_show,
adp8860_bl_l3_dark_max_store);
static ssize_t adp8860_bl_l2_office_max_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t adp8860_bl_l2_office_max_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{ … }
static DEVICE_ATTR(l2_office_max, 0664, adp8860_bl_l2_office_max_show,
adp8860_bl_l2_office_max_store);
static ssize_t adp8860_bl_l1_daylight_max_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t adp8860_bl_l1_daylight_max_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{ … }
static DEVICE_ATTR(l1_daylight_max, 0664, adp8860_bl_l1_daylight_max_show,
adp8860_bl_l1_daylight_max_store);
static ssize_t adp8860_bl_l3_dark_dim_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t adp8860_bl_l3_dark_dim_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR(l3_dark_dim, 0664, adp8860_bl_l3_dark_dim_show,
adp8860_bl_l3_dark_dim_store);
static ssize_t adp8860_bl_l2_office_dim_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t adp8860_bl_l2_office_dim_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR(l2_office_dim, 0664, adp8860_bl_l2_office_dim_show,
adp8860_bl_l2_office_dim_store);
static ssize_t adp8860_bl_l1_daylight_dim_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t adp8860_bl_l1_daylight_dim_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR(l1_daylight_dim, 0664, adp8860_bl_l1_daylight_dim_show,
adp8860_bl_l1_daylight_dim_store);
#ifdef ADP8860_EXT_FEATURES
static ssize_t adp8860_bl_ambient_light_level_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR(ambient_light_level, 0444,
adp8860_bl_ambient_light_level_show, NULL);
static ssize_t adp8860_bl_ambient_light_zone_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t adp8860_bl_ambient_light_zone_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR(ambient_light_zone, 0664,
adp8860_bl_ambient_light_zone_show,
adp8860_bl_ambient_light_zone_store);
#endif
static struct attribute *adp8860_bl_attributes[] = …;
static const struct attribute_group adp8860_bl_attr_group = …;
static int adp8860_probe(struct i2c_client *client)
{ … }
static void adp8860_remove(struct i2c_client *client)
{ … }
#ifdef CONFIG_PM_SLEEP
static int adp8860_i2c_suspend(struct device *dev)
{ … }
static int adp8860_i2c_resume(struct device *dev)
{ … }
#endif
static SIMPLE_DEV_PM_OPS(adp8860_i2c_pm_ops, adp8860_i2c_suspend,
adp8860_i2c_resume);
static const struct i2c_device_id adp8860_id[] = …;
MODULE_DEVICE_TABLE(i2c, adp8860_id);
static struct i2c_driver adp8860_driver = …;
module_i2c_driver(…) …;
MODULE_LICENSE(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;