From: Paul Cercueil <paul@crapouillou.net>
To: Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>
Cc: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org,
od@zcrc.me, Paul Cercueil <paul@crapouillou.net>
Subject: [PATCH 5/5] clk: ingenic/jz4725b: Fix "pll half" divider not read/written properly
Date: Thu, 2 May 2019 23:25:02 +0200 [thread overview]
Message-ID: <20190502212502.24330-5-paul@crapouillou.net> (raw)
In-Reply-To: <20190502212502.24330-1-paul@crapouillou.net>
The code was setting the bit 21 of the CPCCR register to use a divider
of 2 for the "pll half" clock, and clearing the bit to use a divider
of 1.
This is the opposite of how this register field works: a cleared bit
means that the /2 divider is used, and a set bit means that the divider
is 1.
Restore the correct behaviour using the newly introduced .div_table
field.
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
drivers/clk/ingenic/jz4725b-cgu.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/clk/ingenic/jz4725b-cgu.c b/drivers/clk/ingenic/jz4725b-cgu.c
index 31325dd40a0f..47287956824b 100644
--- a/drivers/clk/ingenic/jz4725b-cgu.c
+++ b/drivers/clk/ingenic/jz4725b-cgu.c
@@ -37,6 +37,10 @@ static const u8 jz4725b_cgu_cpccr_div_table[] = {
1, 2, 3, 4, 6, 8,
};
+static const u8 jz4725b_cgu_pll_half_div_table[] = {
+ 2, 1,
+};
+
static const struct ingenic_cgu_clk_info jz4725b_cgu_clocks[] = {
/* External clocks */
@@ -70,7 +74,10 @@ static const struct ingenic_cgu_clk_info jz4725b_cgu_clocks[] = {
[JZ4725B_CLK_PLL_HALF] = {
"pll half", CGU_CLK_DIV,
.parents = { JZ4725B_CLK_PLL, -1, -1, -1 },
- .div = { CGU_REG_CPCCR, 21, 1, 1, -1, -1, -1 },
+ .div = {
+ CGU_REG_CPCCR, 21, 1, 1, -1, -1, -1,
+ jz4725b_cgu_pll_half_div_table,
+ },
},
[JZ4725B_CLK_CCLK] = {
--
2.21.0.593.g511ec345e18
next prev parent reply other threads:[~2019-05-02 21:25 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-02 21:24 [PATCH 1/5] clk: ingenic: Add support for divider tables Paul Cercueil
2019-05-02 21:24 ` [PATCH 2/5] clk: ingenic/jz4740: Fix incorrect dividers for main clocks Paul Cercueil
2019-06-07 21:03 ` Stephen Boyd
2019-06-08 10:18 ` Paul Cercueil
2019-05-02 21:25 ` [PATCH 3/5] clk: ingenic/jz4770: " Paul Cercueil
2019-06-07 21:03 ` Stephen Boyd
2019-05-02 21:25 ` [PATCH 4/5] clk: ingenic/jz4725b: " Paul Cercueil
2019-06-07 21:03 ` Stephen Boyd
2019-05-02 21:25 ` Paul Cercueil [this message]
2019-06-07 21:03 ` [PATCH 5/5] clk: ingenic/jz4725b: Fix "pll half" divider not read/written properly Stephen Boyd
2019-06-07 21:03 ` [PATCH 1/5] clk: ingenic: Add support for divider tables Stephen Boyd
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=20190502212502.24330-5-paul@crapouillou.net \
--to=paul@crapouillou.net \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=od@zcrc.me \
--cc=sboyd@kernel.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
all inboxes | Powered by JetHome®