From fe7b75d79203d6b6f7f6cab82f8dfeaee4407ade Mon Sep 17 00:00:00 2001 From: Ren Kuo Date: Fri, 31 Oct 2025 19:23:33 +0800 Subject: [PATCH] mb/google/fatcat/var/moonstone: Add fw_config touchscreen setting Add a fw_config for touchscreen and non-touchscreen sku. Based on the field to differentiat the touchscreen I2C port on/off and GPIOs configuration. BUG=none TEST=Update the fw_config field and check the ap log: ABSENCE = 0 ... without touchscreen i2c probing messages. PRESENCE = 1 ... with touchscreen i2c probing messages. Change-Id: I5f2cc0b0c37986240fbbeae3668ccc250748295d Signed-off-by: Ren Kuo Reviewed-on: https://review.coreboot.org/c/coreboot/+/89851 Reviewed-by: Karthik Ramasubramanian Tested-by: build bot (Jenkins) Reviewed-by: Kenneth Chan Reviewed-by: Subrata Banik --- .../google/fatcat/variants/moonstone/fw_config.c | 14 ++++++++++++++ .../fatcat/variants/moonstone/overridetree.cb | 5 +++++ 2 files changed, 19 insertions(+) diff --git a/src/mainboard/google/fatcat/variants/moonstone/fw_config.c b/src/mainboard/google/fatcat/variants/moonstone/fw_config.c index 02fc5c82e2..22168413ba 100644 --- a/src/mainboard/google/fatcat/variants/moonstone/fw_config.c +++ b/src/mainboard/google/fatcat/variants/moonstone/fw_config.c @@ -77,6 +77,17 @@ static const struct pad_config pre_mem_fp_spi_enable_pads[] = { PAD_CFG_GPO(GPP_C15, 0, DEEP), }; +static const struct pad_config touchscreen_disable_pads[] = { + /* GPP_F08: EN_TCHSCR_PWR => NC */ + PAD_NC(GPP_F08, NONE), + /* GPP_F16: TCHSCR_RST_L => NC */ + PAD_NC(GPP_F16, NONE), + /* GPP_F18: TCHSCR_INT_L => NC */ + PAD_NC(GPP_F18, NONE), + /* GPP_E05: TCHSCR_RPT_EN => NC */ + PAD_NC(GPP_E05, NONE), +}; + void fw_config_configure_pre_mem_gpio(void) { if (!fw_config_is_provisioned()) { @@ -134,4 +145,7 @@ void fw_config_gpio_padbased_override(struct pad_config *padbased_table) GPIO_PADBASED_OVERRIDE(padbased_table, use_usb3c_enable_pads); else GPIO_PADBASED_OVERRIDE(padbased_table, use_usb2a2c_hdmi_enable_pads); + + if (fw_config_probe(FW_CONFIG(TOUCH_SCREEN, ABSENCE))) + GPIO_PADBASED_OVERRIDE(padbased_table, touchscreen_disable_pads); } diff --git a/src/mainboard/google/fatcat/variants/moonstone/overridetree.cb b/src/mainboard/google/fatcat/variants/moonstone/overridetree.cb index 2e8e44e6c3..8f02787cb2 100644 --- a/src/mainboard/google/fatcat/variants/moonstone/overridetree.cb +++ b/src/mainboard/google/fatcat/variants/moonstone/overridetree.cb @@ -16,6 +16,10 @@ fw_config option USB2A2C_HDMI 0 option USB3C 1 end + field TOUCH_SCREEN 13 13 + option ABSENCE 0 + option PRESENCE 1 + end end chip soc/intel/pantherlake @@ -428,6 +432,7 @@ chip soc/intel/pantherlake end end # I2C4 device ref i2c5 on + probe TOUCH_SCREEN PRESENCE chip drivers/i2c/hid register "generic.hid" = ""ELAN9004"" register "generic.desc" = ""ELAN Touchscreen""