Skip to content

Commit

Permalink
ASoC: intel/skl/hda - export number of digital microphones via contro…
Browse files Browse the repository at this point in the history
…l components

It is required for the auto-detection in the user space (for UCM).

Signed-off-by: Jaroslav Kysela <[email protected]>
Signed-off-by: Pierre-Louis Bossart <[email protected]>
Cc: Mark Brown <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
perexg authored and broonie committed Dec 9, 2019
1 parent 1442842 commit 8cd9956
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions sound/soc/intel/boards/skl_hda_dsp_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ static struct snd_soc_card hda_soc_card = {
.late_probe = skl_hda_card_late_probe,
};

static char hda_soc_components[30];

#define IDISP_DAI_COUNT 3
#define HDAC_DAI_COUNT 2
#define DMIC_DAI_COUNT 2
Expand Down Expand Up @@ -183,6 +185,12 @@ static int skl_hda_audio_probe(struct platform_device *pdev)
hda_soc_card.dev = &pdev->dev;
snd_soc_card_set_drvdata(&hda_soc_card, ctx);

if (mach->mach_params.dmic_num > 0) {
snprintf(hda_soc_components, sizeof(hda_soc_components),
"cfg-dmics:%d", mach->mach_params.dmic_num);
hda_soc_card.components = hda_soc_components;
}

return devm_snd_soc_register_card(&pdev->dev, &hda_soc_card);
}

Expand Down
3 changes: 2 additions & 1 deletion sound/soc/sof/intel/hda.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ static int hda_init_caps(struct snd_sof_dev *sdev)
const char *tplg_filename;
const char *idisp_str;
const char *dmic_str;
int dmic_num;
int dmic_num = 0;
int codec_num = 0;
int i;
#endif
Expand Down Expand Up @@ -472,6 +472,7 @@ static int hda_init_caps(struct snd_sof_dev *sdev)
mach_params->codec_mask = bus->codec_mask;
mach_params->platform = dev_name(sdev->dev);
mach_params->common_hdmi_codec_drv = hda_codec_use_common_hdmi;
mach_params->dmic_num = dmic_num;
}

/* create codec instances */
Expand Down

0 comments on commit 8cd9956

Please sign in to comment.