Unverified Commit 120f3e6f authored by Johan Hovold's avatar Johan Hovold Committed by Mark Brown
Browse files

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: aa21a7d4 ("ASoC: codecs: wsa884x: Add WSA884x family of speakers")
Cc: stable@vger.kernel.org	# 6.5
Cc: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
Reviewed-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Tested-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Reviewed-by: default avatarSrinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Link: https://patch.msgid.link/20260102111413.9605-4-johan@kernel.org


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 29d71b8a
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -1534,7 +1534,7 @@ static void wsa884x_init(struct wsa884x_priv *wsa884x)

	wsa884x_set_gain_parameters(wsa884x);

	wsa884x->hw_init = false;
	wsa884x->hw_init = true;
}

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

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

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