platform/x86: lg-laptop: Add support for the HDAP opregion field
Subsystems (2)
PATCH 1/1 platform/x86: lg-laptop: Add support for the HDAP opregion field
Various LG notebooks have a special field called "HDAP" inside the ACPI operation region handled by the lg-laptop driver:
Field (XIN1, AnyAcc, Lock, Preserve)
{
DMSG, 8,
HDAP, 8,
Offset (0x10),
P80B, 8,
P81B, 8,
P82B, 8,
P83B, 8,
P84B, 8,
P85B, 8,
P86B, 8,
P87B, 8,
Offset (0x3E8),
PMSG, 1600
}This field is set to 1/0 when the HD audio device is enabled/disabled using the _PS0/_PS3 ACPI control methods. Add support for this field to avoid printing warning messages when AML bytecode writes data into it.
--- drivers/platform/x86/lg-laptop.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/platform/x86/lg-laptop.c +11 -0
@@ -18,6 +18,7 @@#include <linux/leds.h> #include <linux/module.h> #include <linux/platform_device.h> +#include <linux/string_choices.h> #include <linux/types.h> #include <acpi/battery.h>
@@ -41,6 +42,7 @@ MODULE_PARM_DESC(fw_debug, "Enable printing of firmware debug messages");#define LG_ADDRESS_SPACE_ID 0x8F#define LG_ADDRESS_SPACE_DEBUG_FLAG_ADR 0x00 +#define LG_ADDRESS_SPACE_HD_AUDIO_POWER_ADDR 0x01#define LG_ADDRESS_SPACE_FAN_MODE_ADR 0x03#define LG_ADDRESS_SPACE_DTTM_FLAG_ADR 0x20
@@ -674,6 +676,15 @@ static acpi_status lg_laptop_address_space_write(struct device *dev, acpi_physic byte = value &0xFF ;switch (address) { +case LG_ADDRESS_SPACE_HD_AUDIO_POWER_ADDR : +/* +* The HD audio power field is not affected by the DTTM flag, +* so we have to manually check fw_debug. +*/ +if (fw_debug) +dev_dbg (dev,"HD audio power %s\n" ,str_enabled_disabled (byte)); + +return AE_OK ;case LG_ADDRESS_SPACE_FAN_MODE_ADR :/* * The fan mode field is not affected by the DTTM flag, so we
Signature · 1 line
2.39.5
Ilpo Järvinen
maintainerQuoted 20 lines · Armin Wolf
Various LG notebooks have a special field called "HDAP" inside the ACPI operation region handled by the lg-laptop driver:
Field (XIN1, AnyAcc, Lock, Preserve) { DMSG, 8, HDAP, 8, Offset (0x10), P80B, 8, P81B, 8, P82B, 8, P83B, 8, P84B, 8, P85B, 8, P86B, 8, P87B, 8, Offset (0x3E8), PMSG, 1600 }
Quoted 1 line
[...]
Thank you for your contribution, it has been applied to my local review-ilpo-next branch. Note it will show up in the public platform-drivers-x86/review-ilpo-next branch only once I've pushed my local branch there, which might take a while.
The list of commits applied:
[1/1] platform/x86: lg-laptop: Add support for the HDAP opregion field
commit: 644004565d4cda479995fa9e72c00d62ca084e08
--
i.