Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/50382 )
Change subject: device/azalia: Add weak function for extra verbs ......................................................................
device/azalia: Add weak function for extra verbs
Introduce a weak function to be overwritten by mainboard to provide additional verbs for runtime based configuration.
The mainboard must implement azalia_extra_verb_table, check the viddid and return a pointer to the buffer holding the additonal verbs.
To be used for runtime detection of present jacks on prodrive/hermes.
Change-Id: I983c62d26be68885bb2f5b3a85f989b9d6b77706 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M src/device/azalia_device.c M src/include/device/azalia_device.h 2 files changed, 28 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/82/50382/1
diff --git a/src/device/azalia_device.c b/src/device/azalia_device.c index e383821..999ac0e 100644 --- a/src/device/azalia_device.c +++ b/src/device/azalia_device.c @@ -188,10 +188,17 @@ return -1; }
+__weak u32 *azalia_extra_verb_table(u32 viddid, u32 *verb_table_size) +{ + *verb_table_size = 0; + return NULL; +} + static void codec_init(struct device *dev, u8 *base, int addr) { u32 reg32; const u32 *verb; + u32 *extra_verbs; u32 verb_size; int i;
@@ -233,6 +240,22 @@ return; } printk(BIOS_DEBUG, "azalia_audio: verb loaded.\n"); + + verb_size = 0; + extra_verbs = azalia_extra_verb_table(reg32, &verb_size); + if (extra_verbs != NULL && verb_size != 0) { + printk(BIOS_DEBUG, "azalia_audio: extra_verb_size: %d\n", verb_size); + for (i = 0; i < verb_size; i++) { + if (wait_for_ready(base) < 0) + return; + + write32(base + HDA_IC_REG, extra_verbs[i]); + + if (wait_for_valid(base) < 0) + return; + } + printk(BIOS_DEBUG, "azalia_audio: extra verb loaded.\n"); + } }
static void codecs_init(struct device *dev, u8 *base, u32 codec_mask) diff --git a/src/include/device/azalia_device.h b/src/include/device/azalia_device.h index 1b4e769..095f7c2 100644 --- a/src/include/device/azalia_device.h +++ b/src/include/device/azalia_device.h @@ -25,6 +25,11 @@ void azalia_audio_init(struct device *dev); extern struct device_operations default_azalia_audio_ops;
+/* + * Allows a mainboard to specify additional verb configured at runtime. + */ +u32 *azalia_extra_verb_table(u32 viddid, u32 *verb_table_size); + extern const u32 cim_verb_data[]; extern const u32 cim_verb_data_size; extern const u32 pc_beep_verbs[];