From 779872ff4d9ce156dbb408550db2d529bd8bc5d9 Mon Sep 17 00:00:00 2001 From: Tim Crawford Date: Mon, 5 Dec 2022 08:49:46 -0700 Subject: [PATCH] mb/system76: Add custom backlight levels for Intel GMA Add custom backlight levels for all models except: - addw1 - bonw14: Does not use the iGPU Change-Id: Ibea37f19acca0d718211fc41706019a92a240c70 Signed-off-by: Tim Crawford --- .../system76/cml-u/acpi/backlight.asl | 31 +++++++++++++++++++ .../system76/cml-u/acpi/mainboard.asl | 3 ++ src/mainboard/system76/cml-u/dsdt.asl | 1 - .../system76/gaze15/acpi/backlight.asl | 31 +++++++++++++++++++ .../system76/gaze15/acpi/mainboard.asl | 3 ++ src/mainboard/system76/gaze15/dsdt.asl | 1 - .../system76/kbl-u/acpi/backlight.asl | 31 +++++++++++++++++++ .../system76/kbl-u/acpi/mainboard.asl | 4 +++ .../system76/oryp5/acpi/backlight.asl | 31 +++++++++++++++++++ .../system76/oryp5/acpi/mainboard.asl | 3 ++ src/mainboard/system76/oryp5/dsdt.asl | 1 - .../system76/oryp6/acpi/backlight.asl | 31 +++++++++++++++++++ .../system76/oryp6/acpi/mainboard.asl | 3 ++ src/mainboard/system76/oryp6/dsdt.asl | 1 - .../system76/tgl-h/acpi/backlight.asl | 31 +++++++++++++++++++ .../system76/tgl-h/acpi/mainboard.asl | 3 ++ src/mainboard/system76/tgl-h/dsdt.asl | 1 - .../system76/tgl-u/acpi/backlight.asl | 31 +++++++++++++++++++ .../system76/tgl-u/acpi/mainboard.asl | 3 ++ src/mainboard/system76/tgl-u/dsdt.asl | 1 - .../system76/whl-u/acpi/backlight.asl | 31 +++++++++++++++++++ .../system76/whl-u/acpi/mainboard.asl | 3 ++ src/mainboard/system76/whl-u/dsdt.asl | 1 - 23 files changed, 273 insertions(+), 7 deletions(-) create mode 100644 src/mainboard/system76/cml-u/acpi/backlight.asl create mode 100644 src/mainboard/system76/gaze15/acpi/backlight.asl create mode 100644 src/mainboard/system76/kbl-u/acpi/backlight.asl create mode 100644 src/mainboard/system76/oryp5/acpi/backlight.asl create mode 100644 src/mainboard/system76/oryp6/acpi/backlight.asl create mode 100644 src/mainboard/system76/tgl-h/acpi/backlight.asl create mode 100644 src/mainboard/system76/tgl-u/acpi/backlight.asl create mode 100644 src/mainboard/system76/whl-u/acpi/backlight.asl diff --git a/src/mainboard/system76/cml-u/acpi/backlight.asl b/src/mainboard/system76/cml-u/acpi/backlight.asl new file mode 100644 index 00000000000..f0202344508 --- /dev/null +++ b/src/mainboard/system76/cml-u/acpi/backlight.asl @@ -0,0 +1,31 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include + +Scope (GFX0) +{ + Name (BRIG, Package (22) { + 40, /* default AC */ + 40, /* default Battery */ + 5, + 10, + 15, + 20, + 25, + 30, + 35, + 40, + 45, + 50, + 55, + 60, + 65, + 70, + 75, + 80, + 85, + 90, + 95, + 100 + }) +} diff --git a/src/mainboard/system76/cml-u/acpi/mainboard.asl b/src/mainboard/system76/cml-u/acpi/mainboard.asl index 416cc5a1511..3335ba8fdd8 100644 --- a/src/mainboard/system76/cml-u/acpi/mainboard.asl +++ b/src/mainboard/system76/cml-u/acpi/mainboard.asl @@ -6,6 +6,9 @@ Scope (\_SB) { #include "sleep.asl" + Scope (PCI0) { + #include "backlight.asl" + } } Scope (\_GPE) { diff --git a/src/mainboard/system76/cml-u/dsdt.asl b/src/mainboard/system76/cml-u/dsdt.asl index 982e226118a..b633254edd3 100644 --- a/src/mainboard/system76/cml-u/dsdt.asl +++ b/src/mainboard/system76/cml-u/dsdt.asl @@ -19,7 +19,6 @@ DefinitionBlock( { #include #include - #include } #include diff --git a/src/mainboard/system76/gaze15/acpi/backlight.asl b/src/mainboard/system76/gaze15/acpi/backlight.asl new file mode 100644 index 00000000000..f0202344508 --- /dev/null +++ b/src/mainboard/system76/gaze15/acpi/backlight.asl @@ -0,0 +1,31 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include + +Scope (GFX0) +{ + Name (BRIG, Package (22) { + 40, /* default AC */ + 40, /* default Battery */ + 5, + 10, + 15, + 20, + 25, + 30, + 35, + 40, + 45, + 50, + 55, + 60, + 65, + 70, + 75, + 80, + 85, + 90, + 95, + 100 + }) +} diff --git a/src/mainboard/system76/gaze15/acpi/mainboard.asl b/src/mainboard/system76/gaze15/acpi/mainboard.asl index 4e67439c569..b235437c25d 100644 --- a/src/mainboard/system76/gaze15/acpi/mainboard.asl +++ b/src/mainboard/system76/gaze15/acpi/mainboard.asl @@ -6,6 +6,9 @@ Scope (\_SB) { #include "sleep.asl" + Scope (PCI0) { + #include "backlight.asl" + } } Scope (\_GPE) { diff --git a/src/mainboard/system76/gaze15/dsdt.asl b/src/mainboard/system76/gaze15/dsdt.asl index d2bd57d78aa..a48382b578f 100644 --- a/src/mainboard/system76/gaze15/dsdt.asl +++ b/src/mainboard/system76/gaze15/dsdt.asl @@ -18,7 +18,6 @@ DefinitionBlock( Device (\_SB.PCI0) { #include #include - #include } #include diff --git a/src/mainboard/system76/kbl-u/acpi/backlight.asl b/src/mainboard/system76/kbl-u/acpi/backlight.asl new file mode 100644 index 00000000000..f0202344508 --- /dev/null +++ b/src/mainboard/system76/kbl-u/acpi/backlight.asl @@ -0,0 +1,31 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include + +Scope (GFX0) +{ + Name (BRIG, Package (22) { + 40, /* default AC */ + 40, /* default Battery */ + 5, + 10, + 15, + 20, + 25, + 30, + 35, + 40, + 45, + 50, + 55, + 60, + 65, + 70, + 75, + 80, + 85, + 90, + 95, + 100 + }) +} diff --git a/src/mainboard/system76/kbl-u/acpi/mainboard.asl b/src/mainboard/system76/kbl-u/acpi/mainboard.asl index 11735e8e019..a36923f4673 100644 --- a/src/mainboard/system76/kbl-u/acpi/mainboard.asl +++ b/src/mainboard/system76/kbl-u/acpi/mainboard.asl @@ -1,6 +1,10 @@ /* SPDX-License-Identifier: GPL-2.0-only */ Scope (\_SB) { + Scope (PCI0) { + #include "backlight.asl" + } + #include "ac.asl" #include "battery.asl" #include "buttons.asl" diff --git a/src/mainboard/system76/oryp5/acpi/backlight.asl b/src/mainboard/system76/oryp5/acpi/backlight.asl new file mode 100644 index 00000000000..f0202344508 --- /dev/null +++ b/src/mainboard/system76/oryp5/acpi/backlight.asl @@ -0,0 +1,31 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include + +Scope (GFX0) +{ + Name (BRIG, Package (22) { + 40, /* default AC */ + 40, /* default Battery */ + 5, + 10, + 15, + 20, + 25, + 30, + 35, + 40, + 45, + 50, + 55, + 60, + 65, + 70, + 75, + 80, + 85, + 90, + 95, + 100 + }) +} diff --git a/src/mainboard/system76/oryp5/acpi/mainboard.asl b/src/mainboard/system76/oryp5/acpi/mainboard.asl index 4373b2a4a12..17d2221ab4c 100644 --- a/src/mainboard/system76/oryp5/acpi/mainboard.asl +++ b/src/mainboard/system76/oryp5/acpi/mainboard.asl @@ -7,6 +7,9 @@ Scope (\_SB) { #include "sleep.asl" + Scope (PCI0) { + #include "backlight.asl" + } } Scope (\_GPE) diff --git a/src/mainboard/system76/oryp5/dsdt.asl b/src/mainboard/system76/oryp5/dsdt.asl index 982e226118a..b633254edd3 100644 --- a/src/mainboard/system76/oryp5/dsdt.asl +++ b/src/mainboard/system76/oryp5/dsdt.asl @@ -19,7 +19,6 @@ DefinitionBlock( { #include #include - #include } #include diff --git a/src/mainboard/system76/oryp6/acpi/backlight.asl b/src/mainboard/system76/oryp6/acpi/backlight.asl new file mode 100644 index 00000000000..f0202344508 --- /dev/null +++ b/src/mainboard/system76/oryp6/acpi/backlight.asl @@ -0,0 +1,31 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include + +Scope (GFX0) +{ + Name (BRIG, Package (22) { + 40, /* default AC */ + 40, /* default Battery */ + 5, + 10, + 15, + 20, + 25, + 30, + 35, + 40, + 45, + 50, + 55, + 60, + 65, + 70, + 75, + 80, + 85, + 90, + 95, + 100 + }) +} diff --git a/src/mainboard/system76/oryp6/acpi/mainboard.asl b/src/mainboard/system76/oryp6/acpi/mainboard.asl index 4e67439c569..b235437c25d 100644 --- a/src/mainboard/system76/oryp6/acpi/mainboard.asl +++ b/src/mainboard/system76/oryp6/acpi/mainboard.asl @@ -6,6 +6,9 @@ Scope (\_SB) { #include "sleep.asl" + Scope (PCI0) { + #include "backlight.asl" + } } Scope (\_GPE) { diff --git a/src/mainboard/system76/oryp6/dsdt.asl b/src/mainboard/system76/oryp6/dsdt.asl index d2bd57d78aa..a48382b578f 100644 --- a/src/mainboard/system76/oryp6/dsdt.asl +++ b/src/mainboard/system76/oryp6/dsdt.asl @@ -18,7 +18,6 @@ DefinitionBlock( Device (\_SB.PCI0) { #include #include - #include } #include diff --git a/src/mainboard/system76/tgl-h/acpi/backlight.asl b/src/mainboard/system76/tgl-h/acpi/backlight.asl new file mode 100644 index 00000000000..f0202344508 --- /dev/null +++ b/src/mainboard/system76/tgl-h/acpi/backlight.asl @@ -0,0 +1,31 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include + +Scope (GFX0) +{ + Name (BRIG, Package (22) { + 40, /* default AC */ + 40, /* default Battery */ + 5, + 10, + 15, + 20, + 25, + 30, + 35, + 40, + 45, + 50, + 55, + 60, + 65, + 70, + 75, + 80, + 85, + 90, + 95, + 100 + }) +} diff --git a/src/mainboard/system76/tgl-h/acpi/mainboard.asl b/src/mainboard/system76/tgl-h/acpi/mainboard.asl index 4675bc94b85..c982a9ee4cb 100644 --- a/src/mainboard/system76/tgl-h/acpi/mainboard.asl +++ b/src/mainboard/system76/tgl-h/acpi/mainboard.asl @@ -6,4 +6,7 @@ Scope (\_SB) { #include "sleep.asl" + Scope (PCI0) { + #include "backlight.asl" + } } diff --git a/src/mainboard/system76/tgl-h/dsdt.asl b/src/mainboard/system76/tgl-h/dsdt.asl index fb40a5d67f8..904073cc7de 100644 --- a/src/mainboard/system76/tgl-h/dsdt.asl +++ b/src/mainboard/system76/tgl-h/dsdt.asl @@ -20,7 +20,6 @@ DefinitionBlock( #include #include #include - #include } #include diff --git a/src/mainboard/system76/tgl-u/acpi/backlight.asl b/src/mainboard/system76/tgl-u/acpi/backlight.asl new file mode 100644 index 00000000000..f0202344508 --- /dev/null +++ b/src/mainboard/system76/tgl-u/acpi/backlight.asl @@ -0,0 +1,31 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include + +Scope (GFX0) +{ + Name (BRIG, Package (22) { + 40, /* default AC */ + 40, /* default Battery */ + 5, + 10, + 15, + 20, + 25, + 30, + 35, + 40, + 45, + 50, + 55, + 60, + 65, + 70, + 75, + 80, + 85, + 90, + 95, + 100 + }) +} diff --git a/src/mainboard/system76/tgl-u/acpi/mainboard.asl b/src/mainboard/system76/tgl-u/acpi/mainboard.asl index 4675bc94b85..c982a9ee4cb 100644 --- a/src/mainboard/system76/tgl-u/acpi/mainboard.asl +++ b/src/mainboard/system76/tgl-u/acpi/mainboard.asl @@ -6,4 +6,7 @@ Scope (\_SB) { #include "sleep.asl" + Scope (PCI0) { + #include "backlight.asl" + } } diff --git a/src/mainboard/system76/tgl-u/dsdt.asl b/src/mainboard/system76/tgl-u/dsdt.asl index fb40a5d67f8..904073cc7de 100644 --- a/src/mainboard/system76/tgl-u/dsdt.asl +++ b/src/mainboard/system76/tgl-u/dsdt.asl @@ -20,7 +20,6 @@ DefinitionBlock( #include #include #include - #include } #include diff --git a/src/mainboard/system76/whl-u/acpi/backlight.asl b/src/mainboard/system76/whl-u/acpi/backlight.asl new file mode 100644 index 00000000000..f0202344508 --- /dev/null +++ b/src/mainboard/system76/whl-u/acpi/backlight.asl @@ -0,0 +1,31 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include + +Scope (GFX0) +{ + Name (BRIG, Package (22) { + 40, /* default AC */ + 40, /* default Battery */ + 5, + 10, + 15, + 20, + 25, + 30, + 35, + 40, + 45, + 50, + 55, + 60, + 65, + 70, + 75, + 80, + 85, + 90, + 95, + 100 + }) +} diff --git a/src/mainboard/system76/whl-u/acpi/mainboard.asl b/src/mainboard/system76/whl-u/acpi/mainboard.asl index ade0bb2625a..2495377d68e 100644 --- a/src/mainboard/system76/whl-u/acpi/mainboard.asl +++ b/src/mainboard/system76/whl-u/acpi/mainboard.asl @@ -6,6 +6,9 @@ Scope (\_SB) { #include "sleep.asl" + Scope (PCI0) { + #include "backlight.asl" + } } Scope (\_GPE) { diff --git a/src/mainboard/system76/whl-u/dsdt.asl b/src/mainboard/system76/whl-u/dsdt.asl index 982e226118a..b633254edd3 100644 --- a/src/mainboard/system76/whl-u/dsdt.asl +++ b/src/mainboard/system76/whl-u/dsdt.asl @@ -19,7 +19,6 @@ DefinitionBlock( { #include #include - #include } #include