msm: audio: qdsp5v2: Change the 4.1 encoder driver to address 4.1 modem

Change-Id: I9d1d084485fce8bc43964f0afdf73589d028344b
Signed-off-by: Kalyani Polepeddy <kpolep@codeaurora.org>
diff --git a/arch/arm/mach-msm/qdsp5v2/audio_amrnb_in.c b/arch/arm/mach-msm/qdsp5v2/audio_amrnb_in.c
index db56a0b..e1af44f 100644
--- a/arch/arm/mach-msm/qdsp5v2/audio_amrnb_in.c
+++ b/arch/arm/mach-msm/qdsp5v2/audio_amrnb_in.c
@@ -34,6 +34,7 @@
 #include <mach/iommu_domains.h>
 #include <mach/msm_subsystem_map.h>
 #include <mach/msm_adsp.h>
+#include <mach/socinfo.h>
 #include <mach/qdsp5v2/qdsp5audreccmdi.h>
 #include <mach/qdsp5v2/qdsp5audrecmsg.h>
 #include <mach/qdsp5v2/audpreproc.h>
@@ -104,6 +105,7 @@
 	int enabled;
 	int running;
 	int stopped; /* set when stopped, cleared on flush */
+	char *build_id;
 };
 
 struct audio_frame {
@@ -337,7 +339,13 @@
 	struct audpreproc_audrec_cmd_enc_cfg cmd;
 
 	memset(&cmd, 0, sizeof(cmd));
-	cmd.cmd_id = AUDPREPROC_AUDREC_CMD_ENC_CFG_2;
+	if (audio->build_id[17] == '1') {
+		cmd.cmd_id = AUDPREPROC_AUDREC_CMD_ENC_CFG_2;
+		MM_ERR("sending AUDPREPROC_AUDREC_CMD_ENC_CFG_2 command");
+	} else {
+		cmd.cmd_id = AUDPREPROC_AUDREC_CMD_ENC_CFG;
+		MM_ERR("sending AUDPREPROC_AUDREC_CMD_ENC_CFG command");
+	}
 	cmd.stream_id = audio->enc_id;
 
 	if (enable)
@@ -854,6 +862,9 @@
 		MM_ERR("failed to register device event listener\n");
 		goto evt_error;
 	}
+	audio->build_id = socinfo_get_build_id();
+	MM_ERR("build id used is = %s\n", audio->build_id);
+
 	file->private_data = audio;
 	audio->opened = 1;
 done: