diff options
author | Carlos Corbacho <carlos@strangeworlds.co.uk> | 2008-06-21 04:09:27 -0400 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2008-07-16 17:27:02 -0400 |
commit | f2b585b4a31731b17b9769eae523986fa7fddcde (patch) | |
tree | 6c7271d33a60e2eae1731f5880dc50ddbdfb0faf /drivers/misc/acer-wmi.c | |
parent | 9991d9f2bc75dc8735932240b67432d4073b8f60 (diff) |
acer-wmi: Respect framebuffer blanking in backlight
If the framebuffer has requested blanking, turn the backlight down. Also
offer the user the option to do this.
Reported-by: Michal Pecio <michal.pecio@gmail.com>
Signed-off-by: Carlos Corbacho <carlos@strangeworlds.co.uk>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
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 | } |