diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
index ed800f5da..259565cbf 100644
--- a/drivers/leds/Kconfig
+++ b/drivers/leds/Kconfig
@@ -379,6 +379,26 @@ config LEDS_LP50XX
 	  To compile this driver as a module, choose M here: the
 	  module will be called leds-lp50xx.
 
+config LEDS_SPI_LP5860
+	tristate "LED Support for TI LP5860 SPI LED driver chip"
+	depends on SPI
+	help
+	  If you say yes here you get support for the Texas Instruments
+	  LP5860 LED driver.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called lp5860_spi.
+
+config LEDS_I2C_LP5860
+	tristate "LED Support for TI LP5860 I2C LED driver chip"
+	depends on I2C
+	help
+	  If you say yes here you get support for the Texas Instruments
+	  LP5860 LED driver.
+
+	  To compile this driver as a module, choose M here: the
+	  module will be called lp5860_i2c.
+
 config LEDS_LP55XX_COMMON
 	tristate "Common Driver for TI/National LP5521/5523/55231/5562/8501"
 	depends on LEDS_CLASS
diff --git a/drivers/leds/Makefile b/drivers/leds/Makefile
index c636ec069..d973502f6 100644
--- a/drivers/leds/Makefile
+++ b/drivers/leds/Makefile
@@ -88,6 +88,11 @@ obj-$(CONFIG_LEDS_WM831X_STATUS)	+= leds-wm831x-status.o
 obj-$(CONFIG_LEDS_WM8350)		+= leds-wm8350.o
 obj-$(CONFIG_LEDS_WRAP)			+= leds-wrap.o
 
+leds_lp5860_i2c-objs := leds-lp5860-i2c.o leds-lp5860-core.o
+leds_lp5860_spi-objs := leds-lp5860-spi.o leds-lp5860-core.o
+obj-$(CONFIG_LEDS_I2C_LP5860)	+= leds_lp5860_i2c.o
+obj-$(CONFIG_LEDS_SPI_LP5860)	+= leds_lp5860_spi.o
+
 # LED SPI Drivers
 obj-$(CONFIG_LEDS_CR0014114)		+= leds-cr0014114.o
 obj-$(CONFIG_LEDS_DAC124S085)		+= leds-dac124s085.o
