lynxpoint/broadwell: Use `azalia_program_verb_table()`

Use the `azalia_program_verb_table()` function in preparation to
deduplicate Azalia init code.

Change-Id: I22cfee41e001c9ecf4fbac37aadbd12f43ac8aaf
Signed-off-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59116
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/src/soc/intel/broadwell/pch/hda.c b/src/soc/intel/broadwell/pch/hda.c
index 37f2d9f..2230614 100644
--- a/src/soc/intel/broadwell/pch/hda.c
+++ b/src/soc/intel/broadwell/pch/hda.c
@@ -24,7 +24,7 @@
 	}
 
 	if (pc_beep_verbs_size)
-		hda_codec_write(base, pc_beep_verbs_size, pc_beep_verbs);
+		azalia_program_verb_table(base, pc_beep_verbs, pc_beep_verbs_size);
 }
 
 static void hda_pch_init(struct device *dev, u8 *base)
diff --git a/src/southbridge/intel/lynxpoint/azalia.c b/src/southbridge/intel/lynxpoint/azalia.c
index fe5c4c9..8e138f1 100644
--- a/src/southbridge/intel/lynxpoint/azalia.c
+++ b/src/southbridge/intel/lynxpoint/azalia.c
@@ -24,7 +24,7 @@
 	}
 
 	if (pc_beep_verbs_size)
-		hda_codec_write(base, pc_beep_verbs_size, pc_beep_verbs);
+		azalia_program_verb_table(base, pc_beep_verbs, pc_beep_verbs_size);
 }
 
 static void azalia_pch_init(struct device *dev, u8 *base)
diff --git a/src/southbridge/intel/lynxpoint/hda_verb.c b/src/southbridge/intel/lynxpoint/hda_verb.c
index 41ecac1..ba30f1d 100644
--- a/src/southbridge/intel/lynxpoint/hda_verb.c
+++ b/src/southbridge/intel/lynxpoint/hda_verb.c
@@ -91,23 +91,6 @@
 	return -1;
 }
 
-int hda_codec_write(u8 *base, u32 size, const u32 *data)
-{
-	int i;
-
-	for (i = 0; i < size; i++) {
-		if (hda_wait_for_ready(base) < 0)
-			return -1;
-
-		write32(base + HDA_IC_REG, data[i]);
-
-		if (hda_wait_for_valid(base) < 0)
-			return -1;
-	}
-
-	return 0;
-}
-
 int hda_codec_init(u8 *base, int addr, int verb_size, const u32 *verb_data)
 {
 	const u32 *verb;
@@ -146,7 +129,7 @@
 	}
 
 	/* 3 */
-	rc = hda_codec_write(base, size, verb);
+	rc = azalia_program_verb_table(base, verb, size);
 
 	if (rc < 0)
 		printk(BIOS_DEBUG, "HDA: verb not loaded\n");
diff --git a/src/southbridge/intel/lynxpoint/hda_verb.h b/src/southbridge/intel/lynxpoint/hda_verb.h
index 07ee513..327811f 100644
--- a/src/southbridge/intel/lynxpoint/hda_verb.h
+++ b/src/southbridge/intel/lynxpoint/hda_verb.h
@@ -6,7 +6,6 @@
 #include <stdint.h>
 
 int hda_codec_detect(u8 *base);
-int hda_codec_write(u8 *base, u32 size, const u32 *data);
 int hda_codec_init(u8 *base, int addr, int verb_size, const u32 *verb_data);
 
 #endif