audio: Add support for Audience EarSmart ICs

Some devices (often T-Mobile variants) have extra hardware for
incall audio processing.
Audio must be routed to the ES IC properly so it can be passed to
ALSA, otherwise the RX/TX streams are lost.

Change-Id: Ib29c747d5728a09726e14bab00f26ad273400aba
diff --git a/audio/voice.c b/audio/voice.c
index 6de05fa..824724a 100644
--- a/audio/voice.c
+++ b/audio/voice.c
@@ -34,6 +34,10 @@
 #include "audio_hw.h"
 #include "voice.h"
 
+#ifdef AUDIENCE_EARSMART_IC
+#include "audience.h"
+#endif
+
 static struct pcm_config pcm_config_voicecall = {
     .channels = 2,
     .rate = 8000,
@@ -249,6 +253,11 @@
         start_voice_session_bt_sco(session);
     }
 
+#ifdef AUDIENCE_EARSMART_IC
+    ALOGV("%s: Enabling Audience IC", __func__);
+    es_start_voice_session(session);
+#endif
+
     if (session->two_mic_control) {
         ALOGV("%s: enabling two mic control", __func__);
         ril_set_two_mic_control(&session->ril, AUDIENCE, TWO_MIC_SOLUTION_ON);
@@ -290,6 +299,10 @@
         stop_voice_session_bt_sco(session);
     }
 
+#ifdef AUDIENCE_EARSMART_IC
+    ALOGV("%s: Disabling Audience IC", __func__);
+    es_stop_voice_session();
+#endif
 
     session->out_device = AUDIO_DEVICE_NONE;