提交 e001525c 编写于 作者: G Gaku Inami 提交者: Stephen Boyd

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: NGaku Inami <gaku.inami.xw@bp.renesas.com>
Signed-off-by: NHiroyuki Yokoyama <hiroyuki.yokoyama.vx@renesas.com>
Signed-off-by: NYoshihiro Kaneko <ykaneko0929@gmail.com>
Acked-by: NKuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: NStephen Boyd <sboyd@codeaurora.org>
上级 fa0abb18
...@@ -343,6 +343,15 @@ static int cs2000_set_rate(struct clk_hw *hw, ...@@ -343,6 +343,15 @@ static int cs2000_set_rate(struct clk_hw *hw,
return __cs2000_set_rate(priv, ch, rate, parent_rate); return __cs2000_set_rate(priv, ch, rate, parent_rate);
} }
static int cs2000_set_saved_rate(struct cs2000_priv *priv)
{
int ch = 0; /* it uses ch0 only at this point */
return __cs2000_set_rate(priv, ch,
priv->saved_rate,
priv->saved_parent_rate);
}
static int cs2000_enable(struct clk_hw *hw) static int cs2000_enable(struct clk_hw *hw)
{ {
struct cs2000_priv *priv = hw_to_priv(hw); struct cs2000_priv *priv = hw_to_priv(hw);
...@@ -535,11 +544,8 @@ static int cs2000_probe(struct i2c_client *client, ...@@ -535,11 +544,8 @@ static int cs2000_probe(struct i2c_client *client,
static int cs2000_resume(struct device *dev) static int cs2000_resume(struct device *dev)
{ {
struct cs2000_priv *priv = dev_get_drvdata(dev); struct cs2000_priv *priv = dev_get_drvdata(dev);
int ch = 0; /* it uses ch0 only at this point */
return __cs2000_set_rate(priv, ch, return cs2000_set_saved_rate(priv);
priv->saved_rate,
priv->saved_parent_rate);
} }
static const struct dev_pm_ops cs2000_pm_ops = { static const struct dev_pm_ops cs2000_pm_ops = {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册