]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge branch 'acpi-ec' into acpi-pm
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 20 Jul 2017 14:44:09 +0000 (16:44 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Thu, 20 Jul 2017 14:44:09 +0000 (16:44 +0200)
1  2 
drivers/acpi/ec.c

diff --combined drivers/acpi/ec.c
index ddb01e9fa5b225eda5a83cf8a06501ddaded2fc5,8ab4df64b8bee33ef1c21a4fdbfc862eb0247441..f97a76782493a29503a58d68ed2838f2638f667a
@@@ -27,7 -27,7 +27,7 @@@
  
  /* Uncomment next line to get verbose printout */
  /* #define DEBUG */
 -#define pr_fmt(fmt) "ACPI : EC: " fmt
 +#define pr_fmt(fmt) "ACPI: EC: " fmt
  
  #include <linux/kernel.h>
  #include <linux/module.h>
@@@ -151,6 -151,10 +151,10 @@@ static bool ec_freeze_events __read_mos
  module_param(ec_freeze_events, bool, 0644);
  MODULE_PARM_DESC(ec_freeze_events, "Disabling event handling during suspend/resume");
  
+ static bool ec_no_wakeup __read_mostly;
+ module_param(ec_no_wakeup, bool, 0644);
+ MODULE_PARM_DESC(ec_no_wakeup, "Do not wake up from suspend-to-idle");
  struct acpi_ec_query_handler {
        struct list_head node;
        acpi_ec_query_func func;
@@@ -1875,11 -1879,37 +1879,37 @@@ static int acpi_ec_suspend(struct devic
        struct acpi_ec *ec =
                acpi_driver_data(to_acpi_device(dev));
  
 -      if (ec_freeze_events)
 +      if (acpi_sleep_no_ec_events() && ec_freeze_events)
                acpi_ec_disable_event(ec);
        return 0;
  }
  
+ static int acpi_ec_suspend_noirq(struct device *dev)
+ {
+       struct acpi_ec *ec = acpi_driver_data(to_acpi_device(dev));
+       /*
+        * The SCI handler doesn't run at this point, so the GPE can be
+        * masked at the low level without side effects.
+        */
+       if (ec_no_wakeup && test_bit(EC_FLAGS_STARTED, &ec->flags) &&
+           ec->reference_count >= 1)
+               acpi_set_gpe(NULL, ec->gpe, ACPI_GPE_DISABLE);
+       return 0;
+ }
+ static int acpi_ec_resume_noirq(struct device *dev)
+ {
+       struct acpi_ec *ec = acpi_driver_data(to_acpi_device(dev));
+       if (ec_no_wakeup && test_bit(EC_FLAGS_STARTED, &ec->flags) &&
+           ec->reference_count >= 1)
+               acpi_set_gpe(NULL, ec->gpe, ACPI_GPE_ENABLE);
+       return 0;
+ }
  static int acpi_ec_resume(struct device *dev)
  {
        struct acpi_ec *ec =
  #endif
  
  static const struct dev_pm_ops acpi_ec_pm = {
+       SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(acpi_ec_suspend_noirq, acpi_ec_resume_noirq)
        SET_SYSTEM_SLEEP_PM_OPS(acpi_ec_suspend, acpi_ec_resume)
  };