return 0;
}
+static void intel_hid_pm_complete(struct device *device)
+{
+ struct intel_hid_priv *priv = dev_get_drvdata(device);
+
+ if (priv->wakeup_mode) {
+ acpi_ec_set_gpe_wake_mask(ACPI_GPE_DISABLE);
+ priv->wakeup_mode = false;
+ }
+}
+
static int intel_hid_pl_suspend_handler(struct device *device)
{
if (pm_suspend_via_firmware()) {
static int intel_hid_pl_resume_handler(struct device *device)
{
- if (device_may_wakeup(device)) {
- struct intel_hid_priv *priv = dev_get_drvdata(device);
+ intel_hid_pm_complete(device);
- acpi_ec_set_gpe_wake_mask(ACPI_GPE_DISABLE);
- priv->wakeup_mode = false;
- }
if (pm_resume_via_firmware()) {
intel_hid_set_enable(device, true);
intel_button_array_enable(device, true);
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,
return 0;
}
-static int intel_vbtn_pm_resume(struct device *dev)
+static void intel_vbtn_pm_complete(struct device *dev)
{
- if (device_may_wakeup(dev)) {
- struct intel_vbtn_priv *priv = dev_get_drvdata(dev);
+ struct intel_vbtn_priv *priv = dev_get_drvdata(dev);
+ if (priv->wakeup_mode) {
acpi_ec_set_gpe_wake_mask(ACPI_GPE_DISABLE);
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,