ACPI: video: Fix reversed brightness behavior on ThinkPad SL series
commit936574fd1687ea60a88a5070059e40c7dec7f414
authorZhang Rui <rui.zhang@intel.com>
Thu, 11 Dec 2008 21:24:52 +0000 (11 16:24 -0500)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 12 Feb 2009 17:50:36 +0000 (12 09:50 -0800)
treeb530209f63f908b342fef3943c35f9f9a738f7ff
parent54fe30373788fa3e968ade0481e08a6f13067b73
ACPI: video: Fix reversed brightness behavior on ThinkPad SL series

commit 935e5f290ec1eb0f1c15004421f5fd3154380fd5 upstream.

Section B.6.2 of ACPI 3.0b specification that defines _BCL method
doesn't require the brightness levels returned to be sorted.
At least ThinkPad SL300 (and probably all IdeaPads) returns the
array reversed (i.e. bightest levels have lowest indexes), which
causes the brightness management behave in completely reversed
manner on these machines (brightness increases when the laptop is
idle, while the display dims when used).

Sorting the array by brightness level values after reading the list
fixes the issue.

http://bugzilla.kernel.org/show_bug.cgi?id=12037

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Tested-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Len Brown <len.brown@intel.com>
Signed-off-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/acpi/video.c