All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Hui Wang <hui.wang@canonical.com>,
	Curtis Malainey <cujomalainey@google.com>,
	alsa-devel@alsa-project.org, broonie@kernel.org,
	Daniel Drake <drake@endlessm.com>
Subject: Re: [PATCH 6/6] ALSA: hda/intel: stop probe if DMICS are detected on Skylake+ platforms
Date: Fri, 19 Jul 2019 20:55:30 +0200	[thread overview]
Message-ID: <s5hh87hzwf1.wl-tiwai@suse.de> (raw)
In-Reply-To: <6bc24e2a-596b-83f4-d022-5f630657c3a1@linux.intel.com>

On Fri, 19 Jul 2019 20:29:10 +0200,
Pierre-Louis Bossart wrote:
> 
> 
> >> @@ -2055,6 +2078,17 @@ static int azx_probe(struct pci_dev *pci,
> >>   	card->private_data = chip;
> >>   	hda = container_of(chip, struct hda_intel, chip);
> >>   +	/*
> >> +	 * stop probe if digital microphones detected on Skylake+ platform
> >> +	 * with the DSP enabled. This is an opt-in behavior defined at build
> >> +	 * time or at run-time with a module parameter
> >> +	 */
> >> +	if (IS_ENABLED(CONFIG_SND_HDA_INTEL_DETECT_DMIC) || dmic_detect >= 0) {
> >
> > Isn't it "dmic_detect != 0" ?  Otherwise passing dmic_detect=0 would
> > be treated as positive here.
> 
> Ah, good catch. I literally copied the enable_msi example here, which
> relies on >= 0.
> 
> 	if (enable_msi >= 0) {
> 		chip->msi = !!enable_msi;
> 		return;
> 	}
> 
> Not sure what the intention was here.

The MSI-enablement depends on the platform.  enable_msi >=0 means that
user passed module option explicitly so we follow that.  Otherwise,
let the system chooses whether to enable MSI or not.

> Using dmic_detect != 0 wouldn't work for the default -1 value,
> maybe dmic_detect > 0 is probably a better solution?

In your case, the logic doesn't look like the dynamically platform
dependent, so it should be simpler as below:

static bool dmic_detect = IS_ENABLED(CONFIG_SND_HDA_INTEL_DETECT_DMIC);
module_param(dmic_detect, bool, 0444);

and evaluate it

	if (dmic_detect) {
		ret = azx_check_dmic();
		....
		
That is, if Kconfig is set, it's per default enabled, but user can
still turn it off via option.  Otherwise user needs to enable it via
option.


Takashi

  reply	other threads:[~2019-07-19 18:55 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-19 17:06 [PATCH 0/6] ALSA/HDA: abort probe when DMICs are detected Pierre-Louis Bossart
2019-07-19 17:06 ` [PATCH 1/6] ASoC: Intel: Skylake: move NHLT header to common directory Pierre-Louis Bossart
2019-07-19 17:06 ` [PATCH 2/6] ALSA: hda: move parts of NHLT code to new module Pierre-Louis Bossart
2019-07-19 17:06 ` [PATCH 3/6] ALSA: hda: intel-nhlt: remove useless OR operation Pierre-Louis Bossart
2019-07-19 18:09   ` Takashi Iwai
2019-07-19 18:20     ` Pierre-Louis Bossart
2019-07-19 18:30       ` Takashi Iwai
2019-07-19 17:06 ` [PATCH 4/6] ALSA: hda: intel-nhlt: handle NHLT VENDOR_DEFINED DMIC geometry Pierre-Louis Bossart
2019-07-19 17:06 ` [PATCH 5/6] ASoC: Intel: Skylake: use common NHLT module Pierre-Louis Bossart
2019-07-19 17:06 ` [PATCH 6/6] ALSA: hda/intel: stop probe if DMICS are detected on Skylake+ platforms Pierre-Louis Bossart
2019-07-19 18:13   ` Takashi Iwai
2019-07-19 18:29     ` Pierre-Louis Bossart
2019-07-19 18:55       ` Takashi Iwai [this message]
2019-07-19 20:21         ` Pierre-Louis Bossart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5hh87hzwf1.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=cujomalainey@google.com \
    --cc=drake@endlessm.com \
    --cc=hui.wang@canonical.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.