Attention is currently required from: Zhi7 Li, Karthik Ramasubramanian. Tim Wawrzynczak has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/56930 )
Change subject: mb/google/dedede/var/sasukette: Update codec configration for codec ALC5682I-VD & VS ......................................................................
Patch Set 1:
(1 comment)
Patchset:
PS1: I think all you are trying to do is to change the `_HID` value depending on the the fw_config values for sasukette?
If so, something more like the following should work for you:
``` diff --git a/src/mainboard/google/dedede/variants/sasukette/Makefile.inc b/src/mainboard/google/dedede/variants/sasukette/Makefile.inc index fd60a18b694..74121943ddb 100644 --- a/src/mainboard/google/dedede/variants/sasukette/Makefile.inc +++ b/src/mainboard/google/dedede/variants/sasukette/Makefile.inc @@ -1,5 +1,6 @@ ## SPDX-License-Identifier: GPL-2.0-or-later
ramstage-y += gpio.c +ramstage-y += ramstage.c
smm-y += variant.c diff --git a/src/mainboard/google/dedede/variants/sasukette/ramstage.c b/src/mainboard/google/dedede/variants/sasukette/ramstage.c new file mode 100644 index 00000000000..1fe87609514 --- /dev/null +++ b/src/mainboard/google/dedede/variants/sasukette/ramstage.c @@ -0,0 +1,28 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include <baseboard/variants.h> +#include <device/device.h> +#include <device/path.h> +#include <fw_config.h> + +extern struct chip_operations drivers_i2c_generic_ops; + +void variant_devtree_update(void) +{ + const struct device_path codec_path[] = { + { .type = DEVICE_PATH_PCI, .pci.devfn = PCH_DEVFN_I2C4 }, + { .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; + + 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))) + config->hid = "RTL5682"; +} ```
This will just update the `hid` value of the chip in the devicetree before emitting the ACPI tables, and the driver will just use that for the _HID value.