From 0992a90daa80a17f9e7e33a56fd3f9660ee84c97 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 4 May 2023 16:54:57 -0600 Subject: 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 Reviewed-by: Bin Meng --- cmd/acpi.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cmd/acpi.c') 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; -- cgit v1.2.3