Frank Chu has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/61671 )
Change subject: mb/google/volteer/var/delbin: update fw_config probe for ALC5682-VD & VS ......................................................................
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: FrankChu frank_chu@pegatron.corp-partner.google.com Change-Id: Idf5b3661e74a189390d25381e03448c28a966f38 --- M src/mainboard/google/volteer/variants/delbin/overridetree.cb M src/mainboard/google/volteer/variants/delbin/variant.c 2 files changed, 5 insertions(+), 17 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/71/61671/1
diff --git a/src/mainboard/google/volteer/variants/delbin/overridetree.cb b/src/mainboard/google/volteer/variants/delbin/overridetree.cb index 3ff6bb2..76de7c6 100644 --- a/src/mainboard/google/volteer/variants/delbin/overridetree.cb +++ b/src/mainboard/google/volteer/variants/delbin/overridetree.cb @@ -145,7 +145,7 @@ 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 f502a1a..3effcdf 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)