summaryrefslogtreecommitdiff
path: root/cmd/acpi.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-05-04 16:54:57 -0600
committerBin Meng <bmeng@tinylab.org>2023-05-11 10:25:29 +0800
commit0992a90daa80a17f9e7e33a56fd3f9660ee84c97 (patch)
tree0ab7deffbdd3c6b5c81eec013b6d0de47d8b5b00 /cmd/acpi.c
parentd8062e950367fab0f219a889e8f2fbfade90108c (diff)
acpi: Create a new Kconfig for ACPI
We have several Kconfig options for ACPI, but all relate to specific functions, such as generating tables and AML code. Add a new option which controls including basic ACPI library code, including the lib/acpi directory. This will allow us to add functions which are available even if table generation is not supported. Adjust the command to avoid a build error when ACPIGEN is not enabled. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Diffstat (limited to 'cmd/acpi.c')
-rw-r--r--cmd/acpi.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/cmd/acpi.c b/cmd/acpi.c
index d0fc062ef8c..991b5235e28 100644
--- a/cmd/acpi.c
+++ b/cmd/acpi.c
@@ -162,6 +162,10 @@ static int do_acpi_items(struct cmd_tbl *cmdtp, int flag, int argc,
bool dump_contents;
dump_contents = argc >= 2 && !strcmp("-d", argv[1]);
+ if (!IS_ENABLED(CONFIG_ACPIGEN)) {
+ printf("Not supported (enable ACPIGEN)\n");
+ return CMD_RET_FAILURE;
+ }
acpi_dump_items(dump_contents ? ACPI_DUMP_CONTENTS : ACPI_DUMP_LIST);
return 0;