diff mbox series

[14/14] ASoC: SOF: Intel: hda: add dev_dbg() when DMIC number is overridden

Message ID 20210204203312.27112-15-pierre-louis.bossart@linux.intel.com
State Accepted
Commit 026370cb5bd7ef7999bc4379ab89ffd7a73874f2
Headers show
Series ASoC: SOF/Intel/SoundWire: add missing quirks and DMIC support | expand

Commit Message

Pierre-Louis Bossart Feb. 4, 2021, 8:33 p.m. UTC
It's useful for debug and system integration to show cases where we
ignore the number of microphones reported by NHLT.

Suggested-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@intel.com>
Reviewed-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
---
 sound/soc/sof/intel/hda.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Mark Brown Feb. 5, 2021, 3:33 p.m. UTC | #1
On Thu, Feb 04, 2021 at 02:33:12PM -0600, Pierre-Louis Bossart wrote:

>  	/* allow for module parameter override */
> -	if (hda_dmic_num != -1)
> +	if (hda_dmic_num != -1) {

This is breaking in an x86 allmodconfig build due to:

/mnt/kernel/sound/soc/sof/intel/hda.c: In function 'dmic_topology_fixup':
/mnt/kernel/sound/soc/sof/intel/hda.c:615:6: error: 'hda_dmic_num' undeclared (first use in this function); did you mean 'dmic_num'?
  if (hda_dmic_num != -1) {
      ^~~~~~~~~~~~
      dmic_num
/mnt/kernel/sound/soc/sof/intel/hda.c:615:6: note: each undeclared identifier is reported only once for each function it appears in

which will actually be triggered by one of the earlier patches in the
series (my script is going through things in reverse order), that
variable is only defined for CONFIG_SOC_SOF_HDA.
Pierre-Louis Bossart Feb. 5, 2021, 3:47 p.m. UTC | #2
On 2/5/21 9:33 AM, Mark Brown wrote:
> On Thu, Feb 04, 2021 at 02:33:12PM -0600, Pierre-Louis Bossart wrote:
> 
>>   	/* allow for module parameter override */
>> -	if (hda_dmic_num != -1)
>> +	if (hda_dmic_num != -1) {
> 
> This is breaking in an x86 allmodconfig build due to:
> 
> /mnt/kernel/sound/soc/sof/intel/hda.c: In function 'dmic_topology_fixup':
> /mnt/kernel/sound/soc/sof/intel/hda.c:615:6: error: 'hda_dmic_num' undeclared (first use in this function); did you mean 'dmic_num'?
>    if (hda_dmic_num != -1) {
>        ^~~~~~~~~~~~
>        dmic_num
> /mnt/kernel/sound/soc/sof/intel/hda.c:615:6: note: each undeclared identifier is reported only once for each function it appears in
> 
> which will actually be triggered by one of the earlier patches in the
> series (my script is going through things in reverse order), that
> variable is only defined for CONFIG_SOC_SOF_HDA.

That's not good. Please drop this patch for now, it's nice-to-have and 
not critical.

I'll have to figure out why this wasn't reported earlier.
Mark Brown Feb. 5, 2021, 3:51 p.m. UTC | #3
On Fri, Feb 05, 2021 at 09:47:39AM -0600, Pierre-Louis Bossart wrote:
> On 2/5/21 9:33 AM, Mark Brown wrote:
> > On Thu, Feb 04, 2021 at 02:33:12PM -0600, Pierre-Louis Bossart wrote:

> > This is breaking in an x86 allmodconfig build due to:

> > which will actually be triggered by one of the earlier patches in the
> > series (my script is going through things in reverse order), that
> > variable is only defined for CONFIG_SOC_SOF_HDA.

> That's not good. Please drop this patch for now, it's nice-to-have and not
> critical.

> I'll have to figure out why this wasn't reported earlier.

Like I say it's not that patch that's causing the break, I didn't walk
through and work out which one was - the patch isn't actually adding the
usage or anything.
Pierre-Louis Bossart Feb. 5, 2021, 4:38 p.m. UTC | #4
> Like I say it's not that patch that's causing the break, I didn't walk
> through and work out which one was - the patch isn't actually adding the
> usage or anything.

Ah yes, you're correct. Mea culpa. We're using the parameter for HDA and 
SoundWire now, but HDA is disabled with allmodconfig due to a mutual 
exclusion with NOCODEC. I've had this on my todo list for a while.

We need something like this, will test and resend a v2. Sorry about the 
noise.

diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c
index 2014058bddf2..0dc3a8c0f5e3 100644
--- a/sound/soc/sof/intel/hda.c
+++ b/sound/soc/sof/intel/hda.c
@@ -285,11 +285,13 @@ static char *hda_model;
  module_param(hda_model, charp, 0444);
  MODULE_PARM_DESC(hda_model, "Use the given HDA board model.");

-#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA)
+#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA) || 
IS_ENABLED(CONFIG_SND_SOC_SOF_INTEL_SOUNDWIRE)
  static int hda_dmic_num = -1;
  module_param_named(dmic_num, hda_dmic_num, int, 0444);
  MODULE_PARM_DESC(dmic_num, "SOF HDA DMIC number");
+#endif

+#if IS_ENABLED(CONFIG_SND_SOC_SOF_HDA)
  static bool hda_codec_use_common_hdmi = 
IS_ENABLED(CONFIG_SND_HDA_CODEC_HDMI);
  module_param_named(use_common_hdmi, hda_codec_use_common_hdmi, bool, 
0444);
  MODULE_PARM_DESC(use_common_hdmi, "SOF HDA use common HDMI codec driver");
Mark Brown Feb. 5, 2021, 4:52 p.m. UTC | #5
On Fri, Feb 05, 2021 at 10:38:54AM -0600, Pierre-Louis Bossart wrote:

> > Like I say it's not that patch that's causing the break, I didn't walk
> > through and work out which one was - the patch isn't actually adding the
> > usage or anything.

> Ah yes, you're correct. Mea culpa. We're using the parameter for HDA and
> SoundWire now, but HDA is disabled with allmodconfig due to a mutual
> exclusion with NOCODEC. I've had this on my todo list for a while.

> We need something like this, will test and resend a v2. Sorry about the
> noise.

Yeah, that looks like it should do the job.
diff mbox series

Patch

diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c
index a61eb7afd364..5926d23da9ae 100644
--- a/sound/soc/sof/intel/hda.c
+++ b/sound/soc/sof/intel/hda.c
@@ -612,8 +612,12 @@  static int dmic_topology_fixup(struct snd_sof_dev *sdev,
 	dmic_num = check_nhlt_dmic(sdev);
 
 	/* allow for module parameter override */
-	if (hda_dmic_num != -1)
+	if (hda_dmic_num != -1) {
+		dev_dbg(sdev->dev,
+			"overriding DMICs detected in NHLT tables %d by kernel param %d\n",
+			dmic_num, hda_dmic_num);
 		dmic_num = hda_dmic_num;
+	}
 
 	switch (dmic_num) {
 	case 1: