Skip to content

Commit 8a146fb

Browse files
jwrdegoedeLinus Walleij
authored andcommitted
gpio: acpi: Call enable_irq_wake for _IAE GpioInts with Wake set
On Bay Trail / Cherry Trail systems with a LID switch, the LID switch is often connect to a gpioint handled by an _IAE event handler. Before this commit such systems would not wake up when opening the lid, requiring the powerbutton to be pressed after opening the lid to wakeup. Note that Bay Trail / Cherry Trail systems use suspend-to-idle, so the interrupts are generated anyway on those lines on lid switch changes, but they are treated by the IRQ subsystem as spurious while suspended if not marked as wakeup IRQs. This commit calls enable_irq_wake() for _IAE GpioInts with a valid event handler which have their Wake flag set. This fixes such systems not waking up when opening the lid. Signed-off-by: Hans de Goede <[email protected]> Acked-by: Mika Westerberg <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
1 parent c02ed2e commit 8a146fb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/gpio/gpiolib-acpi.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,9 @@ static acpi_status acpi_gpiochip_request_interrupt(struct acpi_resource *ares,
266266
goto fail_free_event;
267267
}
268268

269+
if (agpio->wake_capable == ACPI_WAKE_CAPABLE)
270+
enable_irq_wake(irq);
271+
269272
list_add_tail(&event->node, &acpi_gpio->events);
270273
return AE_OK;
271274

@@ -339,6 +342,9 @@ void acpi_gpiochip_free_interrupts(struct gpio_chip *chip)
339342
list_for_each_entry_safe_reverse(event, ep, &acpi_gpio->events, node) {
340343
struct gpio_desc *desc;
341344

345+
if (irqd_is_wakeup_set(irq_get_irq_data(event->irq)))
346+
disable_irq_wake(event->irq);
347+
342348
free_irq(event->irq, event);
343349
desc = event->desc;
344350
if (WARN_ON(IS_ERR(desc)))

0 commit comments

Comments
 (0)