ASoC: cs47l35: use dsp running flag for dsp status
authorYoon (Seungyoon) Lee <w22905@motorola.com>
Tue, 30 Apr 2019 20:28:54 +0000 (15:28 -0500)
committerlingsen1 <lingsen1@lenovo.com>
Sun, 7 Feb 2021 09:37:02 +0000 (17:37 +0800)
instead of checking DSP memory address for DSP core status,
check the flag from wm_adsp to determine algorithm status.

Change-Id: I846afc671e708dedd9af52000a7eb76cc39adc3b
Signed-off-by: Yoon (Seungyoon) Lee <w22905@motorola.com>
Reviewed-on: https://gerrit.mot.com/1346616
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Zhengming Yao <yaozm1@mt.com>
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key

sound/soc/codecs/cs47l35.c

index ca54b48a7a03ce23a8fc8e175c5a86508aa24dad..f4700e96e876ea212c2099f90a6accca3080ecfb 100755 (executable)
@@ -238,10 +238,8 @@ static int cs47l35_get_dsp_state(struct snd_kcontrol *kcontrol,
        struct soc_mixer_control *mc = (struct soc_mixer_control *)
                kcontrol->private_value;
        struct wm_adsp *dsp = &dsps[mc->shift];
-       unsigned int val;
 
-       regmap_read(dsp->regmap, dsp->base + ADSP2_CONTROL, &val);
-       if (val & ADSP2_CORE_ENA)
+       if (dsp != NULL && dsp->running)
                ucontrol->value.integer.value[0] = 1;
        else
                ucontrol->value.integer.value[0] = 0;