ASoC: msm: Fix FM glitch issue.

For FM glitch issue, currently unity gain is being applied
as driver is not sending afe loopback gain cmd to LPASS before
afe loopback start cmd. afe loopback gain fails when
sent before sending loopback start cmd, as there is no APR
registration implemented. Adding APR registration to the cmd
to address the issue.

Signed-off-by: Jayasena Sangaraboina <jsanga@codeaurora.org>
diff --git a/sound/soc/msm/qdsp6/q6afe.c b/sound/soc/msm/qdsp6/q6afe.c
index 5c47159..7157a8b 100644
--- a/sound/soc/msm/qdsp6/q6afe.c
+++ b/sound/soc/msm/qdsp6/q6afe.c
@@ -424,9 +424,14 @@
 	int ret = 0;
 
 	if (this_afe.apr == NULL) {
-		pr_err("%s: AFE is not opened\n", __func__);
-		ret = -EPERM;
-		goto fail_cmd;
+		this_afe.apr = apr_register("ADSP", "AFE", afe_callback,
+					0xFFFFFFFF, &this_afe);
+		pr_debug("%s: Register AFE\n", __func__);
+		if (this_afe.apr == NULL) {
+			pr_err("%s: Unable to register AFE\n", __func__);
+			ret = -ENODEV;
+			return ret;
+		}
 	}
 
 	if (afe_validate_port(port_id) < 0) {