From b119a0b82470ef3aadad9f27c245d26bd423e402 Mon Sep 17 00:00:00 2001 From: Junjie Mao Date: Tue, 22 Jun 2021 11:16:51 +0800 Subject: [PATCH] board_inspector: collect descriptions of ACPI devices _STR is another device identification object defined in ACPI spec that describes a device. This patch collects this string (when available) into board XML as well. Tracked-On: #6287 Signed-off-by: Junjie Mao --- misc/config_tools/board_inspector/extractors/50-acpi.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/misc/config_tools/board_inspector/extractors/50-acpi.py b/misc/config_tools/board_inspector/extractors/50-acpi.py index d5d0ada59..541f8563b 100644 --- a/misc/config_tools/board_inspector/extractors/50-acpi.py +++ b/misc/config_tools/board_inspector/extractors/50-acpi.py @@ -145,6 +145,11 @@ def fetch_device_info(devices_node, interpreter, namepath): element.tag = "bus" element.set("type", buses[hid]) + # Description + if interpreter.context.has_symbol(f"{namepath}._STR"): + desc = interpreter.interpret_method_call(f"{namepath}._STR").get().decode(encoding="utf-16").strip("\00") + element.set("description", desc) + # Address if interpreter.context.has_symbol(f"{namepath}._ADR"): adr = interpreter.interpret_method_call(f"{namepath}._ADR").get()