Skip to content

Commit b836882

Browse files
zonquebebarino
authored andcommitted
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>
1 parent da1eb4e commit b836882

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/clk/clk-cs2000-cp.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ struct cs2000_priv {
8181

8282
bool dynamic_mode;
8383
bool lf_ratio;
84+
bool clk_skip;
8485

8586
/* suspend/resume */
8687
unsigned long saved_rate;
@@ -133,7 +134,7 @@ static int cs2000_enable_dev_config(struct cs2000_priv *priv, bool enable)
133134
return ret;
134135

135136
ret = cs2000_bset(priv, FUNC_CFG1, CLKSKIPEN,
136-
enable ? CLKSKIPEN : 0);
137+
(enable && priv->clk_skip) ? CLKSKIPEN : 0);
137138
if (ret < 0)
138139
return ret;
139140

@@ -464,6 +465,8 @@ static int cs2000_clk_register(struct cs2000_priv *priv)
464465
if (ret < 0)
465466
return ret;
466467

468+
priv->clk_skip = of_property_read_bool(np, "cirrus,clock-skip");
469+
467470
ref_clk_rate = clk_get_rate(priv->ref_clk);
468471
ret = cs2000_ref_clk_bound_rate(priv, ref_clk_rate);
469472
if (ret < 0)

0 commit comments

Comments
 (0)