mb/google/brya/variants/primus: add fw_config_probe for ALC5682I-VS

Added fw_config_probe method to distinguish different audio codecs to
facilitate the use of different topology files by the OS.

BUG=b:205883511
TEST=emerge-brya coreboot chromeos-bootimage and check audio function

Signed-off-by: Malik_Hsu <malik_hsu@wistron.corp-partner.google.com>
Change-Id: I0d5b95e89154b2cb6b371f24cc1b151c23ff642f
Reviewed-on: https://review.coreboot.org/c/coreboot/+/59367
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
This commit is contained in:
Malik_Hsu 2021-11-17 09:47:16 +08:00 committed by Felix Held
parent 6b81adf8bc
commit 797bc1b8e4
3 changed files with 12 additions and 2 deletions

View File

@ -80,5 +80,12 @@ static void fw_config_handle(void *unused)
gpio_configure_pads(i2s_enable_pads, ARRAY_SIZE(i2s_enable_pads));
gpio_configure_pads(bt_i2s_enable_pads, ARRAY_SIZE(bt_i2s_enable_pads));
}
if (fw_config_probe(FW_CONFIG(AUDIO, MAX98360_ALC5682I_VS_I2S))) {
printk(BIOS_INFO, "Configure audio over I2S with MAX98360 ALC5682I-VS.\n");
gpio_configure_pads(dmic_enable_pads, ARRAY_SIZE(dmic_enable_pads));
gpio_configure_pads(i2s_enable_pads, ARRAY_SIZE(i2s_enable_pads));
gpio_configure_pads(bt_i2s_enable_pads, ARRAY_SIZE(bt_i2s_enable_pads));
}
}
BOOT_STATE_INIT_ENTRY(BS_DEV_ENABLE, BS_ON_ENTRY, fw_config_handle, NULL);

View File

@ -14,6 +14,7 @@ fw_config
field AUDIO 8 10
option AUDIO_UNKNOWN 0
option MAX98360_ALC5682I_I2S 1
option MAX98360_ALC5682I_VS_I2S 2
end
field DB_LTE 11 12
option LTE_ABSENT 0
@ -184,6 +185,7 @@ chip soc/intel/alderlake
register "property_list[0].integer" = "1"
device i2c 1a alias audio_codec on
probe AUDIO MAX98360_ALC5682I_I2S
probe AUDIO MAX98360_ALC5682I_VS_I2S
end
end
end #I2C0

View File

@ -4,6 +4,7 @@
#include <boardid.h>
#include <device/device.h>
#include <drivers/i2c/hid/chip.h>
#include <fw_config.h>
static void devtree_update_emmc_rtd3(uint32_t board_ver)
{
@ -22,8 +23,8 @@ static void devtree_update_audio_codec(uint32_t board_ver)
if (board_ver <= 1)
return;
config->hid = "RTL5682";
audio_codec->enabled = 1;
if (fw_config_probe(FW_CONFIG(AUDIO, MAX98360_ALC5682I_VS_I2S)))
config->hid = "RTL5682";
}
void variant_devtree_update(void)