diff options
author | Weimin Wu <wuweimin@huaqin.corp-partner.google.com> | 2024-07-30 17:31:46 +0800 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2024-08-08 07:58:33 +0000 |
commit | 1fdeabe507d30b5ff22ffa264dde23c00b69faef (patch) | |
tree | 116f8219d31dc495128a6049ad315984092a1f80 /src | |
parent | 47bc698d36179f62de009715d7ea5f50a55865c6 (diff) |
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
TEST=ectool cbi set 6 0x0x10200a0;
touchscreen functions normally;
Change-Id: Ifd6330be8924d4873f0efab3ce404168a62099eb
Signed-off-by: Weimin Wu <wuweimin@huaqin.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/83704
Reviewed-by: zhongtian wu <wuzhongtian@huaqin.corp-partner.google.com>
Reviewed-by: Eric Lai <ericllai@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src')
3 files changed, 47 insertions, 20 deletions
diff --git a/src/mainboard/google/dedede/variants/awasuki/overridetree.cb b/src/mainboard/google/dedede/variants/awasuki/overridetree.cb index 820cbcb39d..148840fc16 100644 --- a/src/mainboard/google/dedede/variants/awasuki/overridetree.cb +++ b/src/mainboard/google/dedede/variants/awasuki/overridetree.cb @@ -181,18 +181,24 @@ chip soc/intel/jasperlake 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 TOUCHSCREEN TOUCHSCREEN_PRESENT + chip drivers/i2c/generic + register "hid" = ""ELAN0001"" + register "desc" = ""ELAN Touchscreen"" + register "irq" = "ACPI_IRQ_LEVEL_LOW(GPP_D4_IRQ)" + register "detect" = "1" + register "reset_gpio" = "ACPI_GPIO_OUTPUT_ACTIVE_LOW(GPP_D5)" - register "generic.enable_gpio" = + register "reset_delay_ms" = "25" + 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 7199c7c4bd..418826c2a4 100644 --- a/src/mainboard/google/dedede/variants/awasuki/ramstage.c +++ b/src/mainboard/google/dedede/variants/awasuki/ramstage.c @@ -3,18 +3,35 @@ #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[] = { + /* A11 : TOUCH_RPT_EN */ + PAD_NC(GPP_A11, NONE), + + /* D4 : TOUCH_INT_ODL */ + PAD_NC(GPP_D4, NONE), + /* D5 : TOUCH_RESET_L */ + PAD_NC(GPP_D5, NONE), + /* D6 : EN_PP3300_TOUCH_S0 */ + PAD_NC(GPP_D6, NONE), + + /* 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(); if (fw_config_probe(FW_CONFIG(EXT_VR, EXT_VR_ABSENT))) { - 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(TOUCHSCREEN, TOUCHSCREEN_PRESENT))) { + cfg->SerialIoI2cMode[PchSerialIoIndexI2C2] = PchSerialIoDisabled; + gpio_configure_pads(ts_disable_pad, ARRAY_SIZE(ts_disable_pad)); + } } diff --git a/src/mainboard/google/dedede/variants/baseboard/devicetree.cb b/src/mainboard/google/dedede/variants/baseboard/devicetree.cb index c38aa73511..4a234a85ad 100644 --- a/src/mainboard/google/dedede/variants/baseboard/devicetree.cb +++ b/src/mainboard/google/dedede/variants/baseboard/devicetree.cb @@ -15,10 +15,18 @@ fw_config option STYLUS_ABSENT 0 option STYLUS_PRESENT 1 end + field TOUCHSCREEN 5 + option TOUCHSCREEN_ABSENT 0 + option TOUCHSCREEN_PRESENT 1 + end field TABLETMODE 10 option TABLETMODE_DISABLED 0 option TABLETMODE_ENABLED 1 end + field LTE 11 + option LTE_ABSENT 0 + option LTE_PRESENT 1 + end field AUDIO_AMP 14 16 option UNPROVISIONED 0 option MAX98360 1 @@ -26,10 +34,6 @@ fw_config option RT1015P_AUTO 3 option ALC5650 4 end - field LTE 11 - option LTE_ABSENT 0 - option LTE_PRESENT 1 - end field EXT_VR 18 option EXT_VR_PRESENT 0 option EXT_VR_ABSENT 1 |