diff options
author | Henrique de Moraes Holschuh <hmh@hmh.eng.br> | 2007-02-22 13:04:55 -0500 |
---|---|---|
committer | Henrique de Moraes Holschuh <hmh@hmh.eng.br> | 2007-02-22 13:09:25 -0500 |
commit | adb005818b71e9476581a1de5742e2f427ac9e2b (patch) | |
tree | 97f6001a85ac57b2b7494abe4db84686579b4f39 /drivers/acpi/ibm_acpi.c | |
parent | c8f71b01a50597e298dc3214a2f2be7b8d31170c (diff) |
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.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/acpi/ibm_acpi.c b/drivers/acpi/ibm_acpi.c index 4cc534e36e81..7c1b418676b9 100644 --- a/drivers/acpi/ibm_acpi.c +++ b/drivers/acpi/ibm_acpi.c | |||
@@ -1711,6 +1711,12 @@ static struct backlight_ops ibm_backlight_data = { | |||
1711 | 1711 | ||
1712 | static int brightness_init(void) | 1712 | static int brightness_init(void) |
1713 | { | 1713 | { |
1714 | int b; | ||
1715 | |||
1716 | b = brightness_get(NULL); | ||
1717 | if (b < 0) | ||
1718 | return b; | ||
1719 | |||
1714 | ibm_backlight_device = backlight_device_register("ibm", NULL, NULL, | 1720 | ibm_backlight_device = backlight_device_register("ibm", NULL, NULL, |
1715 | &ibm_backlight_data); | 1721 | &ibm_backlight_data); |
1716 | if (IS_ERR(ibm_backlight_device)) { | 1722 | if (IS_ERR(ibm_backlight_device)) { |
@@ -1718,7 +1724,9 @@ static int brightness_init(void) | |||
1718 | return PTR_ERR(ibm_backlight_device); | 1724 | return PTR_ERR(ibm_backlight_device); |
1719 | } | 1725 | } |
1720 | 1726 | ||
1721 | ibm_backlight_device->props.max_brightness = 7; | 1727 | ibm_backlight_device->props.max_brightness = 7; |
1728 | ibm_backlight_device->props.brightness = b; | ||
1729 | backlight_update_status(ibm_backlight_device); | ||
1722 | 1730 | ||
1723 | return 0; | 1731 | return 0; |
1724 | } | 1732 | } |