Weimin Wu has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/83704?usp=email )
Change subject: mb/google/dedede/var/awasuki: Enable ELAN touchscreen with fw_config ......................................................................
mb/google/dedede/var/awasuki: Enable ELAN touchscreen with fw_config
1. Change driver form i2c/hid to i2c/generic. 2. Add fw_config for touchscreen.
BUG=b:351968527 BRANCH=firmware-dedede-13606.B TEST=ectool cbi set 6 0x0x10200a0; touchscreen functions normally;
Change-Id: Ifd6330be8924d4873f0efab3ce404168a62099eb --- M src/mainboard/google/dedede/variants/awasuki/overridetree.cb M src/mainboard/google/dedede/variants/awasuki/ramstage.c 2 files changed, 40 insertions(+), 15 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/04/83704/1
diff --git a/src/mainboard/google/dedede/variants/awasuki/overridetree.cb b/src/mainboard/google/dedede/variants/awasuki/overridetree.cb index 5b1793c..d8a7d24 100644 --- a/src/mainboard/google/dedede/variants/awasuki/overridetree.cb +++ b/src/mainboard/google/dedede/variants/awasuki/overridetree.cb @@ -1,3 +1,10 @@ +fw_config + field TOUCH 5 + option TOUCH_ABSENT 0 + option TOUCH_PRESENT 1 + end +end + chip soc/intel/jasperlake # USB Port Configuration register "usb2_ports[1]" = "USB2_PORT_EMPTY" @@ -177,18 +184,24 @@ end # I2C 0 device pci 15.1 off end # I2C 1 device pci 15.2 on - chip drivers/i2c/hid - register "generic.hid" = ""ELAN9008"" - register "generic.desc" = ""ELAN Touchscreen"" - register "generic.irq" = "ACPI_IRQ_LEVEL_LOW(GPP_D4_IRQ)" - register "generic.detect" = "1" - register "generic.reset_gpio" = + probe TOUCH TOUCH_PRESENT + chip drivers/i2c/generic + register "hid" = ""ELAN0001"" + register "desc" = ""ELAN Touchscreen"" + register "irq" = "ACPI_IRQ_LEVEL_LOW(GPP_D4_IRQ)" + register "probed" = "1" + register "reset_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_LOW(GPP_D5)" - register "generic.enable_gpio" = + register "reset_delay_ms" = "20" + register "reset_off_delay_ms" = "8" + register "stop_gpio" = + "ACPI_GPIO_OUTPUT_ACTIVE_LOW(GPP_A11)" + register "stop_delay_ms" = "280" + register "stop_off_delay_ms" = "2" + register "enable_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_HIGH(GPP_D6)" - register "generic.enable_delay_ms" = "7" - register "generic.has_power_resource" = "1" - register "hid_desc_reg_offset" = "0x01" + register "enable_delay_ms" = "7" + register "has_power_resource" = "1" device i2c 10 on end end end # I2C 2 diff --git a/src/mainboard/google/dedede/variants/awasuki/ramstage.c b/src/mainboard/google/dedede/variants/awasuki/ramstage.c index 7199c7c..b3be79e 100644 --- a/src/mainboard/google/dedede/variants/awasuki/ramstage.c +++ b/src/mainboard/google/dedede/variants/awasuki/ramstage.c @@ -3,8 +3,16 @@ #include <baseboard/variants.h> #include <fw_config.h> #include <soc/soc_chip.h> +#include <soc/gpio.h>
-static void ext_vr_update(void) +static const struct pad_config ts_disable_pad[] = { + /* H4 : AP_I2C_TS_SDA */ + PAD_NC(GPP_H4, NONE), + /* H5 : AP_I2C_TS_SCL */ + PAD_NC(GPP_H5, NONE), +}; + +void variant_devtree_update(void) { struct soc_intel_jasperlake_config *cfg = config_of_soc();
@@ -12,9 +20,13 @@ printk(BIOS_INFO, "Device config for EXT_VR_ABSENT.\n"); cfg->disable_external_bypass_vr = 1; } -}
-void variant_devtree_update(void) -{ - ext_vr_update(); + if (!fw_config_probe(FW_CONFIG(TOUCH, TOUCH_PRESENT))) { + cfg->SerialIoI2cMode[PchSerialIoIndexI2C2] = PchSerialIoDisabled; + } + + if (!fw_config_probe(FW_CONFIG(TOUCH, TOUCH_PRESENT))) { + printk(BIOS_INFO, "Disable TS GPIO pins.\n"); + gpio_configure_pads(ts_disable_pad, ARRAY_SIZE(ts_disable_pad)); + } }