summaryrefslogtreecommitdiff
path: root/drivers/acpi/ibm_acpi.c
diff options
context:
space:
mode:
authorHenrique de Moraes Holschuh <hmh@hmh.eng.br>2007-02-22 18:04:55 (GMT)
committerHenrique de Moraes Holschuh <hmh@hmh.eng.br>2007-02-22 18:09:25 (GMT)
commitadb005818b71e9476581a1de5742e2f427ac9e2b (patch)
tree97f6001a85ac57b2b7494abe4db84686579b4f39 /drivers/acpi/ibm_acpi.c
parentc8f71b01a50597e298dc3214a2f2be7b8d31170c (diff)
downloadlinux-adb005818b71e9476581a1de5742e2f427ac9e2b.tar.xz
ACPI: ibm-acpi: fix initial status of backlight device
The brightness class core does not update the initial status of the device's brightness at register time. Do it by ourselves. Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Acked-by: Richard Purdie <rpurdie@rpsys.net>
Diffstat (limited to 'drivers/acpi/ibm_acpi.c')
-rw-r--r--drivers/acpi/ibm_acpi.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/acpi/ibm_acpi.c b/drivers/acpi/ibm_acpi.c
index 4cc534e..7c1b418 100644
--- a/drivers/acpi/ibm_acpi.c
+++ b/drivers/acpi/ibm_acpi.c
@@ -1711,6 +1711,12 @@ static struct backlight_ops ibm_backlight_data = {
static int brightness_init(void)
{
+ int b;
+
+ b = brightness_get(NULL);
+ if (b < 0)
+ return b;
+
ibm_backlight_device = backlight_device_register("ibm", NULL, NULL,
&ibm_backlight_data);
if (IS_ERR(ibm_backlight_device)) {
@@ -1718,7 +1724,9 @@ static int brightness_init(void)
return PTR_ERR(ibm_backlight_device);
}
- ibm_backlight_device->props.max_brightness = 7;
+ ibm_backlight_device->props.max_brightness = 7;
+ ibm_backlight_device->props.brightness = b;
+ backlight_update_status(ibm_backlight_device);
return 0;
}