aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/da7210.c
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2010-07-21 01:12:16 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2010-07-23 05:17:47 -0400
commita7e7cd5bd7d1e0134032b8db5e64ceb9dac8b3ca (patch)
tree3f285221d86cbb9e7d55cfcb0e35a0f7385e1341 /sound/soc/codecs/da7210.c
parent49e704279953b652ec6adc7f5dec412ad118a938 (diff)
ASoC: da7210: Add HeadPhone Playback Volume control
HeadPhone Playback Volume control register of DA7210 has reserved area. This patch considered it as mute. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/da7210.c')
-rw-r--r--sound/soc/codecs/da7210.c31
1 files changed, 27 insertions, 4 deletions
diff --git a/sound/soc/codecs/da7210.c b/sound/soc/codecs/da7210.c
index a83aa187a7f2..3e42d1e0e601 100644
--- a/sound/soc/codecs/da7210.c
+++ b/sound/soc/codecs/da7210.c
@@ -23,6 +23,7 @@
23#include <sound/pcm_params.h> 23#include <sound/pcm_params.h>
24#include <sound/soc-dapm.h> 24#include <sound/soc-dapm.h>
25#include <sound/initval.h> 25#include <sound/initval.h>
26#include <sound/tlv.h>
26 27
27#include "da7210.h" 28#include "da7210.h"
28 29
@@ -136,6 +137,29 @@
136 137
137#define DA7210_VERSION "0.0.1" 138#define DA7210_VERSION "0.0.1"
138 139
140/*
141 * Playback Volume
142 *
143 * max : 0x3F (+15.0 dB)
144 * (1.5 dB step)
145 * min : 0x11 (-54.0 dB)
146 * mute : 0x10
147 * reserved : 0x00 - 0x0F
148 *
149 * ** FIXME **
150 *
151 * Reserved area are considered as "mute".
152 * -> min = -79.5 dB
153 */
154static const DECLARE_TLV_DB_SCALE(hp_out_tlv, -7950, 150, 1);
155
156static const struct snd_kcontrol_new da7210_snd_controls[] = {
157
158 SOC_DOUBLE_R_TLV("HeadPhone Playback Volume",
159 DA7210_HP_L_VOL, DA7210_HP_R_VOL,
160 0, 0x3F, 0, hp_out_tlv),
161};
162
139/* Codec private data */ 163/* Codec private data */
140struct da7210_priv { 164struct da7210_priv {
141 struct snd_soc_codec codec; 165 struct snd_soc_codec codec;
@@ -218,10 +242,6 @@ static int da7210_startup(struct snd_pcm_substream *substream,
218 struct snd_soc_codec *codec = dai->codec; 242 struct snd_soc_codec *codec = dai->codec;
219 243
220 if (is_play) { 244 if (is_play) {
221 /* PlayBack Volume 40 */
222 snd_soc_update_bits(codec, DA7210_HP_L_VOL, 0x3F, 40);
223 snd_soc_update_bits(codec, DA7210_HP_R_VOL, 0x3F, 40);
224
225 /* Enable Out */ 245 /* Enable Out */
226 snd_soc_update_bits(codec, DA7210_OUTMIX_L, 0x1F, 0x10); 246 snd_soc_update_bits(codec, DA7210_OUTMIX_L, 0x1F, 0x10);
227 snd_soc_update_bits(codec, DA7210_OUTMIX_R, 0x1F, 0x10); 247 snd_soc_update_bits(codec, DA7210_OUTMIX_R, 0x1F, 0x10);
@@ -647,6 +667,9 @@ static int da7210_probe(struct platform_device *pdev)
647 if (ret < 0) 667 if (ret < 0)
648 goto pcm_err; 668 goto pcm_err;
649 669
670 snd_soc_add_controls(da7210_codec, da7210_snd_controls,
671 ARRAY_SIZE(da7210_snd_controls));
672
650 dev_info(&pdev->dev, "DA7210 Audio Codec %s\n", DA7210_VERSION); 673 dev_info(&pdev->dev, "DA7210 Audio Codec %s\n", DA7210_VERSION);
651 674
652pcm_err: 675pcm_err: