mirror of
git://git.yoctoproject.org/linux-yocto.git
synced 2026-01-27 12:47:24 +01:00
ASoC: codecs: wsa881x: fix unnecessary initialisation
commit 29d71b8a5a40708b3eed9ba4953bfc2312c9c776 upstream.
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.
Fixes: a0aab9e140 ("ASoC: codecs: add wsa881x amplifier support")
Cc: stable@vger.kernel.org # 5.6
Cc: Srinivas Kandagatla <srini@kernel.org>
Signed-off-by: Johan Hovold <johan@kernel.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@oss.qualcomm.com>
Link: https://patch.msgid.link/20260102111413.9605-3-johan@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
2617495ba7
commit
60f7e00894
|
|
@ -683,6 +683,7 @@ struct wsa881x_priv {
|
|||
*/
|
||||
unsigned int sd_n_val;
|
||||
int active_ports;
|
||||
bool hw_init;
|
||||
bool port_prepared[WSA881X_MAX_SWR_PORTS];
|
||||
bool port_enable[WSA881X_MAX_SWR_PORTS];
|
||||
};
|
||||
|
|
@ -692,6 +693,9 @@ static void wsa881x_init(struct wsa881x_priv *wsa881x)
|
|||
struct regmap *rm = wsa881x->regmap;
|
||||
unsigned int val = 0;
|
||||
|
||||
if (wsa881x->hw_init)
|
||||
return;
|
||||
|
||||
regmap_register_patch(wsa881x->regmap, wsa881x_rev_2_0,
|
||||
ARRAY_SIZE(wsa881x_rev_2_0));
|
||||
|
||||
|
|
@ -729,6 +733,8 @@ static void wsa881x_init(struct wsa881x_priv *wsa881x)
|
|||
regmap_update_bits(rm, WSA881X_OTP_REG_28, 0x3F, 0x3A);
|
||||
regmap_update_bits(rm, WSA881X_BONGO_RESRV_REG1, 0xFF, 0xB2);
|
||||
regmap_update_bits(rm, WSA881X_BONGO_RESRV_REG2, 0xFF, 0x05);
|
||||
|
||||
wsa881x->hw_init = true;
|
||||
}
|
||||
|
||||
static int wsa881x_component_probe(struct snd_soc_component *comp)
|
||||
|
|
@ -1073,6 +1079,9 @@ static int wsa881x_update_status(struct sdw_slave *slave,
|
|||
{
|
||||
struct wsa881x_priv *wsa881x = dev_get_drvdata(&slave->dev);
|
||||
|
||||
if (status == SDW_SLAVE_UNATTACHED)
|
||||
wsa881x->hw_init = false;
|
||||
|
||||
if (status == SDW_SLAVE_ATTACHED && slave->dev_num > 0)
|
||||
wsa881x_init(wsa881x);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user