summaryrefslogtreecommitdiff
path: root/src/mainboard/google/volteer
diff options
context:
space:
mode:
authorFrankChu <frank_chu@pegatron.corp-partner.google.com>2022-02-07 16:27:27 +0800
committerFelix Held <felix-coreboot@felixheld.de>2022-02-10 12:51:02 +0000
commit7516766abcaeff029b10a9c9352a8e27d6867120 (patch)
treea711e1f832793c1dd1e742e696afa94867b53b0f /src/mainboard/google/volteer
parent876cfe0ee2c2f4bf14a4846fc648b2c32d98c20d (diff)
mb/google/volteer/var/delbin: update fw_config probe for ALC5682-VD & VS
use DEV_PTR to get codec HID for simplify the variant.c code ALC5682-VD: _HID = "10EC5682" ALC5682I-VS: _HID = "RTL5682" BUG=b:204523176 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: Idf5b3661e74a189390d25381e03448c28a966f38 Reviewed-on: https://review.coreboot.org/c/coreboot/+/61671 Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'src/mainboard/google/volteer')
-rw-r--r--src/mainboard/google/volteer/variants/delbin/overridetree.cb2
-rw-r--r--src/mainboard/google/volteer/variants/delbin/variant.c20
2 files changed, 5 insertions, 17 deletions
diff --git a/src/mainboard/google/volteer/variants/delbin/overridetree.cb b/src/mainboard/google/volteer/variants/delbin/overridetree.cb
index 3ff6bb2737..76de7c6171 100644
--- a/src/mainboard/google/volteer/variants/delbin/overridetree.cb
+++ b/src/mainboard/google/volteer/variants/delbin/overridetree.cb
@@ -145,7 +145,7 @@ chip soc/intel/tigerlake
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 end
+ device i2c 1a alias audio_codec on end
end
chip drivers/i2c/max98373
register "vmon_slot_no" = "0"
diff --git a/src/mainboard/google/volteer/variants/delbin/variant.c b/src/mainboard/google/volteer/variants/delbin/variant.c
index f502a1a129..3effcdf4d8 100644
--- a/src/mainboard/google/volteer/variants/delbin/variant.c
+++ b/src/mainboard/google/volteer/variants/delbin/variant.c
@@ -2,30 +2,18 @@
#include <baseboard/variants.h>
#include <fw_config.h>
-#include <drivers/i2c/generic/chip.h>
-#include <soc/pci_devs.h>
+#include <drivers/i2c/hid/chip.h>
+#include <device/device.h>
-extern struct chip_operations drivers_i2c_generic_ops;
static void audio_codec_update(void)
{
- const struct device_path codec_path[] = {
- {.type = DEVICE_PATH_PCI, .pci.devfn = PCH_DEVFN_I2C0},
- {.type = DEVICE_PATH_I2C, .i2c.device = 0x1a}
- };
- const struct device *codec =
- find_dev_nested_path(pci_root_bus(), codec_path,
- ARRAY_SIZE(codec_path));
+ struct device *codec = DEV_PTR(audio_codec);
struct drivers_i2c_generic_config *config;
- if (!codec || (codec->chip_ops != &drivers_i2c_generic_ops) ||
- !codec->chip_info)
- return;
config = codec->chip_info;
-
if (fw_config_probe(FW_CONFIG(AUDIO_CODEC_SOURCE, AUDIO_CODEC_ALC5682)))
config->hid = "10EC5682";
- else if (fw_config_probe(FW_CONFIG(AUDIO_CODEC_SOURCE,
- AUDIO_CODEC_ALC5682I_VS)))
+ else
config->hid = "RTL5682";
}
void variant_devtree_update(void)