summaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2019-08-23 19:48:15 +0200
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>2019-09-07 20:16:09 +0200
commit0ecee9e3d42231e5641671c5b6b1127d3efff1d4 (patch)
treee68d7b2056e403642ac4350a7b3240657b7fe903 /drivers/platform
parentplatform/x86: intel_int0002_vgpio: Fix wakeups not working on Cherry Trail (diff)
downloadlinux-0ecee9e3d42231e5641671c5b6b1127d3efff1d4.tar.xz
linux-0ecee9e3d42231e5641671c5b6b1127d3efff1d4.zip
platform/x86: intel_int0002_vgpio: Use device_init_wakeup
Use device_init_wakeup and pm_wakeup_hard_event instead of directly calling pm_system_wakeup(). This is the preferred way to do this and this will allow the user to disable wakeup through INT0002 events through sysfs. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/intel_int0002_vgpio.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/platform/x86/intel_int0002_vgpio.c b/drivers/platform/x86/intel_int0002_vgpio.c
index 4df10d5b9db9..d291bb482786 100644
--- a/drivers/platform/x86/intel_int0002_vgpio.c
+++ b/drivers/platform/x86/intel_int0002_vgpio.c
@@ -122,7 +122,7 @@ static irqreturn_t int0002_irq(int irq, void *data)
generic_handle_irq(irq_find_mapping(chip->irq.domain,
GPE0A_PME_B0_VIRT_GPIO_PIN));
- pm_system_wakeup();
+ pm_wakeup_hard_event(chip->parent);
return IRQ_HANDLED;
}
@@ -215,6 +215,13 @@ static int int0002_probe(struct platform_device *pdev)
gpiochip_set_chained_irqchip(chip, irq_chip, irq, NULL);
+ device_init_wakeup(dev, true);
+ return 0;
+}
+
+static int int0002_remove(struct platform_device *pdev)
+{
+ device_init_wakeup(&pdev->dev, false);
return 0;
}
@@ -230,6 +237,7 @@ static struct platform_driver int0002_driver = {
.acpi_match_table = int0002_acpi_ids,
},
.probe = int0002_probe,
+ .remove = int0002_remove,
};
module_platform_driver(int0002_driver);