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:
parent
876cfe0ee2
commit
7516766abc
|
@ -145,7 +145,7 @@ chip soc/intel/tigerlake
|
||||||
register "property_list[0].type" = "ACPI_DP_TYPE_INTEGER"
|
register "property_list[0].type" = "ACPI_DP_TYPE_INTEGER"
|
||||||
register "property_list[0].name" = ""realtek,jd-src""
|
register "property_list[0].name" = ""realtek,jd-src""
|
||||||
register "property_list[0].integer" = "1"
|
register "property_list[0].integer" = "1"
|
||||||
device i2c 1a on end
|
device i2c 1a alias audio_codec on end
|
||||||
end
|
end
|
||||||
chip drivers/i2c/max98373
|
chip drivers/i2c/max98373
|
||||||
register "vmon_slot_no" = "0"
|
register "vmon_slot_no" = "0"
|
||||||
|
|
|
@ -2,30 +2,18 @@
|
||||||
|
|
||||||
#include <baseboard/variants.h>
|
#include <baseboard/variants.h>
|
||||||
#include <fw_config.h>
|
#include <fw_config.h>
|
||||||
#include <drivers/i2c/generic/chip.h>
|
#include <drivers/i2c/hid/chip.h>
|
||||||
#include <soc/pci_devs.h>
|
#include <device/device.h>
|
||||||
|
|
||||||
extern struct chip_operations drivers_i2c_generic_ops;
|
|
||||||
static void audio_codec_update(void)
|
static void audio_codec_update(void)
|
||||||
{
|
{
|
||||||
const struct device_path codec_path[] = {
|
struct device *codec = DEV_PTR(audio_codec);
|
||||||
{.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 drivers_i2c_generic_config *config;
|
struct drivers_i2c_generic_config *config;
|
||||||
|
|
||||||
if (!codec || (codec->chip_ops != &drivers_i2c_generic_ops) ||
|
|
||||||
!codec->chip_info)
|
|
||||||
return;
|
|
||||||
config = codec->chip_info;
|
config = codec->chip_info;
|
||||||
|
|
||||||
if (fw_config_probe(FW_CONFIG(AUDIO_CODEC_SOURCE, AUDIO_CODEC_ALC5682)))
|
if (fw_config_probe(FW_CONFIG(AUDIO_CODEC_SOURCE, AUDIO_CODEC_ALC5682)))
|
||||||
config->hid = "10EC5682";
|
config->hid = "10EC5682";
|
||||||
else if (fw_config_probe(FW_CONFIG(AUDIO_CODEC_SOURCE,
|
else
|
||||||
AUDIO_CODEC_ALC5682I_VS)))
|
|
||||||
config->hid = "RTL5682";
|
config->hid = "RTL5682";
|
||||||
}
|
}
|
||||||
void variant_devtree_update(void)
|
void variant_devtree_update(void)
|
||||||
|
|
Loading…
Reference in New Issue