summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorZhang Rui <rui.zhang@intel.com>2008-12-31 10:58:48 +0800
committerGreg Kroah-Hartman <gregkh@suse.de>2009-02-06 14:00:44 -0800
commit9b304c0bd70f0056f86340ee6eafacefbbb6a5e8 (patch)
tree4a35490dced5db12d72c336363531f3f79404aac /drivers
parenta21e824081db7004d321e201872c04d82663f6eb (diff)
video: always update the brightness when poking "brightness"
commit 9e6dada9d255497127251c03aaa59296d186f959 upstream. always update props.brightness no matter the backlight is changed via procfs, hotkeys or sysfs. Sighed-off-by: Zhang Rui <rui.zhang@intel.com> Acked-by: Matthew Garrett <mjg59@srcf.ucam.org> Signed-off-by: Len Brown <len.brown@intel.com> Cc: Thomas Renninger <trenn@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/acpi/video.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index 79409c9d2ad6..42e1e842ee51 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -482,6 +482,7 @@ acpi_video_device_lcd_set_level(struct acpi_video_device *device, int level)
int status = AE_OK;
union acpi_object arg0 = { ACPI_TYPE_INTEGER };
struct acpi_object_list args = { 1, &arg0 };
+ int state;
arg0.integer.value = level;
@@ -490,6 +491,10 @@ acpi_video_device_lcd_set_level(struct acpi_video_device *device, int level)
status = acpi_evaluate_object(device->dev->handle, "_BCM",
&args, NULL);
device->brightness->curr = level;
+ for (state = 2; state < device->brightness->count; state++)
+ if (level == device->brightness->levels[state])
+ device->backlight->props.brightness = state - 2;
+
return status;
}