Skip to content

Commit 042096d

Browse files
committed
ASoC: Intel: sof_sdw: warn both sdw and pch dmic are used
Typically, SoundWire MIC and PCH DMIC will not coexist. However, we may want to use both of them in some special cases. Add a warning to let users know that SoundWire MIC and PCH DMIC are both present and they could overwrite it with kernel params. Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
1 parent df94eb1 commit 042096d

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

sound/soc/intel/boards/sof_sdw.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,6 +1107,7 @@ static int sof_card_dai_links_create(struct snd_soc_card *card)
11071107
struct snd_soc_codec_conf *codec_conf;
11081108
struct asoc_sdw_codec_info *ssp_info;
11091109
struct asoc_sdw_endpoint *sof_ends;
1110+
struct asoc_sdw_endpoint *sof_end;
11101111
struct asoc_sdw_dailink *sof_dais;
11111112
int num_devs = 0;
11121113
int num_ends = 0;
@@ -1116,6 +1117,7 @@ static int sof_card_dai_links_create(struct snd_soc_card *card)
11161117
int hdmi_num;
11171118
unsigned long ssp_mask;
11181119
int ret;
1120+
int i;
11191121

11201122
ret = asoc_sdw_count_sdw_endpoints(card, &num_devs, &num_ends);
11211123
if (ret < 0) {
@@ -1180,6 +1182,18 @@ static int sof_card_dai_links_create(struct snd_soc_card *card)
11801182
mach_params->dmic_num = DMIC_DEFAULT_CHANNELS;
11811183
}
11821184

1185+
if (dmic_num > 0) {
1186+
sof_end = sof_ends;
1187+
for (i = 0; i < num_ends; i++) {
1188+
if (sof_end->dai_info->dai_type == SOC_SDW_DAI_TYPE_MIC) {
1189+
dev_warn(dev,
1190+
"Both SDW DMIC and PCH DMIC are present, if incorrect, please override with kernel params\n");
1191+
break;
1192+
}
1193+
sof_end++;
1194+
}
1195+
}
1196+
11831197
if (sof_sdw_quirk & SOF_SSP_BT_OFFLOAD_PRESENT)
11841198
bt_num = 1;
11851199

0 commit comments

Comments
 (0)