alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: cs42l51: add additional ADC volume controls
@ 2020-09-18 13:43 Guillermo Rodríguez
  2020-09-18 16:50 ` Rhodes, David
  2020-09-21 16:57 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Guillermo Rodríguez @ 2020-09-18 13:43 UTC (permalink / raw)
  To: alsa-devel
  Cc: Guillermo Rodríguez, Takashi Iwai, Liam Girdwood,
	Mark Brown, James Schulman, David Rhodes

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* RE: [PATCH] ASoC: cs42l51: add additional ADC volume controls
  2020-09-18 13:43 [PATCH] ASoC: cs42l51: add additional ADC volume controls Guillermo Rodríguez
@ 2020-09-18 16:50 ` Rhodes, David
  2020-09-21 16:57 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Rhodes, David @ 2020-09-18 16:50 UTC (permalink / raw)
  To: Guillermo Rodríguez, alsa-devel
  Cc: Takashi Iwai, Mark Brown, Liam Girdwood, Schulman, James

> -----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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ASoC: cs42l51: add additional ADC volume controls
  2020-09-18 13:43 [PATCH] ASoC: cs42l51: add additional ADC volume controls Guillermo Rodríguez
  2020-09-18 16:50 ` Rhodes, David
@ 2020-09-21 16:57 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2020-09-21 16:57 UTC (permalink / raw)
  To: Guillermo Rodríguez, alsa-devel
  Cc: Liam Girdwood, James Schulman, Takashi Iwai, David Rhodes

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1160 bytes --]

On Fri, 18 Sep 2020 15:43:16 +0200, Guillermo Rodríguez wrote:
> Add volume controls for:
> - Analog programmable gain amplifier (PGA) (-3 .. +12 dB)
> - ADC attenuator (0 .. -96 dB)

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: cs42l51: add additional ADC volume controls
      commit: 641088722244f59fed00b68f7f5aaa3d56c1d73d

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-09-21 17:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-18 13:43 [PATCH] ASoC: cs42l51: add additional ADC volume controls Guillermo Rodríguez
2020-09-18 16:50 ` Rhodes, David
2020-09-21 16:57 ` Mark Brown

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).