diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2015-09-17 20:52:44 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-09-19 10:41:15 -0400 |
commit | e3a4d958d78e4f1709f3d4611849617ac9222a0c (patch) | |
tree | 4bc88a647f70ffce2aeaa44ce329da2561bf1698 | |
parent | b07570628471777aabb5695284e1af4533e502da (diff) |
ASoC: ak4613: add Digital Playback Volume support
For L/ROUT1 to L/ROUT6
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/codecs/ak4613.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/sound/soc/codecs/ak4613.c b/sound/soc/codecs/ak4613.c index fd96a8f9e2d3..07a266460ec3 100644 --- a/sound/soc/codecs/ak4613.c +++ b/sound/soc/codecs/ak4613.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/regmap.h> | 22 | #include <linux/regmap.h> |
23 | #include <sound/soc.h> | 23 | #include <sound/soc.h> |
24 | #include <sound/pcm_params.h> | 24 | #include <sound/pcm_params.h> |
25 | #include <sound/tlv.h> | ||
25 | 26 | ||
26 | #define PW_MGMT1 0x00 /* Power Management 1 */ | 27 | #define PW_MGMT1 0x00 /* Power Management 1 */ |
27 | #define PW_MGMT2 0x01 /* Power Management 2 */ | 28 | #define PW_MGMT2 0x01 /* Power Management 2 */ |
@@ -91,6 +92,31 @@ struct ak4613_interface { | |||
91 | struct ak4613_formats playback; | 92 | struct ak4613_formats playback; |
92 | }; | 93 | }; |
93 | 94 | ||
95 | /* | ||
96 | * Playback Volume | ||
97 | * | ||
98 | * max : 0x00 : 0 dB | ||
99 | * ( 0.5 dB step ) | ||
100 | * min : 0xFE : -127.0 dB | ||
101 | * mute: 0xFF | ||
102 | */ | ||
103 | static const DECLARE_TLV_DB_SCALE(out_tlv, -12750, 50, 1); | ||
104 | |||
105 | static const struct snd_kcontrol_new ak4613_snd_controls[] = { | ||
106 | SOC_DOUBLE_R_TLV("Digital Playback Volume1", LOUT1, ROUT1, | ||
107 | 0, 0xFF, 1, out_tlv), | ||
108 | SOC_DOUBLE_R_TLV("Digital Playback Volume2", LOUT2, ROUT2, | ||
109 | 0, 0xFF, 1, out_tlv), | ||
110 | SOC_DOUBLE_R_TLV("Digital Playback Volume3", LOUT3, ROUT3, | ||
111 | 0, 0xFF, 1, out_tlv), | ||
112 | SOC_DOUBLE_R_TLV("Digital Playback Volume4", LOUT4, ROUT4, | ||
113 | 0, 0xFF, 1, out_tlv), | ||
114 | SOC_DOUBLE_R_TLV("Digital Playback Volume5", LOUT5, ROUT5, | ||
115 | 0, 0xFF, 1, out_tlv), | ||
116 | SOC_DOUBLE_R_TLV("Digital Playback Volume6", LOUT6, ROUT6, | ||
117 | 0, 0xFF, 1, out_tlv), | ||
118 | }; | ||
119 | |||
94 | static const struct reg_default ak4613_reg[] = { | 120 | static const struct reg_default ak4613_reg[] = { |
95 | { 0x0, 0x0f }, { 0x1, 0x07 }, { 0x2, 0x3f }, { 0x3, 0x20 }, | 121 | { 0x0, 0x0f }, { 0x1, 0x07 }, { 0x2, 0x3f }, { 0x3, 0x20 }, |
96 | { 0x4, 0x20 }, { 0x5, 0x55 }, { 0x6, 0x05 }, { 0x7, 0x07 }, | 122 | { 0x4, 0x20 }, { 0x5, 0x55 }, { 0x6, 0x05 }, { 0x7, 0x07 }, |
@@ -397,6 +423,8 @@ static int ak4613_resume(struct snd_soc_codec *codec) | |||
397 | static struct snd_soc_codec_driver soc_codec_dev_ak4613 = { | 423 | static struct snd_soc_codec_driver soc_codec_dev_ak4613 = { |
398 | .resume = ak4613_resume, | 424 | .resume = ak4613_resume, |
399 | .set_bias_level = ak4613_set_bias_level, | 425 | .set_bias_level = ak4613_set_bias_level, |
426 | .controls = ak4613_snd_controls, | ||
427 | .num_controls = ARRAY_SIZE(ak4613_snd_controls), | ||
400 | .dapm_widgets = ak4613_dapm_widgets, | 428 | .dapm_widgets = ak4613_dapm_widgets, |
401 | .num_dapm_widgets = ARRAY_SIZE(ak4613_dapm_widgets), | 429 | .num_dapm_widgets = ARRAY_SIZE(ak4613_dapm_widgets), |
402 | .dapm_routes = ak4613_intercon, | 430 | .dapm_routes = ak4613_intercon, |