Skip to content

Commit

Permalink
ASoC: SOF: intel: hda: support also devices with 1 and 3 dmics
Browse files Browse the repository at this point in the history
Currently the dmic check code supports only devices with 2 or 4 dmics.
With other dmic counts the function will return 0. Lately we've seen
devices with only 1 dmic thus enable also configurations with 1, and
possibly 3, dmics. Add also topology postfix -1ch and -3ch for new dmic
configuration.

Signed-off-by: Jaska Uimonen <[email protected]>
Reviewed-by: Pierre-Louis Bossart <[email protected]>
Signed-off-by: Ranjani Sridharan <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
Jaska Uimonen authored and broonie committed Aug 26, 2020
1 parent 6c63c95 commit 3dca35e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion sound/soc/sof/intel/hda.c
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ static int check_nhlt_dmic(struct snd_sof_dev *sdev)
if (nhlt) {
dmic_num = intel_nhlt_get_dmic_geo(sdev->dev, nhlt);
intel_nhlt_free(nhlt);
if (dmic_num == 2 || dmic_num == 4)
if (dmic_num >= 1 && dmic_num <= 4)
return dmic_num;
}

Expand Down Expand Up @@ -992,9 +992,15 @@ static int hda_generic_machine_select(struct snd_sof_dev *sdev)
dmic_num = hda_dmic_num;

switch (dmic_num) {
case 1:
dmic_str = "-1ch";
break;
case 2:
dmic_str = "-2ch";
break;
case 3:
dmic_str = "-3ch";
break;
case 4:
dmic_str = "-4ch";
break;
Expand Down

0 comments on commit 3dca35e

Please sign in to comment.