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>
This commit is contained in:
FrankChu 2022-02-07 16:27:27 +08:00 committed by Felix Held
parent 876cfe0ee2
commit 7516766abc
2 changed files with 5 additions and 17 deletions

View File

@ -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"

View File

@ -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)