#include <linux/kernel.h>
#include <linux/leds-lp3952.h>
#include <linux/module.h>
#include <linux/notifier.h>
#include <linux/platform_device.h>
#include <linux/reboot.h>
#include <linux/regmap.h>
static int lp3952_register_write(struct i2c_client *client, u8 reg, u8 val)
struct lp3952_led_array *priv = i2c_get_clientdata(client);
ret = regmap_write(priv->regmap, reg, val);
dev_err(&client->dev, "%s: reg 0x%x, val 0x%x, err %d\n",
__func__, reg, val, ret);
static void lp3952_on_off(struct lp3952_led_array *priv,
enum lp3952_leds led_id, bool on)
dev_dbg(&priv->client->dev, "%s LED %d to %d\n", __func__, led_id, on);
if (led_id == LP3952_LED_ALL)
val = LP3952_LED_MASK_ALL;
ret = regmap_update_bits(priv->regmap, LP3952_REG_LED_CTRL, val,
dev_err(&priv->client->dev, "%s, Error %d\n", __func__, ret);
static int lp3952_set_brightness(struct led_classdev *cdev,
enum led_brightness value)
unsigned int reg, shift_val;
struct lp3952_ctrl_hdl *led = container_of(cdev,