device/azalia_device: Adapt and export `codec_init()`
Make the `codec_init()` function non-static so that it can be used in other places. Rename it to `azalia_codec_init()` for consistency with the other functions of the API. Also, update the function's signature to make it more flexible. Remove the unused `dev` parameter and allow callers to pass the verb table to use. Update the original call site to preserve behavior. Change-Id: I5343796242065b5fedc78cd95bcf010c9e2623dd Signed-off-by: Angel Pons <th3fanbus@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/59117 Reviewed-by: Arthur Heymans <arthur@aheymans.xyz> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
parent
5300b0327e
commit
86dfd3c083
|
@ -227,7 +227,7 @@ __weak void mainboard_azalia_program_runtime_verbs(u8 *base, u32 viddid)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
static void codec_init(struct device *dev, u8 *base, int addr)
|
void azalia_codec_init(u8 *base, int addr, const u32 *verb_table, u32 verb_table_bytes)
|
||||||
{
|
{
|
||||||
u32 reg32;
|
u32 reg32;
|
||||||
const u32 *verb;
|
const u32 *verb;
|
||||||
|
@ -252,7 +252,7 @@ static void codec_init(struct device *dev, u8 *base, int addr)
|
||||||
/* 2 */
|
/* 2 */
|
||||||
reg32 = read32(base + HDA_IR_REG);
|
reg32 = read32(base + HDA_IR_REG);
|
||||||
printk(BIOS_DEBUG, "azalia_audio: codec viddid: %08x\n", reg32);
|
printk(BIOS_DEBUG, "azalia_audio: codec viddid: %08x\n", reg32);
|
||||||
verb_size = azalia_find_verb(cim_verb_data, cim_verb_data_size, reg32, &verb);
|
verb_size = azalia_find_verb(verb_table, verb_table_bytes, reg32, &verb);
|
||||||
|
|
||||||
if (!verb_size) {
|
if (!verb_size) {
|
||||||
printk(BIOS_DEBUG, "azalia_audio: No verb!\n");
|
printk(BIOS_DEBUG, "azalia_audio: No verb!\n");
|
||||||
|
@ -276,7 +276,7 @@ void azalia_codecs_init(struct device *dev, u8 *base, u16 codec_mask)
|
||||||
|
|
||||||
for (i = CONFIG_AZALIA_MAX_CODECS - 1; i >= 0; i--) {
|
for (i = CONFIG_AZALIA_MAX_CODECS - 1; i >= 0; i--) {
|
||||||
if (codec_mask & (1 << i))
|
if (codec_mask & (1 << i))
|
||||||
codec_init(dev, base, i);
|
azalia_codec_init(base, i, cim_verb_data, cim_verb_data_size);
|
||||||
}
|
}
|
||||||
|
|
||||||
azalia_program_verb_table(base, pc_beep_verbs, pc_beep_verbs_size);
|
azalia_program_verb_table(base, pc_beep_verbs, pc_beep_verbs_size);
|
||||||
|
|
|
@ -23,6 +23,7 @@ int azalia_enter_reset(u8 *base);
|
||||||
int azalia_exit_reset(u8 *base);
|
int azalia_exit_reset(u8 *base);
|
||||||
u32 azalia_find_verb(const u32 *verb_table, u32 verb_table_bytes, u32 viddid, const u32 **verb);
|
u32 azalia_find_verb(const u32 *verb_table, u32 verb_table_bytes, u32 viddid, const u32 **verb);
|
||||||
int azalia_program_verb_table(u8 *base, const u32 *verbs, u32 verb_size);
|
int azalia_program_verb_table(u8 *base, const u32 *verbs, u32 verb_size);
|
||||||
|
void azalia_codec_init(u8 *base, int addr, const u32 *verb_table, u32 verb_table_bytes);
|
||||||
void azalia_codecs_init(struct device *dev, u8 *base, u16 codec_mask);
|
void azalia_codecs_init(struct device *dev, u8 *base, u16 codec_mask);
|
||||||
void azalia_audio_init(struct device *dev);
|
void azalia_audio_init(struct device *dev);
|
||||||
extern struct device_operations default_azalia_audio_ops;
|
extern struct device_operations default_azalia_audio_ops;
|
||||||
|
|
Loading…
Reference in New Issue