audio: Select device based on supported mic count

source_mic_type is obtained using max mic count. Default value
is dual mic.
If fluence is enabled, device is selected based on fluence type set
and mic count supported.
For VoiceRecognition source, channel count should be 1 to enable
fluence.
Add support for 3 and 4 channel recording.

Change-Id: I4c7229230b79830a66e25cc49d80f1e7090c0212
diff --git a/hal/msm8974/platform.h b/hal/msm8974/platform.h
index 7fe7271..3cd4361 100644
--- a/hal/msm8974/platform.h
+++ b/hal/msm8974/platform.h
@@ -32,6 +32,13 @@
     FLUENCE_BROADSIDE = 0x2,
 };
 
+enum {
+    SOURCE_MONO_MIC  = 0x1,            /* Target contains 1 mic */
+    SOURCE_DUAL_MIC  = 0x2,            /* Target contains 2 mics */
+    SOURCE_THREE_MIC = 0x4,            /* Target contains 3 mics */
+    SOURCE_QUAD_MIC  = 0x8,            /* Target contains 4 mics */
+};
+
 /*
  * Below are the devices for which is back end is same, SLIMBUS_0_RX.
  * All these devices are handled by the internal HW codec. We can
@@ -171,6 +178,7 @@
     SND_DEVICE_IN_SPEAKER_QMIC_NS,
     SND_DEVICE_IN_SPEAKER_QMIC_AEC_NS,
     SND_DEVICE_IN_THREE_MIC,
+    SND_DEVICE_IN_HANDSET_TMIC,
     SND_DEVICE_IN_END,
 
     SND_DEVICE_MAX = SND_DEVICE_IN_END,
@@ -371,6 +379,9 @@
 #define FM_RX_VOLUME "Internal FM RX Volume"
 #endif
 
+#define PLATFORM_MAX_MIC_COUNT "input_mic_max_count"
+#define PLATFORM_DEFAULT_MIC_COUNT 2
+
 #define LIB_CSD_CLIENT "libcsd-client.so"
 /* CSD-CLIENT related functions */
 typedef int (*init_t)(bool);