linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: wens@csie.org (Chen-Yu Tsai)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/9] clk: sunxi-ng: sun5i: Fix bit offset of audio PLL post-divider
Date: Thu, 12 Oct 2017 16:36:57 +0800	[thread overview]
Message-ID: <20171012083705.24409-2-wens@csie.org> (raw)
In-Reply-To: <20171012083705.24409-1-wens@csie.org>

The post-divider for the audio PLL is in bits [29:26], as specified
in the user manual, not [19:16] as currently programmed in the code.
The post-divider has a default register value of 2, i.e. a divider
of 3. This means the clock rate fed to the audio codec would be off.

This was discovered when porting sigma-delta modulation for the PLL
to sun5i, which needs the post-divider to be 1.

Fix the bit offset, so we do actually force the post-divider to a
certain value.

Fixes: 5e73761786d6 ("clk: sunxi-ng: Add sun5i CCU driver")
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 drivers/clk/sunxi-ng/ccu-sun5i.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/sunxi-ng/ccu-sun5i.c b/drivers/clk/sunxi-ng/ccu-sun5i.c
index ab9e850b3707..2f385a57cd91 100644
--- a/drivers/clk/sunxi-ng/ccu-sun5i.c
+++ b/drivers/clk/sunxi-ng/ccu-sun5i.c
@@ -982,8 +982,8 @@ static void __init sun5i_ccu_init(struct device_node *node,
 
 	/* Force the PLL-Audio-1x divider to 4 */
 	val = readl(reg + SUN5I_PLL_AUDIO_REG);
-	val &= ~GENMASK(19, 16);
-	writel(val | (3 << 16), reg + SUN5I_PLL_AUDIO_REG);
+	val &= ~GENMASK(29, 26);
+	writel(val | (3 << 26), reg + SUN5I_PLL_AUDIO_REG);
 
 	/*
 	 * Use the peripheral PLL as the AHB parent, instead of CPU /
-- 
2.14.2

  reply	other threads:[~2017-10-12  8:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-12  8:36 [PATCH 0/9] clk: sunxi-ng: Use sigma-delta modulation for audio PLL Chen-Yu Tsai
2017-10-12  8:36 ` Chen-Yu Tsai [this message]
2017-10-12  8:36 ` [PATCH 2/9] clk: sunxi-ng: nm: Check if requested rate is supported by fractional clock Chen-Yu Tsai
2017-10-12  8:36 ` [PATCH 3/9] clk: sunxi-ng: Add sigma-delta modulation support Chen-Yu Tsai
2017-10-12  8:37 ` [PATCH 4/9] clk: sunxi-ng: nm: Add support for sigma-delta modulation Chen-Yu Tsai
2017-10-12  8:37 ` [PATCH 5/9] clk: sunxi-ng: sun8i: h3: Use sigma-delta modulation for audio PLL Chen-Yu Tsai
2017-10-12  8:37 ` [PATCH 6/9] clk: sunxi-ng: sun4i: " Chen-Yu Tsai
2017-10-12  8:37 ` [PATCH 7/9] clk: sunxi-ng: sun5i: " Chen-Yu Tsai
2017-10-12  8:37 ` [PATCH 8/9] clk: sunxi-ng: sun6i: " Chen-Yu Tsai
2017-10-12  8:37 ` [PATCH 9/9] clk: sunxi-ng: sun8i: a23: " Chen-Yu Tsai
2017-10-13  7:28 ` [PATCH 0/9] clk: sunxi-ng: " Maxime Ripard

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=20171012083705.24409-2-wens@csie.org \
    --to=wens@csie.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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).