]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
ASoC: intel/skl/hda - export number of digital microphones via control components
authorJaroslav Kysela <perex@perex.cz>
Wed, 4 Dec 2019 21:15:44 +0000 (15:15 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Mar 2020 06:18:22 +0000 (07:18 +0100)
[ Upstream commit 8cd9956f61c65022209ce6d1e55ed12aea12357d ]

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

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20191204211556.12671-2-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
sound/soc/intel/boards/skl_hda_dsp_generic.c
sound/soc/sof/intel/hda.c

index 4e45901e3a2f1afa19997fda757989292a43f57b..11eaee9ae41f72ce4354b8d7a676b05c8e0eb05b 100644 (file)
@@ -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
@@ -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);
 }
 
index 82ecadda886c6f7d4a71a2d5b1e61b7616f9bc36..a1780259292fa871f193c8f2f43fa31060bf4b53 100644 (file)
@@ -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
@@ -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 */