Commit 90af2cf6 authored by Zhang Rui's avatar Zhang Rui Committed by Len Brown

ACPI video: fix an error when the brightness levels on AC and on Battery are same

when the brightness level on AC and brightness level on Battery
are same, the level_ac_battery is 1 in the current code,
which is wrong.
Signed-off-by: default avatarZhang Rui <rui.zhang@intel.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent d91dfbb4
...@@ -770,10 +770,12 @@ acpi_video_init_brightness(struct acpi_video_device *device) ...@@ -770,10 +770,12 @@ acpi_video_init_brightness(struct acpi_video_device *device)
* In this case, the first two elements in _BCL packages * In this case, the first two elements in _BCL packages
* are also supported brightness levels that OS should take care of. * are also supported brightness levels that OS should take care of.
*/ */
for (i = 2; i < count; i++) for (i = 2; i < count; i++) {
if (br->levels[i] == br->levels[0] || if (br->levels[i] == br->levels[0])
br->levels[i] == br->levels[1])
level_ac_battery++; level_ac_battery++;
if (br->levels[i] == br->levels[1])
level_ac_battery++;
}
if (level_ac_battery < 2) { if (level_ac_battery < 2) {
level_ac_battery = 2 - level_ac_battery; level_ac_battery = 2 - level_ac_battery;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment