Attention is currently required from: Christian Walter. Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/50383 )
Change subject: mb/prodrive/hermes: Configure 'internal audio' ......................................................................
mb/prodrive/hermes: Configure 'internal audio'
Implement azalia_extra_verb_table and let the azalia driver configure the codec according to the EEPROM configuration internal_audio_connection:
* 0 disabled * 1 Front HP out * 2 Internal speaker
Change-Id: I2bab0f2d36826c193b1af2b9ca2598a7bf00ac46 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M src/mainboard/prodrive/hermes/hda_verb.c 1 file changed, 54 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/83/50383/1
diff --git a/src/mainboard/prodrive/hermes/hda_verb.c b/src/mainboard/prodrive/hermes/hda_verb.c index 59b8aa6..a97286c 100644 --- a/src/mainboard/prodrive/hermes/hda_verb.c +++ b/src/mainboard/prodrive/hermes/hda_verb.c @@ -1,6 +1,9 @@ /* SPDX-License-Identifier: GPL-2.0-only */
#include <device/azalia_device.h> +#include <string.h> +#include <stdlib.h> +#include "variants/baseboard/include/eeprom.h"
const u32 cim_verb_data[] = { 0x10ec0888, /* Codec Vendor / Device ID: Realtek ALC888 */ @@ -168,3 +171,54 @@ const u32 pc_beep_verbs[0] = {};
AZALIA_ARRAY_SIZES; + +u32 *azalia_extra_verb_table(u32 viddid, u32 *verb_table_size) +{ + const struct eeprom_board_settings *const board_cfg = get_board_settings(); + u32 *verbs; + + if (!board_cfg) + return NULL; + + if (viddid != 0x10ec0888) + return NULL; + + verbs = malloc(sizeof(u32) * 4); + if (!verbs) + return NULL; + + *verb_table_size = 0; + + if (board_cfg->internal_audio_connection == 0) { + static u32 verb_data[] = { + AZALIA_PIN_CFG(0, 0x1b, 0x411111f0), + }; + memcpy(&verbs[*verb_table_size], verb_data, sizeof(verb_data)); + *verb_table_size += sizeof(verb_data) / sizeof(u32); + + } else if (board_cfg->internal_audio_connection == 1) { + static u32 verb_data[] = { + AZALIA_PIN_CFG(0, 0x1b, 0x02214c40), + }; + memcpy(&verbs[*verb_table_size], verb_data, sizeof(verb_data)); + *verb_table_size += sizeof(verb_data) / sizeof(u32); + } else { + static u32 verb_data[] = { + AZALIA_PIN_CFG(0, 0x1b, AZALIA_PIN_DESC( + INTEGRATED, + INTERNAL, + NA, + SPEAKER, + TYPE_UNKNOWN, + COLOR_UNKNOWN, + false, + 0xf, + 0)), + }; + memcpy(&verbs[*verb_table_size], verb_data, sizeof(verb_data)); + *verb_table_size += sizeof(verb_data) / sizeof(u32); + } + + /* Leak verbs */ + return verbs; +} \ No newline at end of file