From: Takashi Iwai <tiwai@suse.de>
To: Mark Brown <broonie@kernel.org>
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
Johan Hovold <johan@kernel.org>,
perex@perex.cz, tiwai@suse.com, lgirdwood@gmail.com,
ckeepax@opensource.cirrus.com, kuninori.morimoto.gx@renesas.com,
linux-kernel@vger.kernel.org,
pierre-louis.bossart@linux.intel.com,
alsa-devel@alsa-project.org
Subject: Re: [PATCH] ASoC: codecs: wcd938x: fix dB range for HPHL and HPHR
Date: Fri, 07 Jul 2023 15:47:47 +0200 [thread overview]
Message-ID: <87v8evkf3w.wl-tiwai@suse.de> (raw)
In-Reply-To: <f1041542-bd97-41d9-96b9-c6e5fef6b096@sirena.org.uk>
On Fri, 07 Jul 2023 15:35:29 +0200,
Mark Brown wrote:
>
> On Fri, Jul 07, 2023 at 03:30:48PM +0200, Takashi Iwai wrote:
> > Mark Brown wrote:
>
> > > It's moderately common - typically in these cases the control is
> > > described in the datasheet as an attenuation control rather than a gain,
> > > and this usually corresponds to the physical implementation being only
> > > able to make signals smaller relative to the reference.
>
> > Yeah, I see the use case. The problem is, however, that we're using
> > the very same dB info for both gain and attenuation. That means,
> > application has no idea how to interpret those dB values -- to be
> > added or to be subtracted.
>
> > We should have defined a new TLV type for attenuation to
> > differentiate, and define the TLV macro to give proper min/max.
>
> The ASoC generic control stuff supports inverting the value prior to
> presentation to userspace so it's masked there (instead of writing the
> number userspace sees to the register we subtract the number from the
> maximum value and write that to the register), pulling that up further
> to the ALSA core might be nice I guess?
I believe yes. Though, I'm still not sure how we can improve the
mismatch of dB min/max. The dB values of those inverted controls
reflect the result of subtraction, no?
Takashi
next prev parent reply other threads:[~2023-07-07 13:48 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-05 12:57 [PATCH] ASoC: codecs: wcd938x: fix dB range for HPHL and HPHR Srinivas Kandagatla
2023-07-06 15:03 ` Mark Brown
2023-07-07 7:35 ` Johan Hovold
2023-07-07 12:37 ` Mark Brown
2023-07-07 12:54 ` Srinivas Kandagatla
2023-07-07 13:20 ` Takashi Iwai
2023-07-07 13:22 ` Mark Brown
2023-07-07 13:30 ` Takashi Iwai
2023-07-07 13:35 ` Mark Brown
2023-07-07 13:47 ` Takashi Iwai [this message]
2023-07-07 15:06 ` Mark Brown
2023-07-10 8:19 ` Takashi Iwai
2023-07-07 13:40 ` Johan Hovold
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=87v8evkf3w.wl-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=ckeepax@opensource.cirrus.com \
--cc=johan@kernel.org \
--cc=kuninori.morimoto.gx@renesas.com \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
--cc=pierre-louis.bossart@linux.intel.com \
--cc=srinivas.kandagatla@linaro.org \
--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