summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm_adsp.c
diff options
context:
space:
mode:
authorMark Brown2012-12-02 13:50:46 +0100
committerMark Brown2012-12-02 16:09:23 +0100
commitdd49e2c8b9f18bd4f2848a9d558da08db3966319 (patch)
tree82701f5e9b719a5a7768bbab4b36bc2c770404c7 /sound/soc/codecs/wm_adsp.c
parentASoC: adsp: Keep ADSP2 memory powered off when not in use (diff)
downloadkernel-qcow2-linux-dd49e2c8b9f18bd4f2848a9d558da08db3966319.tar.gz
kernel-qcow2-linux-dd49e2c8b9f18bd4f2848a9d558da08db3966319.tar.xz
kernel-qcow2-linux-dd49e2c8b9f18bd4f2848a9d558da08db3966319.zip
ASoC: adsp: Set DSP clock rate to SYSCLK rate
For simplicity always run the DSP at the SYSCLK rate. 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.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c
index 3a8d75bfb0b1..dcf14c38e67e 100644
--- a/sound/soc/codecs/wm_adsp.c
+++ b/sound/soc/codecs/wm_adsp.c
@@ -544,6 +544,28 @@ int wm_adsp2_event(struct snd_soc_dapm_widget *w,
switch (event) {
case SND_SOC_DAPM_POST_PMU:
+ /*
+ * For simplicity set the DSP clock rate to be the
+ * SYSCLK rate rather than making it configurable.
+ */
+ ret = regmap_read(dsp->regmap, ARIZONA_SYSTEM_CLOCK_1, &val);
+ if (ret != 0) {
+ adsp_err(dsp, "Failed to read SYSCLK state: %d\n",
+ ret);
+ return ret;
+ }
+ val = (val & ARIZONA_SYSCLK_FREQ_MASK)
+ >> ARIZONA_SYSCLK_FREQ_SHIFT;
+
+ ret = regmap_update_bits(dsp->regmap,
+ dsp->base + ADSP2_CLOCKING,
+ ADSP2_CLK_SEL_MASK, val);
+ if (ret != 0) {
+ adsp_err(dsp, "Failed to set clock rate: %d\n",
+ ret);
+ return ret;
+ }
+
if (dsp->dvfs) {
ret = regmap_read(dsp->regmap,
dsp->base + ADSP2_CLOCKING, &val);