All of lore.kernel.org
 help / color / mirror / Atom feed
From: ChiYuan Huang <u0084500@gmail.com>
To: Mark Brown <broonie@kernel.org>
Cc: oder_chiou@realtek.com, perex@perex.cz, tiwai@suse.com,
	Rob Herring <robh+dt@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	alsa-devel@alsa-project.org, lkml <linux-kernel@vger.kernel.org>,
	cy_huang <cy_huang@richtek.com>,
	"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" 
	<devicetree@vger.kernel.org>, allen lin <allen_lin@richtek.com>
Subject: Re: [PATCH v3 2/2] ASoC: rt9120: Add rt9210 audio amplifier support
Date: Tue, 12 Oct 2021 11:07:43 +0800	[thread overview]
Message-ID: <CADiBU39SKqSULSesj060a62YpMp1hD9ftfMPGtdcbOyZh8iPrw@mail.gmail.com> (raw)
In-Reply-To: <CADiBU3-X5n3b-ZUCFf48C=5oD6RC1E9MD+M6demMLoHzZ3CEBA@mail.gmail.com>

ChiYuan Huang <u0084500@gmail.com> 於 2021年10月12日 週二 上午10:47寫道:
>
> Mark Brown <broonie@kernel.org> 於 2021年10月8日 週五 下午8:51寫道:
> >
> > On Fri, Oct 08, 2021 at 12:50:12PM +0800, cy_huang wrote:
> >
> > > +static const struct snd_kcontrol_new rt9120_snd_controls[] = {
> > > +     SOC_SINGLE_TLV("MS Volume", RT9120_REG_MSVOL, 0, 2047, 1, digital_gain),
> > > +     SOC_SINGLE("SPK Gain", RT9120_REG_SPKGAIN, 0, 7, 0),
> >
> > Volume controls should end in Volume even if they don't have TLV
> > information so applications know how to render them.  I'll fix
> > this up as I apply.
>
> It's not linear mapping analog gain and cannot use the TLV as you said.
> Mappling table is listed like as below
> 0 -> 6dB
> 1 -> 8dB
> 2 -> 10dB
> 3 -> 12dB
> 4 -> 13dB
> 5 -> 14dB
> 6 -> 15dB
> 7 -> 16dB
>
> Do I just need to change it to 'SPK Gain Volume' to present this control item?
> Or is there any table mapping for the nonlinear TLV information?

Finally found there's 'DECLARE_TLV_DB_RANGE' that can meet the requirement.
I will fix this by the tlv db range and naming it to 'SPK Gain Volume'.
If there's any changes still needed, please feel free to let me know.

WARNING: multiple messages have this Message-ID (diff)
From: ChiYuan Huang <u0084500@gmail.com>
To: Mark Brown <broonie@kernel.org>
Cc: oder_chiou@realtek.com,
	"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
	<devicetree@vger.kernel.org>,
	alsa-devel@alsa-project.org, lkml <linux-kernel@vger.kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	tiwai@suse.com, cy_huang <cy_huang@richtek.com>,
	Rob Herring <robh+dt@kernel.org>,
	allen lin <allen_lin@richtek.com>
Subject: Re: [PATCH v3 2/2] ASoC: rt9120: Add rt9210 audio amplifier support
Date: Tue, 12 Oct 2021 11:07:43 +0800	[thread overview]
Message-ID: <CADiBU39SKqSULSesj060a62YpMp1hD9ftfMPGtdcbOyZh8iPrw@mail.gmail.com> (raw)
In-Reply-To: <CADiBU3-X5n3b-ZUCFf48C=5oD6RC1E9MD+M6demMLoHzZ3CEBA@mail.gmail.com>

ChiYuan Huang <u0084500@gmail.com> 於 2021年10月12日 週二 上午10:47寫道:
>
> Mark Brown <broonie@kernel.org> 於 2021年10月8日 週五 下午8:51寫道:
> >
> > On Fri, Oct 08, 2021 at 12:50:12PM +0800, cy_huang wrote:
> >
> > > +static const struct snd_kcontrol_new rt9120_snd_controls[] = {
> > > +     SOC_SINGLE_TLV("MS Volume", RT9120_REG_MSVOL, 0, 2047, 1, digital_gain),
> > > +     SOC_SINGLE("SPK Gain", RT9120_REG_SPKGAIN, 0, 7, 0),
> >
> > Volume controls should end in Volume even if they don't have TLV
> > information so applications know how to render them.  I'll fix
> > this up as I apply.
>
> It's not linear mapping analog gain and cannot use the TLV as you said.
> Mappling table is listed like as below
> 0 -> 6dB
> 1 -> 8dB
> 2 -> 10dB
> 3 -> 12dB
> 4 -> 13dB
> 5 -> 14dB
> 6 -> 15dB
> 7 -> 16dB
>
> Do I just need to change it to 'SPK Gain Volume' to present this control item?
> Or is there any table mapping for the nonlinear TLV information?

Finally found there's 'DECLARE_TLV_DB_RANGE' that can meet the requirement.
I will fix this by the tlv db range and naming it to 'SPK Gain Volume'.
If there's any changes still needed, please feel free to let me know.

  reply	other threads:[~2021-10-12  3:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-08  4:50 [PATCH v3 0/2] ASoC: rt9120: Add Richtek RT9120 supprot cy_huang
2021-10-08  4:50 ` cy_huang
2021-10-08  4:50 ` [PATCH v3 1/2] ASoC: dt-bindings: rt9120: Add initial bindings cy_huang
2021-10-08  4:50   ` cy_huang
2021-10-08  4:50 ` [PATCH v3 2/2] ASoC: rt9120: Add rt9210 audio amplifier support cy_huang
2021-10-08  4:50   ` cy_huang
2021-10-08 12:51   ` Mark Brown
2021-10-08 12:51     ` Mark Brown
2021-10-12  2:47     ` ChiYuan Huang
2021-10-12  2:47       ` ChiYuan Huang
2021-10-12  3:07       ` ChiYuan Huang [this message]
2021-10-12  3:07         ` ChiYuan Huang

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=CADiBU39SKqSULSesj060a62YpMp1hD9ftfMPGtdcbOyZh8iPrw@mail.gmail.com \
    --to=u0084500@gmail.com \
    --cc=allen_lin@richtek.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=cy_huang@richtek.com \
    --cc=devicetree@vger.kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oder_chiou@realtek.com \
    --cc=perex@perex.cz \
    --cc=robh+dt@kernel.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 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.