gpiolib-acpi: Don't set GPIOs for wakeup in S3 mode
[platform/kernel/linux-starfive.git] / drivers / gpio / gpiolib-acpi.c
index e2ab4d5..fa3de3c 100644 (file)
@@ -1080,7 +1080,8 @@ int acpi_dev_gpio_irq_wake_get_by(struct acpi_device *adev, const char *name, in
                                dev_dbg(&adev->dev, "IRQ %d already in use\n", irq);
                        }
 
-                       if (wake_capable)
+                       /* avoid suspend issues with GPIOs when systems are using S3 */
+                       if (wake_capable && acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0)
                                *wake_capable = info.wake_capable;
 
                        return irq;