From: Mark Brown Date: Sun, 2 Dec 2012 12:50:46 +0000 (+0900) Subject: ASoC: adsp: Set DSP clock rate to SYSCLK rate X-Git-Tag: v3.8-rc1~29^2~5^2~76^2~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dd49e2c8b9f18bd4f2848a9d558da08db3966319;p=profile%2Fivi%2Fkernel-x86-ivi.git ASoC: adsp: Set DSP clock rate to SYSCLK rate For simplicity always run the DSP at the SYSCLK rate. Signed-off-by: Mark Brown --- diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c index 3a8d75b..dcf14c3 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);