diff options
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 } |