aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm_adsp.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2013-02-18 14:09:23 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2013-03-21 13:55:14 -0400
commitdc91428a6152b2c8428a39a27ab9b5e429848f55 (patch)
tree895656e8f8764f371e48915c7c3dd74b3b01f93b /sound/soc/codecs/wm_adsp.c
parentf4a76e7cc6d1c402e990e2111fb94afb305fb974 (diff)
ASoC: arizona: Basic support for ISRC rate selection
Since ASoC does not yet really have the framework features needed to support propagating sample rates through the device well yet implement basic support for the ISRCs equivalent to that we currently have for the ASRCs. The user can opt for 8kHz or 16kHz as the rate for the DSP blocks in addition to the main audio rate, these being the primary use cases. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/wm_adsp.c')
-rw-r--r--sound/soc/codecs/wm_adsp.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c
index f3f7e75f8628..3a481fd1bf9a 100644
--- a/sound/soc/codecs/wm_adsp.c
+++ b/sound/soc/codecs/wm_adsp.c
@@ -31,6 +31,7 @@
31 31
32#include <linux/mfd/arizona/registers.h> 32#include <linux/mfd/arizona/registers.h>
33 33
34#include "arizona.h"
34#include "wm_adsp.h" 35#include "wm_adsp.h"
35 36
36#define adsp_crit(_dsp, fmt, ...) \ 37#define adsp_crit(_dsp, fmt, ...) \
@@ -246,15 +247,38 @@ static const struct soc_enum wm_adsp_fw_enum[] = {
246 SOC_ENUM_SINGLE(0, 3, ARRAY_SIZE(wm_adsp_fw_text), wm_adsp_fw_text), 247 SOC_ENUM_SINGLE(0, 3, ARRAY_SIZE(wm_adsp_fw_text), wm_adsp_fw_text),
247}; 248};
248 249
250static const struct soc_enum wm_adsp_rate_enum[] = {
251 SOC_VALUE_ENUM_SINGLE(ARIZONA_DSP1_CONTROL_1,
252 ARIZONA_DSP1_RATE_SHIFT, 0xf,
253 ARIZONA_RATE_ENUM_SIZE,
254 arizona_rate_text, arizona_rate_val),
255 SOC_VALUE_ENUM_SINGLE(ARIZONA_DSP2_CONTROL_1,
256 ARIZONA_DSP1_RATE_SHIFT, 0xf,
257 ARIZONA_RATE_ENUM_SIZE,
258 arizona_rate_text, arizona_rate_val),
259 SOC_VALUE_ENUM_SINGLE(ARIZONA_DSP3_CONTROL_1,
260 ARIZONA_DSP1_RATE_SHIFT, 0xf,
261 ARIZONA_RATE_ENUM_SIZE,
262 arizona_rate_text, arizona_rate_val),
263 SOC_VALUE_ENUM_SINGLE(ARIZONA_DSP3_CONTROL_1,
264 ARIZONA_DSP1_RATE_SHIFT, 0xf,
265 ARIZONA_RATE_ENUM_SIZE,
266 arizona_rate_text, arizona_rate_val),
267};
268
249const struct snd_kcontrol_new wm_adsp_fw_controls[] = { 269const struct snd_kcontrol_new wm_adsp_fw_controls[] = {
250 SOC_ENUM_EXT("DSP1 Firmware", wm_adsp_fw_enum[0], 270 SOC_ENUM_EXT("DSP1 Firmware", wm_adsp_fw_enum[0],
251 wm_adsp_fw_get, wm_adsp_fw_put), 271 wm_adsp_fw_get, wm_adsp_fw_put),
272 SOC_ENUM("DSP1 Rate", wm_adsp_rate_enum[0]),
252 SOC_ENUM_EXT("DSP2 Firmware", wm_adsp_fw_enum[1], 273 SOC_ENUM_EXT("DSP2 Firmware", wm_adsp_fw_enum[1],
253 wm_adsp_fw_get, wm_adsp_fw_put), 274 wm_adsp_fw_get, wm_adsp_fw_put),
275 SOC_ENUM("DSP2 Rate", wm_adsp_rate_enum[1]),
254 SOC_ENUM_EXT("DSP3 Firmware", wm_adsp_fw_enum[2], 276 SOC_ENUM_EXT("DSP3 Firmware", wm_adsp_fw_enum[2],
255 wm_adsp_fw_get, wm_adsp_fw_put), 277 wm_adsp_fw_get, wm_adsp_fw_put),
278 SOC_ENUM("DSP3 Rate", wm_adsp_rate_enum[2]),
256 SOC_ENUM_EXT("DSP4 Firmware", wm_adsp_fw_enum[3], 279 SOC_ENUM_EXT("DSP4 Firmware", wm_adsp_fw_enum[3],
257 wm_adsp_fw_get, wm_adsp_fw_put), 280 wm_adsp_fw_get, wm_adsp_fw_put),
281 SOC_ENUM("DSP4 Rate", wm_adsp_rate_enum[3]),
258}; 282};
259EXPORT_SYMBOL_GPL(wm_adsp_fw_controls); 283EXPORT_SYMBOL_GPL(wm_adsp_fw_controls);
260 284