diff options
author | Kyösti Mälkki <kyosti.malkki@gmail.com> | 2021-01-21 16:34:43 +0200 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2021-01-25 17:01:12 +0000 |
commit | b0db813523ab6de2fa0894d1e2cb979f22a01871 (patch) | |
tree | 47ff3bb8ae27616cfca97198e2f92f01fefec8a9 /src/soc/amd/common/block/gpio_banks/gpio.c | |
parent | b218c20c0015da77377bbc1efc0fc2efbe204360 (diff) | |
download | coreboot-b0db813523ab6de2fa0894d1e2cb979f22a01871.tar.xz |
soc/amd: Refactor ACPI power state and ELOG
Change-Id: Ib7423c8d80355871393c377ebaffdfe2846d8852
Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/49836
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'src/soc/amd/common/block/gpio_banks/gpio.c')
-rw-r--r-- | src/soc/amd/common/block/gpio_banks/gpio.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/soc/amd/common/block/gpio_banks/gpio.c b/src/soc/amd/common/block/gpio_banks/gpio.c index bdc243fa2c..5b0111b28f 100644 --- a/src/soc/amd/common/block/gpio_banks/gpio.c +++ b/src/soc/amd/common/block/gpio_banks/gpio.c @@ -1,10 +1,12 @@ /* SPDX-License-Identifier: GPL-2.0-only */ +#include <acpi/acpi_pm.h> #include <device/mmio.h> #include <device/device.h> #include <console/console.h> #include <elog.h> #include <gpio.h> +#include <amdblocks/acpi.h> #include <amdblocks/acpimmio.h> #include <amdblocks/gpio_banks.h> #include <amdblocks/smi.h> @@ -363,11 +365,17 @@ void gpio_fill_wake_state(struct gpio_wake_state *state) check_gpios(state->wake_stat[1], 14, 128, state); } -void gpio_add_events(const struct gpio_wake_state *state) +void gpio_add_events(void) { + const struct chipset_power_state *ps; + const struct gpio_wake_state *state; int i; int end; + if (acpi_pm_state_for_elog(&ps) < 0) + return; + state = &ps->gpio_state; + end = MIN(state->num_valid_wake_gpios, ARRAY_SIZE(state->wake_gpios)); for (i = 0; i < end; i++) elog_add_event_wake(ELOG_WAKE_SOURCE_GPIO, state->wake_gpios[i]); |