diff options
Diffstat (limited to 'drivers/misc/acer-wmi.c')
-rw-r--r-- | drivers/misc/acer-wmi.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/misc/acer-wmi.c b/drivers/misc/acer-wmi.c index b82ff25a7b54..e35825f7e7ba 100644 --- a/drivers/misc/acer-wmi.c +++ b/drivers/misc/acer-wmi.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/init.h> | 29 | #include <linux/init.h> |
30 | #include <linux/types.h> | 30 | #include <linux/types.h> |
31 | #include <linux/dmi.h> | 31 | #include <linux/dmi.h> |
32 | #include <linux/fb.h> | ||
32 | #include <linux/backlight.h> | 33 | #include <linux/backlight.h> |
33 | #include <linux/leds.h> | 34 | #include <linux/leds.h> |
34 | #include <linux/platform_device.h> | 35 | #include <linux/platform_device.h> |
@@ -830,7 +831,15 @@ static int read_brightness(struct backlight_device *bd) | |||
830 | 831 | ||
831 | static int update_bl_status(struct backlight_device *bd) | 832 | static int update_bl_status(struct backlight_device *bd) |
832 | { | 833 | { |
833 | set_u32(bd->props.brightness, ACER_CAP_BRIGHTNESS); | 834 | int intensity = bd->props.brightness; |
835 | |||
836 | if (bd->props.power != FB_BLANK_UNBLANK) | ||
837 | intensity = 0; | ||
838 | if (bd->props.fb_blank != FB_BLANK_UNBLANK) | ||
839 | intensity = 0; | ||
840 | |||
841 | set_u32(intensity, ACER_CAP_BRIGHTNESS); | ||
842 | |||
834 | return 0; | 843 | return 0; |
835 | } | 844 | } |
836 | 845 | ||
@@ -852,8 +861,9 @@ static int __devinit acer_backlight_init(struct device *dev) | |||
852 | 861 | ||
853 | acer_backlight_device = bd; | 862 | acer_backlight_device = bd; |
854 | 863 | ||
864 | bd->props.power = FB_BLANK_UNBLANK; | ||
865 | bd->props.brightness = max_brightness; | ||
855 | bd->props.max_brightness = max_brightness; | 866 | bd->props.max_brightness = max_brightness; |
856 | bd->props.brightness = read_brightness(NULL); | ||
857 | backlight_update_status(bd); | 867 | backlight_update_status(bd); |
858 | return 0; | 868 | return 0; |
859 | } | 869 | } |