Re: [PATCH] ASoC: intel/skl/hda - export number of digital microphones via control components

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 11/26/19 4:34 AM, Jaroslav Kysela wrote:
It is required for the auto-detection in the user space (for UCM).

Signed-off-by: Jaroslav Kysela <perex@xxxxxxxx>
Cc: Pierre-Louis Bossart <pierre-louis.bossart@xxxxxxxxxxxxxxx>
Cc: Mark Brown <broonie@xxxxxxxxxx>

Thanks Jaroslav.
The changes are fine, but the code changes in hda.c will conflict with the cleanups done by Ranjani (which I was planning to send next week).

Any objections if we take this patch into the SOF tree (without changes to authorship) and provide it on alsa-devel next week with the cleanups, so that we don't have any conflicts?

---
  sound/soc/intel/boards/skl_hda_dsp_generic.c | 8 ++++++++
  sound/soc/sof/intel/hda.c                    | 3 ++-
  2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/sound/soc/intel/boards/skl_hda_dsp_generic.c b/sound/soc/intel/boards/skl_hda_dsp_generic.c
index 4e45901e3a2f..11eaee9ae41f 100644
--- a/sound/soc/intel/boards/skl_hda_dsp_generic.c
+++ b/sound/soc/intel/boards/skl_hda_dsp_generic.c
@@ -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);
  }
diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c
index 7dc0018dc4c3..92fffca76af5 100644
--- a/sound/soc/sof/intel/hda.c
+++ b/sound/soc/sof/intel/hda.c
@@ -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
@@ -465,6 +465,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 */

_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux