aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGaku Inami <gaku.inami.xw@bp.renesas.com>2017-04-19 13:46:31 -0400
committerStephen Boyd <sboyd@codeaurora.org>2017-08-31 14:32:32 -0400
commite001525c4bcca9d3476f3ae30ff03e9ff67703d0 (patch)
tree65d5d8220cc959231d211d955327dd8d2ad53e4b
parentfa0abb18d981099071ad382375d1d9e625d81f36 (diff)
clk: cs2000: Add cs2000_set_saved_rate
This patch adds the common function to reset the clk rate in order to be able to use it in other cases. Signed-off-by: Gaku Inami <gaku.inami.xw@bp.renesas.com> Signed-off-by: Hiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com> Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com> Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
-rw-r--r--drivers/clk/clk-cs2000-cp.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/drivers/clk/clk-cs2000-cp.c b/drivers/clk/clk-cs2000-cp.c
index c54baede4d68..e8ea81c30f0c 100644
--- a/drivers/clk/clk-cs2000-cp.c
+++ b/drivers/clk/clk-cs2000-cp.c
@@ -343,6 +343,15 @@ static int cs2000_set_rate(struct clk_hw *hw,
343 return __cs2000_set_rate(priv, ch, rate, parent_rate); 343 return __cs2000_set_rate(priv, ch, rate, parent_rate);
344} 344}
345 345
346static int cs2000_set_saved_rate(struct cs2000_priv *priv)
347{
348 int ch = 0; /* it uses ch0 only at this point */
349
350 return __cs2000_set_rate(priv, ch,
351 priv->saved_rate,
352 priv->saved_parent_rate);
353}
354
346static int cs2000_enable(struct clk_hw *hw) 355static int cs2000_enable(struct clk_hw *hw)
347{ 356{
348 struct cs2000_priv *priv = hw_to_priv(hw); 357 struct cs2000_priv *priv = hw_to_priv(hw);
@@ -535,11 +544,8 @@ probe_err:
535static int cs2000_resume(struct device *dev) 544static int cs2000_resume(struct device *dev)
536{ 545{
537 struct cs2000_priv *priv = dev_get_drvdata(dev); 546 struct cs2000_priv *priv = dev_get_drvdata(dev);
538 int ch = 0; /* it uses ch0 only at this point */
539 547
540 return __cs2000_set_rate(priv, ch, 548 return cs2000_set_saved_rate(priv);
541 priv->saved_rate,
542 priv->saved_parent_rate);
543} 549}
544 550
545static const struct dev_pm_ops cs2000_pm_ops = { 551static const struct dev_pm_ops cs2000_pm_ops = {