Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d23b90f9 authored by Jitendra Singh Naruka's avatar Jitendra Singh Naruka
Browse files

ASoC: msm: qdsp6v2: check if backend active before querying RMS



RMS query to dsp should be done only when the relevant back end is
active to avoid un-necessary errors. Put a check to see if the
backend is active.

CRs-Fixed: 597886
Change-Id: I1ed402272eb34aa6120adbb97d1627a3f7f9b3c5
Signed-off-by: default avatarJitendra Singh Naruka <jnaruk@codeaurora.org>
parent 2d37de8c
Loading
Loading
Loading
Loading
+20 −14
Original line number Diff line number Diff line
@@ -3192,6 +3192,7 @@ static const struct snd_kcontrol_new stereo_to_custom_stereo_controls[] = {
int msm_routing_get_rms_value_control(struct snd_kcontrol *kcontrol,
				struct snd_ctl_elem_value *ucontrol) {
	int rc = 0;
	int be_idx = 0;
	char *param_value;
	int *update_param_value;
	uint32_t param_length = sizeof(uint32_t);
@@ -3201,6 +3202,10 @@ int msm_routing_get_rms_value_control(struct snd_kcontrol *kcontrol,
		pr_err("%s, param memory alloc failed\n", __func__);
		return -ENOMEM;
	}
	for (be_idx = 0; be_idx < MSM_BACKEND_DAI_MAX; be_idx++)
		if (msm_bedais[be_idx].port_id == SLIMBUS_0_TX)
			break;
	if ((be_idx < MSM_BACKEND_DAI_MAX) && msm_bedais[be_idx].active) {
		rc = adm_get_params(SLIMBUS_0_TX,
				RMS_MODULEID_APPI_PASSTHRU,
				RMS_PARAM_FIRST_SAMPLE,
@@ -3216,6 +3221,7 @@ int msm_routing_get_rms_value_control(struct snd_kcontrol *kcontrol,

		pr_debug("%s: FROM DSP value[0] 0x%x\n",
			  __func__, update_param_value[0]);
	}
	kfree(param_value);
	return 0;
}