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_a2dp_in.c b/arch/arm/mach-msm/qdsp5v2/audio_a2dp_in.c
index 519d785..6166de2 100644
--- a/arch/arm/mach-msm/qdsp5v2/audio_a2dp_in.c
+++ b/arch/arm/mach-msm/qdsp5v2/audio_a2dp_in.c
@@ -42,6 +42,7 @@
 #include <mach/msm_adsp.h>
 #include <mach/msm_memtypes.h>
 #include <mach/msm_subsystem_map.h>
+#include <mach/socinfo.h>
 #include <mach/qdsp5v2/qdsp5audreccmdi.h>
 #include <mach/qdsp5v2/qdsp5audrecmsg.h>
 #include <mach/qdsp5v2/audpreproc.h>
@@ -114,6 +115,7 @@
 	int running;
 	int stopped; /* set when stopped, cleared on flush */
 	int abort; /* set when error, like sample rate mismatch */
+	char *build_id;
 };
 
 static struct audio_a2dp_in the_audio_a2dp_in;
@@ -368,7 +370,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)
@@ -941,6 +949,8 @@
 		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;
 	rc = 0;