From 3b23fa609210d13cd43ca403c10f904ec5d44dc8 Mon Sep 17 00:00:00 2001 From: Frank Chu Date: Fri, 6 Jan 2023 11:20:55 +0800 Subject: mb/google/brya/var/marasov: Disable touch panel power for non-touch sku Disable touch panel power for non-touch sku by fw_config TOUCH field. BUG=b:263452842 BRANCH=firmware-brya-14505.B TEST=emerge-brya coreboot chromeos-bootimage Signed-off-by: Frank Chu Change-Id: I4736f94481512806377b733b26fdc7290046c555 Reviewed-on: https://review.coreboot.org/c/coreboot/+/71691 Reviewed-by: Eric Lai Reviewed-by: Kyle Lin Tested-by: build bot (Jenkins) --- .../google/brya/variants/marasov/Makefile.inc | 1 + .../google/brya/variants/marasov/fw_config.c | 28 ++++++++++++++++++++++ .../google/brya/variants/marasov/overridetree.cb | 8 ++++++- 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 src/mainboard/google/brya/variants/marasov/fw_config.c (limited to 'src/mainboard/google/brya/variants') diff --git a/src/mainboard/google/brya/variants/marasov/Makefile.inc b/src/mainboard/google/brya/variants/marasov/Makefile.inc index 139345f260..4d25f34ea1 100644 --- a/src/mainboard/google/brya/variants/marasov/Makefile.inc +++ b/src/mainboard/google/brya/variants/marasov/Makefile.inc @@ -2,6 +2,7 @@ bootblock-y += gpio.c romstage-y += gpio.c +ramstage-$(CONFIG_FW_CONFIG) += fw_config.c romstage-y += memory.c diff --git a/src/mainboard/google/brya/variants/marasov/fw_config.c b/src/mainboard/google/brya/variants/marasov/fw_config.c new file mode 100644 index 0000000000..73ae600df9 --- /dev/null +++ b/src/mainboard/google/brya/variants/marasov/fw_config.c @@ -0,0 +1,28 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include +#include +#include +#include + +static const struct pad_config touch_enable_pads[] = { + /* C0 : SMBCLK ==> EN_PP3300_TCHSCR */ + PAD_CFG_GPO(GPP_C0, 1, DEEP), +}; + +static const struct pad_config touch_disable_pads[] = { + /* C0 : SMBCLK ==> NC */ + PAD_NC(GPP_C0, NONE), +}; + +static void fw_config_handle(void *unused) +{ + if (fw_config_probe(FW_CONFIG(TOUCH, TOUCH_ELAN0001))) { + printk(BIOS_INFO, "Configure Touch GPIO GPP_C0 to GPO_H.\n"); + gpio_configure_pads(touch_enable_pads, ARRAY_SIZE(touch_enable_pads)); + } else { + printk(BIOS_INFO, "Configure Touch GPIO GPP_C0 to NC.\n"); + gpio_configure_pads(touch_disable_pads, ARRAY_SIZE(touch_disable_pads)); + } +} +BOOT_STATE_INIT_ENTRY(BS_DEV_ENABLE, BS_ON_ENTRY, fw_config_handle, NULL); diff --git a/src/mainboard/google/brya/variants/marasov/overridetree.cb b/src/mainboard/google/brya/variants/marasov/overridetree.cb index bf9d5e037c..e90df9e8f0 100644 --- a/src/mainboard/google/brya/variants/marasov/overridetree.cb +++ b/src/mainboard/google/brya/variants/marasov/overridetree.cb @@ -12,6 +12,10 @@ fw_config option UFC_USB 0 option UFC_MIPI 1 end + field TOUCH 5 5 + option TOUCH_NONE 0 + option TOUCH_ELAN0001 1 + end field STORAGE 30 31 option STORAGE_UNKNOWN 0 option STORAGE_NVME 1 @@ -163,7 +167,9 @@ chip soc/intel/alderlake register "stop_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_LOW(GPP_C6)" register "stop_off_delay_ms" = "1" register "has_power_resource" = "1" - device i2c 10 on end + device i2c 10 on + probe TOUCH TOUCH_ELAN0001 + end end end #I2C3 device ref i2c5 on -- cgit v1.2.3