summaryrefslogtreecommitdiff
path: root/src/mainboard/google/volteer/variants/copano/variant.c
diff options
context:
space:
mode:
authorFrankChu <frank_chu@pegatron.corp-partner.google.com>2022-02-07 16:45:26 +0800
committerFelix Held <felix-coreboot@felixheld.de>2022-02-10 12:51:19 +0000
commit6e122455bd359686bf2d55193ba10fe2c3d410fa (patch)
tree256fd6e86c2bddc88f3a992688236a43a97bb2bc /src/mainboard/google/volteer/variants/copano/variant.c
parent7516766abcaeff029b10a9c9352a8e27d6867120 (diff)
mb/google/volteer/var/copano: Add fw_config probe for ALC5682-VD & VS
ALC5682-VD/ALC5682I-VS load different kernel driver by different _HID name. Update hid name depending on the AUDIO_CODEC_SOURCE field of fw_config. Define FW_CONFIG bits 41 - 43 (SSFC bits 9 - 11) for codec selection. ALC5682-VD: _HID = "10EC5682" ALC5682I-VS: _HID = "RTL5682" BUG=b:218245715 BRANCH=volteer TEST=ALC5682-VD/ALC5682I-VS audio codec can work Signed-off-by: Frank Chu <frank_chu@pegatron.corp-partner.google.com> Change-Id: I081dcf5451c82c03592f954ee25267b31ad81753 Reviewed-on: https://review.coreboot.org/c/coreboot/+/61674 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Diffstat (limited to 'src/mainboard/google/volteer/variants/copano/variant.c')
-rw-r--r--src/mainboard/google/volteer/variants/copano/variant.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/mainboard/google/volteer/variants/copano/variant.c b/src/mainboard/google/volteer/variants/copano/variant.c
new file mode 100644
index 0000000000..3effcdf4d8
--- /dev/null
+++ b/src/mainboard/google/volteer/variants/copano/variant.c
@@ -0,0 +1,22 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#include <baseboard/variants.h>
+#include <fw_config.h>
+#include <drivers/i2c/hid/chip.h>
+#include <device/device.h>
+
+static void audio_codec_update(void)
+{
+ struct device *codec = DEV_PTR(audio_codec);
+ struct drivers_i2c_generic_config *config;
+
+ config = codec->chip_info;
+ if (fw_config_probe(FW_CONFIG(AUDIO_CODEC_SOURCE, AUDIO_CODEC_ALC5682)))
+ config->hid = "10EC5682";
+ else
+ config->hid = "RTL5682";
+}
+void variant_devtree_update(void)
+{
+ audio_codec_update();
+}