#include <linux/module.h>
#include <linux/init.h>
#include <linux/platform_device.h>
#include <linux/backlight.h>
#include <linux/slab.h>
#include <linux/mfd/lm3533.h>
#define LM3533_HVCTRLBANK_COUNT …
#define LM3533_BL_MAX_BRIGHTNESS …
#define LM3533_REG_CTRLBANK_AB_BCONF …
struct lm3533_bl { … };
static inline int lm3533_bl_get_ctrlbank_id(struct lm3533_bl *bl)
{ … }
static int lm3533_bl_update_status(struct backlight_device *bd)
{ … }
static int lm3533_bl_get_brightness(struct backlight_device *bd)
{ … }
static const struct backlight_ops lm3533_bl_ops = …;
static ssize_t show_id(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t show_als_channel(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t show_als_en(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t store_als_en(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t len)
{ … }
static ssize_t show_linear(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t store_linear(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t len)
{ … }
static ssize_t show_pwm(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t store_pwm(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t len)
{ … }
static LM3533_ATTR_RO(als_channel);
static LM3533_ATTR_RW(als_en);
static LM3533_ATTR_RO(id);
static LM3533_ATTR_RW(linear);
static LM3533_ATTR_RW(pwm);
static struct attribute *lm3533_bl_attributes[] = …;
static umode_t lm3533_bl_attr_is_visible(struct kobject *kobj,
struct attribute *attr, int n)
{
struct device *dev = kobj_to_dev(kobj);
struct lm3533_bl *bl = dev_get_drvdata(dev);
umode_t mode = attr->mode;
if (attr == &dev_attr_als_channel.attr ||
attr == &dev_attr_als_en.attr) {
if (!bl->lm3533->have_als)
mode = 0;
}
return mode;
};
static struct attribute_group lm3533_bl_attribute_group = …;
static int lm3533_bl_setup(struct lm3533_bl *bl,
struct lm3533_bl_platform_data *pdata)
{ … }
static int lm3533_bl_probe(struct platform_device *pdev)
{ … }
static void lm3533_bl_remove(struct platform_device *pdev)
{ … }
#ifdef CONFIG_PM_SLEEP
static int lm3533_bl_suspend(struct device *dev)
{ … }
static int lm3533_bl_resume(struct device *dev)
{ … }
#endif
static SIMPLE_DEV_PM_OPS(lm3533_bl_pm_ops, lm3533_bl_suspend, lm3533_bl_resume);
static void lm3533_bl_shutdown(struct platform_device *pdev)
{ … }
static struct platform_driver lm3533_bl_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_ALIAS(…) …;