alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: "Rhodes, David" <David.Rhodes@cirrus.com>
To: "Guillermo Rodríguez" <guille.rodriguez@gmail.com>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>
Cc: Takashi Iwai <tiwai@suse.com>, Mark Brown <broonie@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	"Schulman, James" <James.Schulman@cirrus.com>
Subject: RE: [PATCH] ASoC: cs42l51: add additional ADC volume controls
Date: Fri, 18 Sep 2020 16:50:27 +0000	[thread overview]
Message-ID: <DM6PR19MB2284C2BA7A43A3F7E50F83B2EE3F0@DM6PR19MB2284.namprd19.prod.outlook.com> (raw)
In-Reply-To: <20200918134317.22574-1-guille.rodriguez@gmail.com>

> -----Original Message-----
> From: Guillermo Rodríguez <guille.rodriguez@gmail.com>
> Sent: Friday, September 18, 2020 8:43 AM
> To: alsa-devel@alsa-project.org
> Cc: Guillermo Rodríguez <guille.rodriguez@gmail.com>; Schulman, James
> <James.Schulman@cirrus.com>; Rhodes, David <David.Rhodes@cirrus.com>;
> Liam Girdwood <lgirdwood@gmail.com>; Mark Brown
> <broonie@kernel.org>; Jaroslav Kysela <perex@perex.cz>; Takashi Iwai
> <tiwai@suse.com>
> Subject: [PATCH] ASoC: cs42l51: add additional ADC volume controls
> 
> Add volume controls for:
> - Analog programmable gain amplifier (PGA) (-3 .. +12 dB)
> - ADC attenuator (0 .. -96 dB)
> 
> Signed-off-by: Guillermo Rodríguez <guille.rodriguez@gmail.com>
> ---
>  sound/soc/codecs/cs42l51.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/sound/soc/codecs/cs42l51.c b/sound/soc/codecs/cs42l51.c
> index 764f2ef8f59d..097c4e8d9950 100644
> --- a/sound/soc/codecs/cs42l51.c
> +++ b/sound/soc/codecs/cs42l51.c
> @@ -122,6 +122,9 @@ static const char *chan_mix[] = {
>  	"R L",
>  };
> 
> +static const DECLARE_TLV_DB_SCALE(pga_tlv, -300, 50, 0);
> +static const DECLARE_TLV_DB_SCALE(adc_att_tlv, -9600, 100, 0);
> +
>  static SOC_ENUM_SINGLE_EXT_DECL(cs42l51_chan_mix, chan_mix);
> 
>  static const struct snd_kcontrol_new cs42l51_snd_controls[] = {
> @@ -138,6 +141,12 @@ static const struct snd_kcontrol_new
> cs42l51_snd_controls[] = {
>  			0, 0x19, 0x7F, adc_pcm_tlv),
>  	SOC_DOUBLE_R("ADC Mixer Switch",
>  			CS42L51_ADCA_VOL, CS42L51_ADCB_VOL, 7, 1, 1),
> +	SOC_DOUBLE_R_SX_TLV("ADC Attenuator Volume",
> +			CS42L51_ADCA_ATT, CS42L51_ADCB_ATT,
> +			0, 0xA0, 96, adc_att_tlv),
> +	SOC_DOUBLE_R_SX_TLV("PGA Volume",
> +			CS42L51_ALC_PGA_CTL, CS42L51_ALC_PGB_CTL,
> +			0, 0x1A, 30, pga_tlv),
>  	SOC_SINGLE("Playback Deemphasis Switch", CS42L51_DAC_CTL, 3, 1,
> 0),
>  	SOC_SINGLE("Auto-Mute Switch", CS42L51_DAC_CTL, 2, 1, 0),
>  	SOC_SINGLE("Soft Ramp Switch", CS42L51_DAC_CTL, 1, 1, 0),
> --
> 2.26.0

Acked-by: David Rhodes <David.rhodes@cirrus.com>

Thanks,
David

  reply	other threads:[~2020-09-18 16:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-18 13:43 [PATCH] ASoC: cs42l51: add additional ADC volume controls Guillermo Rodríguez
2020-09-18 16:50 ` Rhodes, David [this message]
2020-09-21 16:57 ` 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=DM6PR19MB2284C2BA7A43A3F7E50F83B2EE3F0@DM6PR19MB2284.namprd19.prod.outlook.com \
    --to=david.rhodes@cirrus.com \
    --cc=James.Schulman@cirrus.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=guille.rodriguez@gmail.com \
    --cc=lgirdwood@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).