Frank Chu has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/60415 )
Change subject: mb/google/volteer/var/collis: Add fw_config probe for ALC5682-VD & VS ......................................................................
mb/google/volteer/var/collis: Add fw_config probe for ALC5682-VD & VS
ALC5682-VD/ALC5682I-VS load different kernel driver by different hid name. Update hid name depending on the AUDIO_CODEC_SOURCE field of fw_config. Define FW_CONFIG bits 41 - 43 (SSFC bits 9 - 11) for codec selection.
ALC5682-VD: _HID = "10EC5682" ALC5682I-VS: _HID = "RTL5682"
BUG=b:192535692 TEST=ALC5682-VD/ALC5682I-VS audio codec can work
Signed-off-by: FrankChu frank_chu@pegatron.corp-partner.google.com Change-Id: Ia6089441dc1ba04c3f7427dda065b85bd295af0d --- M src/mainboard/google/volteer/Kconfig M src/mainboard/google/volteer/variants/collis/Makefile.inc M src/mainboard/google/volteer/variants/collis/overridetree.cb A src/mainboard/google/volteer/variants/collis/variant.c 4 files changed, 35 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/15/60415/1
diff --git a/src/mainboard/google/volteer/Kconfig b/src/mainboard/google/volteer/Kconfig index 0c77a79..d3f48640 100644 --- a/src/mainboard/google/volteer/Kconfig +++ b/src/mainboard/google/volteer/Kconfig @@ -18,6 +18,7 @@ select DRIVERS_USB_ACPI select EC_GOOGLE_CHROMEEC select EC_GOOGLE_CHROMEEC_BOARDID + select EC_GOOGLE_CHROMEEC_INCLUDE_SSFC_IN_FW_CONFIG select EC_GOOGLE_CHROMEEC_SKUID select EC_GOOGLE_CHROMEEC_LPC select FW_CONFIG diff --git a/src/mainboard/google/volteer/variants/collis/Makefile.inc b/src/mainboard/google/volteer/variants/collis/Makefile.inc index 343c7db..2af91aa 100644 --- a/src/mainboard/google/volteer/variants/collis/Makefile.inc +++ b/src/mainboard/google/volteer/variants/collis/Makefile.inc @@ -5,3 +5,5 @@ bootblock-y += gpio.c
ramstage-y += gpio.c + +ramstage-y += variant.c diff --git a/src/mainboard/google/volteer/variants/collis/overridetree.cb b/src/mainboard/google/volteer/variants/collis/overridetree.cb index 3323bdf..d89e526 100644 --- a/src/mainboard/google/volteer/variants/collis/overridetree.cb +++ b/src/mainboard/google/volteer/variants/collis/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]. @@ -93,7 +100,7 @@ end device ref i2c0 on chip drivers/i2c/generic - register "hid" = ""10EC5682"" + # register "hid" is set in variants.c because of FW_CONFIG register "name" = ""RT58"" register "desc" = ""Headset Codec"" register "irq_gpio" = "ACPI_GPIO_IRQ_EDGE_BOTH(GPP_R5)" @@ -102,8 +109,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" @@ -113,6 +119,7 @@ register "name" = ""MAXR"" device i2c 31 on probe AUDIO MAX98373_ALC5682I_I2S_UP4 + probe AUDIO MAX98373_ALC5682IVS_I2S_UP4 end end chip drivers/i2c/max98373 @@ -123,6 +130,7 @@ register "name" = ""MAXL"" device i2c 32 on probe AUDIO MAX98373_ALC5682I_I2S_UP4 + probe AUDIO MAX98373_ALC5682IVS_I2S_UP4 end end end @@ -190,6 +198,7 @@ probe AUDIO MAX98373_ALC5682_SNDW probe AUDIO MAX98373_ALC5682I_I2S_UP4 probe AUDIO MAX98360_ALC5682I_I2S + probe AUDIO MAX98373_ALC5682IVS_I2S_UP4 end device ref pcie_rp9 on chip soc/intel/common/block/pcie/rtd3 diff --git a/src/mainboard/google/volteer/variants/collis/variant.c b/src/mainboard/google/volteer/variants/collis/variant.c new file mode 100644 index 0000000..6b06cba --- /dev/null +++ b/src/mainboard/google/volteer/variants/collis/variant.c @@ -0,0 +1,20 @@ +#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(); +}