From 47b7904d78ff2f0eb002edea99a3b761ccde962b Mon Sep 17 00:00:00 2001 From: Alan Huang Date: Tue, 29 Mar 2022 19:08:23 +0800 Subject: mb/google/brya/variants/baseboard/brask: Turn off NFC power in S0ix Turn off the NFC power which is controlled by GPP_D3 to save power in S0ix states. For an USB device, the S0ix hook is needed for the on/off operations to take place. BUG=b:202737385 BRANCH=firmware-brya-14505.B TEST=measure the voltage of GPP_D3 in S0ix states Signed-off-by: Alan Huang Change-Id: I69588c82dfde1744c45c7aff3ac05b80bb16a8f3 Reviewed-on: https://review.coreboot.org/c/coreboot/+/63191 Tested-by: build bot (Jenkins) Reviewed-by: Eric Lai --- .../google/brya/variants/brask/include/variant/gpio.h | 2 ++ src/mainboard/google/brya/variants/brask/variant.c | 10 ++++++++++ 2 files changed, 12 insertions(+) (limited to 'src/mainboard') diff --git a/src/mainboard/google/brya/variants/brask/include/variant/gpio.h b/src/mainboard/google/brya/variants/brask/include/variant/gpio.h index 27c87b3fe7..4c28cc90fb 100644 --- a/src/mainboard/google/brya/variants/brask/include/variant/gpio.h +++ b/src/mainboard/google/brya/variants/brask/include/variant/gpio.h @@ -5,4 +5,6 @@ #include +#define NFC_POWER GPP_D3 + #endif /* __MAINBOARD_GPIO_H__ */ diff --git a/src/mainboard/google/brya/variants/brask/variant.c b/src/mainboard/google/brya/variants/brask/variant.c index 04105db2ea..3f1796edb2 100644 --- a/src/mainboard/google/brya/variants/brask/variant.c +++ b/src/mainboard/google/brya/variants/brask/variant.c @@ -3,9 +3,19 @@ #include #include #include +#include +#include void variant_update_soc_chip_config(struct soc_intel_alderlake_config *config) { config->cnvi_bt_audio_offload = fw_config_probe(FW_CONFIG(AUDIO, NAU88L25B_I2S)); } + +void variant_generate_s0ix_hook(enum s0ix_entry entry) +{ + if (entry == S0IX_ENTRY) + acpigen_soc_clear_tx_gpio(NFC_POWER); + else if (entry == S0IX_EXIT) + acpigen_soc_set_tx_gpio(NFC_POWER); +} -- cgit v1.2.3