From 521ea726c2bd412914fd3f6b0ef72e5ff29bd426 Mon Sep 17 00:00:00 2001 From: Prasad Kumpatla Date: Sat, 9 May 2020 11:49:54 +0530 Subject: [PATCH] asoc: codecs: check the spkr status before access the wsa registers Before access the wsa register check the spkr status bit in power-down sequence. Change-Id: I5e07ee56e17701275784fd4c413bc214c5893989 Signed-off-by: Prasad Kumpatla --- asoc/codecs/wsa883x/wsa883x.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/asoc/codecs/wsa883x/wsa883x.c b/asoc/codecs/wsa883x/wsa883x.c index 6617ce126d..4da1953533 100644 --- a/asoc/codecs/wsa883x/wsa883x.c +++ b/asoc/codecs/wsa883x/wsa883x.c @@ -1296,9 +1296,10 @@ static int wsa883x_event_notify(struct notifier_block *nb, switch (event) { case BOLERO_WSA_EVT_PA_OFF_PRE_SSR: - snd_soc_component_update_bits(wsa883x->component, - WSA883X_PA_FSM_CTL, - 0x01, 0x00); + if (test_bit(SPKR_STATUS, &wsa883x->status_mask)) + snd_soc_component_update_bits(wsa883x->component, + WSA883X_PA_FSM_CTL, + 0x01, 0x00); wsa883x_swr_down(wsa883x); break;