summaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorMatus Ujhelyi <ujhelyi.m@gmail.com>2013-04-30 01:18:08 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2013-04-30 03:28:19 +0200
commit4d22f8c306233433bdf9298b2e7806e9c71674bc (patch)
tree49b3a37f0cb85d98936d4e02b66e85f27f50c158 /drivers/video
parentDocumentation: add missing documentation for tps65217-bl device tree binding (diff)
downloadlinux-4d22f8c306233433bdf9298b2e7806e9c71674bc.tar.xz
linux-4d22f8c306233433bdf9298b2e7806e9c71674bc.zip
drivers/video/backlight/tps65217_bl.c add default brightness value option
Signed-off-by: Matus Ujhelyi <matus.ujhelyi@streamunlimited.com> Cc: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/backlight/tps65217_bl.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/video/backlight/tps65217_bl.c b/drivers/video/backlight/tps65217_bl.c
index 70881633b45a..05782312aeb3 100644
--- a/drivers/video/backlight/tps65217_bl.c
+++ b/drivers/video/backlight/tps65217_bl.c
@@ -245,6 +245,18 @@ tps65217_bl_parse_dt(struct platform_device *pdev)
}
}
+ if (!of_property_read_u32(node, "default-brightness", &val)) {
+ if (val < 0 ||
+ val > 100) {
+ dev_err(&pdev->dev,
+ "invalid 'default-brightness' value in the device tree\n");
+ err = ERR_PTR(-EINVAL);
+ goto err;
+ }
+
+ pdata->dft_brightness = val;
+ }
+
of_node_put(node);
return pdata;
@@ -311,7 +323,8 @@ static int tps65217_bl_probe(struct platform_device *pdev)
return PTR_ERR(tps65217_bl->bl);
}
- tps65217_bl->bl->props.brightness = 0;
+ tps65217_bl->bl->props.brightness = pdata->dft_brightness;
+ backlight_update_status(tps65217_bl->bl);
platform_set_drvdata(pdev, tps65217_bl);
return 0;