diff mbox

[2/2] ASoC: tfa9879: Add bass and treble gain/freq controls.

Message ID 1415278441-27866-3-git-send-email-peda@lysator.liu.se (mailing list archive)
State New, archived
Headers show

Commit Message

Peter Rosin Nov. 6, 2014, 12:54 p.m. UTC
From: Peter Rosin <peda@axentia.se>

Signed-off-by: Peter Rosin <peda@axentia.se>
---
 sound/soc/codecs/tfa9879.c |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

Comments

Lars-Peter Clausen Nov. 6, 2014, 1:17 p.m. UTC | #1
On 11/06/2014 01:54 PM, Peter Rosin wrote:
> From: Peter Rosin <peda@axentia.se>
>
> Signed-off-by: Peter Rosin <peda@axentia.se>
> ---
>   sound/soc/codecs/tfa9879.c |   16 ++++++++++++++++
>   1 file changed, 16 insertions(+)

Is there any specific reason why this is separate and not part of the 
initial patch?
Mark Brown Nov. 6, 2014, 1:40 p.m. UTC | #2
On Thu, Nov 06, 2014 at 01:54:01PM +0100, Peter Rosin wrote:

> From: Peter Rosin <peda@axentia.se>

Like Lars suggested just squash this into the previous patch.

> +	SOC_SINGLE_TLV("Treble Gain Volume", TFA9879_BASS_TREBLE,
> +		       TFA9879_G_TRBLE_SHIFT, 18, 0, tb_gain_tlv),
> +	SOC_SINGLE_TLV("Bass Gain Volume", TFA9879_BASS_TREBLE,
> +		       TFA9879_G_BASS_SHIFT, 18, 0, tb_gain_tlv),

X Volume, the Gain is redundant.
diff mbox

Patch

diff --git a/sound/soc/codecs/tfa9879.c b/sound/soc/codecs/tfa9879.c
index 90cc28f7e6ed..0d62962542e2 100644
--- a/sound/soc/codecs/tfa9879.c
+++ b/sound/soc/codecs/tfa9879.c
@@ -213,10 +213,26 @@  static bool tfa9879_volatile_register(struct device *dev, unsigned int reg)
 }
 
 static const DECLARE_TLV_DB_SCALE(volume_tlv, -7050, 50, 1);
+static const DECLARE_TLV_DB_SCALE(tb_gain_tlv, -1800, 200, 0);
+static const char * const tb_freq_text[] = {
+	"Low", "Mid", "High"
+};
+static const struct soc_enum treble_freq_enum =
+	SOC_ENUM_SINGLE(TFA9879_BASS_TREBLE, TFA9879_F_TRBLE_SHIFT,
+			ARRAY_SIZE(tb_freq_text), tb_freq_text);
+static const struct soc_enum bass_freq_enum =
+	SOC_ENUM_SINGLE(TFA9879_BASS_TREBLE, TFA9879_F_BASS_SHIFT,
+			ARRAY_SIZE(tb_freq_text), tb_freq_text);
 
 static const struct snd_kcontrol_new tfa9879_controls[] = {
 	SOC_SINGLE_TLV("PCM Playback Volume", TFA9879_VOLUME_CONTROL,
 		       TFA9879_VOL_SHIFT, 0xbd, 1, volume_tlv),
+	SOC_SINGLE_TLV("Treble Gain Volume", TFA9879_BASS_TREBLE,
+		       TFA9879_G_TRBLE_SHIFT, 18, 0, tb_gain_tlv),
+	SOC_SINGLE_TLV("Bass Gain Volume", TFA9879_BASS_TREBLE,
+		       TFA9879_G_BASS_SHIFT, 18, 0, tb_gain_tlv),
+	SOC_ENUM("Treble Corner Freq", treble_freq_enum),
+	SOC_ENUM("Bass Corner Freq", bass_freq_enum),
 };
 
 static const struct snd_soc_dapm_widget tfa9879_dapm_widgets[] = {