From 9e6dada9d255497127251c03aaa59296d186f959 Mon Sep 17 00:00:00 2001 From: Zhang Rui Date: Wed, 31 Dec 2008 10:58:48 +0800 Subject: [PATCH] video: always update the brightness when poking "brightness" always update props.brightness no matter the backlight is changed via procfs, hotkeys or sysfs. Sighed-off-by: Zhang Rui Acked-by: Matthew Garrett Signed-off-by: Len Brown --- drivers/acpi/video.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index baa441929720..66a610d0e2f5 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c @@ -481,6 +481,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; @@ -489,6 +490,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; } -- 2.39.2