From: Joonyoung Shim <jy0922.shim@samsung.com>
To: linux-clk@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, mturquette@linaro.org,
sboyd@codeaurora.org, haojian.zhuang@gmail.com,
james.hogan@imgtec.com, jy0922.shim@samsung.com
Subject: [PATCH 2/2] clk: divider: fix to set parent rate from CLK_DIVIDER_READ_ONLY flag
Date: Tue, 07 Apr 2015 16:46:46 +0900 [thread overview]
Message-ID: <1428392806-14538-2-git-send-email-jy0922.shim@samsung.com> (raw)
In-Reply-To: <1428392806-14538-1-git-send-email-jy0922.shim@samsung.com>
The round_rate callback function will returns alway same parent clk rate
of divider with CLK_DIVIDER_READ_ONLY flag. If be used
CLK_SET_RATE_PARENT flag with CLK_DIVIDER_READ_ONLY flag, then never
change parent clk rate anymore.
>From this case, this patch allows to change parent clk rate.
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
---
drivers/clk/clk-divider.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/clk/clk-divider.c b/drivers/clk/clk-divider.c
index ce34d29a..37e285e 100644
--- a/drivers/clk/clk-divider.c
+++ b/drivers/clk/clk-divider.c
@@ -352,6 +352,11 @@ static long clk_divider_round_rate(struct clk_hw *hw, unsigned long rate,
bestdiv = readl(divider->reg) >> divider->shift;
bestdiv &= div_mask(divider->width);
bestdiv = _get_div(divider->table, bestdiv, divider->flags);
+
+ if ((__clk_get_flags(hw->clk) & CLK_SET_RATE_PARENT))
+ *prate = __clk_round_rate(__clk_get_parent(hw->clk),
+ rate);
+
return DIV_ROUND_UP(*prate, bestdiv);
}
--
1.9.1
next prev parent reply other threads:[~2015-04-07 7:46 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-07 7:46 [PATCH 1/2] clk: divider: don't set_rate with CLK_DIVIDER_READ_ONLY flag Joonyoung Shim
2015-04-07 7:46 ` Joonyoung Shim [this message]
2015-05-12 23:25 ` [PATCH 2/2] clk: divider: fix to set parent rate from " Michael Turquette
2015-05-12 23:57 ` Stephen Boyd
2015-05-15 2:12 ` Joonyoung Shim
2015-06-04 22:42 ` Stephen Boyd
2015-05-12 23:59 ` [PATCH 1/2] clk: divider: don't set_rate with " Stephen Boyd
2015-05-15 1:52 ` Joonyoung Shim
2015-06-04 22:44 ` 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=1428392806-14538-2-git-send-email-jy0922.shim@samsung.com \
--to=jy0922.shim@samsung.com \
--cc=haojian.zhuang@gmail.com \
--cc=james.hogan@imgtec.com \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@linaro.org \
--cc=sboyd@codeaurora.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).