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>
This commit is contained in:
Angel Pons 2021-11-10 17:44:51 +01:00 committed by Paul Fagerburg
parent 1297b9c74d
commit 5300b0327e
4 changed files with 3 additions and 21 deletions

View File

@ -24,7 +24,7 @@ static void codecs_init(u8 *base, u32 codec_mask)
} }
if (pc_beep_verbs_size) 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) static void hda_pch_init(struct device *dev, u8 *base)

View File

@ -24,7 +24,7 @@ static void codecs_init(u8 *base, u32 codec_mask)
} }
if (pc_beep_verbs_size) 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) static void azalia_pch_init(struct device *dev, u8 *base)

View File

@ -91,23 +91,6 @@ static int hda_wait_for_valid(u8 *base)
return -1; 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) int hda_codec_init(u8 *base, int addr, int verb_size, const u32 *verb_data)
{ {
const u32 *verb; const u32 *verb;
@ -146,7 +129,7 @@ int hda_codec_init(u8 *base, int addr, int verb_size, const u32 *verb_data)
} }
/* 3 */ /* 3 */
rc = hda_codec_write(base, size, verb); rc = azalia_program_verb_table(base, verb, size);
if (rc < 0) if (rc < 0)
printk(BIOS_DEBUG, "HDA: verb not loaded\n"); printk(BIOS_DEBUG, "HDA: verb not loaded\n");

View File

@ -6,7 +6,6 @@
#include <stdint.h> #include <stdint.h>
int hda_codec_detect(u8 *base); 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); int hda_codec_init(u8 *base, int addr, int verb_size, const u32 *verb_data);
#endif #endif