From: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
To: broonie@linaro.org, lee.jones@linaro.org, sameo@linux.intel.com,
lgirdwood@gmail.com, perex@perex.cz, tiwai@suse.de
Cc: alsa-devel@alsa-project.org, patches@opensource.wolfsonmicro.com,
linux-kernel@vger.kernel.org
Subject: [PATCH 3/3 v4 RESEND] ASoC: arizona: Add DVFS handling for sample rate control
Date: Fri, 8 Aug 2014 14:35:10 +0100 [thread overview]
Message-ID: <20140808133510.GC2665@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <20140808133233.GA2665@opensource.wolfsonmicro.com>
From: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Some codecs need to boost DVFS for higher sample rates.
Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
---
sound/soc/codecs/arizona.c | 22 +++++++++++++++++++++-
1 files changed, 21 insertions(+), 1 deletions(-)
diff --git a/sound/soc/codecs/arizona.c b/sound/soc/codecs/arizona.c
index d441d80..c5b6be2 100644
--- a/sound/soc/codecs/arizona.c
+++ b/sound/soc/codecs/arizona.c
@@ -1185,7 +1185,7 @@ static int arizona_hw_params_rate(struct snd_pcm_substream *substream,
struct arizona_priv *priv = snd_soc_codec_get_drvdata(codec);
struct arizona_dai_priv *dai_priv = &priv->dai[dai->id - 1];
int base = dai->driver->base;
- int i, sr_val;
+ int i, sr_val, ret;
/*
* We will need to be more flexible than this in future,
@@ -1201,6 +1201,26 @@ static int arizona_hw_params_rate(struct snd_pcm_substream *substream,
}
sr_val = i;
+ switch (priv->arizona->type) {
+ case WM5102:
+ case WM8997:
+ if (arizona_sr_vals[sr_val] >= 88200)
+ ret = arizona_dvfs_up(priv->arizona,
+ ARIZONA_DVFS_SR1_RQ);
+ else
+ ret = arizona_dvfs_down(priv->arizona,
+ ARIZONA_DVFS_SR1_RQ);
+
+ if (ret != 0) {
+ arizona_aif_err(dai, "Failed to change DVFS %d\n", ret);
+ return ret;
+ }
+ break;
+
+ default:
+ break;
+ }
+
switch (dai_priv->clk) {
case ARIZONA_CLK_SYSCLK:
switch (priv->arizona->type) {
--
1.7.2.5
next prev parent reply other threads:[~2014-08-08 13:35 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-08 13:32 [PATCH 1/3 v4 RESEND] mfd: arizona: Export function to control subsystem DVFS Richard Fitzgerald
2014-08-08 13:34 ` [PATCH 2/3 v4 RESEND] ASoC: wm_adsp: Move DVFS control into codec driver Richard Fitzgerald
2014-08-08 13:35 ` Richard Fitzgerald [this message]
2014-08-12 13:34 ` [PATCH 3/3 v4 RESEND] ASoC: arizona: Add DVFS handling for sample rate control Charles Keepax
2014-08-12 15:57 ` Mark Brown
2014-08-21 10:40 ` [PATCH 1/3 v4 RESEND] mfd: arizona: Export function to control subsystem DVFS Lee Jones
2014-08-25 10:15 ` Richard Fitzgerald
2014-09-01 14:47 ` Richard Fitzgerald
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140808133510.GC2665@opensource.wolfsonmicro.com \
--to=rf@opensource.wolfsonmicro.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@linaro.org \
--cc=lee.jones@linaro.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=patches@opensource.wolfsonmicro.com \
--cc=perex@perex.cz \
--cc=sameo@linux.intel.com \
--cc=tiwai@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox