diff options
author | Kun Liu <liukun11@huaqin.corp-partner.google.com> | 2024-09-18 14:25:11 +0800 |
---|---|---|
committer | Subrata Banik <subratabanik@google.com> | 2024-09-30 08:11:53 +0000 |
commit | 9a9191cf2fd05a91258d9a62e7b68494d1565fb0 (patch) | |
tree | 3dc74ddbcca794ee884ec7c1e2fbc8873faf2a70 /src/mainboard | |
parent | bda33e1585aecc48f067b13d1207d075b303899a (diff) |
mb/google/brox/var/lotso: Fix goodix touchscreen power off sequence
Poweroff does not seem to use the ACPI _OFF function, but rather the
smihandler. Creating variant_smi_sleep function for nami to handle
the power off sequence during reboot/poweroff.
BUG=b:364193909
TEST=emerge-brox coreboot
Change-Id: I0108be4e5e7c0265aae0f16fd4e2b7cbe5936112
Signed-off-by: Kun Liu <liukun11@huaqin.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/84412
Reviewed-by: Jian Tong <tongjian@huaqin.corp-partner.google.com>
Reviewed-by: Karthik Ramasubramanian <kramasub@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/mainboard')
4 files changed, 30 insertions, 0 deletions
diff --git a/src/mainboard/google/brox/smihandler.c b/src/mainboard/google/brox/smihandler.c index 9208d51613..21b441f8d9 100644 --- a/src/mainboard/google/brox/smihandler.c +++ b/src/mainboard/google/brox/smihandler.c @@ -4,11 +4,15 @@ #include <ec/google/chromeec/ec.h> #include <ec/google/chromeec/smm.h> #include <elog.h> +#include <baseboard/variants.h> #include <intelblocks/smihandler.h> #include <variant/ec.h> +void __weak variant_smi_sleep(u8 slp_typ) {} + void mainboard_smi_sleep(u8 slp_typ) { + variant_smi_sleep(slp_typ); chromeec_smi_sleep(slp_typ, MAINBOARD_EC_S3_WAKE_EVENTS, MAINBOARD_EC_S5_WAKE_EVENTS); } diff --git a/src/mainboard/google/brox/variants/baseboard/include/baseboard/variants.h b/src/mainboard/google/brox/variants/baseboard/include/baseboard/variants.h index d04a793ec2..a1fbe018b1 100644 --- a/src/mainboard/google/brox/variants/baseboard/include/baseboard/variants.h +++ b/src/mainboard/google/brox/variants/baseboard/include/baseboard/variants.h @@ -25,6 +25,7 @@ bool variant_is_half_populated(void); void variant_update_soc_chip_config(struct soc_intel_alderlake_config *config); void variant_fill_ssdt(const struct device *dev); void variant_configure_pads(void); +void variant_smi_sleep(u8 slp_typ); enum s0ix_entry { S0IX_EXIT, diff --git a/src/mainboard/google/brox/variants/lotso/Makefile.mk b/src/mainboard/google/brox/variants/lotso/Makefile.mk index 3754e0dae2..a1059a5eba 100644 --- a/src/mainboard/google/brox/variants/lotso/Makefile.mk +++ b/src/mainboard/google/brox/variants/lotso/Makefile.mk @@ -6,3 +6,4 @@ romstage-y += gpio.c ramstage-y += gpio.c ramstage-$(CONFIG_FW_CONFIG) += variant.c ramstage-y += ramstage.c +smm-y += smihandler.c diff --git a/src/mainboard/google/brox/variants/lotso/smihandler.c b/src/mainboard/google/brox/variants/lotso/smihandler.c new file mode 100644 index 0000000000..ab8de8e4d2 --- /dev/null +++ b/src/mainboard/google/brox/variants/lotso/smihandler.c @@ -0,0 +1,24 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <acpi/acpi.h> +#include <baseboard/variants.h> +#include <delay.h> + +#include "gpio.h" + +#define TOUCH_RESET GPP_F17 +#define TOUCH_ENABLE GPP_F7 + + +#define GOODIX_RESET_OFF_DELAY 5 + +void variant_smi_sleep(u8 slp_typ) +{ + if (slp_typ == ACPI_S5) { + /* TOUCHSCREEN_RST# */ + gpio_set(TOUCH_RESET, 0); + mdelay(GOODIX_RESET_OFF_DELAY); + /* EN_PP3300_DX_TOUCHSCREEN */ + gpio_set(TOUCH_ENABLE, 0); + } +} |