linux/drivers/video/backlight/lp855x_bl.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * TI LP855x Backlight Driver
 *
 *			Copyright (C) 2011 Texas Instruments
 */

#include <linux/acpi.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/i2c.h>
#include <linux/backlight.h>
#include <linux/delay.h>
#include <linux/err.h>
#include <linux/of.h>
#include <linux/platform_data/lp855x.h>
#include <linux/pwm.h>
#include <linux/regulator/consumer.h>

/* LP8550/1/2/3/6 Registers */
#define LP855X_BRIGHTNESS_CTRL
#define LP855X_DEVICE_CTRL
#define LP855X_EEPROM_START
#define LP855X_EEPROM_END
#define LP8556_EPROM_START
#define LP8556_EPROM_END

/* LP8555/7 Registers */
#define LP8557_BL_CMD
#define LP8557_BL_MASK
#define LP8557_BL_ON
#define LP8557_BL_OFF
#define LP8557_BRIGHTNESS_CTRL
#define LP8557_CONFIG
#define LP8555_EPROM_START
#define LP8555_EPROM_END
#define LP8557_EPROM_START
#define LP8557_EPROM_END

#define DEFAULT_BL_NAME
#define MAX_BRIGHTNESS

enum lp855x_brightness_ctrl_mode {};

struct lp855x;

/*
 * struct lp855x_device_config
 * @pre_init_device: init device function call before updating the brightness
 * @reg_brightness: register address for brigthenss control
 * @reg_devicectrl: register address for device control
 * @post_init_device: late init device function call
 */
struct lp855x_device_config {};

struct lp855x {};

static int lp855x_write_byte(struct lp855x *lp, u8 reg, u8 data)
{}

static int lp855x_update_bit(struct lp855x *lp, u8 reg, u8 mask, u8 data)
{}

static bool lp855x_is_valid_rom_area(struct lp855x *lp, u8 addr)
{}

static int lp8557_bl_off(struct lp855x *lp)
{}

static int lp8557_bl_on(struct lp855x *lp)
{}

static struct lp855x_device_config lp855x_dev_cfg =;

static struct lp855x_device_config lp8557_dev_cfg =;

/*
 * Device specific configuration flow
 *
 *    a) pre_init_device(optional)
 *    b) update the brightness register
 *    c) update device control register
 *    d) update ROM area(optional)
 *    e) post_init_device(optional)
 *
 */
static int lp855x_configure(struct lp855x *lp)
{}

static int lp855x_pwm_ctrl(struct lp855x *lp, int br, int max_br)
{}

static int lp855x_bl_update_status(struct backlight_device *bl)
{}

static const struct backlight_ops lp855x_bl_ops =;

static int lp855x_backlight_register(struct lp855x *lp)
{}

static ssize_t lp855x_get_chip_id(struct device *dev,
				struct device_attribute *attr, char *buf)
{}

static ssize_t lp855x_get_bl_ctl_mode(struct device *dev,
				     struct device_attribute *attr, char *buf)
{}

static DEVICE_ATTR(chip_id, S_IRUGO, lp855x_get_chip_id, NULL);
static DEVICE_ATTR(bl_ctl_mode, S_IRUGO, lp855x_get_bl_ctl_mode, NULL);

static struct attribute *lp855x_attributes[] =;

static const struct attribute_group lp855x_attr_group =;

#ifdef CONFIG_OF
static int lp855x_parse_dt(struct lp855x *lp)
{}
#else
static int lp855x_parse_dt(struct lp855x *lp)
{
	return -EINVAL;
}
#endif

static int lp855x_parse_acpi(struct lp855x *lp)
{}

static int lp855x_probe(struct i2c_client *cl)
{}

static void lp855x_remove(struct i2c_client *cl)
{}

static const struct of_device_id lp855x_dt_ids[] __maybe_unused =;
MODULE_DEVICE_TABLE(of, lp855x_dt_ids);

static const struct i2c_device_id lp855x_ids[] =;
MODULE_DEVICE_TABLE(i2c, lp855x_ids);

#ifdef CONFIG_ACPI
static const struct acpi_device_id lp855x_acpi_match[] =;
MODULE_DEVICE_TABLE(acpi, lp855x_acpi_match);
#endif

static struct i2c_driver lp855x_driver =;

module_i2c_driver();

MODULE_DESCRIPTION();
MODULE_AUTHOR();
MODULE_LICENSE();