blob: 161cc5f55f50111bd8ed6091e94dcaaa4438a922 [file] [log] [blame]
Maulik V Vagheladfc99172018-08-07 12:06:23 +05301/*
2 * This file is part of the coreboot project.
3 *
4 * Copyright 2018 Intel Corp.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16#include <baseboard/variants.h>
Maulik V Vagheladfc99172018-08-07 12:06:23 +053017#include <console/console.h>
18#include <nhlt.h>
19#include <soc/nhlt.h>
20
21void __weak variant_nhlt_init(struct nhlt *nhlt)
22{
23 /* 1-dmic configuration */
24 if (IS_ENABLED(CONFIG_NHLT_DMIC_1CH_16B) &&
25 !nhlt_soc_add_dmic_array(nhlt, 1))
26 printk(BIOS_ERR, "Added 1CH DMIC array.\n");
27 /* 2-dmic configuration */
28 if (IS_ENABLED(CONFIG_NHLT_DMIC_2CH_16B) &&
29 !nhlt_soc_add_dmic_array(nhlt, 2))
30 printk(BIOS_ERR, "Added 2CH DMIC array.\n");
31 /* 4-dmic configuration */
32 if (IS_ENABLED(CONFIG_NHLT_DMIC_4CH_16B) &&
33 !nhlt_soc_add_dmic_array(nhlt, 4))
34 printk(BIOS_ERR, "Added 4CH DMIC array.\n");
35
36 if (IS_ENABLED(CONFIG_INCLUDE_SND_MAX98357_DA7219_NHLT)) {
37 /* Dialog for Headset codec.
38 * Headset codec is bi-directional but uses the same
39 * configuration settings for render and capture endpoints.
40 */
41 if (!nhlt_soc_add_da7219(nhlt, AUDIO_LINK_SSP2))
42 printk(BIOS_ERR, "Added Dialog_7219 codec.\n");
43
44 /* MAXIM Smart Amps for left and right speakers. */
45 if (!nhlt_soc_add_max98357(nhlt, AUDIO_LINK_SSP1))
46 printk(BIOS_ERR, "Added Maxim_98357 codec.\n");
47 }
48
49 if (IS_ENABLED(CONFIG_INCLUDE_SND_MAX98373_NHLT) &&
50 !nhlt_soc_add_max98373(nhlt, AUDIO_LINK_SSP1))
51 printk(BIOS_ERR, "Added Maxim_98373 codec.\n");
52}