Restructure the driver to add the support for new WLED
peripherals.
Signed-off-by: Kiran Gunda <kgunda@xxxxxxxxxxxxxx>
Acked-by: Daniel Thompson <daniel.thompson@xxxxxxxxxx>
---
drivers/video/backlight/qcom-wled.c | 395 ++++++++++++++++++++++--------------
1 file changed, 245 insertions(+), 150 deletions(-)
diff --git a/drivers/video/backlight/qcom-wled.c b/drivers/video/backlight/qcom-wled.c
index f191242..740f1b6 100644
--- a/drivers/video/backlight/qcom-wled.c
+++ b/drivers/video/backlight/qcom-wled.c
@@ -7,59 +7,71 @@
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_device.h>
+#include <linux/of_address.h>
#include <linux/regmap.h>
/* From DT binding */
+#define WLED_MAX_STRINGS 4
+
#define WLED_DEFAULT_BRIGHTNESS 2048
-#define WLED3_SINK_REG_BRIGHT_MAX 0xFFF
-#define WLED3_CTRL_REG_VAL_BASE 0x40
+#define WLED_SINK_REG_BRIGHT_MAX 0xFFF