Skip to content

Commit 5f8f2d0

Browse files
bardliaoranj063
authored andcommitted
ASoC: Intel: sof_sdw: correct mach_params->dmic_num
mach_params->dmic_num will be used to set the cfg-mics value of card->components string which should be the dmic channels. However dmic_num is dmic link number and could be set due to the SOC_SDW_PCH_DMIC quirk. Set mach_params->dmic_num to the default value if the dmic link is created due to the SOC_SDW_PCH_DMIC quirk. Fixes: 7db9f63 ("ASoC: Intel: sof_sdw: overwrite mach_params->dmic_num") Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
1 parent b0dc371 commit 5f8f2d0

1 file changed

Lines changed: 14 additions & 10 deletions

File tree

sound/soc/intel/boards/sof_sdw.c

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ static int quirk_override = -1;
2222
module_param_named(quirk, quirk_override, int, 0444);
2323
MODULE_PARM_DESC(quirk, "Board-specific quirk override");
2424

25+
#define DMIC_DEFAULT_CHANNELS 2
26+
2527
static void log_quirks(struct device *dev)
2628
{
2729
if (SOC_SDW_JACK_JDSRC(sof_sdw_quirk))
@@ -1133,17 +1135,19 @@ static int sof_card_dai_links_create(struct snd_soc_card *card)
11331135
hdmi_num = SOF_PRE_TGL_HDMI_COUNT;
11341136

11351137
/* enable dmic01 & dmic16k */
1136-
if (sof_sdw_quirk & SOC_SDW_PCH_DMIC || mach_params->dmic_num) {
1137-
if (ctx->ignore_internal_dmic)
1138-
dev_warn(dev, "Ignoring PCH DMIC\n");
1139-
else
1140-
dmic_num = 2;
1138+
if (ctx->ignore_internal_dmic) {
1139+
dev_warn(dev, "Ignoring internal DMIC\n");
1140+
mach_params->dmic_num = 0;
1141+
} else if (mach_params->dmic_num) {
1142+
dmic_num = 2;
1143+
} else if (sof_sdw_quirk & SOC_SDW_PCH_DMIC) {
1144+
dmic_num = 2;
1145+
/*
1146+
* mach_params->dmic_num will be used to set the cfg-mics value of
1147+
* card->components string. Set it to the default value.
1148+
*/
1149+
mach_params->dmic_num = DMIC_DEFAULT_CHANNELS;
11411150
}
1142-
/*
1143-
* mach_params->dmic_num will be used to set the cfg-mics value of card->components
1144-
* string. Overwrite it to the actual number of PCH DMICs used in the device.
1145-
*/
1146-
mach_params->dmic_num = dmic_num;
11471151

11481152
if (sof_sdw_quirk & SOF_SSP_BT_OFFLOAD_PRESENT)
11491153
bt_num = 1;

0 commit comments

Comments
 (0)