From 95a5e72213a810305bfcec2da47b4892f74296b5 Mon Sep 17 00:00:00 2001 From: Eran Mitrani Date: Mon, 26 Jun 2023 13:27:42 -0700 Subject: mb/google/rex/var/rex0: Change touch over spi interrupt trigger to edge This CL corrects the trigger for HID over SPI from Level to Edge. BUG:None TEST:Tested with I2C and SPI Change-Id: I78937af22df22d80a702477b6790a7aa40d782a4 Signed-off-by: Eran Mitrani Reviewed-on: https://review.coreboot.org/c/coreboot/+/76116 Reviewed-by: Subrata Banik Tested-by: build bot (Jenkins) Reviewed-by: Kapil Porwal --- src/mainboard/google/rex/variants/rex0/fw_config.c | 18 ++++++++++++++++++ src/mainboard/google/rex/variants/rex0/gpio.c | 2 -- .../rex0/include/variant/acpi/hid_spi_elan.asl | 2 +- 3 files changed, 19 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/mainboard/google/rex/variants/rex0/fw_config.c b/src/mainboard/google/rex/variants/rex0/fw_config.c index 416b4769b1..b3958b0c20 100644 --- a/src/mainboard/google/rex/variants/rex0/fw_config.c +++ b/src/mainboard/google/rex/variants/rex0/fw_config.c @@ -89,6 +89,16 @@ static const struct pad_config ish_enable_pads[] = { PAD_CFG_NF(GPP_F22, NONE, DEEP, NF8), }; +static const struct pad_config touchscreen_i2c_int_pads[] = { + /* GPP_C07 : [] ==> SOC_TCHSCR_INT */ + PAD_CFG_GPI_APIC(GPP_C07, NONE, PLTRST, LEVEL, NONE), +}; + +static const struct pad_config touchscreen_spi_int_pads[] = { + /* GPP_C07 : [] ==> SOC_TCHSCR_INT */ + PAD_CFG_GPI_APIC(GPP_C07, NONE, PLTRST, EDGE_SINGLE, INVERT), +}; + void fw_config_gpio_padbased_override(struct pad_config *padbased_table) { if (!fw_config_is_provisioned()) { @@ -121,4 +131,12 @@ void fw_config_gpio_padbased_override(struct pad_config *padbased_table) printk(BIOS_INFO, "Configure GPIOs for ISH.\n"); GPIO_PADBASED_OVERRIDE(padbased_table, ish_enable_pads); } + + if (fw_config_probe(FW_CONFIG(TOUCHSCREEN, TOUCHSCREEN_I2C))) { + printk(BIOS_INFO, "Configure Touchscreen Interrupt for I2C.\n"); + GPIO_PADBASED_OVERRIDE(padbased_table, touchscreen_i2c_int_pads); + } else { /* SPI */ + printk(BIOS_INFO, "Configure Touchscreen Interrupt for SPI.\n"); + GPIO_PADBASED_OVERRIDE(padbased_table, touchscreen_spi_int_pads); + } } diff --git a/src/mainboard/google/rex/variants/rex0/gpio.c b/src/mainboard/google/rex/variants/rex0/gpio.c index b30bff4cbb..b4ae75693b 100644 --- a/src/mainboard/google/rex/variants/rex0/gpio.c +++ b/src/mainboard/google/rex/variants/rex0/gpio.c @@ -116,8 +116,6 @@ static const struct pad_config gpio_table[] = { PAD_CFG_GPO(GPP_C05, 1, PLTRST), /* GPP_C06 : [] ==> SOC_TCHSCR_RPT_EN */ PAD_CFG_GPO(GPP_C06, 0, DEEP), - /* GPP_C07 : [] ==> SOC_TCHSCR_INT */ - PAD_CFG_GPI_APIC(GPP_C07, NONE, PLTRST, LEVEL, NONE), /* GPP_C08 : [] ==> SOCHOT_ODL */ PAD_CFG_NF(GPP_C08, NONE, DEEP, NF2), /* GPP_C09 : net NC is not present in the given design */ diff --git a/src/mainboard/google/rex/variants/rex0/include/variant/acpi/hid_spi_elan.asl b/src/mainboard/google/rex/variants/rex0/include/variant/acpi/hid_spi_elan.asl index cc8cb935a5..5421a0acba 100644 --- a/src/mainboard/google/rex/variants/rex0/include/variant/acpi/hid_spi_elan.asl +++ b/src/mainboard/google/rex/variants/rex0/include/variant/acpi/hid_spi_elan.asl @@ -39,7 +39,7 @@ Device(TCSC) { 0, /* ResourceSourceIndex */ ResourceConsumer, /* ResourceUsage */ ) - Interrupt(ResourceConsumer, Level, ActiveLow, Shared) + Interrupt(ResourceConsumer, Edge, ActiveLow, Shared) { TOUCH_SCR_IRQ } -- cgit v1.2.3