Matt DeVillier has submitted this change. ( https://review.coreboot.org/c/coreboot/+/87085?usp=email )
(
4 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted one.
)Change subject: drivers/intel/touch: Conditionally add ACPI _PRW based on wake source
......................................................................
drivers/intel/touch: Conditionally add ACPI _PRW based on wake source
This change addresses an issue in the touch driver where the ACPI _PRW
method was added unconditionally. The ACPI _PRW method should only be
generated when an Interrupt() resource is used in the _CRS method.
When a GpioInt() resource is used instead, the _PRW method is not
required.
The ACPI generation code has been updated to conditionally add the
_PRW method based on whether the wake source is a GPIO interrupt or
an IRQ interrupt. Now, the _PRW method is only added when an IRQ pin
is specified, which is consistent with ACPI requirements.
BUG=none
TEST=Configure the DRIVERS_INTEL_TOUCH option on a motherboard that
has the necessary touch configurations with wake support. Verify that
the THC ACPI tables are correctly generated in the SSDT. If wake_gpio
(i.e. GpioInt()) is used for wake, no _PRW is generated for the device.
Signed-off-by: Cliff Huang <cliff.huang(a)intel.com>
Change-Id: I56fc8486c7494ff37c1d580d57838fee286128a6
Reviewed-on: https://review.coreboot.org/c/coreboot/+/87085
Reviewed-by: Kapil Porwal <kapilporwal(a)google.com>
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
---
M src/drivers/intel/touch/touch.c
1 file changed, 6 insertions(+), 1 deletion(-)
Approvals:
build bot (Jenkins): Verified
Kapil Porwal: Looks good to me, approved
diff --git a/src/drivers/intel/touch/touch.c b/src/drivers/intel/touch/touch.c
index 0283312..a89d2e6 100644
--- a/src/drivers/intel/touch/touch.c
+++ b/src/drivers/intel/touch/touch.c
@@ -194,6 +194,10 @@
touch_acpi_name(dev));
acpigen_write_name("_CRS");
acpigen_write_resourcetemplate_header();
+ /*
+ * NOTE: config->wake_gpio: uses GpioInt() in _CRS; PAD needs to be Driver Mode
+ * config->wake_irq: uses Interrupt() in _CRS; use GPE; PAD needs to be ACPI Mode
+ */
if (config->wake_gpio.pin_count)
acpi_device_write_gpio(&config->wake_gpio);
else if (config->wake_irq.pin)
@@ -201,7 +205,8 @@
acpigen_write_resourcetemplate_footer();
acpigen_write_name_integer("_S0W", ACPI_DEVICE_SLEEP_D3_HOT);
- acpigen_write_PRW(config->wake_gpe, 3);
+ if (config->wake_irq.pin)
+ acpigen_write_PRW(config->wake_gpe, 3);
}
static void touch_generate_acpi_i2cdev_dsd(const struct device *dev)
--
To view, visit https://review.coreboot.org/c/coreboot/+/87085?usp=email
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: coreboot
Gerrit-Branch: main
Gerrit-Change-Id: I56fc8486c7494ff37c1d580d57838fee286128a6
Gerrit-Change-Number: 87085
Gerrit-PatchSet: 6
Gerrit-Owner: Cliff Huang <cliff.huang(a)intel.com>
Gerrit-Reviewer: Intel coreboot Reviewers <intel_coreboot_reviewers(a)intel.com>
Gerrit-Reviewer: Jérémy Compostella <jeremy.compostella(a)intel.com>
Gerrit-Reviewer: Kapil Porwal <kapilporwal(a)google.com>
Gerrit-Reviewer: Kyoung Il Kim <kyoung.il.kim(a)intel.com>
Gerrit-Reviewer: Matt DeVillier <matt.devillier(a)gmail.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Gerrit-CC: Paul Menzel <paulepanter(a)mailbox.org>