diff --git a/drivers/leds/leds-lp5860-core.c b/drivers/leds/leds-lp5860-core.c
new file mode 100644
index 000000000..b2a7db410
--- /dev/null
+++ b/drivers/leds/leds-lp5860-core.c
@@ -0,0 +1,553 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * LP5860 Driver
+ *
+ * Copyright 2012 Texas Instruments
+ *
+ * Author: Texas Instruments
+ *
+ *
+ */
+#include <linux/gpio.h>
+#include <linux/io.h>
+#include <linux/interrupt.h>
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/of_gpio.h>
+#include <linux/of_platform.h>
+#include <linux/platform_device.h>
+#include <linux/regmap.h>
+#include "leds-lp5860.h"
+#include <linux/string.h>
+
+int lp5860_update_bits(struct device *dev, unsigned int reg, unsigned int mask, unsigned int val)
+{
+	int ret;
+	unsigned int tmp, orig;
+
+	ret = lp5860_read(dev, reg, &orig);
+	if (ret < 0)
+		return ret;
+
+	tmp = orig & ~mask;
+	tmp |= val & mask;
+
+	if (tmp != orig) {
+		ret = lp5860_write(dev, reg, tmp);
+
+		if (ret < 0)
+			return ret;
+	}
+
+	return ret;
+}
+
+
+static int lp5860_set_reg_data(struct lp5860 *priv, int reg, int mask, const char *buf, int step)
+{
+
+	int ret;
+	unsigned long value = 0;
+
+	ret = kstrtoul(buf, 0, &value);
+	if (ret)
+		return ret;
+
+	ret = lp5860_update_bits(priv->dev, reg, mask, value << step);
+	if (ret < 0)
+		return ret;
+
+	return 0;
+}
+static int lp5860_get_reg_data(struct lp5860 *priv, int reg, int mask, int step, char *buf)
+{
+	int ret;
+	int reg_value = 0;
+	int data;
+
+	ret = lp5860_read(priv->dev, reg, &reg_value);
+	data = (reg_value & mask) >> step;
+
+	return sprintf(buf, "%d", data);
+}
+
+static ssize_t lp5860_set_reg_offset(struct device *dev,
+							struct device_attribute *attr,
+							const char *buf, size_t size)
+{
+	struct lp5860 *priv = dev_get_drvdata(dev);
+	int ret;
+	unsigned long value;
+
+	ret = kstrtoul(buf, 0, &value);
+	if (ret)
+		return ret;
+
+	priv->reg_offset = value;
+
+	return 0;
+}
+
+static ssize_t lp5860_get_reg_value(struct device *dev,
+							struct device_attribute *attr,
+							char *buf)
+{
+	struct lp5860 *priv = dev_get_drvdata(dev);
+	int ret;
+	unsigned int value;
+
+	ret = lp5860_read(priv->dev, priv->reg_offset, &value);
+	if (ret)
+		return -EINVAL;
+
+	sprintf(buf, "%d", value);
+	return 0;
+}
+static LP5860_DEV_ATTR_RW(reg_offset_value, lp5860_get_reg_value, lp5860_set_reg_offset);
+
+
+LP5860_SHOW_MODE(chip_value, LP5860_CHIP_EN, LP5860_CHIP_MASK, LP5860_CHIP_MOVE_STEP)
+LP5860_STORE_MODE(chip_value, LP5860_CHIP_EN, LP5860_CHIP_MASK, LP5860_CHIP_MOVE_STEP)
+static LP5860_DEV_ATTR_RW(chip_value, lp5860_get_chip_value, lp5860_set_chip_value);
+
+LP5860_SHOW_MODE(max_line, LP5860_DEV_INITIAL, LP5860_MAX_LINE_MASK, LP5860_MAX_LINE_MOVE_STEP)
+LP5860_STORE_MODE(max_line, LP5860_DEV_INITIAL, LP5860_MAX_LINE_MASK, LP5860_MAX_LINE_MOVE_STEP)
+static LP5860_DEV_ATTR_RW(max_line, lp5860_get_max_line, lp5860_set_max_line);
+
+LP5860_SHOW_MODE(date_ref_mode, LP5860_DEV_INITIAL, LP5860_MODE_MASK, LP5860_MODE_MOVE_STEP)
+LP5860_STORE_MODE(date_ref_mode, LP5860_DEV_INITIAL, LP5860_MODE_MASK, LP5860_MODE_MOVE_STEP)
+static LP5860_DEV_ATTR_RW(date_ref_mode, lp5860_get_date_ref_mode, lp5860_set_date_ref_mode);
+
+LP5860_SHOW_MODE(pwm_frequency, LP5860_DEV_INITIAL, LP5860_PWM_FREQUENCY_MASK,
+					LP5860_PWM_FREQUENCY_MOVE_STEP)
+LP5860_STORE_MODE(pwm_frequency, LP5860_DEV_INITIAL, LP5860_PWM_FREQUENCY_MASK,
+					LP5860_PWM_FREQUENCY_MOVE_STEP)
+static LP5860_DEV_ATTR_RW(pwm_frequency, lp5860_get_pwm_frequency, lp5860_set_pwm_frequency);
+
+LP5860_SHOW_MODE(sw_blk, LP5860_DEV_CONFIG1, LP5860_SW_BLK_MASK, LP5860_SW_BLK_MOVE_STEP)
+LP5860_STORE_MODE(sw_blk, LP5860_DEV_CONFIG1, LP5860_SW_BLK_MASK, LP5860_SW_BLK_MOVE_STEP)
+static LP5860_DEV_ATTR_RW(sw_blk, lp5860_get_sw_blk, lp5860_set_sw_blk);
+
+LP5860_SHOW_MODE(pwm_scale_mode, LP5860_DEV_CONFIG1, LP5860_PWM_SCALE_MODE_MASK,
+					LP5860_PWM_SCALE_MODE_MOVE_STEP)
+LP5860_STORE_MODE(pwm_scale_mode, LP5860_DEV_CONFIG1, LP5860_PWM_SCALE_MODE_MASK,
+					LP5860_PWM_SCALE_MODE_MOVE_STEP)
+static LP5860_DEV_ATTR_RW(pwm_scale_mode, lp5860_get_pwm_scale_mode, lp5860_set_pwm_scale_mode);
+
+LP5860_SHOW_MODE(pwm_phaseshift, LP5860_DEV_CONFIG1, LP5860_PWM_PHASESHIFT_MASK,
+					LP5860_CHIP_MOVE_STEP)
+LP5860_STORE_MODE(pwm_phaseshift, LP5860_DEV_CONFIG1, LP5860_PWM_PHASESHIFT_MASK,
+					LP5860_CHIP_MOVE_STEP)
+static LP5860_DEV_ATTR_RW(pwm_phaseshift, lp5860_get_pwm_phaseshift, lp5860_set_pwm_phaseshift);
+
+LP5860_SHOW_MODE(cs_on_shift, LP5860_DEV_CONFIG1, LP5860_CS_ON_SHIFT_MASK,
+					LP5860_CS_ON_SHIFT_MOVE_STEP)
+LP5860_STORE_MODE(cs_on_shift, LP5860_DEV_CONFIG1, LP5860_CS_ON_SHIFT_MASK,
+					LP5860_CS_ON_SHIFT_MOVE_STEP)
+static LP5860_DEV_ATTR_RW(cs_on_shift, lp5860_get_cs_on_shift, lp5860_set_cs_on_shift);
+
+LP5860_SHOW_MODE(comp_group3, LP5860_DEV_CONFIG2, LP5860_COMP_GROUP3_MASK,
+					LP5860_COMP_GROUP3_MOVE_STEP)
+LP5860_STORE_MODE(comp_group3, LP5860_DEV_CONFIG2, LP5860_COMP_GROUP3_MASK,
+					LP5860_COMP_GROUP3_MOVE_STEP)
+static LP5860_DEV_ATTR_RW(comp_group3, lp5860_get_comp_group3, lp5860_set_comp_group3);
+
+LP5860_SHOW_MODE(comp_group2, LP5860_DEV_CONFIG2, LP5860_COMP_GROUP2_MASK,
+					LP5860_COMP_GROUP2_MOVE_STEP)
+LP5860_STORE_MODE(comp_group2, LP5860_DEV_CONFIG2, LP5860_COMP_GROUP2_MASK,
+					LP5860_COMP_GROUP2_MOVE_STEP)
+static LP5860_DEV_ATTR_RW(comp_group2, lp5860_get_comp_group2, lp5860_set_comp_group2);
+
+LP5860_SHOW_MODE(comp_group1, LP5860_DEV_CONFIG2, LP5860_COMP_GROUP1_MASK,
+					LP5860_COMP_GROUP1_MOVE_STEP)
+LP5860_STORE_MODE(comp_group1, LP5860_DEV_CONFIG2, LP5860_COMP_GROUP1_MASK,
+					LP5860_COMP_GROUP1_MOVE_STEP)
+static LP5860_DEV_ATTR_RW(comp_group1, lp5860_get_comp_group1, lp5860_set_comp_group1);
+
+LP5860_SHOW_MODE(lod_removal, LP5860_DEV_CONFIG2, LP5860_LOD_REMOVAL_MASK,
+					LP5860_LOD_REMOVAL_MOVE_STEP)
+LP5860_STORE_MODE(lod_removal, LP5860_DEV_CONFIG2, LP5860_LOD_REMOVAL_MASK,
+					LP5860_LOD_REMOVAL_MOVE_STEP)
+static LP5860_DEV_ATTR_RW(lod_removal, lp5860_get_lod_removal, lp5860_set_lod_removal);
+
+LP5860_SHOW_MODE(lsd_removal, LP5860_DEV_CONFIG2, LP5860_LSD_REMOVAL_MASK,
+					LP5860_LSD_REMOVAL_MOVE_STEP)
+LP5860_STORE_MODE(lsd_removal, LP5860_DEV_CONFIG2, LP5860_LSD_REMOVAL_MASK,
+					LP5860_LSD_REMOVAL_MOVE_STEP)
+static LP5860_DEV_ATTR_RW(lsd_removal, lp5860_get_lsd_removal, lp5860_set_lsd_removal);
+
+LP5860_SHOW_MODE(down_deghost, LP5860_DEV_CONFIG3, LP5860_DOWN_DEGHOST_MASK,
+					LP5860_DOWN_DEGHOST_MOVE_STEP)
+LP5860_STORE_MODE(down_deghost, LP5860_DEV_CONFIG3, LP5860_DOWN_DEGHOST_MASK,
+					LP5860_DOWN_DEGHOST_MOVE_STEP)
+static LP5860_DEV_ATTR_RW(down_deghost, lp5860_get_down_deghost, lp5860_set_down_deghost);
+
+LP5860_SHOW_MODE(up_deghost, LP5860_DEV_CONFIG3, LP5860_UP_DEGHOST_MASK,
+					LP5860_UP_DEGHOST_MOVE_STEP)
+LP5860_STORE_MODE(up_deghost, LP5860_DEV_CONFIG3, LP5860_UP_DEGHOST_MASK,
+					LP5860_UP_DEGHOST_MOVE_STEP)
+static LP5860_DEV_ATTR_RW(up_deghost, lp5860_get_up_deghost, lp5860_set_up_deghost);
+
+LP5860_SHOW_MODE(maximum_current, LP5860_DEV_CONFIG3, LP5860_MAXIMUM_CURRENT_MASK,
+					LP5860_MAXIMUM_CURRENT_MOVE_STEP)
+LP5860_STORE_MODE(maximum_current, LP5860_DEV_CONFIG3, LP5860_MAXIMUM_CURRENT_MASK,
+					LP5860_MAXIMUM_CURRENT_MOVE_STEP)
+static LP5860_DEV_ATTR_RW(maximum_current, lp5860_get_maximum_current, lp5860_set_maximum_current);
+
+LP5860_SHOW_MODE(up_deghost_enable, LP5860_DEV_CONFIG3, LP5860_UP_DEGHOST_ENABLE_MASK,
+					LP5860_UP_DEGHOST_ENABLE_MOVE_STEP)
+LP5860_STORE_MODE(up_deghost_enable, LP5860_DEV_CONFIG3, LP5860_UP_DEGHOST_ENABLE_MASK,
+					LP5860_UP_DEGHOST_ENABLE_MOVE_STEP)
+static LP5860_DEV_ATTR_RW(up_deghost_enable, lp5860_get_up_deghost_enable,
+							lp5860_set_up_deghost_enable);
+
+LP5860_SHOW_MODE(pwm_global, LP5860_GLOBAL_BRI, 0xff, 0)
+LP5860_STORE_MODE(pwm_global, LP5860_GLOBAL_BRI, 0xff, 0)
+static LP5860_DEV_ATTR_RW(pwm_global, lp5860_get_pwm_global, lp5860_set_pwm_global);
+
+LP5860_SHOW_MODE(pwm_group1, LP5860_GROUP0_BRI, 0xff, 0)
+LP5860_STORE_MODE(pwm_group1, LP5860_GROUP0_BRI, 0xff, 0)
+static LP5860_DEV_ATTR_RW(pwm_group1, lp5860_get_pwm_group1, lp5860_set_pwm_group1);
+
+LP5860_SHOW_MODE(pwm_group2, LP5860_GROUP1_BRI, 0xff, 0)
+LP5860_STORE_MODE(pwm_group2, LP5860_GROUP1_BRI, 0xff, 0)
+static LP5860_DEV_ATTR_RW(pwm_group2, lp5860_get_pwm_group2, lp5860_set_pwm_group2);
+
+LP5860_SHOW_MODE(pwm_group3, LP5860_GROUP2_BRI, 0xff, 0)
+LP5860_STORE_MODE(pwm_group3, LP5860_GROUP2_BRI, 0xff, 0)
+static LP5860_DEV_ATTR_RW(pwm_group3, lp5860_get_pwm_group3, lp5860_set_pwm_group3);
+
+LP5860_SHOW_MODE(r_current_set, LP5860_R_CURRENT_SET, LP5860_CC_GROUP_MASK, 0)
+LP5860_STORE_MODE(r_current_set, LP5860_R_CURRENT_SET, LP5860_CC_GROUP_MASK, 0)
+static LP5860_DEV_ATTR_RW(r_current_set, lp5860_get_r_current_set, lp5860_set_r_current_set);
+
+LP5860_SHOW_MODE(g_current_set, LP5860_G_CURRENT_SET, LP5860_CC_GROUP_MASK, 0)
+LP5860_STORE_MODE(g_current_set, LP5860_G_CURRENT_SET, LP5860_CC_GROUP_MASK, 0)
+static LP5860_DEV_ATTR_RW(g_current_set, lp5860_get_g_current_set, lp5860_set_g_current_set);
+
+LP5860_SHOW_MODE(b_current_set, LP5860_B_CURRENT_SET, LP5860_CC_GROUP_MASK, 0)
+LP5860_STORE_MODE(b_current_set, LP5860_B_CURRENT_SET, LP5860_CC_GROUP_MASK, 0)
+static LP5860_DEV_ATTR_RW(b_current_set, lp5860_get_b_current_set, lp5860_set_b_current_set);
+
+LP5860_SHOW_MODE(global_lod, LP5860_FAULT_STATE, LP5860_GLOBAL_LOD_STATE,
+					LP5860_GLOBAL_LOD_MOVE_STEP)
+static LP5860_DEV_ATTR_RO(global_lod, lp5860_get_global_lod);
+
+LP5860_SHOW_MODE(global_lsd, LP5860_FAULT_STATE, LP5860_GLOBAL_LSD_STATE,
+					LP5860_GLOBAL_LSD_MOVE_STEP)
+static LP5860_DEV_ATTR_RO(global_lsd, lp5860_get_global_lsd);
+
+LP5860_STORE_MODE(global_lod_celar, LP5860_LOD_CLEAR, 0x0f, 0)
+static LP5860_DEV_ATTR_WO(global_lod_celar, lp5860_set_global_lod_celar);
+
+LP5860_STORE_MODE(global_lsd_celar, LP5860_LSD_CLEAR, 0x0f, 0)
+static LP5860_DEV_ATTR_WO(global_lsd_celar, lp5860_set_global_lsd_celar);
+
+LP5860_STORE_MODE(reset_en, LP5860_RESET, 0xff, 0)
+static LP5860_DEV_ATTR_WO(reset_en, lp5860_set_reset_en);
+
+
+static ssize_t lp5860_set_dot_group(struct device *dev,
+							struct device_attribute *attr,
+							const char *buf, size_t size)
+{
+	unsigned long value, cs, line;
+	char *cur = kmalloc(ATTR_BUF_MAX, GFP_KERNEL);
+
+	if (cur == NULL)
+		return -ENOMEM;
+
+	memset(cur, 0, ATTR_BUF_MAX);
+	memcpy(cur, buf, size);
+
+	if (kstrtoul(strsep(&cur, " "), 0, &line))
+		goto err;
+
+	if (kstrtoul(strsep(&cur, " "), 0, &cs))
+		goto err;
+
+	if (kstrtoul(strsep(&cur, " "), 0, &value))
+		goto err;
+
+	lp5860_update_bits(dev, LP5860_GRP_SEL_START + (line * MAX_DOT_REG_NUM)
+				+ (cs / MAX_DOT_GROUP_NUM), 0x03 << ((cs % MAX_DOT_GROUP_NUM)*2),
+				(value & 0x03) << ((cs % MAX_DOT_GROUP_NUM)*2));
+
+	kfree(cur);
+	return size;
+
+err:
+	dev_err(dev, "Parameter error\r\n");
+	kfree(cur);
+	return -EINVAL;
+
+}
+
+static LP5860_DEV_ATTR_WO(dot_group, lp5860_set_dot_group);
+
+
+static ssize_t lp5860_set_dot_dc_current(struct device *dev,
+							struct device_attribute *attr,
+							const char *buf, size_t size)
+{
+	unsigned long value, cs, line;
+	char *cur = kmalloc(ATTR_BUF_MAX, GFP_KERNEL);
+
+	if (cur == NULL)
+		return -ENOMEM;
+
+	memset(cur, 0, ATTR_BUF_MAX);
+	memcpy(cur, buf, size);
+
+	if (kstrtoul(strsep(&cur, " "), 0, &line))
+		goto err;
+
+	if (kstrtoul(strsep(&cur, " "), 0, &cs))
+		goto err;
+
+	if (kstrtoul(strsep(&cur, " "), 0, &value))
+		goto err;
+
+	lp5860_write(dev, LP5860_DC_START + (line * MAX_DOT_DC_CURRENT__LINE_REG) + cs,
+					value & 0xff);
+
+	kfree(cur);
+	return size;
+
+err:
+	dev_err(dev, "Parameter error\r\n");
+	kfree(cur);
+	return -EINVAL;
+
+}
+static LP5860_DEV_ATTR_WO(dot_dc_current, lp5860_set_dot_dc_current);
+
+static ssize_t lp5860_set_dot_onoff(struct device *dev,
+							struct device_attribute *attr,
+							const char *buf, size_t size)
+{
+	unsigned long value, cs, line;
+	char *cur = kmalloc(ATTR_BUF_MAX, GFP_KERNEL);
+
+	if (cur == NULL)
+		return -ENOMEM;
+
+	memset(cur, 0, ATTR_BUF_MAX);
+	memcpy(cur, buf, size);
+
+	if (kstrtoul(strsep(&cur, " "), 0, &line))
+		goto err;
+
+	if (kstrtoul(strsep(&cur, " "), 0, &cs))
+		goto err;
+
+	if (kstrtoul(strsep(&cur, " "), 0, &value))
+		goto err;
+
+	lp5860_update_bits(dev, LP5860_DOT_ONOFF_START + (line * MAX_DOT_ONOFF_REG_NUM)
+			+ (cs / MAX_DOT_ONOFF_GROUP_NUM), 1 << (cs % MAX_DOT_ONOFF_GROUP_NUM),
+			(value & 0x01) << (cs % MAX_DOT_ONOFF_GROUP_NUM));
+
+	kfree(cur);
+	return size;
+
+err:
+	dev_err(dev, "Parameter error\r\n");
+	kfree(cur);
+	return -EINVAL;
+
+}
+static LP5860_DEV_ATTR_WO(dot_onoff, lp5860_set_dot_onoff);
+
+
+static ssize_t lp5860_set_dot_16bits_pwm_bri(struct device *dev,
+							struct device_attribute *attr,
+							const char *buf, size_t size)
+{
+	unsigned long value, cs, line;
+	char *cur = kmalloc(ATTR_BUF_MAX, GFP_KERNEL);
+
+	if (cur == NULL)
+		return -ENOMEM;
+
+	memset(cur, 0, ATTR_BUF_MAX);
+	memcpy(cur, buf, size);
+
+	if (kstrtoul(strsep(&cur, " "), 0, &line))
+		goto err;
+
+	if (kstrtoul(strsep(&cur, " "), 0, &cs))
+		goto err;
+
+	if (kstrtoul(strsep(&cur, " "), 0, &value))
+		goto err;
+
+	lp5860_write(dev, LP5860_PWM_BRI_START + (line * PWM_BRI_MAX_LINE_REG)
+				+ (cs * PWM_BRI_OFFSET), (value >> 8) & 0xff);
+
+	lp5860_write(dev, LP5860_PWM_BRI_START + (line * PWM_BRI_MAX_LINE_REG)
+				+ (cs * PWM_BRI_OFFSET + 1), value & 0xff);
+
+	kfree(cur);
+	return size;
+
+err:
+	dev_err(dev, "Parameter error\r\n");
+	kfree(cur);
+	return -EINVAL;
+}
+static LP5860_DEV_ATTR_WO(dot_pwm_16bits_bri, lp5860_set_dot_16bits_pwm_bri);
+
+static ssize_t lp5860_set_dot_8bits_pwm_bri(struct device *dev,
+							struct device_attribute *attr,
+							const char *buf, size_t size)
+{
+	unsigned long value, cs, line;
+	char *cur = kmalloc(ATTR_BUF_MAX, GFP_KERNEL);
+
+	if (cur == NULL)
+		return -ENOMEM;
+
+	memset(cur, 0, ATTR_BUF_MAX);
+	memcpy(cur, buf, strlen(buf));
+
+	if (kstrtoul(strsep(&cur, " "), 0, &line))
+		goto err;
+
+	if (kstrtoul(strsep(&cur, " "), 0, &cs))
+		goto err;
+
+	if (kstrtoul(strsep(&cur, " "), 0, &value))
+		goto err;
+
+	lp5860_write(dev, LP5860_PWM_BRI_START + (line * PWM_8BITS_BRI_MAX_LINE_REG) +
+						(cs * PWM_8BITS_BRI_OFFSET), value & 0xff);
+
+	kfree(cur);
+	return size;
+
+err:
+	kfree(cur);
+	dev_err(dev, "Parameter error\r\n");
+	return -EINVAL;
+}
+static LP5860_DEV_ATTR_WO(dot_pwm_8bits_bri, lp5860_set_dot_8bits_pwm_bri);
+
+static ssize_t lp5860_set_send_sync(struct device *dev,
+							struct device_attribute *attr,
+							const char *buf, size_t size)
+{
+	struct lp5860 *priv = dev_get_drvdata(dev);
+	int ret;
+	unsigned long value;
+
+	ret = kstrtoul(buf, 0, &value);
+	if (ret)
+		return ret;
+
+
+	gpio_set_value(priv->sync_gpio, 1);
+	udelay(value);
+	gpio_set_value(priv->sync_gpio, 0);
+
+
+	return size;
+}
+static LP5860_DEV_ATTR_WO(send_sync, lp5860_set_send_sync);
+
+static struct attribute *lp5860_attributes[] = {
+	&dev_attr_reg_offset_value.attr,
+	&dev_attr_chip_value.attr,
+	&dev_attr_max_line.attr,
+	&dev_attr_date_ref_mode.attr,
+	&dev_attr_pwm_frequency.attr,
+	&dev_attr_sw_blk.attr,
+	&dev_attr_pwm_scale_mode.attr,
+	&dev_attr_pwm_phaseshift.attr,
+	&dev_attr_cs_on_shift.attr,
+	&dev_attr_comp_group3.attr,
+	&dev_attr_comp_group2.attr,
+	&dev_attr_comp_group1.attr,
+	&dev_attr_lod_removal.attr,
+	&dev_attr_lsd_removal.attr,
+	&dev_attr_down_deghost.attr,
+	&dev_attr_up_deghost.attr,
+	&dev_attr_maximum_current.attr,
+	&dev_attr_up_deghost_enable.attr,
+	&dev_attr_pwm_global.attr,
+	&dev_attr_pwm_group1.attr,
+	&dev_attr_pwm_group2.attr,
+	&dev_attr_pwm_group3.attr,
+	&dev_attr_r_current_set.attr,
+	&dev_attr_g_current_set.attr,
+	&dev_attr_b_current_set.attr,
+	&dev_attr_global_lod.attr,
+	&dev_attr_global_lsd.attr,
+	&dev_attr_global_lod_celar.attr,
+	&dev_attr_global_lsd_celar.attr,
+	&dev_attr_reset_en.attr,
+	&dev_attr_dot_group.attr,
+	&dev_attr_dot_dc_current.attr,
+	&dev_attr_dot_onoff.attr,
+	&dev_attr_dot_pwm_16bits_bri.attr,
+	&dev_attr_dot_pwm_8bits_bri.attr,
+	&dev_attr_send_sync.attr,
+	NULL,
+};
+
+static const struct attribute_group lp5860_group = {
+	.attrs = lp5860_attributes,
+};
+
+
+static int lp5860_probe_dt(struct lp5860 *priv)
+{
+	enum of_gpio_flags flags;
+
+	priv->ifs_gpio = of_get_named_gpio_flags(priv->dev->of_node, "ifs-gpio", 0, &flags);
+	gpio_request(priv->ifs_gpio, "ifsgpio");
+	gpio_direction_output(priv->ifs_gpio, 1);
+
+	priv->enable_gpio = of_get_named_gpio_flags(priv->dev->of_node, "enable-gpio", 0, &flags);
+	gpio_request(priv->enable_gpio, "enablegpio");
+	gpio_direction_output(priv->enable_gpio, 1);
+
+	priv->sync_gpio = of_get_named_gpio_flags(priv->dev->of_node, "sync-gpio", 0, &flags);
+	gpio_request(priv->sync_gpio, "sync-gpio");
+	gpio_direction_output(priv->sync_gpio, 1);
+
+	return 0;
+}
+
+int lp5860_device_init(struct lp5860 *lp5860, lp5860_device_type type)
+{
+	int ret;
+
+	dev_set_drvdata(lp5860->dev, lp5860);
+
+	lp5860_probe_dt(lp5860);
+
+	gpio_set_value(lp5860->enable_gpio, 0);
+	gpio_set_value(lp5860->enable_gpio, 1);
+
+	if (type == LP5860_DEVICE_TYPE_I2C)
+		gpio_set_value(lp5860->ifs_gpio, 0);
+	else
+		gpio_set_value(lp5860->ifs_gpio, 1);
+
+	ret = sysfs_create_group(&lp5860->dev->kobj, &lp5860_group);
+	if (ret)
+		return ret;
+
+	return 0;
+}
+
+int lp5860_device_remove(struct device *dev)
+{
+
+	sysfs_remove_group(&dev->kobj, &lp5860_group);
+
+	return 0;
+}
+
+
diff --git a/drivers/leds/leds-lp5860-i2c.c b/drivers/leds/leds-lp5860-i2c.c
new file mode 100644
index 000000000..a0e40c34f
--- /dev/null
+++ b/drivers/leds/leds-lp5860-i2c.c
@@ -0,0 +1,146 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * LP5860 Driver
+ *
+ * Copyright 2012 Texas Instruments
+ *
+ * Author: Texas Instruments
+ *
+ *
+ */
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/fs.h>
+#include <linux/io.h>
+#include <linux/ioctl.h>
+#include <linux/device.h>
+#include <linux/cdev.h>
+#include <linux/of.h>
+#include <linux/of_gpio.h>
+#include <linux/gpio.h>
+#include <linux/input.h>
+#include <linux/platform_device.h>
+#include <linux/compaction.h>
+#include <linux/irq.h>
+#include <linux/irqreturn.h>
+#include <linux/uaccess.h>
+#include <linux/interrupt.h>
+#include <linux/fcntl.h>
+#include <linux/sh_clk.h>
+#include <linux/i2c.h>
+#include <linux/delay.h>
+#include <linux/slab.h>
+#include "leds-lp5860.h"
+
+int lp5860_write(struct device *dev, unsigned short reg, unsigned char val)
+{
+	int ret;
+	struct i2c_client *client = to_i2c_client(dev);
+	struct i2c_adapter *adapter = client->adapter;
+	struct i2c_msg msg;
+	unsigned char cal_addr = 0;
+	unsigned char buf[2] = {0};
+
+	cal_addr = (client->addr << 2) | ((0x0300 & reg) >> 8);
+	buf[0] = reg & 0xff;
+	buf[1] = val;
+
+	msg.addr = cal_addr;
+	msg.flags = 0;
+	msg.len = 2;
+	msg.buf = buf;
+
+	ret = i2c_transfer(adapter, &msg, 1);
+	if (ret < 0) {
+		dev_err(dev, "i2c_transfer read reg error\r\n");
+		return ret;
+	}
+
+	return 0;
+}
+
+int lp5860_read(struct device *dev, unsigned short reg, unsigned int *val)
+{
+	int ret;
+	struct i2c_client *client = to_i2c_client(dev);
+	struct i2c_adapter *adapter = client->adapter;
+	struct i2c_msg msg[2];
+	unsigned char cal_addr = 0;
+	unsigned char tmp_reg;
+	unsigned char tmp_data;
+
+	cal_addr = (client->addr << 2) | ((0x0300 & reg) >> 8);
+	tmp_reg = reg & 0xff;
+
+	msg[0].addr = cal_addr;
+	msg[0].flags = 0;
+	msg[0].len = 1;
+	msg[0].buf = &tmp_reg;
+
+
+	msg[1].addr = cal_addr;
+	msg[1].flags = 1;
+	msg[1].len = 1;
+	msg[1].buf = &tmp_data;
+
+	ret = i2c_transfer(adapter, msg, 2);
+	if (ret < 0) {
+		dev_err(dev, "i2c_transfer read reg error\r\n");
+		return ret;
+	}
+	*val = tmp_data;
+	return 0;
+}
+
+static int lp5860_probe(struct i2c_client *client, const struct i2c_device_id *id)
+{
+	struct lp5860 *lp5860;
+	struct device *dev = &client->dev;
+
+
+	lp5860 = devm_kzalloc(dev, sizeof(struct lp5860), GFP_KERNEL);
+	if (!lp5860)
+		return -ENOMEM;
+
+	lp5860->dev = dev;
+
+	return lp5860_device_init(lp5860, LP5860_DEVICE_TYPE_I2C);
+}
+
+static int lp5860_remove(struct i2c_client *client)
+{
+	struct device *dev = &client->dev;
+
+	lp5860_device_remove(dev);
+
+	return 0;
+}
+
+static const struct i2c_device_id lp5860_id[] = {
+	{"lp5860", 0},
+	{},
+};
+
+static const struct of_device_id lp5860_of_match_table[] = {
+	{.compatible = "ti,lp5860"},
+	{},
+};
+
+static struct i2c_driver lp5860_driver = {
+	.driver = {
+		.name = "lp5860",
+		.owner = THIS_MODULE,
+		.of_match_table = lp5860_of_match_table,
+	},
+	.probe = lp5860_probe,
+	.remove = lp5860_remove,
+	.id_table = lp5860_id,
+};
+
+module_i2c_driver(lp5860_driver);
+
+MODULE_DESCRIPTION("TI leds lp5860");
+MODULE_AUTHOR("zlzx");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS("spi:leds-lp5860");
diff --git a/drivers/leds/leds-lp5860-spi.c b/drivers/leds/leds-lp5860-spi.c
new file mode 100644
index 000000000..898133150
--- /dev/null
+++ b/drivers/leds/leds-lp5860-spi.c
@@ -0,0 +1,119 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * LP5860 Driver
+ *
+ * Copyright 2012 Texas Instruments
+ *
+ * Author: Texas Instruments
+ *
+ *
+ */
+#include <linux/init.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/rtc.h>
+#include <linux/spi/spi.h>
+#include <linux/bcd.h>
+#include <linux/slab.h>
+#include <linux/of.h>
+#include <linux/of_gpio.h>
+#include <linux/regmap.h>
+#include "leds-lp5860.h"
+
+
+int lp5860_write(struct device *dev, unsigned short reg, unsigned char val)
+{
+	struct spi_device *spi = to_spi_device(dev);
+	unsigned char buf[3];
+	int ret;
+
+	/* MSB must be '1' to write */
+	reg = (((reg << 1) | 1) << 5);
+	buf[0] = (reg & 0xff00) >> 8;
+	buf[1] = (reg & 0x00ff);
+	buf[2] = val;
+
+	ret = spi_write(spi, buf, 3);
+	if (ret < 0) {
+		dev_err(dev, "spi_transfer write reg error\r\n");
+		return ret;
+	}
+
+	return 0;
+}
+
+int lp5860_read(struct device *dev, unsigned short reg, unsigned int *val)
+{
+	struct spi_device *spi = to_spi_device(dev);
+	int ret;
+	unsigned char buf[2] = {0};
+
+	if (!val)
+		return -EINVAL;
+
+	/* MSB must be '0' to read */
+	reg = (((reg << 1) | 0) << 5);
+
+	buf[0] = (reg & 0xff00) >> 8;
+	buf[1] = (reg & 0x00ff);
+
+
+	ret = spi_write_then_read(spi, buf, 2, val, 1);
+
+	if (ret < 0) {
+		dev_err(dev, "spi_transfer read reg error\r\n");
+		return ret;
+	}
+
+	return 0;
+}
+
+static int lp5860_probe(struct spi_device *spi)
+{
+	struct lp5860 *lp5860;
+	struct device *dev = &spi->dev;
+
+	spi->mode = SPI_MODE_0;
+	spi->bits_per_word = 8;
+	spi_setup(spi);
+
+
+	lp5860 = devm_kzalloc(&spi->dev, sizeof(struct lp5860), GFP_KERNEL);
+	if (!lp5860)
+		return -ENOMEM;
+
+	lp5860->dev = dev;
+
+	return lp5860_device_init(lp5860, LP5860_DEVICE_TYPE_SPI);
+}
+
+static int lp5860_remove(struct spi_device *spi)
+{
+	struct device *dev = &spi->dev;
+
+	lp5860_device_remove(dev);
+
+	return 0;
+}
+
+static const struct of_device_id lp5860_of_match[] = {
+	{ .compatible = "ti,lp5860" },
+	{}
+};
+MODULE_DEVICE_TABLE(of, lp5860_of_match);
+
+static struct spi_driver lp5860_driver = {
+	.driver = {
+		.name	= "lp5860",
+		.of_match_table = of_match_ptr(lp5860_of_match),
+	},
+	.probe	= lp5860_probe,
+	.remove = lp5860_remove,
+};
+
+module_spi_driver(lp5860_driver);
+
+MODULE_DESCRIPTION("TI leds lp5860");
+MODULE_AUTHOR("zlzx");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS("spi:leds-lp5860");
diff --git a/drivers/leds/leds-lp5860.h b/drivers/leds/leds-lp5860.h
new file mode 100644
index 000000000..fd4432560
--- /dev/null
+++ b/drivers/leds/leds-lp5860.h
@@ -0,0 +1,303 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * LP5860 Driver Header
+ *
+ * Copyright (C) 2012 Texas Instruments
+ *
+ * Author: Texas Instruments
+ *
+ * Derived from leds-lp5860.c
+ */
+
+#ifndef _LEDS_LP5860_COMMON_H
+#define _LEDS_LP5860_COMMON_H
+
+#include <linux/led-class-multicolor.h>
+
+/* lp586x Register */
+#define LP5860_CHIP_EN			0x00
+#define LP5860_DEV_INITIAL		0x01
+#define LP5860_DEV_CONFIG1		0x02
+#define LP5860_DEV_CONFIG2		0x03
+#define LP5860_DEV_CONFIG3		0x04
+#define LP5860_GLOBAL_BRI		0x05
+#define LP5860_GROUP0_BRI		0x06
+#define LP5860_GROUP1_BRI		0x07
+#define LP5860_GROUP2_BRI		0x08
+#define LP5860_R_CURRENT_SET	0x09
+#define LP5860_G_CURRENT_SET	0x0A
+#define LP5860_B_CURRENT_SET	0x0B
+#define LP5860_GRP_SEL_START	0x0C
+#define LP5860_DOT_ONOFF_START	0x43
+#define LP5860_FAULT_STATE		0x64
+#define LP5860_DOT_LOD_START	0x65
+#define LP5860_DOT_LSD_START	0x86
+#define LP5860_LOD_CLEAR		0xA7
+#define LP5860_LSD_CLEAR		0xA8
+#define LP5860_RESET			0xA9
+#define LP5860_DC_START			0x0100
+#define LP5860_PWM_BRI_START	0x0200
+#define LP5860_MAX_REG			0x038B
+
+/* Register chip_enable Value */
+#define LP5860_CHIP_MOVE_STEP	0
+#define LP5860_CHIP_MASK	BIT(0)
+#define LP5860_CHIP_DISABLE                       0x00
+#define LP5860_CHIP_ENABLE                        0x01
+
+/* Register Dev_initial Value */
+#define LP5860_MAX_LINE_MOVE_STEP	3
+#define LP5860_MAX_LINE_MASK	GENMASK(6, 3)
+#define LP5860_MAX_LINE_11                        0x0B
+#define LP5860_MAX_LINE_10                        0x0A
+#define LP5860_MAX_LINE_9                         0x09
+#define LP5860_MAX_LINE_8                         0x08
+#define LP5860_MAX_LINE_7                         0x07
+#define LP5860_MAX_LINE_6                         0x06
+#define LP5860_MAX_LINE_5                         0x05
+#define LP5860_MAX_LINE_4                         0x04
+#define LP5860_MAX_LINE_3                         0x03
+#define LP5860_MAX_LINE_2                         0x02
+#define LP5860_MAX_LINE_1                         0x01
+
+#define LP5860_MODE_MOVE_STEP	1
+#define LP5860_MODE_MASK	GENMASK(2, 1)
+#define LP5860_MODE_3_1                           0x03
+#define LP5860_MODE_3                             0x02
+#define LP5860_MODE_2                             0x01
+#define LP5860_MODE_1                             0x00
+
+#define LP5860_PWM_FREQUENCY_MOVE_STEP	0
+#define LP5860_PWM_FREQUENCY_MASK	BIT(0)
+#define LP5860_PWM_FREQUENCY_62_5K                0x01
+#define LP5860_PWM_FREQUENCY_125K                 0x00
+
+/* *Register Dev_config1 Valu */
+#define LP5860_SW_BLK_MOVE_STEP	3
+#define LP5860_SW_BLK_MASK	BIT(3)
+#define LP5860_SW_BLK_05US                        0x01
+#define LP5860_SW_BLK_1US                         0x00
+
+#define LP5860_PWM_SCALE_MODE_MOVE_STEP	2
+#define LP5860_PWM_SCALE_MODE_MASK	BIT(2)
+#define LP5860_PWM_SCALE_EXPONENTIAL              0x01
+#define LP5860_PWM_SCALE_LINEAR                   0x00
+
+#define LP5860_PWM_PHASESHIFT_MOVE_STEP	1
+#define LP5860_PWM_PHASESHIFT_MASK	BIT(1)
+#define LP5860_PWM_PHASESHIFT_ON                  0x01
+#define LP5860_PWM_PHASESHIFT_OFF                 0x00
+
+#define LP5860_CS_ON_SHIFT_MOVE_STEP	0
+#define LP5860_CS_ON_SHIFT_MASK		BIT(0)
+#define LP5860_CS_DELAY_ON                        0x01
+#define LP5860_CS_DELAY_OFF                       0x00
+
+/* Register Dev_config2 Value */
+#define LP5860_COMP_GROUP3_MOVE_STEP	6
+#define LP5860_COMP_GROUP3_MASK		GENMASK(7, 6)
+#define LP5860_COMP_GROUP3_3CLOCK                 0x03
+#define LP5860_COMP_GROUP3_2CLOCK                 0x02
+#define LP5860_COMP_GROUP3_1CLOCK                 0x01
+#define LP5860_COMP_GROUP3_OFF                    0x00
+
+#define LP5860_COMP_GROUP2_MOVE_STEP	4
+#define LP5860_COMP_GROUP2_MASK		GENMASK(5, 4)
+#define LP5860_COMP_GROUP2_3CLOCK                 0x03
+#define LP5860_COMP_GROUP2_2CLOCK                 0x02
+#define LP5860_COMP_GROUP2_1CLOCK                 0x01
+#define LP5860_COMP_GROUP2_OFF                    0x00
+
+#define LP5860_COMP_GROUP1_MOVE_STEP	2
+#define LP5860_COMP_GROUP1_MASK		GENMASK(3, 2)
+#define LP5860_COMP_GROUP1_3CLOCK                 0x03
+#define LP5860_COMP_GROUP1_2CLOCK                 0x02
+#define LP5860_COMP_GROUP1_1CLOCK                 0x01
+#define LP5860_COMP_GROUP1_OFF                    0x00
+
+#define LP5860_LOD_REMOVAL_MOVE_STEP	1
+#define LP5860_LOD_REMOVAL_MASK		BIT(1)
+#define LP5860_LOD_REMOVAL_EN                     0x01
+#define LP5860_LOD_REMOVAL_OFF                    0x00
+
+#define LP5860_LSD_REMOVAL_MOVE_STEP	0
+#define LP5860_LSD_REMOVAL_MASK		BIT(0)
+#define LP5860_LSD_REMOVAL_EN                     0x01
+#define LP5860_LSD_REMOVAL_OFF                    0x00
+
+/* Register Dev_config3 Value */
+#define LP5860_DOWN_DEGHOST_MOVE_STEP	6
+#define LP5860_DOWN_DEGHOST_MASK		GENMASK(7, 6)
+#define LP5860_DOWN_DEGHOST_STRONG                0x03
+#define LP5860_DOWN_DEGHOST_MEDIUM                0x02
+#define LP5860_DOWN_DEGHOST_WEAK                  0x01
+#define LP5860_DOWN_DEGHOST_OFF                   0x00
+
+#define LP5860_UP_DEGHOST_MOVE_STEP	4
+#define LP5860_UP_DEGHOST_MASK		GENMASK(5, 4)
+#define LP5860_UP_DEGHOST_GND                     0x03
+#define LP5860_UP_DEGHOST_3                       0x02
+#define LP5860_UP_DEGHOST_2_5                     0x01
+#define LP5860_UP_DEGHOST_2                       0x00
+
+#define LP5860_MAXIMUM_CURRENT_MOVE_STEP	1
+#define LP5860_MAXIMUM_CURRENT_MASK		GENMASK(3, 1)
+#define LP5860_MAXIMUM_CURRENT_50                 0x07
+#define LP5860_MAXIMUM_CURRENT_40                 0x06
+#define LP5860_MAXIMUM_CURRENT_30                 0x05
+#define LP5860_MAXIMUM_CURRENT_20                 0x04
+#define LP5860_MAXIMUM_CURRENT_15                 0x03
+#define LP5860_MAXIMUM_CURRENT_10                 0x02
+#define LP5860_MAXIMUM_CURRENT_5                  0x01
+#define LP5860_MAXIMUM_CURRENT_3                  0x00
+
+#define LP5860_UP_DEGHOST_ENABLE_MOVE_STEP	0
+#define LP5860_UP_DEGHOST_ENABLE_MASK		BIT(0)
+#define LP5860_UP_DEGHOST_ENABLE_EN                      0x01
+#define LP5860_UP_DEGHOST_ENABLE_OFF                     0x00
+
+/* Register PWM */
+#define LP5860_PWM_GLOBAL_MAX	0xff
+#define LP5860_PWM_GROUP_MAX	0xff
+
+/* Register CC GROUP select */
+#define LP5860_CC_GROUP_MASK		GENMASK(7, 0)
+#define LP5860_CC_GROUP_MAX		0x7F
+
+/* Register dot group select */
+#define LP5860_DOT_0_MOVE_STEP	0
+#define LP5860_DOT_1_MOVE_STEP	2
+#define LP5860_DOT_2_MOVE_STEP	4
+#define LP5860_DOT_3_MOVE_STEP	6
+
+#define LP5860_DOT_GROUP3		0x03
+#define LP5860_DOT_GROUP2		0x02
+#define LP5860_DOT_GROUP1		0x01
+#define LP5860_DOT_GROUP_NONE	0x00
+
+#define LP5860_PWM_DOT_MAX	0xff
+/* dot onoff Value */
+#define LP5860_DOT_CS0_MOVE_STEP	0
+#define LP5860_DOT_CS1_MOVE_STEP	1
+#define LP5860_DOT_CS2_MOVE_STEP	2
+#define LP5860_DOT_CS3_MOVE_STEP	3
+#define LP5860_DOT_CS4_MOVE_STEP	4
+#define LP5860_DOT_CS5_MOVE_STEP	5
+#define LP5860_DOT_CS6_MOVE_STEP	6
+#define LP5860_DOT_CS7_MOVE_STEP	7
+
+#define LP5860_DOT_CS_ON 0x01
+#define LP5860_DOT_CS_OFF 0x00
+
+/* dot lod Value */
+#define LP5860_DOT_LOD0_MOVE_STEP	0
+#define LP5860_DOT_LOD1_MOVE_STEP	1
+#define LP5860_DOT_LOD2_MOVE_STEP	2
+#define LP5860_DOT_LOD3_MOVE_STEP	3
+#define LP5860_DOT_LOD4_MOVE_STEP	4
+#define LP5860_DOT_LOD5_MOVE_STEP	5
+#define LP5860_DOT_LOD6_MOVE_STEP	6
+#define LP5860_DOT_LOD7_MOVE_STEP	7
+
+#define LP5860_DOT_LOD_ON 0x01
+#define LP5860_DOT_LOD_OFF 0x00
+
+/* dot lsd Value */
+#define LP5860_DOT_LSD0_MOVE_STEP	0
+#define LP5860_DOT_LSD1_MOVE_STEP	1
+#define LP5860_DOT_LSD2_MOVE_STEP	2
+#define LP5860_DOT_LSD3_MOVE_STEP	3
+#define LP5860_DOT_LSD4_MOVE_STEP	4
+#define LP5860_DOT_LSD5_MOVE_STEP	5
+#define LP5860_DOT_LSD6_MOVE_STEP	6
+#define LP5860_DOT_LSD7_MOVE_STEP	7
+
+#define LP5860_DOT_LSD_ON 0x01
+#define LP5860_DOT_LSD_OFF 0x00
+
+/* REG FAULT_STATE */
+#define LP5860_GLOBAL_LOD_MOVE_STEP	1
+#define LP5860_GLOBAL_LOD_STATE		BIT(1)
+#define LP5860_GLOBAL_LSD_MOVE_STEP	0
+#define LP5860_GLOBAL_LSD_STATE		BIT(0)
+
+#define LP5860_FAULT_STATE_ON 0x01
+#define LP5860_FAULT_STATE_OFF 0x00
+
+/* REG FAULT_STATE */
+#define LP5860_GLOBAL_LOD_CELAR		0x00
+#define LP5860_GLOBAL_LSD_CELAR		0x00
+
+
+#define LP5860_LOD_CLEAR_EN		0xff
+#define LP5860_LSD_CLEAR_EN		0xff
+#define LP5860_RESET_EN			0xff
+
+#define MAX_INPUT_PARAMETER		10
+#define MAX_DOT_GROUP_NUM		4
+#define MAX_DOT_REG_NUM			5
+#define MAX_DOT_DC_CURRENT__LINE_REG		18
+
+#define PWM_8BITS_BRI_MAX_LINE_REG	18
+#define PWM_8BITS_BRI_OFFSET		1
+
+#define PWM_BRI_MAX_LINE_REG	36
+#define PWM_BRI_OFFSET			2
+#define LP5860_MAX_LED_CONSTANT	18
+#define LP5860_MAX_LED_SCAN		11
+#define LP5860_MAX_LED			(LP5860_MAX_LED_CONSTANT * LP5860_MAX_LED_SCAN)
+
+#define MAX_DOT_ONOFF_REG_NUM	3
+#define MAX_DOT_ONOFF_GROUP_NUM	8
+
+#define ATTR_BUF_MAX			64
+
+
+#define LP5860_DEV_ATTR_RW(name, name_show, name_store)	\
+	DEVICE_ATTR(name, 0644, name_show, name_store)
+#define LP5860_DEV_ATTR_RO(name, name_show)		\
+	DEVICE_ATTR(name, 0444, name_show, NULL)
+#define LP5860_DEV_ATTR_WO(name, name_store)		\
+	DEVICE_ATTR(name, 0200, NULL, name_store)
+
+
+#define LP5860_SHOW_MODE(nr, reg, mask, step) \
+static ssize_t lp5860_get_##nr(struct device *dev, struct device_attribute *attr, char *buf) \
+{ \
+	struct lp5860 *priv = dev_get_drvdata(dev); \
+	return lp5860_get_reg_data(priv, reg, mask, step, buf); \
+}
+
+#define LP5860_STORE_MODE(nr, reg, mask, step) \
+static ssize_t lp5860_set_##nr(struct device *dev, struct device_attribute *attr, \
+								const char *buf, size_t len) \
+{ \
+	struct lp5860 *priv = dev_get_drvdata(dev); \
+	lp5860_set_reg_data(priv, reg, mask, buf, step); \
+	return len; \
+}
+
+typedef enum {
+	LP5860_DEVICE_TYPE_I2C = 0,
+	LP5860_DEVICE_TYPE_SPI,
+} lp5860_device_type;
+
+struct lp5860 {
+	struct device *dev;
+
+	int ifs_gpio;
+	int sync_gpio;
+	int enable_gpio;
+
+	int max_leds;
+	int num_of_leds;
+	int reg_offset;
+
+};
+
+int lp5860_device_init(struct lp5860 *lp5860, lp5860_device_type type);
+int lp5860_device_remove(struct device *dev);
+int lp5860_write(struct device *dev, unsigned short reg, unsigned char val);
+int lp5860_read(struct device *dev, unsigned short reg, unsigned int *val);
+
+#endif /* _LEDS_LP5860_H */
