ACPI video: support _BCL packages that don't export brightness levels when machine...
authorZhang Rui <rui.zhang@intel.com>
Wed, 18 Mar 2009 08:27:12 +0000 (16:27 +0800)
committerLen Brown <len.brown@intel.com>
Sat, 28 Mar 2009 01:55:58 +0000 (21:55 -0400)
commitd32f69470c2081ffdfd82740ac19f940790f9e93
treee15e8d5bd6dbc9c1aa03cf1da78bcc75c3ac21fa
parent24450c7add575cef53097738f16a4c1a720fa5cb
ACPI video: support _BCL packages that don't export brightness levels when machine is on AC/Battery

Many buggy BIOSes don't export the brightness levels when machine
is on AC/Battery in the _BCL method.

Reformat the _BCL package for these laptops:
now the elements in device->brightness->levels[] are like:
levels[0]: brightness level when on AC power.
levels[1]: brightness level when on Battery power.
levels[2]: supported brightness level 1.
levels[3]: supported brightness level 2.
...
levels[n]: supported brightness level n-1.
levels[n + 1]: supported brightness level n.
So if there are n supported brightness levels on this laptop,
we will have n+2 entries in device->brightnes->levels[].

level[0] and level[1] are invalid on the laptops that don't
export the brightness levels on AC/Battery.
Fortunately, we never use these two values at all, even for the
valid ones.

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

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Acked-by: Matthew Garrett <mjg59@srcf.ucam.org>
Acked-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/acpi/video.c