2009-09-17 18:58:07

by Arun Sudhilal

[permalink] [raw]
Subject: [PATCH] Adding LED1 & LED2 control for DA9034 backlight driver

From: Arun KS <[email protected]>

Signed-off-by: Arun KS <[email protected]>
---
drivers/video/backlight/da903x_bl.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/drivers/video/backlight/da903x_bl.c b/drivers/video/backlight/da903x_bl.c
index 93bb434..a056074 100644
--- a/drivers/video/backlight/da903x_bl.c
+++ b/drivers/video/backlight/da903x_bl.c
@@ -23,6 +23,8 @@
#define DA9030_WLED_CP_EN (1 << 6)
#define DA9030_WLED_TRIM(x) ((x) & 0x7)

+#define DA9034_LED1_CONTROL 0x35
+#define DA9034_LED1_CONTROL 0x36
#define DA9034_WLED_CONTROL1 0x3C
#define DA9034_WLED_CONTROL2 0x3D

@@ -66,6 +68,14 @@ static int da903x_backlight_set(struct backlight_device *bl, int brightness)
val |= brightness ? DA9030_WLED_CP_EN : 0;
ret = da903x_write(dev, DA9030_WLED_CONTROL, val);
break;
+ case DA9034_ID_LED_1:
+ ret = da903x_update(dev, DA9034_LED1_CONTROL,
+ brightness, 0x7f);
+ break;
+ case DA9034_ID_LED_2:
+ ret = da903x_update(dev, DA9034_LED2_CONTROL,
+ brightness, 0x7f);
+ break;
}

if (ret)
@@ -114,6 +124,8 @@ static int da903x_backlight_probe(struct platform_device *pdev)
max_brightness = DA9030_MAX_BRIGHTNESS;
break;
case DA9034_ID_WLED:
+ case DA9034_ID_LED_1:
+ case DA9034_ID_LED_2:
max_brightness = DA9034_MAX_BRIGHTNESS;
break;
default:
--
1.5.4.3