Skip to content

Commit 08c9f40

Browse files
Wer-Wolfij-intel
authored andcommitted
platform/x86: wmi: Call WCxx methods when setting data blocks
After performing some tests with a custom SSDT table available at https://github.com/Wer-Wolf/acpi-wmi-ssdt i found out that Windows also enables data block collection even when the data block is being set. Emulate this behaviour to avoid confusing the ACPI firmware. The bus-based API already implements this behaviour, so only the legacy GUID-based API needs to be changed. Signed-off-by: Armin Wolf <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Ilpo Järvinen <[email protected]> Signed-off-by: Ilpo Järvinen <[email protected]>
1 parent 656f096 commit 08c9f40

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

Documentation/wmi/acpi-interface.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ Similar to the ``WExx`` ACPI methods, except that it controls data collection
8989
instead of events and thus the last two characters of the ACPI method name are
9090
the method ID of the data block to enable/disable.
9191

92+
Those ACPI methods are also called before setting data blocks to match the
93+
behaviour of the Windows driver.
94+
9295
_WED ACPI method
9396
----------------
9497

drivers/platform/x86/wmi.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,14 @@ acpi_status wmi_set_block(const char *guid_string, u8 instance, const struct acp
463463
if (IS_ERR(wdev))
464464
return AE_ERROR;
465465

466+
if (wmi_device_enable(wdev, true) < 0)
467+
dev_warn(&wdev->dev, "Failed to enable device\n");
468+
466469
status = wmidev_block_set(wdev, instance, in);
470+
471+
if (wmi_device_enable(wdev, false) < 0)
472+
dev_warn(&wdev->dev, "Failed to disable device\n");
473+
467474
wmi_device_put(wdev);
468475

469476
return status;

0 commit comments

Comments
 (0)