Skip to content

Commit 2f3d32f

Browse files
zonquebebarino
authored andcommitted
clk: cs2000-cp: freeze config during register fiddling
Make sure to freeze the configuration of the chip during the programming of 32-bit registers. This avoids the processing of invalid intermediate states. Signed-off-by: Daniel Mack <daniel@zonque.org> Link: https://lore.kernel.org/r/20220125093336.226787-9-daniel@zonque.org Signed-off-by: Stephen Boyd <sboyd@kernel.org>
1 parent b836882 commit 2f3d32f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

drivers/clk/clk-cs2000-cp.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
#define FRACNSRC_DYNAMIC (1 << 0)
5353

5454
/* GLOBAL_CFG */
55+
#define FREEZE (1 << 7)
5556
#define ENDEV2 (0x1)
5657

5758
/* FUNC_CFG1 */
@@ -335,6 +336,10 @@ static int __cs2000_set_rate(struct cs2000_priv *priv, int ch,
335336
{
336337
int ret;
337338

339+
ret = cs2000_bset(priv, GLOBAL_CFG, FREEZE, FREEZE);
340+
if (ret < 0)
341+
return ret;
342+
338343
ret = cs2000_select_ratio_mode(priv, rate, parent_rate);
339344
if (ret < 0)
340345
return ret;
@@ -347,6 +352,10 @@ static int __cs2000_set_rate(struct cs2000_priv *priv, int ch,
347352
if (ret < 0)
348353
return ret;
349354

355+
ret = cs2000_bset(priv, GLOBAL_CFG, FREEZE, 0);
356+
if (ret < 0)
357+
return ret;
358+
350359
priv->saved_rate = rate;
351360
priv->saved_parent_rate = parent_rate;
352361

0 commit comments

Comments
 (0)