Skip to content

Commit 120f3e6

Browse files
jhovoldbroonie
authored andcommitted
ASoC: codecs: wsa884x: fix codec initialisation
The soundwire update_status() callback may be called multiple times with the same ATTACHED status but initialisation should only be done when transitioning from UNATTACHED to ATTACHED. Fix the inverted hw_init flag which was set to false instead of true after initialisation which defeats its purpose and may result in repeated unnecessary initialisation. Similarly, the initial state of the flag was also inverted so that the codec would only be initialised and brought out of regmap cache only mode if its status first transitions to UNATTACHED. Fixes: aa21a7d ("ASoC: codecs: wsa884x: Add WSA884x family of speakers") Cc: stable@vger.kernel.org # 6.5 Cc: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Johan Hovold <johan@kernel.org> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Tested-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com> Link: https://patch.msgid.link/20260102111413.9605-4-johan@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 29d71b8 commit 120f3e6

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

sound/soc/codecs/wsa884x.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1534,7 +1534,7 @@ static void wsa884x_init(struct wsa884x_priv *wsa884x)
15341534

15351535
wsa884x_set_gain_parameters(wsa884x);
15361536

1537-
wsa884x->hw_init = false;
1537+
wsa884x->hw_init = true;
15381538
}
15391539

15401540
static int wsa884x_update_status(struct sdw_slave *slave,
@@ -2109,7 +2109,6 @@ static int wsa884x_probe(struct sdw_slave *pdev,
21092109

21102110
/* Start in cache-only until device is enumerated */
21112111
regcache_cache_only(wsa884x->regmap, true);
2112-
wsa884x->hw_init = true;
21132112

21142113
if (IS_REACHABLE(CONFIG_HWMON)) {
21152114
struct device *hwmon;

0 commit comments

Comments
 (0)