提交 9e6dada9 编写于 作者: Z Zhang Rui 提交者: Len Brown

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: NZhang Rui <rui.zhang@intel.com>
Acked-by: NMatthew Garrett <mjg59@srcf.ucam.org>
Signed-off-by: NLen Brown <len.brown@intel.com>
上级 11e93130
...@@ -481,6 +481,7 @@ acpi_video_device_lcd_set_level(struct acpi_video_device *device, int level) ...@@ -481,6 +481,7 @@ acpi_video_device_lcd_set_level(struct acpi_video_device *device, int level)
int status = AE_OK; int status = AE_OK;
union acpi_object arg0 = { ACPI_TYPE_INTEGER }; union acpi_object arg0 = { ACPI_TYPE_INTEGER };
struct acpi_object_list args = { 1, &arg0 }; struct acpi_object_list args = { 1, &arg0 };
int state;
arg0.integer.value = level; arg0.integer.value = level;
...@@ -489,6 +490,10 @@ acpi_video_device_lcd_set_level(struct acpi_video_device *device, int 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", status = acpi_evaluate_object(device->dev->handle, "_BCM",
&args, NULL); &args, NULL);
device->brightness->curr = level; 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; return status;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册