Skip to content

Commit 308ac75

Browse files
committed
Merge tag 'gpio-v4.11-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio
Pull late GPIO fixes from Linus Walleij: "Some late coming ACPI fixes for GPIO. We're dealing with ACPI issues here. The first is related to wake IRQs on Bay Trail/Cherry Trail CPUs which are common in laptops. The second is about proper probe deferral when reading _CRS properties. For my untrained eye it seems there was some quarrel between the BIOS and the kernel about who is supposed to deal with wakeups from GPIO lines" * tag 'gpio-v4.11-3' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: ACPI / gpio: do not fall back to parsing _CRS when we get a deferral gpio: acpi: Call enable_irq_wake for _IAE GpioInts with Wake set
2 parents b824a95 + 693bdaa commit 308ac75

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

drivers/gpio/gpiolib-acpi.c

Lines changed: 9 additions & 1 deletion
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)))
@@ -571,8 +577,10 @@ struct gpio_desc *acpi_find_gpio(struct device *dev,
571577
}
572578

573579
desc = acpi_get_gpiod_by_index(adev, propname, idx, &info);
574-
if (!IS_ERR(desc) || (PTR_ERR(desc) == -EPROBE_DEFER))
580+
if (!IS_ERR(desc))
575581
break;
582+
if (PTR_ERR(desc) == -EPROBE_DEFER)
583+
return ERR_CAST(desc);
576584
}
577585

578586
/* Then from plain _CRS GPIOs */

0 commit comments

Comments
 (0)