summaryrefslogtreecommitdiff
path: root/src/mainboard/google
diff options
context:
space:
mode:
authorMalik_Hsu <malik_hsu@wistron.corp-partner.google.com>2021-11-17 09:47:16 +0800
committerFelix Held <felix-coreboot@felixheld.de>2021-11-22 14:53:53 +0000
commit797bc1b8e4a6a8497be8c5e2d5db57e6071579fb (patch)
tree3794df508ec52722c7b6b0ca1dcc3d92a75caeaf /src/mainboard/google
parent6b81adf8bcd3684f109ed21ed8892c3ccd943708 (diff)
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>
Diffstat (limited to 'src/mainboard/google')
-rw-r--r--src/mainboard/google/brya/variants/primus/fw_config.c7
-rw-r--r--src/mainboard/google/brya/variants/primus/overridetree.cb2
-rw-r--r--src/mainboard/google/brya/variants/primus/variant.c5
3 files changed, 12 insertions, 2 deletions
diff --git a/src/mainboard/google/brya/variants/primus/fw_config.c b/src/mainboard/google/brya/variants/primus/fw_config.c
index 0beedc7941..c9b4a38be5 100644
--- a/src/mainboard/google/brya/variants/primus/fw_config.c
+++ b/src/mainboard/google/brya/variants/primus/fw_config.c
@@ -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);
diff --git a/src/mainboard/google/brya/variants/primus/overridetree.cb b/src/mainboard/google/brya/variants/primus/overridetree.cb
index 48319b7f5b..ddb78c0ca7 100644
--- a/src/mainboard/google/brya/variants/primus/overridetree.cb
+++ b/src/mainboard/google/brya/variants/primus/overridetree.cb
@@ -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
diff --git a/src/mainboard/google/brya/variants/primus/variant.c b/src/mainboard/google/brya/variants/primus/variant.c
index b783ac08e7..e10648d6c3 100644
--- a/src/mainboard/google/brya/variants/primus/variant.c
+++ b/src/mainboard/google/brya/variants/primus/variant.c
@@ -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)