diff options
author | Eran Mitrani <mitrani@google.com> | 2023-06-26 13:27:42 -0700 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2023-07-10 15:03:18 +0000 |
commit | 95a5e72213a810305bfcec2da47b4892f74296b5 (patch) | |
tree | 09d8ab8c23deac36777044f2310473b1b247d82d /src/mainboard | |
parent | 266e6557ba50a33fd1290f64552dc76d7fb48151 (diff) |
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 <mitrani@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/76116
Reviewed-by: Subrata Banik <subratabanik@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
Diffstat (limited to 'src/mainboard')
3 files changed, 19 insertions, 3 deletions
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 } |