From a6d337badf0dbc6e56c9debc3062ce7f85ce863b Mon Sep 17 00:00:00 2001 From: Dtrain Hsu Date: Thu, 18 May 2023 17:28:42 +0800 Subject: mb/google/nissa/var/uldren: Add fw_config probe for touchscreen Use fw_config to probe touchscreen. BUG=b:283199751 BRANCH=firmware-nissa-15217.B TEST=emerge-nissa coreboot chromeos-bootimage Change-Id: I5d8129b3af3aa09e5bc31160de82d9ef7af0dd59 Signed-off-by: Dtrain Hsu Reviewed-on: https://review.coreboot.org/c/coreboot/+/75335 Tested-by: build bot (Jenkins) Reviewed-by: Jakub Czapiga Reviewed-by: Derek Huang --- .../google/brya/variants/uldren/overridetree.cb | 37 +++++++++++++++++++--- .../google/brya/variants/uldren/variant.c | 23 ++++++++++++++ 2 files changed, 55 insertions(+), 5 deletions(-) (limited to 'src/mainboard/google/brya/variants/uldren') diff --git a/src/mainboard/google/brya/variants/uldren/overridetree.cb b/src/mainboard/google/brya/variants/uldren/overridetree.cb index 9ca61b7c4e..fa20808e78 100644 --- a/src/mainboard/google/brya/variants/uldren/overridetree.cb +++ b/src/mainboard/google/brya/variants/uldren/overridetree.cb @@ -1,3 +1,15 @@ +fw_config + field TOUCHSCREEN 10 12 + option TOUCHSCREEN_UNKNOWN 0 + option TOUCHSCREEN_NONE 1 + option TOUCHSCREEN_EKTH7D18 2 + option TOUCHSCREEN_GT7996F 3 + option TOUCHSCREEN_EKTH5012 4 + option TOUCHSCREEN_WDT8752A 5 + option TOUCHSCREEN_GTCH7502 6 + end +end + chip soc/intel/alderlake register "sagv" = "SaGv_Enabled" @@ -159,7 +171,10 @@ chip soc/intel/alderlake register "generic.enable_delay_ms" = "1" register "generic.has_power_resource" = "1" register "hid_desc_reg_offset" = "0x20" - device i2c 2c on end + device i2c 2c on + probe TOUCHSCREEN TOUCHSCREEN_UNKNOWN + probe TOUCHSCREEN TOUCHSCREEN_WDT8752A + end end chip drivers/i2c/generic register "hid" = ""ELAN0001"" @@ -175,7 +190,10 @@ chip soc/intel/alderlake register "enable_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPP_C0)" register "enable_delay_ms" = "1" register "has_power_resource" = "1" - device i2c 10 on end + device i2c 10 on + probe TOUCHSCREEN TOUCHSCREEN_UNKNOWN + probe TOUCHSCREEN TOUCHSCREEN_EKTH5012 + end end chip drivers/i2c/hid register "generic.hid" = ""ELAN900C"" @@ -191,7 +209,10 @@ chip soc/intel/alderlake register "generic.enable_delay_ms" = "6" register "generic.has_power_resource" = "1" register "hid_desc_reg_offset" = "0x01" - device i2c 16 on end + device i2c 16 on + probe TOUCHSCREEN TOUCHSCREEN_UNKNOWN + probe TOUCHSCREEN TOUCHSCREEN_EKTH7D18 + end end chip drivers/i2c/hid register "generic.hid" = ""GXTP7996"" @@ -206,7 +227,10 @@ chip soc/intel/alderlake register "generic.enable_delay_ms" = "10" register "generic.has_power_resource" = "1" register "hid_desc_reg_offset" = "0x01" - device i2c 5d on end + device i2c 5d on + probe TOUCHSCREEN TOUCHSCREEN_UNKNOWN + probe TOUCHSCREEN TOUCHSCREEN_GT7996F + end end chip drivers/i2c/hid register "generic.hid" = ""GTCH7502"" @@ -221,7 +245,10 @@ chip soc/intel/alderlake register "generic.enable_delay_ms" = "30" register "generic.has_power_resource" = "1" register "hid_desc_reg_offset" = "0x01" - device i2c 40 on end + device i2c 40 on + probe TOUCHSCREEN TOUCHSCREEN_UNKNOWN + probe TOUCHSCREEN TOUCHSCREEN_GTCH7502 + end end end device ref i2c3 on diff --git a/src/mainboard/google/brya/variants/uldren/variant.c b/src/mainboard/google/brya/variants/uldren/variant.c index 6a79780f6e..d9a6565eed 100644 --- a/src/mainboard/google/brya/variants/uldren/variant.c +++ b/src/mainboard/google/brya/variants/uldren/variant.c @@ -1,8 +1,31 @@ /* SPDX-License-Identifier: GPL-2.0-only */ +#include +#include +#include #include +static const struct pad_config touchscreen_disable_pads[] = { + /* C0 : SMBCLK ==> EN_PP3300_TCHSCR_X */ + PAD_NC(GPP_C0, NONE), + /* C1 : SMBDATA ==> TCHSCR_RST_L */ + PAD_NC(GPP_C1, NONE), + /* H6 : I2C1_SDA ==> SOC_I2C_TCHSCR_SDA */ + PAD_NC(GPP_H6, NONE), + /* H7 : I2C1_SCL ==> SOC_I2C_TCHSCR_SCL */ + PAD_NC(GPP_H7, NONE), +}; + const char *get_wifi_sar_cbfs_filename(void) { return "wifi_sar_0.hex"; } + +void fw_config_gpio_padbased_override(struct pad_config *padbased_table) +{ + if (fw_config_probe(FW_CONFIG(TOUCHSCREEN, TOUCHSCREEN_NONE))) { + printk(BIOS_INFO, "Disable touchscreen GPIO pins.\n"); + gpio_padbased_override(padbased_table, touchscreen_disable_pads, + ARRAY_SIZE(touchscreen_disable_pads)); + } +} -- cgit v1.2.3