From df99e57289ba2413cc82ef5f8dc70e37059eac31 Mon Sep 17 00:00:00 2001 From: Malik_Hsu Date: Thu, 11 Nov 2021 15:03:50 +0800 Subject: [PATCH] mb/google/brya/variants/primus: enable ALC5682I-VS In next phase build, the audio codec will change to ALC5682I-VS BUG=b:205883511 TEST=emerge-brya coreboot chromeos-bootimage and check audio function Signed-off-by: Malik_Hsu Change-Id: I5906ef9bb88da7fe450a986bf7dd1ee701227f95 Reviewed-on: https://review.coreboot.org/c/coreboot/+/59173 Tested-by: build bot (Jenkins) Reviewed-by: Tim Wawrzynczak --- .../google/brya/variants/primus/overridetree.cb | 2 +- .../google/brya/variants/primus/variant.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/mainboard/google/brya/variants/primus/overridetree.cb b/src/mainboard/google/brya/variants/primus/overridetree.cb index 8028798f3c..48319b7f5b 100644 --- a/src/mainboard/google/brya/variants/primus/overridetree.cb +++ b/src/mainboard/google/brya/variants/primus/overridetree.cb @@ -182,7 +182,7 @@ chip soc/intel/alderlake register "property_list[0].type" = "ACPI_DP_TYPE_INTEGER" register "property_list[0].name" = ""realtek,jd-src"" register "property_list[0].integer" = "1" - device i2c 1a on + device i2c 1a alias audio_codec on probe AUDIO MAX98360_ALC5682I_I2S end end diff --git a/src/mainboard/google/brya/variants/primus/variant.c b/src/mainboard/google/brya/variants/primus/variant.c index 4780334779..b783ac08e7 100644 --- a/src/mainboard/google/brya/variants/primus/variant.c +++ b/src/mainboard/google/brya/variants/primus/variant.c @@ -3,6 +3,7 @@ #include #include #include +#include static void devtree_update_emmc_rtd3(uint32_t board_ver) { @@ -13,8 +14,21 @@ static void devtree_update_emmc_rtd3(uint32_t board_ver) emmc_rtd3->enabled = 0; } +static void devtree_update_audio_codec(uint32_t board_ver) +{ + struct device *audio_codec = DEV_PTR(audio_codec); + struct drivers_i2c_generic_config *config = audio_codec->chip_info; + + if (board_ver <= 1) + return; + + config->hid = "RTL5682"; + audio_codec->enabled = 1; +} + void variant_devtree_update(void) { uint32_t board_ver = board_id(); devtree_update_emmc_rtd3(board_ver); + devtree_update_audio_codec(board_ver); }