Frank Chu has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/71691 )
Change subject: mb/google/brya/variants/marasov: Disable touch panel power for non-touch sku ......................................................................
mb/google/brya/variants/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 Frank_Chu@pegatron.corp-partner.google.com Change-Id: I4736f94481512806377b733b26fdc7290046c555 --- M src/mainboard/google/brya/variants/marasov/Makefile.inc A src/mainboard/google/brya/variants/marasov/fw_config.c M src/mainboard/google/brya/variants/marasov/overridetree.cb 3 files changed, 53 insertions(+), 1 deletion(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/91/71691/1
diff --git a/src/mainboard/google/brya/variants/marasov/Makefile.inc b/src/mainboard/google/brya/variants/marasov/Makefile.inc index 139345f..4d25f34e 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 0000000..4e923c8 --- /dev/null +++ b/src/mainboard/google/brya/variants/marasov/fw_config.c @@ -0,0 +1,28 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +#include <bootstate.h> +#include <console/console.h> +#include <fw_config.h> +#include <gpio.h> + +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 if (fw_config_probe(FW_CONFIG(TOUCH, TOUCH_NONE))) { + 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 bf9d5e0..e90df9e 100644 --- a/src/mainboard/google/brya/variants/marasov/overridetree.cb +++ b/src/mainboard/google/brya/variants/marasov/overridetree.cb @@ -12,6 +12,10 @@ 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 @@ 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