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 <tony-huang@quanta.corp-partner.google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/90492
Reviewed-by: Kevin Chiu <kevin.chiu.17802@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Tony Huang 2025-12-12 13:30:00 +08:00 committed by Matt DeVillier
commit ae48ff8c0b

View file

@ -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)