diff options
Diffstat (limited to 'src/mainboard')
3 files changed, 33 insertions, 3 deletions
diff --git a/src/mainboard/google/volteer/variants/copano/Makefile.inc b/src/mainboard/google/volteer/variants/copano/Makefile.inc index 343c7dbb95..2af91aab63 100644 --- a/src/mainboard/google/volteer/variants/copano/Makefile.inc +++ b/src/mainboard/google/volteer/variants/copano/Makefile.inc @@ -5,3 +5,5 @@ romstage-y += memory.c bootblock-y += gpio.c ramstage-y += gpio.c + +ramstage-y += variant.c diff --git a/src/mainboard/google/volteer/variants/copano/overridetree.cb b/src/mainboard/google/volteer/variants/copano/overridetree.cb index 7ffa7ab3c4..150db08367 100644 --- a/src/mainboard/google/volteer/variants/copano/overridetree.cb +++ b/src/mainboard/google/volteer/variants/copano/overridetree.cb @@ -1,3 +1,10 @@ +fw_config + field AUDIO_CODEC_SOURCE 41 43 + option AUDIO_CODEC_UNPROVISIONED 0 + option AUDIO_CODEC_ALC5682 1 + option AUDIO_CODEC_ALC5682I_VS 2 + end +end chip soc/intel/tigerlake # BitMask where bits [3:0] are Controller 0 Channel [3:0] and # bits [7:4] are Controller 1 Channel [3:0]. @@ -117,7 +124,7 @@ chip soc/intel/tigerlake device ref i2c0 on chip drivers/i2c/generic - register "hid" = ""10EC5682"" + # register "hid" is set in variant.c because of FW_CONFIG register "name" = ""RT58"" register "desc" = ""Headset Codec"" register "irq_gpio" = "ACPI_GPIO_IRQ_EDGE_BOTH(GPP_R5)" @@ -126,8 +133,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/copano/variant.c b/src/mainboard/google/volteer/variants/copano/variant.c new file mode 100644 index 0000000000..3effcdf4d8 --- /dev/null +++ b/src/mainboard/google/volteer/variants/copano/variant.c @@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include <baseboard/variants.h> +#include <fw_config.h> +#include <drivers/i2c/hid/chip.h> +#include <device/device.h> + +static void audio_codec_update(void) +{ + struct device *codec = DEV_PTR(audio_codec); + struct drivers_i2c_generic_config *config; + + config = codec->chip_info; + if (fw_config_probe(FW_CONFIG(AUDIO_CODEC_SOURCE, AUDIO_CODEC_ALC5682))) + config->hid = "10EC5682"; + else + config->hid = "RTL5682"; +} +void variant_devtree_update(void) +{ + audio_codec_update(); +} |