Skip to content

Commit

Permalink
ASoC: cs35l56: Don't add the same register patch multiple times
Browse files Browse the repository at this point in the history
[ Upstream commit 07687cd ]

Move the call to cs35l56_set_patch() earlier in cs35l56_init() so
that it only adds the register patch on first-time initialization.

The call was after the post_soft_reset label, so every time this
function was run to re-initialize the hardware after a reset it would
call regmap_register_patch() and add the same reg_sequence again.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
Fixes: 898673b ("ASoC: cs35l56: Move shared data into a common data structure")
Link: https://msgid.link/r/20240129162737.497-6-rf@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Stable-dep-of: eba2eb2 ("ASoC: soc-card: Fix missing locking in snd_soc_card_get_kcontrol()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
rfvirgil authored and gregkh committed Mar 6, 2024
1 parent 1d5f1ee commit b7bdbd6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sound/soc/codecs/cs35l56.c
Original file line number Diff line number Diff line change
Expand Up @@ -1159,6 +1159,10 @@ int cs35l56_init(struct cs35l56_private *cs35l56)
if (ret < 0)
return ret;

ret = cs35l56_set_patch(&cs35l56->base);
if (ret)
return ret;

/* Populate the DSP information with the revision and security state */
cs35l56->dsp.part = devm_kasprintf(cs35l56->base.dev, GFP_KERNEL, "cs35l56%s-%02x",
cs35l56->base.secured ? "s" : "", cs35l56->base.rev);
Expand Down Expand Up @@ -1197,10 +1201,6 @@ int cs35l56_init(struct cs35l56_private *cs35l56)
if (ret)
return ret;

ret = cs35l56_set_patch(&cs35l56->base);
if (ret)
return ret;

/* Registers could be dirty after soft reset or SoundWire enumeration */
regcache_sync(cs35l56->base.regmap);

Expand Down

0 comments on commit b7bdbd6

Please sign in to comment.