devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Viswanath L <viswanathl@nvidia.com>
To: Mark Brown <broonie@kernel.org>, Sameer Pujar <spujar@nvidia.com>
Cc: <perex@perex.cz>, <tiwai@suse.com>, <robh+dt@kernel.org>,
	<lgirdwood@gmail.com>, <thierry.reding@gmail.com>,
	<jonathanh@nvidia.com>, <digetx@gmail.com>,
	<alsa-devel@alsa-project.org>, <devicetree@vger.kernel.org>,
	<linux-tegra@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<sharadg@nvidia.com>, <mkumard@nvidia.com>,
	<rlokhande@nvidia.com>, <dramesh@nvidia.com>,
	<atalambedu@nvidia.com>
Subject: Re: Re: [PATCH v3 03/10] ASoC: tegra: add Tegra210 based DMIC driver
Date: Fri, 28 Feb 2020 13:00:23 +0530	[thread overview]
Message-ID: <1e450c5c-ea8a-1310-38d6-7f8f26c4cab0@nvidia.com> (raw)
In-Reply-To: <20200221130005.GD5546@sirena.org.uk>


On 2/21/2020 6:30 PM, Mark Brown wrote:
> On Thu, Feb 20, 2020 at 12:04:45PM +0530, Sameer Pujar wrote:
>
>> +++ b/sound/soc/tegra/tegra210_dmic.c
>> @@ -0,0 +1,515 @@
>> +// SPDX-License-Identifier: GPL-2.0-only
>> +/*
>> + * tegra210_dmic.c - Tegra210 DMIC driver
>> + *
>> + * Copyright (c) 2020 NVIDIA CORPORATION.  All rights reserved.
> Please make the entire comment a C++ one so things look more
> intentional.
>
>> +	/* Below enables all filters - DCR, LP and SC */
>> +	{ TEGRA210_DMIC_DBG_CTRL, 0xe },
> So this isn't the hardware default?
No, the HW default is 0x2. Also, we are repurposing the LP filter for 
applying gain.
>
>> +	srate = params_rate(params);
>> +	if (dmic->srate_override)
>> +		srate = dmic->srate_override;
> How does this work for userspace?  If we just ignore the sample rate we
> were asked for I'd expect that the application would get upset.
>
>> +	if (strstr(kcontrol->id.name, "Boost Gain"))
>> +		dmic->boost_gain = value;
> Volume controls should end in "Volume".
>
>> +	else if (strstr(kcontrol->id.name, "Audio Channels"))
>> +		dmic->audio_ch_override = value;
> This is something that would usually come from hw_params?
Yes, hw_params is where it is taken from. The additional override is 
optional and would not usually need to be set by user. However, we have 
certain other modules, like multiplexer and demultiplexer (proposed to 
be upstreamed in the near future), where no. of channels get changed at 
the output. When one or more such modules are connected in the path, 
hw_params does not reflect the channels post multiplex/demultiplex, 
hence this override would be needed.
>
>> +	else if (strstr(kcontrol->id.name, "LR Polarity Select"))
>> +		dmic->lrsel = value;
> This and some of the others look like they're describing details of how
> the board is wired up so I'd not expect them to be runtime selectable?
No, these are not board wiring. OSR, polarity, etc. are configurable 
within the DMIC (within Tegra). Of course, these controls are optional 
and the default works just fine. Also, to clarify here, 'runtime 
selectable' does not mean these parameters can be modified while a 
recording session is in progress. These parameters (optional) need to 
set up before a session is started. User can close the recording, 
reconfigure the parameters, then start a new session, without needing 
reboot.
>
>> +	SND_SOC_DAPM_MIC("Dummy Input", NULL),
> This is just the microphone that happens to be attached, isn't it?  If
> so that's a weird name.
It is not necessary for an actual mic to be connected to the pin. 
Recording will work even when the pin is left open, capture being 
silence. All the drivers, whether for playback or for capture, work OK 
even without any physical end-point, hence the "dummy" I/O.
>
>> +static const char * const tegra210_dmic_mono_conv_text[] = {
>> +	"ZERO", "COPY",
>> +};
> It'd be more idiomatic for ALSA to write these as Zero and Copy.
>
>> +	SOC_ENUM_EXT("Channel Select", tegra210_dmic_ch_enum,
>> +		     tegra210_dmic_get_control, tegra210_dmic_put_control),
>> +	SOC_ENUM_EXT("Mono To Stereo",
>> +		     tegra210_dmic_mono_conv_enum, tegra210_dmic_get_control,
>> +		     tegra210_dmic_put_control),
>> +	SOC_ENUM_EXT("Stereo To Mono",
>> +		     tegra210_dmic_stereo_conv_enum, tegra210_dmic_get_control,
>> +		     tegra210_dmic_put_control),
> I'd expect these to be in DAPM.
These are finer controls and I would guess are outside what can be 
described by DAPM. E.g. - say the user wants mono capture, but the board 
has stereo mics connected. Default configuration is that the Left 
channel would be propagated. The stereo_to_mono option offers additional 
control - to select the Right channel, or mix L and R into one. As 
mentioned earlier, much of the controls here are not necessary to be set 
for a basic use case to work. These are advanced settings.

  parent reply	other threads:[~2020-02-28  7:30 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-20  6:34 [PATCH v3 00/10] add ASoC components for AHUB Sameer Pujar
2020-02-20  6:34 ` [PATCH v3 01/10] dt-bindings: sound: tegra: add DT binding " Sameer Pujar
2020-02-21 12:39   ` Mark Brown
2020-02-26 16:02   ` Rob Herring
2020-02-20  6:34 ` [PATCH v3 02/10] ASoC: tegra: add support for CIF programming Sameer Pujar
2020-02-20 14:30   ` Jon Hunter
2020-02-21  5:27   ` Dmitry Osipenko
2020-02-20  6:34 ` [PATCH v3 03/10] ASoC: tegra: add Tegra210 based DMIC driver Sameer Pujar
2020-02-20 14:36   ` Jon Hunter
2020-02-21  5:53   ` Dmitry Osipenko
2020-02-21 13:00   ` Mark Brown
2020-02-21 14:31     ` Jon Hunter
2020-02-21 16:55       ` Mark Brown
2020-02-24 11:28         ` Jon Hunter
2020-02-24 11:44           ` Mark Brown
2020-02-24 12:29             ` Sameer Pujar
2020-02-24 13:18               ` Mark Brown
2020-02-28  7:30     ` Viswanath L [this message]
2020-02-20  6:34 ` [PATCH v3 04/10] ASoC: tegra: add Tegra210 based I2S driver Sameer Pujar
2020-02-20 14:45   ` Jon Hunter
2020-02-21 13:21   ` Mark Brown
2020-02-20  6:34 ` [PATCH v3 05/10] ASoC: tegra: add Tegra210 based AHUB driver Sameer Pujar
2020-02-20  6:51   ` Randy Dunlap
2020-02-20 15:08   ` Jon Hunter
2020-02-21 13:38   ` Mark Brown
2020-02-20  6:34 ` [PATCH v3 06/10] ASoC: tegra: add Tegra186 based DSPK driver Sameer Pujar
2020-02-20  6:53   ` Randy Dunlap
2020-02-20 15:10   ` Jon Hunter
2020-02-20  6:34 ` [PATCH v3 07/10] ASoC: tegra: add Tegra210 based ADMAIF driver Sameer Pujar
2020-02-20  6:55   ` Randy Dunlap
2020-02-20 15:16   ` Jon Hunter
2020-02-21  6:08   ` Dmitry Osipenko
2020-02-20  6:34 ` [PATCH v3 08/10] arm64: tegra: add AHUB components for few Tegra chips Sameer Pujar
2020-02-20 14:49   ` Jon Hunter
2020-02-20  6:34 ` [PATCH v3 09/10] arm64: tegra: enable AHUB modules " Sameer Pujar
2020-02-20 14:52   ` Jon Hunter
2020-02-20  6:34 ` [PATCH v3 10/10] arm64: defconfig: enable AHUB components for Tegra210 and later Sameer Pujar
2020-02-20 14:52   ` Jon Hunter
2020-02-21  5:44   ` Dmitry Osipenko

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=1e450c5c-ea8a-1310-38d6-7f8f26c4cab0@nvidia.com \
    --to=viswanathl@nvidia.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=atalambedu@nvidia.com \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=digetx@gmail.com \
    --cc=dramesh@nvidia.com \
    --cc=jonathanh@nvidia.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=mkumard@nvidia.com \
    --cc=perex@perex.cz \
    --cc=rlokhande@nvidia.com \
    --cc=robh+dt@kernel.org \
    --cc=sharadg@nvidia.com \
    --cc=spujar@nvidia.com \
    --cc=thierry.reding@gmail.com \
    --cc=tiwai@suse.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).