diff options
author | Haojian Zhuang <haojian.zhuang@marvell.com> | 2009-11-05 10:27:13 -0500 |
---|---|---|
committer | Eric Miao <eric.y.miao@gmail.com> | 2009-12-01 09:02:34 +0800 |
commit | b3a8549593696f5f3efcdbf280e2c8e0fe894855 (patch) | |
tree | ce031f9fbf7d2b23aa6e3c513764f015ab505230 /drivers/video/backlight | |
parent | f64dcac0b1247842db2530959cbe3df1cb1947c4 (diff) |
backlight: da903x_bl: control WLED output current in da9034
Update WLED output current source before changing brightness.
Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
Diffstat (limited to 'drivers/video/backlight')
-rw-r--r-- | drivers/video/backlight/da903x_bl.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/video/backlight/da903x_bl.c b/drivers/video/backlight/da903x_bl.c index 701a1081e19..7fcb0eb54c6 100644 --- a/drivers/video/backlight/da903x_bl.c +++ b/drivers/video/backlight/da903x_bl.c @@ -25,6 +25,7 @@ #define DA9034_WLED_CONTROL1 0x3C #define DA9034_WLED_CONTROL2 0x3D +#define DA9034_WLED_ISET(x) ((x) & 0x1f) #define DA9034_WLED_BOOST_EN (1 << 5) @@ -101,6 +102,7 @@ static struct backlight_ops da903x_backlight_ops = { static int da903x_backlight_probe(struct platform_device *pdev) { + struct da9034_backlight_pdata *pdata = pdev->dev.platform_data; struct da903x_backlight_data *data; struct backlight_device *bl; int max_brightness; @@ -127,6 +129,11 @@ static int da903x_backlight_probe(struct platform_device *pdev) data->da903x_dev = pdev->dev.parent; data->current_brightness = 0; + /* adjust the WLED output current */ + if (pdata) + da903x_write(data->da903x_dev, DA9034_WLED_CONTROL2, + DA9034_WLED_ISET(pdata->output_current)); + bl = backlight_device_register(pdev->name, data->da903x_dev, data, &da903x_backlight_ops); if (IS_ERR(bl)) { |