From: Lars-Peter Clausen <lars@metafoo.de>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>,
Liam Girdwood <lrg@slimlogic.co.uk>
Cc: device-driver-devel@blackfin.uclinux.org,
alsa-devel@alsa-project.org, Lars-Peter Clausen <lars@metafoo.de>,
Mike Frysinger <vapier@gentoo.org>
Subject: [PATCH 12/12] ASoC: SSM2602: Provide dB ranges for the volume controls
Date: Thu, 5 May 2011 16:59:20 +0200 [thread overview]
Message-ID: <1304607560-15083-12-git-send-email-lars@metafoo.de> (raw)
In-Reply-To: <1304607560-15083-1-git-send-email-lars@metafoo.de>
Also fix the maximum value for the capture volume control.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
---
sound/soc/codecs/ssm2602.c | 21 ++++++++++++++++-----
1 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/sound/soc/codecs/ssm2602.c b/sound/soc/codecs/ssm2602.c
index c3d5936..8ed74e6 100644
--- a/sound/soc/codecs/ssm2602.c
+++ b/sound/soc/codecs/ssm2602.c
@@ -40,6 +40,7 @@
#include <sound/pcm_params.h>
#include <sound/soc.h>
#include <sound/initval.h>
+#include <sound/tlv.h>
#include "ssm2602.h"
@@ -87,8 +88,18 @@ static const struct soc_enum ssm2602_enum[] = {
SOC_ENUM_SINGLE(SSM2602_APDIGI, 1, 4, ssm2602_deemph),
};
+static const unsigned int ssm260x_outmix_tlv[] = {
+ TLV_DB_RANGE_HEAD(2),
+ 0, 47, TLV_DB_SCALE_ITEM(TLV_DB_GAIN_MUTE, 0, 0),
+ 48, 127, TLV_DB_SCALE_ITEM(-7400, 100, 0),
+};
+
+static const DECLARE_TLV_DB_SCALE(ssm260x_inpga_tlv, -3450, 150, 0);
+static const DECLARE_TLV_DB_SCALE(ssm260x_sidetone_tlv, -1500, 300, 0);
+
static const struct snd_kcontrol_new ssm260x_snd_controls[] = {
-SOC_DOUBLE_R("Capture Volume", SSM2602_LINVOL, SSM2602_RINVOL, 0, 31, 0),
+SOC_DOUBLE_R_TLV("Capture Volume", SSM2602_LINVOL, SSM2602_RINVOL, 0, 45, 0,
+ ssm260x_inpga_tlv),
SOC_DOUBLE_R("Capture Switch", SSM2602_LINVOL, SSM2602_RINVOL, 7, 1, 1),
SOC_SINGLE("ADC High Pass Filter Switch", SSM2602_APDIGI, 0, 1, 1),
@@ -98,12 +109,12 @@ SOC_ENUM("Playback De-emphasis", ssm2602_enum[1]),
};
static const struct snd_kcontrol_new ssm2602_snd_controls[] = {
-SOC_DOUBLE_R("Master Playback Volume", SSM2602_LOUT1V, SSM2602_ROUT1V,
- 0, 127, 0),
+SOC_DOUBLE_R_TLV("Master Playback Volume", SSM2602_LOUT1V, SSM2602_ROUT1V,
+ 0, 127, 0, ssm260x_outmix_tlv),
SOC_DOUBLE_R("Master Playback ZC Switch", SSM2602_LOUT1V, SSM2602_ROUT1V,
7, 1, 0),
-
-SOC_SINGLE("Sidetone Playback Volume", SSM2602_APANA, 6, 3, 1),
+SOC_SINGLE_TLV("Sidetone Playback Volume", SSM2602_APANA, 6, 3, 1,
+ ssm260x_sidetone_tlv),
SOC_SINGLE("Mic Boost (+20dB)", SSM2602_APANA, 0, 1, 0),
SOC_SINGLE("Mic Boost2 (+20dB)", SSM2602_APANA, 8, 1, 0),
--
1.7.2.5
next prev parent reply other threads:[~2011-05-05 14:59 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-05 14:59 [PATCH 01/12] ASoC: Create codec DAPM widgets before calling the codecs probe function Lars-Peter Clausen
2011-05-05 14:59 ` [PATCH 02/12] ASoC: SSM2602: Cleanup coeff handling Lars-Peter Clausen
2011-05-05 14:59 ` [PATCH 03/12] ASoC: SSM2602: Remove duplicate control Lars-Peter Clausen
2011-05-05 14:59 ` [PATCH 04/12] ASoC: SSM2602: Properly annotate i2c probe and remove functions Lars-Peter Clausen
2011-05-05 14:59 ` [PATCH 05/12] ASoC: SSM2602: Remove unused struct and define Lars-Peter Clausen
2011-05-05 14:59 ` [PATCH 06/12] ASoC: SSM2602: Fix reg_cache_size Lars-Peter Clausen
2011-05-05 14:59 ` [PATCH 07/12] ASoC: SSM2602: Do not power the codec up in probe Lars-Peter Clausen
2011-05-06 10:00 ` Mark Brown
2011-05-05 14:59 ` [PATCH 08/12] ASoC: SSM2602: Fix 'Mic Boost2' control Lars-Peter Clausen
2011-05-05 14:59 ` [PATCH 09/12] ASoC: SSM2602: Add SSM2604 support Lars-Peter Clausen
2011-05-05 14:59 ` [PATCH 10/12] ASoC: SSM2602: Add entry for the ssm2603 to the device id table Lars-Peter Clausen
2011-05-05 14:59 ` [PATCH 11/12] ASoC: SSM2602: Model power supply for the digital core as a DAPM widget Lars-Peter Clausen
2011-05-05 14:59 ` Lars-Peter Clausen [this message]
2011-05-05 19:08 ` [PATCH 01/12] ASoC: Create codec DAPM widgets before calling the codecs probe function Mike Frysinger
2011-05-05 23:01 ` Mike Frysinger
2011-05-07 18:11 ` Liam Girdwood
2011-05-07 18:21 ` Mark Brown
2011-05-08 11:16 ` Liam Girdwood
2011-05-08 13:56 ` Mark Brown
2011-05-08 16:24 ` [PATCH 2/6] ASoC: SSM2602: Do not power the codec up in probe Lars-Peter Clausen
[not found] ` <20110508135613.GA15968-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2011-05-08 16:24 ` [PATCH 1/6] ASoC: SSM2602: Fix default register cache Lars-Peter Clausen
2011-05-08 20:53 ` Liam Girdwood
2011-05-08 23:46 ` Mark Brown
2011-05-08 16:24 ` [PATCH 3/6] ASoC: SSM2602: Add SSM2604 support Lars-Peter Clausen
2011-05-08 16:24 ` [PATCH 5/6] ASoC: SSM2602: Model power supply for the digital core as a DAPM widget Lars-Peter Clausen
2011-05-08 16:24 ` [PATCH 4/6] ASoC: SSM2602: Add entry for the ssm2603 to the device id table Lars-Peter Clausen
2011-05-08 16:24 ` [PATCH 6/6] ASoC: SSM2602: Provide dB ranges for the volume controls Lars-Peter Clausen
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=1304607560-15083-12-git-send-email-lars@metafoo.de \
--to=lars@metafoo.de \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=device-driver-devel@blackfin.uclinux.org \
--cc=lrg@slimlogic.co.uk \
--cc=vapier@gentoo.org \
/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).