From ae48ff8c0b677a12b724540cc2ad2269a8df3b0c Mon Sep 17 00:00:00 2001 From: Tony Huang Date: Fri, 12 Dec 2025 13:30:00 +0800 Subject: [PATCH] drivers/wwan/fm: Use _EVT method to enhance GPIO event handling Currently _Exx suppots the wake pin under 255, for Caboc it's wake pin is 325 which is out of range. This CL change to use _EVT method to enhance GPIO event handling. BUG=b:463410386 TEST=Compiled and tested on google/redrix and google/caboc: 1. emerge-brya coreboot, emerge-brox coreboot 2. Check /proc/interrupts has ACPI:Event 2. Wait for WWAN device to enter suspended state 3. Insert SIM card and modem is able to wake up WWAN device Change-Id: Ifbb83ab48bbe4876269010adb2710641bdc879a5 Signed-off-by: Tony Huang Reviewed-on: https://review.coreboot.org/c/coreboot/+/90492 Reviewed-by: Kevin Chiu Tested-by: build bot (Jenkins) --- src/drivers/wwan/fm/acpi_fm350gl.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/drivers/wwan/fm/acpi_fm350gl.c b/src/drivers/wwan/fm/acpi_fm350gl.c index 564ac03cfc..07054e33cb 100644 --- a/src/drivers/wwan/fm/acpi_fm350gl.c +++ b/src/drivers/wwan/fm/acpi_fm350gl.c @@ -285,18 +285,19 @@ wwan_fm350gl_acpi_event_method(const struct device *dev, if (CONFIG(GENERIC_GPIO_LIB)) pin = gpio_acpi_pin(pin); - if (pin > 0xff) { - printk(BIOS_ERR, "%s: pins above 0xFF are unsupported (pin %u)\n", - __func__, pin); - return; + if (pin <= 0xff) { + snprintf(name, sizeof(name), "_%c%02X", + wake_gpio->irq.mode == ACPI_IRQ_EDGE_TRIGGERED ? 'E' : 'L', pin); + acpigen_write_method_serialized(name, 0); + acpigen_notify(acpi_device_path(dev), 0x02); /* NOTIFY_DEVICE_WAKE */ + acpigen_write_method_end(); + } else { + acpigen_write_method_serialized("_EVT", 1); + acpigen_write_if_lequal_op_int(ARG0_OP, pin); + acpigen_notify(acpi_device_path(dev), 0x02); /* NOTIFY_DEVICE_WAKE */ + acpigen_pop_len(); + acpigen_write_method_end(); } - - snprintf(name, sizeof(name), "_%c%02X", - wake_gpio->irq.mode == ACPI_IRQ_EDGE_TRIGGERED ? 'E' : 'L', pin); - - acpigen_write_method_serialized(name, 0); - acpigen_notify(acpi_device_path(dev), 0x02); /* NOTIFY_DEVICE_WAKE */ - acpigen_write_method_end(); } static void wwan_fm350gl_acpi_gpio_events(const struct device *dev)