From: Peter Ujfalusi <peter.ujfalusi@nokia.com>
To: alsa-devel@alsa-project.org
Cc: sakoman@gmail.com, Peter Ujfalusi <peter.ujfalusi@nokia.com>
Subject: [PATCH 1/9] ASoC: TWL4030: Change the Master volume control to TLV
Date: Mon, 24 Nov 2008 13:49:35 +0200 [thread overview]
Message-ID: <1227527383-22516-2-git-send-email-peter.ujfalusi@nokia.com> (raw)
In-Reply-To: <1227527383-22516-1-git-send-email-peter.ujfalusi@nokia.com>
TWL4030 FGAIN volume control has a range:
-62 to 0 dB in 1 dB steps, 0 in the FGAIN means mute.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
---
sound/soc/codecs/twl4030.c | 11 +++++++++--
1 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/sound/soc/codecs/twl4030.c b/sound/soc/codecs/twl4030.c
index 49c7da3..498c42f 100644
--- a/sound/soc/codecs/twl4030.c
+++ b/sound/soc/codecs/twl4030.c
@@ -33,6 +33,7 @@
#include <sound/soc.h>
#include <sound/soc-dapm.h>
#include <sound/initval.h>
+#include <sound/tlv.h>
#include "twl4030.h"
@@ -189,10 +190,16 @@ static void twl4030_init_chip(struct snd_soc_codec *codec)
}
+/*
+ * FGAIN volume control:
+ * from -62 to 0 dB in 1 dB steps (mute instead of -63 dB)
+ */
+static DECLARE_TLV_DB_SCALE(master_tlv, -6300, 100, 1);
+
static const struct snd_kcontrol_new twl4030_snd_controls[] = {
- SOC_DOUBLE_R("Master Playback Volume",
+ SOC_DOUBLE_R_TLV("Master Playback Volume",
TWL4030_REG_ARXL2PGA, TWL4030_REG_ARXR2PGA,
- 0, 0x3f, 0),
+ 0, 0x3f, 0, master_tlv),
SOC_DOUBLE_R("Capture Volume",
TWL4030_REG_ATXL1PGA, TWL4030_REG_ATXR1PGA,
0, 0x1f, 0),
--
1.6.0.3
next prev parent reply other threads:[~2008-11-24 11:49 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-24 11:49 [PATCH 0/9] ASoC: TWL4030: Add mixer controls for outputs Peter Ujfalusi
2008-11-24 11:49 ` Peter Ujfalusi [this message]
2008-11-24 11:49 ` [PATCH 2/9] ASoC: TWL4030: Add CGAIN volume control Peter Ujfalusi
2008-11-24 11:49 ` [PATCH 3/9] ASoC: TWL4030: Add helper function for mux handling Peter Ujfalusi
2008-11-24 11:49 ` [PATCH 4/9] ASoC: TWL4030: Add helper function for output gain controls Peter Ujfalusi
2008-11-24 11:49 ` [PATCH 5/9] ASoC: TWL4030: Add PreDriv outupt mux and volume controls Peter Ujfalusi
2008-11-24 11:49 ` [PATCH 6/9] ASoC: TWL4030: Add Headset " Peter Ujfalusi
2008-11-24 11:49 ` [PATCH 7/9] ASoC: TWL4030: Add Carkit " Peter Ujfalusi
2008-11-24 11:49 ` [PATCH 8/9] ASoC: TWL4030: Add Hands-free outupt mux control Peter Ujfalusi
2008-11-24 11:49 ` [PATCH 9/9] ASoC: TWL4030: Add Earpiece outupt mux and volume controls Peter Ujfalusi
2008-11-24 13:48 ` [PATCH 5/9] ASoC: TWL4030: Add PreDriv " Mark Brown
2008-11-24 14:19 ` Peter Ujfalusi
2008-11-24 14:50 ` Mark Brown
2008-11-25 10:51 ` Peter Ujfalusi
2008-11-24 13:57 ` [PATCH 4/9] ASoC: TWL4030: Add helper function for output gain controls Mark Brown
2008-11-24 13:55 ` [PATCH 2/9] ASoC: TWL4030: Add CGAIN volume control Mark Brown
2008-11-24 13:55 ` [PATCH 1/9] ASoC: TWL4030: Change the Master volume control to TLV 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=1227527383-22516-2-git-send-email-peter.ujfalusi@nokia.com \
--to=peter.ujfalusi@nokia.com \
--cc=alsa-devel@alsa-project.org \
--cc=sakoman@gmail.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