acpi: Support generation of a device
Allow writing an ACPI device to the generated ACPI code.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Reviewed-by: Wolfgang Wallner <wolfgang.wallner@br-automation.com>
[bmeng: Fix build failures on Sandbox]
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
diff --git a/include/acpi/acpigen.h b/include/acpi/acpigen.h
index 1f37c9c..59d7c2f 100644
--- a/include/acpi/acpigen.h
+++ b/include/acpi/acpigen.h
@@ -56,6 +56,7 @@
AND_OP = 0x7b,
OR_OP = 0x7d,
NOT_OP = 0x80,
+ DEVICE_OP = 0x82,
POWER_RES_OP = 0x84,
RETURN_OP = 0xa4,
};
@@ -314,6 +315,14 @@
int nargs);
/**
+ * acpigen_write_device() - Write an ACPI device
+ *
+ * @ctx: ACPI context pointer
+ * @name: Device name to write
+ */
+void acpigen_write_device(struct acpi_ctx *ctx, const char *name);
+
+/**
* acpigen_write_sta() - Write a _STA method
*
* @ctx: ACPI context pointer