Merge suspend-to-idle rework material for v5.4.

* pm-s2idle-rework: (21 commits)
  ACPI: PM: s2idle: Always set up EC GPE for system wakeup
  ACPI: PM: s2idle: Avoid rearming SCI for wakeup unnecessarily
  PM: suspend: Fix platform_suspend_prepare_noirq()
  intel-hid: Disable button array during suspend-to-idle
  intel-hid: intel-vbtn: Avoid leaking wakeup_mode set
  ACPI: PM: s2idle: Execute LPS0 _DSM functions with suspended devices
  ACPI: EC: PM: Make acpi_ec_dispatch_gpe() print debug message
  ACPI: EC: PM: Consolidate some code depending on PM_SLEEP
  ACPI: PM: s2idle: Eliminate acpi_sleep_no_ec_events()
  ACPI: PM: s2idle: Switch EC over to polling during "noirq" suspend
  ACPI: PM: s2idle: Add acpi.sleep_no_lps0 module parameter
  ACPI: PM: s2idle: Rearrange lps0_device_attach()
  ACPI: PM: Set up EC GPE for system wakeup from drivers that need it
  PM: sleep: Drop dpm_noirq_begin() and dpm_noirq_end()
  PM: sleep: Integrate suspend-to-idle with generig suspend flow
  PM: sleep: Simplify suspend-to-idle control flow
  ACPI: PM: Set s2idle_wakeup earlier and clear it later
  PM: sleep: Fix possible overflow in pm_system_cancel_wakeup()
  ACPI: EC: Return bool from acpi_ec_dispatch_gpe()
  ACPICA: Return u32 from acpi_dispatch_gpe()
  ...
Esse commit está contido em:
Rafael J. Wysocki
2019-09-17 09:35:35 +02:00
15 arquivos alterados com 245 adições e 192 exclusões

Ver arquivo

@@ -252,36 +252,46 @@ static void intel_button_array_enable(struct device *device, bool enable)
}
static int intel_hid_pm_prepare(struct device *device)
{
if (device_may_wakeup(device)) {
struct intel_hid_priv *priv = dev_get_drvdata(device);
priv->wakeup_mode = true;
}
return 0;
}
static void intel_hid_pm_complete(struct device *device)
{
struct intel_hid_priv *priv = dev_get_drvdata(device);
priv->wakeup_mode = true;
return 0;
priv->wakeup_mode = false;
}
static int intel_hid_pl_suspend_handler(struct device *device)
{
if (pm_suspend_via_firmware()) {
intel_button_array_enable(device, false);
if (!pm_suspend_no_platform())
intel_hid_set_enable(device, false);
intel_button_array_enable(device, false);
}
return 0;
}
static int intel_hid_pl_resume_handler(struct device *device)
{
struct intel_hid_priv *priv = dev_get_drvdata(device);
intel_hid_pm_complete(device);
priv->wakeup_mode = false;
if (pm_resume_via_firmware()) {
if (!pm_suspend_no_platform())
intel_hid_set_enable(device, true);
intel_button_array_enable(device, true);
}
intel_button_array_enable(device, true);
return 0;
}
static const struct dev_pm_ops intel_hid_pl_pm_ops = {
.prepare = intel_hid_pm_prepare,
.complete = intel_hid_pm_complete,
.freeze = intel_hid_pl_suspend_handler,
.thaw = intel_hid_pl_resume_handler,
.restore = intel_hid_pl_resume_handler,
@@ -491,6 +501,12 @@ static int intel_hid_probe(struct platform_device *device)
}
device_init_wakeup(&device->dev, true);
/*
* In order for system wakeup to work, the EC GPE has to be marked as
* a wakeup one, so do that here (this setting will persist, but it has
* no effect until the wakeup mask is set for the EC GPE).
*/
acpi_ec_mark_gpe_for_wake();
return 0;
err_remove_notify:

Ver arquivo

@@ -176,6 +176,12 @@ static int intel_vbtn_probe(struct platform_device *device)
return -EBUSY;
device_init_wakeup(&device->dev, true);
/*
* In order for system wakeup to work, the EC GPE has to be marked as
* a wakeup one, so do that here (this setting will persist, but it has
* no effect until the wakeup mask is set for the EC GPE).
*/
acpi_ec_mark_gpe_for_wake();
return 0;
}
@@ -195,22 +201,30 @@ static int intel_vbtn_remove(struct platform_device *device)
static int intel_vbtn_pm_prepare(struct device *dev)
{
struct intel_vbtn_priv *priv = dev_get_drvdata(dev);
if (device_may_wakeup(dev)) {
struct intel_vbtn_priv *priv = dev_get_drvdata(dev);
priv->wakeup_mode = true;
priv->wakeup_mode = true;
}
return 0;
}
static int intel_vbtn_pm_resume(struct device *dev)
static void intel_vbtn_pm_complete(struct device *dev)
{
struct intel_vbtn_priv *priv = dev_get_drvdata(dev);
priv->wakeup_mode = false;
}
static int intel_vbtn_pm_resume(struct device *dev)
{
intel_vbtn_pm_complete(dev);
return 0;
}
static const struct dev_pm_ops intel_vbtn_pm_ops = {
.prepare = intel_vbtn_pm_prepare,
.complete = intel_vbtn_pm_complete,
.resume = intel_vbtn_pm_resume,
.restore = intel_vbtn_pm_resume,
.thaw = intel_vbtn_pm_resume,