mainboard/intel/avenuecity_crb: Update full IIO configuration
[coreboot2.git] / src / mainboard / google / octopus / variants / baseboard / nhlt.c
blob320e470c91cb0790b722c125402106524685de05
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <baseboard/cbi_ssfc.h>
4 #include <baseboard/variants.h>
5 #include <console/console.h>
6 #include <nhlt.h>
7 #include <soc/nhlt.h>
9 void __weak variant_nhlt_init(struct nhlt *nhlt)
11 enum ssfc_audio_codec codec = ssfc_get_audio_codec();
13 /* 2 Channel DMIC array. */
14 if (!nhlt_soc_add_dmic_array(nhlt, 2))
15 printk(BIOS_INFO, "Added 2CH DMIC array.\n");
17 /* 4 Channel DMIC array. */
18 if (!nhlt_soc_add_dmic_array(nhlt, 4))
19 printk(BIOS_INFO, "Added 4CH DMIC arrays.\n");
22 * Headset codec is bi-directional but uses the same configuration
23 * settings for render and capture endpoints.
25 if (CONFIG(NHLT_DA7219) && codec == SSFC_AUDIO_CODEC_DA7219) {
26 /* Dialog for Headset codec */
27 if (!nhlt_soc_add_da7219(nhlt, AUDIO_LINK_SSP2))
28 printk(BIOS_INFO, "Added Dialog_7219 codec.\n");
31 if (CONFIG(NHLT_DA7219) && codec == SSFC_AUDIO_CODEC_CS42L42) {
32 /* Use Dialog NHLT for Cirrus Logic */
33 if (!nhlt_soc_add_da7219(nhlt, AUDIO_LINK_SSP2))
34 printk(BIOS_INFO, "Added Cirrus Logic codec.\n");
37 if (CONFIG(NHLT_RT5682) &&
38 (codec == SSFC_AUDIO_CODEC_RT5682 ||
39 codec == SSFC_AUDIO_CODEC_RT5682_VS)) {
40 /* Realtek for Headset codec */
41 if (!nhlt_soc_add_rt5682(nhlt, AUDIO_LINK_SSP2))
42 printk(BIOS_INFO, "Added ALC5682 codec.\n");
45 /* MAXIM Smart Amps for left and right speakers. */
46 if (!nhlt_soc_add_max98357(nhlt, AUDIO_LINK_SSP1))
47 printk(BIOS_INFO, "Added Maxim_98357 codec.\n");