Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.

Reported-by: Peter Chubb <peter@chubb.wattle.id.au>
Tested-by: Peter Chubb <peter@chubb.wattle.id.au>
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://patch.msgid.link/20251008064112.5981-1-W_Armin@gmx.de
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

authored by

Armin Wolf and committed by
Ilpo Järvinen
64400456 02543298

+11
+11
drivers/platform/x86/lg-laptop.c
··· 19 19 #include <linux/leds.h> 20 20 #include <linux/module.h> 21 21 #include <linux/platform_device.h> 22 + #include <linux/string_choices.h> 22 23 #include <linux/types.h> 23 24 24 25 #include <acpi/battery.h> ··· 43 42 #define LG_ADDRESS_SPACE_ID 0x8F 44 43 45 44 #define LG_ADDRESS_SPACE_DEBUG_FLAG_ADR 0x00 45 + #define LG_ADDRESS_SPACE_HD_AUDIO_POWER_ADDR 0x01 46 46 #define LG_ADDRESS_SPACE_FAN_MODE_ADR 0x03 47 47 48 48 #define LG_ADDRESS_SPACE_DTTM_FLAG_ADR 0x20 ··· 670 668 byte = value & 0xFF; 671 669 672 670 switch (address) { 671 + case LG_ADDRESS_SPACE_HD_AUDIO_POWER_ADDR: 672 + /* 673 + * The HD audio power field is not affected by the DTTM flag, 674 + * so we have to manually check fw_debug. 675 + */ 676 + if (fw_debug) 677 + dev_dbg(dev, "HD audio power %s\n", str_enabled_disabled(byte)); 678 + 679 + return AE_OK; 673 680 case LG_ADDRESS_SPACE_FAN_MODE_ADR: 674 681 /* 675 682 * The fan mode field is not affected by the DTTM flag, so we