From 954a55b950cc13ba6685b71f32d26cb453bc8d06 Mon Sep 17 00:00:00 2001 From: Nico Huber Date: Thu, 27 Aug 2015 13:31:46 +0200 Subject: 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 Reviewed-on: http://review.coreboot.org/11705 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Vladimir Serbinenko --- src/drivers/intel/gma/acpi/brightness_levels.asl | 46 ---------------------- .../intel/gma/acpi/configure_brightness_levels.asl | 24 +++++++++++ .../intel/gma/acpi/default_brightness_levels.asl | 24 +++++++++++ src/drivers/intel/gma/acpi/non-pch.asl | 2 +- src/drivers/intel/gma/acpi/pch.asl | 2 +- 5 files changed, 50 insertions(+), 48 deletions(-) delete mode 100644 src/drivers/intel/gma/acpi/brightness_levels.asl create mode 100644 src/drivers/intel/gma/acpi/configure_brightness_levels.asl create mode 100644 src/drivers/intel/gma/acpi/default_brightness_levels.asl (limited to 'src/drivers/intel/gma/acpi') diff --git a/src/drivers/intel/gma/acpi/brightness_levels.asl b/src/drivers/intel/gma/acpi/brightness_levels.asl deleted file mode 100644 index d0e70a9418..0000000000 --- a/src/drivers/intel/gma/acpi/brightness_levels.asl +++ /dev/null @@ -1,46 +0,0 @@ - Name (BRIG, Package (0x12) - { - 100, /* default AC */ - 100, /* default Battery */ - 2, - 4, - 5, - 7, - 9, - 11, - 13, - 18, - 20, - 24, - 29, - 33, - 40, - 50, - 67, - 100, - }) - - 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))) - } 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))) + } diff --git a/src/drivers/intel/gma/acpi/default_brightness_levels.asl b/src/drivers/intel/gma/acpi/default_brightness_levels.asl new file mode 100644 index 0000000000..6c6f35ee28 --- /dev/null +++ b/src/drivers/intel/gma/acpi/default_brightness_levels.asl @@ -0,0 +1,24 @@ +Scope (GFX0) +{ + Name (BRIG, Package (0x12) + { + 100, /* default AC */ + 100, /* default Battery */ + 2, + 4, + 5, + 7, + 9, + 11, + 13, + 18, + 20, + 24, + 29, + 33, + 40, + 50, + 67, + 100, + }) +} diff --git a/src/drivers/intel/gma/acpi/non-pch.asl b/src/drivers/intel/gma/acpi/non-pch.asl index 0e156272b1..983dc01f10 100644 --- a/src/drivers/intel/gma/acpi/non-pch.asl +++ b/src/drivers/intel/gma/acpi/non-pch.asl @@ -37,6 +37,6 @@ Device (GFX0) BCLM, 16, } -#include "brightness_levels.asl" +#include "configure_brightness_levels.asl" #include "common.asl" } diff --git a/src/drivers/intel/gma/acpi/pch.asl b/src/drivers/intel/gma/acpi/pch.asl index 98746e809d..bd59a43725 100644 --- a/src/drivers/intel/gma/acpi/pch.asl +++ b/src/drivers/intel/gma/acpi/pch.asl @@ -38,6 +38,6 @@ Device (GFX0) BCLM, 16 } -#include "brightness_levels.asl" +#include "configure_brightness_levels.asl" #include "common.asl" } -- cgit v1.2.3