diff options
author | Mark Brown <broonie@linaro.org> | 2014-02-07 14:16:56 -0500 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-02-07 14:53:53 -0500 |
commit | 5be2fc20b101b5138c4f54a584dc11790ef16598 (patch) | |
tree | 0e838bc5c10cff070a3f984e4cff5d426e7edf64 | |
parent | 806d6466076a0aebbe0a9c17294d1a13e93fabcf (diff) |
ASoC: pcm512x: Implement analogue volume control
There are some analogue volume controls in page 1 of the register map so
implement support for them now that we can access the registers.
Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r-- | sound/soc/codecs/pcm512x.c | 6 | ||||
-rw-r--r-- | sound/soc/codecs/pcm512x.h | 8 |
2 files changed, 14 insertions, 0 deletions
diff --git a/sound/soc/codecs/pcm512x.c b/sound/soc/codecs/pcm512x.c index cdcb51e4c86f..3a0bbb6ab242 100644 --- a/sound/soc/codecs/pcm512x.c +++ b/sound/soc/codecs/pcm512x.c | |||
@@ -184,6 +184,8 @@ static bool pcm512x_volatile(struct device *dev, unsigned int reg) | |||
184 | } | 184 | } |
185 | 185 | ||
186 | static const DECLARE_TLV_DB_SCALE(digital_tlv, -10350, 50, 1); | 186 | static const DECLARE_TLV_DB_SCALE(digital_tlv, -10350, 50, 1); |
187 | static const DECLARE_TLV_DB_SCALE(analog_tlv, -600, 600, 0); | ||
188 | static const DECLARE_TLV_DB_SCALE(boost_tlv, 0, 80, 0); | ||
187 | 189 | ||
188 | static const char * const pcm512x_dsp_program_texts[] = { | 190 | static const char * const pcm512x_dsp_program_texts[] = { |
189 | "FIR interpolation with de-emphasis", | 191 | "FIR interpolation with de-emphasis", |
@@ -261,6 +263,10 @@ static const struct soc_enum pcm512x_veds = | |||
261 | static const struct snd_kcontrol_new pcm512x_controls[] = { | 263 | static const struct snd_kcontrol_new pcm512x_controls[] = { |
262 | SOC_DOUBLE_R_TLV("Playback Digital Volume", PCM512x_DIGITAL_VOLUME_2, | 264 | SOC_DOUBLE_R_TLV("Playback Digital Volume", PCM512x_DIGITAL_VOLUME_2, |
263 | PCM512x_DIGITAL_VOLUME_3, 0, 255, 1, digital_tlv), | 265 | PCM512x_DIGITAL_VOLUME_3, 0, 255, 1, digital_tlv), |
266 | SOC_DOUBLE_TLV("Playback Volume", PCM512x_ANALOG_GAIN_CTRL, | ||
267 | PCM512x_LAGN_SHIFT, PCM512x_RAGN_SHIFT, 1, 1, analog_tlv), | ||
268 | SOC_DOUBLE_TLV("Playback Boost Volume", PCM512x_ANALOG_GAIN_BOOST, | ||
269 | PCM512x_AGBL_SHIFT, PCM512x_AGBR_SHIFT, 1, 0, boost_tlv), | ||
264 | SOC_DOUBLE("Playback Digital Switch", PCM512x_MUTE, PCM512x_RQML_SHIFT, | 270 | SOC_DOUBLE("Playback Digital Switch", PCM512x_MUTE, PCM512x_RQML_SHIFT, |
265 | PCM512x_RQMR_SHIFT, 1, 1), | 271 | PCM512x_RQMR_SHIFT, 1, 1), |
266 | 272 | ||
diff --git a/sound/soc/codecs/pcm512x.h b/sound/soc/codecs/pcm512x.h index e58743c965d6..ac4a52c9ccf4 100644 --- a/sound/soc/codecs/pcm512x.h +++ b/sound/soc/codecs/pcm512x.h | |||
@@ -151,4 +151,12 @@ | |||
151 | #define PCM512x_AMLE_SHIFT 1 | 151 | #define PCM512x_AMLE_SHIFT 1 |
152 | #define PCM512x_AMLR_SHIFT 0 | 152 | #define PCM512x_AMLR_SHIFT 0 |
153 | 153 | ||
154 | /* Page 1, Register 2 - analog volume control */ | ||
155 | #define PCM512x_RAGN_SHIFT 0 | ||
156 | #define PCM512x_LAGN_SHIFT 4 | ||
157 | |||
158 | /* Page 1, Register 7 - analog boost control */ | ||
159 | #define PCM512x_AGBR_SHIFT 0 | ||
160 | #define PCM512x_AGBL_SHIFT 4 | ||
161 | |||
154 | #endif | 162 | #endif |