soc/amd/picasso: move acpigen_dptc_call_alib to new common alib

Signed-off-by: Felix Held <felix-coreboot@felixheld.de>
Change-Id: Ib0f7da12429b6278d1e4bc5d6650c7ee0f3b5209
Reviewed-on: https://review.coreboot.org/c/coreboot/+/53940
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Martin Roth <martinroth@google.com>
diff --git a/src/soc/amd/picasso/Kconfig b/src/soc/amd/picasso/Kconfig
index 2f36f2e..e69fb62 100644
--- a/src/soc/amd/picasso/Kconfig
+++ b/src/soc/amd/picasso/Kconfig
@@ -28,6 +28,7 @@
 	select SOC_AMD_COMMON_BLOCK_ACP
 	select SOC_AMD_COMMON_BLOCK_ACPI
 	select SOC_AMD_COMMON_BLOCK_ACPIMMIO
+	select SOC_AMD_COMMON_BLOCK_ACPI_ALIB
 	select SOC_AMD_COMMON_BLOCK_ACPI_GPIO
 	select SOC_AMD_COMMON_BLOCK_AOAC
 	select SOC_AMD_COMMON_BLOCK_APOB
diff --git a/src/soc/amd/picasso/root_complex.c b/src/soc/amd/picasso/root_complex.c
index 979da3e..3517e3d 100644
--- a/src/soc/amd/picasso/root_complex.c
+++ b/src/soc/amd/picasso/root_complex.c
@@ -177,18 +177,6 @@
 	setup_ioapic((u8 *)GNB_IO_APIC_ADDR, GNB_IOAPIC_ID);
 }
 
-static void dptc_call_alib(const char *buf_name, uint8_t *buffer, size_t size)
-{
-	/* Name (buf_name, Buffer(size) {...} */
-	acpigen_write_name(buf_name);
-	acpigen_write_byte_buffer(buffer, size);
-
-	/* \_SB.ALIB(0xc, buf_name) */
-	acpigen_emit_namestring("\\_SB.ALIB");
-	acpigen_write_integer(ALIB_FUNCTION_DYNAMIC_POWER_THERMAL_CONFIG);
-	acpigen_emit_namestring(buf_name);
-}
-
 static void acipgen_dptci(void)
 {
 	const struct soc_amd_picasso_config *config = config_of_soc();
@@ -214,13 +202,14 @@
 	/* If (LEqual ("\_SB.PCI0.LPCB.EC0.TBMD", 1)) */
 	acpigen_write_if_lequal_namestr_int("\\_SB.PCI0.LPCB.EC0.TBMD", 1);
 
-	dptc_call_alib("TABB", (uint8_t *)(void *)&tablet_mode_input,
+	acpigen_dptc_call_alib("TABB", (uint8_t *)(void *)&tablet_mode_input,
 			sizeof(tablet_mode_input));
 
 	/* Else */
 	acpigen_write_else();
 
-	dptc_call_alib("DEFB", (uint8_t *)(void *)&default_input, sizeof(default_input));
+	acpigen_dptc_call_alib("DEFB", (uint8_t *)(void *)&default_input,
+			sizeof(default_input));
 
 	acpigen_pop_len(); /* Else */