All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Ricard Wanderlof <ricardw@axis.com>
Cc: alsa-devel <alsa-devel@alsa-project.org>,
	Liam Girdwood <lgirdwood@gmail.com>
Subject: Re: [PATCH 2/2] ASoC: codec: tlv320adc3xxx: New codec driver
Date: Mon, 4 Oct 2021 17:42:33 +0100	[thread overview]
Message-ID: <YVsu+QMjOQz8pAzY@sirena.org.uk> (raw)
In-Reply-To: <alpine.DEB.2.21.2110041716190.14472@lnxricardw1.se.axis.com>

[-- Attachment #1: Type: text/plain, Size: 3176 bytes --]

On Mon, Oct 04, 2021 at 06:21:10PM +0200, Ricard Wanderlof wrote:
> On Mon, 4 Oct 2021, Mark Brown wrote:
> > On Mon, Oct 04, 2021 at 11:19:21AM +0200, Ricard Wanderlof wrote:

> > > +++ b/sound/soc/codecs/tlv320adc3xxx.c
> > > @@ -0,0 +1,1239 @@
> > > +// SPDX-License-Identifier: GPL-2.0
> > > +/*
> > > + * Based on sound/soc/codecs/tlv320aic3x.c by  Vladimir Barinov

> > Please make the entire comment a C++ one so things look more
> > intentional.

> Ok, I'll change this. I was trying to follow the style of existing 
> drivers, as the majority seem to have C style header comments even though 
> the SPDX line uses C++. I'm now guessing this is for legacy reasons 
> (minimizing changes in existing drivers when the SPDX line was added)?

A lot of SPDX stuff was done mechanically.

> > > +static bool adc3xxx_volatile_reg(struct device *dev, unsigned int reg)
> > > +{
> > > +	switch (reg) {
> > > +	case PAGE_SELECT: /* required by regmap implementation */

> > This is not required by regmap.

> Ok, I'll remove it. The regmap code was taken from tlv320aic3x.c which has 
> a similar paging structure, but I see now that other drivers don't have 
> this, so I guess it's not necessary for tlv320aic3x.c either and is there 
> either erroneously or because it once was necessary?

It's probably an error in either the description of the pages or just
the driver.

> > > +static const char * const micbias_voltage[] = { "off", "2V", "2.5V", 
> > > "AVDD" };

> > This should be configured in the DT, it's going to be a property of the
> > electrical design of the system.

> I can very well imagine that this something that should be runtime 
> userspace configurable. In fact where I work we have had products where 
> the bias voltage (for an externally connected microphone) could be 
> configured by the end user, (although not for this specific driver quite 
> honestly, we have had the need for hardware engineers to change it runtime 
> during circuit verification though).

> Would it be ok to have this configurable both in the DT as well as using a 
> control? Or should it be implemented in another way, such as a number of 
> pre set voltages that are selected between using a control?

It seems like a lot less work to just not have the runtime control and
let someone who needs it figure out how to represent it to userspace.
Something that's basically a backdoor for validation doesn't seem
persuasive, validation often wants to do things we actively wish to
prevent at runtime.

> > > +static const struct snd_kcontrol_new adc3xxx_snd_controls[] = {
> > > +	SOC_DOUBLE_R_TLV("PGA Gain Volume", LEFT_APGA_CTRL, RIGHT_APGA_CTRL,
> > > +			 0, 80, 0, pga_tlv),

> > s/Gain //

> But this would mean that the resulting control will be exposed as 
> "PGA" when viewed in amixer as an scontrol which seems less than intutive, 
> but perhaps there's nothing that can be done about that (other than 
> perhaps expanding PGA to Programmable Gain Amplifier perhaps)?

The TLV information should mean that UIs can figure out to represent it
as a volume control which should be clear enough.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2021-10-04 16:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-04  9:19 [PATCH 2/2] ASoC: codec: tlv320adc3xxx: New codec driver Ricard Wanderlof
2021-10-04 13:40 ` Mark Brown
2021-10-04 16:21   ` Ricard Wanderlof
2021-10-04 16:42     ` Mark Brown [this message]
2021-10-06 12:03       ` Ricard Wanderlof
2021-10-25 16:01       ` Ricard Wanderlof
2021-10-25 16:11         ` Mark Brown
2021-10-26  6:54           ` Ricard Wanderlof
2021-10-26 10:43             ` Mark Brown

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=YVsu+QMjOQz8pAzY@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=lgirdwood@gmail.com \
    --cc=ricardw@axis.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.