diff --git a/src/mainboard/system76/galp5/Kconfig b/src/mainboard/system76/galp5/Kconfig index 2f682b74c8..bd54b04de3 100644 --- a/src/mainboard/system76/galp5/Kconfig +++ b/src/mainboard/system76/galp5/Kconfig @@ -5,7 +5,7 @@ config BOARD_SPECIFIC_OPTIONS select BOARD_ROMSIZE_KB_16384 select DRIVERS_I2C_HID select DRIVERS_INTEL_PMC - #TODO select DRIVERS_SYSTEM76_DGPU + select DRIVERS_SYSTEM76_DGPU select EC_SYSTEM76_EC #TODO select EC_SYSTEM76_EC_BAT_THRESHOLDS select EC_SYSTEM76_EC_DGPU diff --git a/src/mainboard/system76/galp5/acpi/backlight.asl b/src/mainboard/system76/galp5/acpi/backlight.asl new file mode 100644 index 0000000000..12aaab6e4f --- /dev/null +++ b/src/mainboard/system76/galp5/acpi/backlight.asl @@ -0,0 +1,30 @@ +/* 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/galp5/acpi/mainboard.asl b/src/mainboard/system76/galp5/acpi/mainboard.asl index 1fd37b0fe3..a5cae6d655 100644 --- a/src/mainboard/system76/galp5/acpi/mainboard.asl +++ b/src/mainboard/system76/galp5/acpi/mainboard.asl @@ -1,27 +1,15 @@ /* SPDX-License-Identifier: GPL-2.0-only */ #include "../gpio.h" -#if CONFIG(DRIVERS_SYSTEM76_DGPU) - #include -#endif +// TODO: use correct scope #include #define EC_GPE_SCI 0x6E #define EC_GPE_SWI 0x6B #include Scope (\_SB) { - /* Method called from _PTS prior to enter sleep state */ - Method (MPTS, 1) { - \_SB.PCI0.LPCB.EC0.PTS (Arg0) - -#if CONFIG(DRIVERS_SYSTEM76_DGPU) - // Turn DGPU on before sleeping - \_SB.PCI0.PEGP.DEV0._ON() -#endif - } - - /* Method called from _WAK prior to wakeup */ - Method (MWAK, 1) { - \_SB.PCI0.LPCB.EC0.WAK (Arg0) + #include "sleep.asl" + Scope (PCI0) { + #include "backlight.asl" } } diff --git a/src/mainboard/system76/galp5/acpi/sleep.asl b/src/mainboard/system76/galp5/acpi/sleep.asl new file mode 100644 index 0000000000..e6705f6cd9 --- /dev/null +++ b/src/mainboard/system76/galp5/acpi/sleep.asl @@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +/* Method called from _PTS prior to enter sleep state */ +Method (MPTS, 1) { + \_SB.PCI0.LPCB.EC0.PTS (Arg0) + + // Turn DGPU on before sleeping + //TODO: use correct scope \_SB.PCI0.PEGP.DEV0._ON() +} + +/* Method called from _WAK prior to wakeup */ +Method (MWAK, 1) { + \_SB.PCI0.LPCB.EC0.WAK (Arg0) +} diff --git a/src/mainboard/system76/galp5/bootblock.c b/src/mainboard/system76/galp5/bootblock.c index bcba4f71ee..44489dfa6d 100644 --- a/src/mainboard/system76/galp5/bootblock.c +++ b/src/mainboard/system76/galp5/bootblock.c @@ -3,13 +3,9 @@ #include #include #include "gpio.h" -#if CONFIG(DRIVERS_SYSTEM76_DGPU) - #include -#endif +#include void bootblock_mainboard_init(void) { gpio_configure_pads(early_gpio_table, ARRAY_SIZE(early_gpio_table)); -#if CONFIG(DRIVERS_SYSTEM76_DGPU) dgpu_power_enable(1); -#endif } diff --git a/src/mainboard/system76/galp5/dsdt.asl b/src/mainboard/system76/galp5/dsdt.asl index 22627d760b..5983937cf6 100644 --- a/src/mainboard/system76/galp5/dsdt.asl +++ b/src/mainboard/system76/galp5/dsdt.asl @@ -1,5 +1,8 @@ /* SPDX-License-Identifier: GPL-2.0-only */ +//TODO: cleaner solution for ACPI brightness +#define SYSTEM76_ACPI_NO_GFX0 + #include DefinitionBlock( "dsdt.aml", @@ -14,19 +17,17 @@ DefinitionBlock( #include #include - Scope (\_SB) { - Device (PCI0) { - #include - #include - #include - } + Device (\_SB.PCI0) { + #include + #include + #include } + #include + Scope (\_SB.PCI0.LPCB) { #include } #include "acpi/mainboard.asl" - - #include } diff --git a/src/mainboard/system76/galp5/gpio.h b/src/mainboard/system76/galp5/gpio.h index 410170c55b..77d5463192 100644 --- a/src/mainboard/system76/galp5/gpio.h +++ b/src/mainboard/system76/galp5/gpio.h @@ -414,9 +414,9 @@ static const struct pad_config gpio_table[] = { // NC PAD_NC(GPP_T3, NONE), // DGPU_RST#_PCH - //TODO PAD_CFG_TERM_GPO(GPP_U4, 1, NONE, PLTRST), + PAD_CFG_TERM_GPO(GPP_U4, 1, NONE, DEEP), // DGPU_PWR_EN - //TODO PAD_CFG_TERM_GPO(GPP_U5, 1, NONE, PLTRST), + PAD_CFG_TERM_GPO(GPP_U5, 1, NONE, DEEP), }; #endif