aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAngel Pons <th3fanbus@gmail.com>2021-11-10 17:44:51 +0100
committerPaul Fagerburg <pfagerburg@chromium.org>2021-11-11 22:44:37 +0000
commit5300b0327e19fec9752d09d314c6a73869e17e90 (patch)
tree146d4706aa3ccf0e10e5a338115b0de4a60b6514
parent1297b9c74d419e84d7764a4939d34768096de7b1 (diff)
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>
-rw-r--r--src/soc/intel/broadwell/pch/hda.c2
-rw-r--r--src/southbridge/intel/lynxpoint/azalia.c2
-rw-r--r--src/southbridge/intel/lynxpoint/hda_verb.c19
-rw-r--r--src/southbridge/intel/lynxpoint/hda_verb.h1
4 files changed, 3 insertions, 21 deletions
diff --git a/src/soc/intel/broadwell/pch/hda.c b/src/soc/intel/broadwell/pch/hda.c
index 37f2d9f8e6..2230614887 100644
--- a/src/soc/intel/broadwell/pch/hda.c
+++ b/src/soc/intel/broadwell/pch/hda.c
@@ -24,7 +24,7 @@ static void codecs_init(u8 *base, u32 codec_mask)
}
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 fe5c4c9fdd..8e138f168f 100644
--- a/src/southbridge/intel/lynxpoint/azalia.c
+++ b/src/southbridge/intel/lynxpoint/azalia.c
@@ -24,7 +24,7 @@ static void codecs_init(u8 *base, u32 codec_mask)
}
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 41ecac11c5..ba30f1d036 100644
--- a/src/southbridge/intel/lynxpoint/hda_verb.c
+++ b/src/southbridge/intel/lynxpoint/hda_verb.c
@@ -91,23 +91,6 @@ static int hda_wait_for_valid(u8 *base)
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 @@ int hda_codec_init(u8 *base, int addr, int verb_size, const u32 *verb_data)
}
/* 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 07ee513c3c..327811f324 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