Skip to contentSkip to conversation

Backlight: DA9052 Backlight driver v1

PATCH In review ashishj3 2 participants 3 messages Jun 28, 2011 – Jul 5, 2011

Subsystems (3)
lore
Share & tools
lore

ashishj3

author
#0 lore raw

PATCH 9/11 Backlight: DA9052 Backlight driver v1

DA9052 PMIC has capability to supply power for upto 3 banks of 6 white serial LEDS. It can also control intensity of independent banks. To drive these banks boost converter will provide up to 24V and forward current of max. 50mA.

This patch controls intensity of the individual WLEDs bank through DA9052 PMIC.

---
 drivers/video/backlight/Kconfig     |    6 +
 drivers/video/backlight/Makefile    |    1 +
 drivers/video/backlight/da9052_bl.c |  216 +++++++++++++++++++++++++++++++++++
 3 files changed, 223 insertions(+), 0 deletions(-)
 create mode 100755 drivers/video/backlight/da9052_bl.c
drivers/video/backlight/Kconfig +6 -0
index 0c9373b..a14fb21 100644
@@ -237,6 +237,12 @@ config BACKLIGHT_DA903X
 	  If you have a LCD backlight connected to the WLED output of DA9030
 	  or DA9034 WLED output, say Y here to enable this driver.
 
+config BACKLIGHT_DA9052
+        tristate "Dialog DA9052 WLED"
+        depends on PMIC_DA9052
+        help
+          Enable the DA9052 Backlight Driver
+
 config BACKLIGHT_MAX8925
 	tristate "Backlight driver for MAX8925"
 	depends on MFD_MAX8925
drivers/video/backlight/Makefile +1 -0
index b9ca849..a317e11 100644
@@ -26,6 +26,7 @@ obj-$(CONFIG_BACKLIGHT_PROGEAR) += progear_bl.o
 obj-$(CONFIG_BACKLIGHT_CARILLO_RANCH) += cr_bllcd.o
 obj-$(CONFIG_BACKLIGHT_PWM)	+= pwm_bl.o
 obj-$(CONFIG_BACKLIGHT_DA903X)	+= da903x_bl.o
+obj-$(CONFIG_BACKLIGHT_DA9052) += da9052_bl.o
 obj-$(CONFIG_BACKLIGHT_MAX8925)	+= max8925_bl.o
 obj-$(CONFIG_BACKLIGHT_APPLE)	+= apple_bl.o
 obj-$(CONFIG_BACKLIGHT_TOSA)	+= tosa_bl.o
drivers/video/backlight/da9052_bl.c new file +216 -0

216 lines not on this page · raw message

author
#1 lore raw

If there are no comments then can you please Ack this patch.

Quoted 10 lines · On Tue, 2011-06-28 at 19:48 +0530, ashishj3 wrote:

DA9052 PMIC has capability to supply power for upto 3 banks of 6 white serial LEDS. It can also control intensity of independent banks. To drive these banks boost converter will provide up to 24V and forward current of max. 50mA.

This patch controls intensity of the individual WLEDs bank through DA9052 PMIC.

---

#2 lore raw
In reply to ashishj3
Quoted 36 lines · On Tuesday 28 June 2011, ashishj3 wrote:
drivers/video/backlight/da9052_bl.c new file +36 -0
+static struct platform_driver da9052_wled1_driver = {
+       .probe  = da9052_backlight_probe,
+       .remove = da9052_backlight_remove,
+       .driver = {
+               .name   = "da9052-WLED1",
+               .owner  = THIS_MODULE,
+       },
+};
+
+static struct platform_driver da9052_wled2_driver = {
+       .probe  = da9052_backlight_probe,
+       .remove = da9052_backlight_remove,
+       .driver = {
+               .name   = "da9052-WLED2",
+               .owner  = THIS_MODULE,
+       },
+};
+
+static struct platform_driver da9052_wled3_driver = {
+       .probe  = da9052_backlight_probe,
+       .remove = da9052_backlight_remove,
+       .driver = {
+               .name   = "da9052-WLED3",
+               .owner  = THIS_MODULE,
+       },
+};
+
+static int __init da9052_backlight_init(void)
+{
+       int ret;
+
+       ret = platform_driver_register(&da9052_wled1_driver);
+       if (ret)
+               return ret;
+
+       ret = platform_driver_register(&da9052_wled2_driver);

drivers/video/backlight/da9052_bl.c line 203

Quoted 10 lines
drivers/video/backlight/da9052_bl.c new file +10 -0
+       if (ret)
+               return ret;
+
+       ret = platform_driver_register(&da9052_wled3_driver);
+       if (ret)
+               return ret;
+
+       return 0;
+}
+module_init(da9052_backlight_init);

As mentioned before, you should only need to register a single driver for these three devices: Either you name them all the same and just give the individual devices a different platform_device->id, or you leave them with different names and add a platform_driver->id_table to match them all.

Arnd