From beb58a93cf52025db6c3c9eeedfa5531a67190e0 Mon Sep 17 00:00:00 2001 From: Matt DeVillier Date: Tue, 20 Dec 2022 16:29:02 -0600 Subject: mb/google/reef: Implement touchscreen power sequencing For touchscreens on reef variants, drive the enable GPIO high starting in romstage, then disable the reset GPIO in ramstage. This will allow coreboot to detect the presence of i2c touchscreens during ACPI SSDT generation (implemented in a subsequent commit). As the GPIOs are already correct in ramstage, only the romstage ones need to be set. BUG=b:121309055 TEST=tested with rest of patch train Change-Id: I10d1789c8de23653bac81e1f9604a47f93fa3f7d Signed-off-by: Matt DeVillier Reviewed-on: https://review.coreboot.org/c/coreboot/+/71152 Reviewed-by: Angel Pons Tested-by: build bot (Jenkins) --- src/mainboard/google/reef/variants/baseboard/gpio.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mainboard/google/reef/variants/baseboard/gpio.c b/src/mainboard/google/reef/variants/baseboard/gpio.c index e8b86001ec..d13f65bf0f 100644 --- a/src/mainboard/google/reef/variants/baseboard/gpio.c +++ b/src/mainboard/google/reef/variants/baseboard/gpio.c @@ -392,11 +392,18 @@ variant_sleep_gpio_table(u8 slp_typ, size_t *num) return sleep_gpio_table; } +/* GPIOs needed to be set in romstage. */ +static const struct pad_config romstage_gpio_table[] = { + /* Enable touchscreen, hold in reset */ + PAD_CFG_GPO(GPIO_152, 1, DEEP), /* Touch enable */ + PAD_CFG_GPO(GPIO_36, 1, DEEP), /* Touch reset */ +}; + /* Weak implementation of romstage gpio */ const struct pad_config *__weak variant_romstage_gpio_table(size_t *num) { - *num = 0; - return NULL; + *num = ARRAY_SIZE(romstage_gpio_table); + return romstage_gpio_table; } static const struct cros_gpio cros_gpios[] = { -- cgit v1.2.3