From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
To: lee.jones@linaro.org, broonie@kernel.org
Cc: lgirdwood@gmail.com, s.nawrocki@samsung.com,
alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org,
patches@opensource.wolfsonmicro.com
Subject: [PATCH 1/6] ASoC: arizona: Correct handling of FLL theta in synchroniser mode
Date: Fri, 2 Sep 2016 16:52:43 +0100 [thread overview]
Message-ID: <1472831568-466-2-git-send-email-ckeepax@opensource.wolfsonmicro.com> (raw)
In-Reply-To: <1472831568-466-1-git-send-email-ckeepax@opensource.wolfsonmicro.com>
Theta/lambda is used to give the fractional portion of the FLL
frequency multiplication. When the synchroniser is active the
reference path lambda value is hard coded in the hardware to
65536. This patch corrects the handling of theta such that it
is scaled to match this denominator, when the synchroniser is
active.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
---
sound/soc/codecs/arizona.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/sound/soc/codecs/arizona.c b/sound/soc/codecs/arizona.c
index ccb3ca2..ded235f 100644
--- a/sound/soc/codecs/arizona.c
+++ b/sound/soc/codecs/arizona.c
@@ -1920,8 +1920,8 @@ static struct {
struct arizona_fll_cfg {
int n;
- int theta;
- int lambda;
+ unsigned int theta;
+ unsigned int lambda;
int refdiv;
int outdiv;
int fratio;
@@ -2233,6 +2233,10 @@ static int arizona_enable_fll(struct arizona_fll *fll)
fll->ref_src != fll->sync_src) {
arizona_calc_fll(fll, &cfg, fll->ref_freq, false);
+ /* Ref path hardcodes lambda to 65536 when sync is on */
+ if (fll->sync_src >= 0 && cfg.lambda)
+ cfg.theta = (cfg.theta * (1 << 16)) / cfg.lambda;
+
arizona_apply_fll(arizona, fll->base, &cfg, fll->ref_src,
false);
if (fll->sync_src >= 0) {
--
2.1.4
next prev parent reply other threads:[~2016-09-02 15:52 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-02 15:52 [PATCH 0/6] Arizona FLL fixes and Clocking Improvements Charles Keepax
2016-09-02 15:52 ` Charles Keepax [this message]
2016-09-03 11:08 ` Applied "ASoC: arizona: Correct handling of FLL theta in synchroniser mode" to the asoc tree Mark Brown
2016-09-02 15:52 ` [PATCH 2/6] ASoC: arizona: Allow specification of base for arizona_is_enabled_fll Charles Keepax
2016-09-14 17:15 ` Applied "ASoC: arizona: Allow specification of base for arizona_is_enabled_fll" to the asoc tree Mark Brown
2016-09-02 15:52 ` [PATCH 3/6] ASoC: arizona: Avoid changing SYNC_ENA whilst the FLL_ENA is set Charles Keepax
2016-09-02 15:52 ` [PATCH 4/6] mfd: arizona: Add gating of external MCLKn clocks Charles Keepax
2016-09-13 12:44 ` Lee Jones
2016-09-13 12:57 ` Charles Keepax
2016-09-13 13:11 ` Lee Jones
2016-09-30 9:29 ` Charles Keepax
2016-10-04 14:52 ` Lee Jones
2016-09-14 13:11 ` Mark Brown
2016-10-04 14:52 ` [GIT PULL] Immutable branch between MFD and Regulator due for the v4.9 merge window Lee Jones
2016-09-02 15:52 ` [PATCH 5/6] ASoC: arizona: Add gating for clock when used for direct MCLK Charles Keepax
2016-09-05 8:11 ` Sylwester Nawrocki
2016-10-24 18:04 ` Applied "ASoC: arizona: Add gating for clock when used for direct MCLK" to the asoc tree Mark Brown
2016-09-02 15:52 ` [PATCH 6/6] ASoC: arizona: Add gating for source clocks of the FLLs Charles Keepax
2016-09-05 8:12 ` Sylwester Nawrocki
2016-10-24 18:04 ` Applied "ASoC: arizona: Add gating for source clocks of the FLLs" to the asoc tree Mark Brown
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=1472831568-466-2-git-send-email-ckeepax@opensource.wolfsonmicro.com \
--to=ckeepax@opensource.wolfsonmicro.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=lee.jones@linaro.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=patches@opensource.wolfsonmicro.com \
--cc=s.nawrocki@samsung.com \
/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;
as well as URLs for NNTP newsgroup(s).