Skip to content

Commit 55f5a2e

Browse files
committed
ASoC: Intel: skl_hda_dsp_generic: add dmic support on hda platform
Add dmic dai links according to the dmic number set in acpi Signed-off-by: Rander Wang <rander.wang@linux.intel.com>
1 parent e5a2af1 commit 55f5a2e

File tree

3 files changed

+44
-3
lines changed

3 files changed

+44
-3
lines changed

sound/soc/intel/boards/skl_hda_dsp_common.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,28 @@ struct snd_soc_dai_link skl_hda_be_dai_links[HDA_DSP_MAX_BE_DAI_LINKS] = {
9393
.init = NULL,
9494
.no_pcm = 1,
9595
},
96+
{
97+
.name = "dmic01",
98+
.id = 6,
99+
.cpu_dai_name = "DMIC01 Pin",
100+
.codec_name = "dmic-codec",
101+
.codec_dai_name = "dmic-hifi",
102+
.platform_name = "0000:00:1f.3",
103+
.dpcm_capture = 1,
104+
.init = NULL,
105+
.no_pcm = 1,
106+
},
107+
{
108+
.name = "dmic02",
109+
.id = 7,
110+
.cpu_dai_name = "DMIC16k Pin",
111+
.codec_name = "dmic-codec",
112+
.codec_dai_name = "dmic-hifi",
113+
.platform_name = "0000:00:1f.3",
114+
.dpcm_capture = 1,
115+
.init = NULL,
116+
.no_pcm = 1,
117+
},
96118
};
97119

98120
int skl_hda_hdmi_jack_init(struct snd_soc_card *card)

sound/soc/intel/boards/skl_hda_dsp_common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include <sound/core.h>
1616
#include <sound/jack.h>
1717

18-
#define HDA_DSP_MAX_BE_DAI_LINKS 5
18+
#define HDA_DSP_MAX_BE_DAI_LINKS 7
1919

2020
struct skl_hda_hdmi_pcm {
2121
struct list_head head;

sound/soc/intel/boards/skl_hda_dsp_generic.c

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@ static struct snd_soc_card hda_soc_card = {
9797
};
9898

9999
#define IDISP_DAI_COUNT 3
100+
#define HDAC_DAI_COUNT 2
101+
#define DMIC_DAI_COUNT 2
102+
100103
/* there are two routes per iDisp output */
101104
#define IDISP_ROUTE_COUNT (IDISP_DAI_COUNT * 2)
102105
#define IDISP_CODEC_MASK 0x4
@@ -114,9 +117,25 @@ static int skl_hda_fill_card_info(struct snd_soc_acpi_mach_params *mach_params)
114117
if (codec_count == 1 && codec_mask & IDISP_CODEC_MASK) {
115118
num_links = IDISP_DAI_COUNT;
116119
num_route = IDISP_ROUTE_COUNT;
120+
121+
num_links += DMIC_DAI_COUNT;
122+
123+
/*
124+
* rearrange the dai link array and make the
125+
* dmic dai links follow idsp dai links for only
126+
* num_links of dai links would be registered
127+
* to ASoC.
128+
*/
129+
for (i = 0; i < DMIC_DAI_COUNT; i++) {
130+
skl_hda_be_dai_links[IDISP_DAI_COUNT + i] =
131+
skl_hda_be_dai_links[IDISP_DAI_COUNT +
132+
HDAC_DAI_COUNT + i];
133+
}
117134
} else if (codec_count == 2 && codec_mask & IDISP_CODEC_MASK) {
118-
num_links = ARRAY_SIZE(skl_hda_be_dai_links);
119-
num_route = ARRAY_SIZE(skl_hda_map),
135+
num_links = IDISP_DAI_COUNT + HDAC_DAI_COUNT +
136+
DMIC_DAI_COUNT;
137+
num_route = ARRAY_SIZE(skl_hda_map);
138+
120139
card->dapm_widgets = skl_hda_widgets;
121140
card->num_dapm_widgets = ARRAY_SIZE(skl_hda_widgets);
122141
} else {

0 commit comments

Comments
 (0)