aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/clk/clk-cs2000-cp.c
diff options
context:
space:
mode:
authorDaniel Mack <daniel@zonque.org>2022-01-25 10:33:34 +0100
committerStephen Boyd <sboyd@kernel.org>2022-01-25 14:23:16 -0800
commitb83688258605900413dd6c85ac9278eea3bda614 (patch)
treefa8b729c5d3e8aef0ae8f248c8181e2dfcc4837b /drivers/clk/clk-cs2000-cp.c
parentclk: cs2000-cp: add support for dynamic mode (diff)
downloadwireguard-linux-b83688258605900413dd6c85ac9278eea3bda614.tar.xz
wireguard-linux-b83688258605900413dd6c85ac9278eea3bda614.zip
clk: cs2000-cp: make clock skip setting configurable
The clock skip function of this chip is not necessarily desirable in all hardware appliances. This patch makes the feature configurable through a device-tree property. Signed-off-by: Daniel Mack <daniel@zonque.org> Link: https://lore.kernel.org/r/20220125093336.226787-8-daniel@zonque.org Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'drivers/clk/clk-cs2000-cp.c')
-rw-r--r--drivers/clk/clk-cs2000-cp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/clk/clk-cs2000-cp.c b/drivers/clk/clk-cs2000-cp.c
index bd030e156d65..9f99e39b41f2 100644
--- a/drivers/clk/clk-cs2000-cp.c
+++ b/drivers/clk/clk-cs2000-cp.c
@@ -81,6 +81,7 @@ struct cs2000_priv {
bool dynamic_mode;
bool lf_ratio;
+ bool clk_skip;
/* suspend/resume */
unsigned long saved_rate;
@@ -133,7 +134,7 @@ static int cs2000_enable_dev_config(struct cs2000_priv *priv, bool enable)
return ret;
ret = cs2000_bset(priv, FUNC_CFG1, CLKSKIPEN,
- enable ? CLKSKIPEN : 0);
+ (enable && priv->clk_skip) ? CLKSKIPEN : 0);
if (ret < 0)
return ret;
@@ -464,6 +465,8 @@ static int cs2000_clk_register(struct cs2000_priv *priv)
if (ret < 0)
return ret;
+ priv->clk_skip = of_property_read_bool(np, "cirrus,clock-skip");
+
ref_clk_rate = clk_get_rate(priv->ref_clk);
ret = cs2000_ref_clk_bound_rate(priv, ref_clk_rate);
if (ret < 0)