diff options
author | Nico Huber <nico.huber@secunet.com> | 2015-08-27 13:31:46 +0200 |
---|---|---|
committer | Nico Huber <nico.h@gmx.de> | 2015-10-22 23:01:36 +0200 |
commit | 954a55b950cc13ba6685b71f32d26cb453bc8d06 (patch) | |
tree | a94271093c50086963d81ec7b8ae8416f05107e7 /src/drivers/intel/gma/acpi/configure_brightness_levels.asl | |
parent | 3404625bcc5cfed13e2551df53b3e09bb7ec0a19 (diff) |
gma ACPI: Make brightness levels a per board setting
Those are actually board specific. Keep the old value as defaults,
though. The defaults are included by all affected boards.
Change-Id: Ib865c7b4274f2ea3181a89fc52701b740f9bab7d
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: http://review.coreboot.org/11705
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Vladimir Serbinenko <phcoder@gmail.com>
Diffstat (limited to 'src/drivers/intel/gma/acpi/configure_brightness_levels.asl')
-rw-r--r-- | src/drivers/intel/gma/acpi/configure_brightness_levels.asl | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/drivers/intel/gma/acpi/configure_brightness_levels.asl b/src/drivers/intel/gma/acpi/configure_brightness_levels.asl new file mode 100644 index 0000000000..38eb116c67 --- /dev/null +++ b/src/drivers/intel/gma/acpi/configure_brightness_levels.asl @@ -0,0 +1,24 @@ + Method (XBCM, 1, NotSerialized) + { + Store (Divide (Multiply (Arg0, BCLM), 100), BCLV) + } + + Method (XBQC, 0, NotSerialized) + { + /* Find value close to BCLV in BRIG (which must be ordered) */ + Store (BCLV, Local0) // Current value + Store (BCLM, Local1) // For calculations + Store (2, Local2) // Loop index + While (LLess (Local2, Subtract (SizeOf (BRIG), 1))) { + Store (DeRefOf (Index (BRIG, Local2)), Local3) + /* Use same calculation as XBCM, to get exact matches */ + Store (Divide (Multiply (Local3, Local1), 100), Local3) + + If (LLessEqual (Local0, Local3)) { + Return (DeRefOf (Index (BRIG, Local2))) + } + Add (Local2, 1, Local2) + } + /* Didn't find greater/equal value: use the last */ + Return (DeRefOf (Index (BRIG, Local2))) + } |