public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
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: Mon, 10 Jul 2023 10:19:49 +0200	[thread overview]
Message-ID: <87jzv8i3fe.wl-tiwai@suse.de> (raw)
In-Reply-To: <56aecc8d-2f6c-42c0-a13a-89c84cf53773@sirena.org.uk>

On Fri, 07 Jul 2023 17:06:24 +0200,
Mark Brown wrote:
> 
> On Fri, Jul 07, 2023 at 03:47:47PM +0200, Takashi Iwai wrote:
> > Mark Brown wrote:
> 
> > > 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?
> 
> Yes, the dB scale presented to userspace is reversed relative to the
> ordering in the registers.

Right, the TLV min/max corresponds to the control values, and they
don't mean the raw register values.

BTW, this thread made me wonder whether it makes sense to give some
sanity checks (maybe with CONFIG_SND_DEBUG) in ALSA core.
e.g. read_tlv_buf() in sound/core/control.c can perform some tests
before actually passing to user-space.


Takashi

  reply	other threads:[~2023-07-10  8:20 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
2023-07-07 15:06               ` Mark Brown
2023-07-10  8:19                 ` Takashi Iwai [this message]
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=87jzv8i3fe.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