hal: update pcm ids for multi offload use cases

Pcm ids for secondary offload sessions are not mapped
properly for 8916 platform.
Use audio_platform_info.xml to update pcm ids.
Use separate xml file, audio_platform_info_extcodec.xml
for external codec since it's pcm ids are different.

CRs-Fixed: 842795
Change-Id: Id34e639b2c169e95f17400bc3141206dfc6ad0b9
diff --git a/hal/msm8916/platform.c b/hal/msm8916/platform.c
index 4b970bd..650eeee 100644
--- a/hal/msm8916/platform.c
+++ b/hal/msm8916/platform.c
@@ -57,7 +57,7 @@
 #define MIXER_XML_PATH_WCD9306 "/system/etc/mixer_paths_wcd9306.xml"
 #define MIXER_XML_PATH_WCD9330 "/system/etc/mixer_paths_wcd9330.xml"
 #define PLATFORM_INFO_XML_PATH      "/system/etc/audio_platform_info.xml"
-#define PLATFORM_INFO_XML_PATH_I2S  "/system/etc/audio_platform_info_i2s.xml"
+#define PLATFORM_INFO_XML_PATH_EXTCODEC  "/system/etc/audio_platform_info_extcodec.xml"
 
 #define LIB_ACDB_LOADER "libacdbloader.so"
 #define AUDIO_DATA_BLOCK_MIXER_CTL "HDMI EDID"
@@ -231,22 +231,18 @@
     [USECASE_AUDIO_PLAYBACK_OFFLOAD] =
                      {PLAYBACK_OFFLOAD_DEVICE, PLAYBACK_OFFLOAD_DEVICE},
 #ifdef MULTIPLE_OFFLOAD_ENABLED
-    [USECASE_AUDIO_PLAYBACK_OFFLOAD2] =
-                     {PLAYBACK_OFFLOAD_DEVICE2, PLAYBACK_OFFLOAD_DEVICE2},
-    [USECASE_AUDIO_PLAYBACK_OFFLOAD3] =
-                     {PLAYBACK_OFFLOAD_DEVICE3, PLAYBACK_OFFLOAD_DEVICE3},
-    [USECASE_AUDIO_PLAYBACK_OFFLOAD4] =
-                     {PLAYBACK_OFFLOAD_DEVICE4, PLAYBACK_OFFLOAD_DEVICE4},
-    [USECASE_AUDIO_PLAYBACK_OFFLOAD5] =
-                     {PLAYBACK_OFFLOAD_DEVICE5, PLAYBACK_OFFLOAD_DEVICE5},
-    [USECASE_AUDIO_PLAYBACK_OFFLOAD6] =
-                     {PLAYBACK_OFFLOAD_DEVICE6, PLAYBACK_OFFLOAD_DEVICE6},
-    [USECASE_AUDIO_PLAYBACK_OFFLOAD7] =
-                     {PLAYBACK_OFFLOAD_DEVICE7, PLAYBACK_OFFLOAD_DEVICE7},
-    [USECASE_AUDIO_PLAYBACK_OFFLOAD8] =
-                     {PLAYBACK_OFFLOAD_DEVICE8, PLAYBACK_OFFLOAD_DEVICE8},
-    [USECASE_AUDIO_PLAYBACK_OFFLOAD9] =
-                     {PLAYBACK_OFFLOAD_DEVICE9, PLAYBACK_OFFLOAD_DEVICE9},
+    /* Below entries are initialized with invalid values
+     * Valid values should be updated from fnc platform_info_init()
+     * based on pcm ids defined in audio_platform_info.xml.
+     */
+    [USECASE_AUDIO_PLAYBACK_OFFLOAD2] = {-1, -1},
+    [USECASE_AUDIO_PLAYBACK_OFFLOAD3] = {-1, -1},
+    [USECASE_AUDIO_PLAYBACK_OFFLOAD4] = {-1, -1},
+    [USECASE_AUDIO_PLAYBACK_OFFLOAD5] = {-1, -1},
+    [USECASE_AUDIO_PLAYBACK_OFFLOAD6] = {-1, -1},
+    [USECASE_AUDIO_PLAYBACK_OFFLOAD7] = {-1, -1},
+    [USECASE_AUDIO_PLAYBACK_OFFLOAD8] = {-1, -1},
+    [USECASE_AUDIO_PLAYBACK_OFFLOAD9] = {-1, -1},
 #endif
     [USECASE_AUDIO_RECORD] = {AUDIO_RECORD_PCM_DEVICE, AUDIO_RECORD_PCM_DEVICE},
     [USECASE_AUDIO_RECORD_COMPRESS] = {COMPRESS_CAPTURE_DEVICE, COMPRESS_CAPTURE_DEVICE},
@@ -1405,8 +1401,11 @@
 
     set_platform_defaults();
 
-    /* Initialize ACDB ID's */
-    platform_info_init(PLATFORM_INFO_XML_PATH);
+    /* Initialize ACDB and PCM ID's */
+    if (is_external_codec)
+        platform_info_init(PLATFORM_INFO_XML_PATH_EXTCODEC);
+    else
+        platform_info_init(PLATFORM_INFO_XML_PATH);
 
     /* init usb */
     audio_extn_usb_init(adev);
diff --git a/hal/msm8916/platform.h b/hal/msm8916/platform.h
index 6d5b4a0..78c9ff8 100644
--- a/hal/msm8916/platform.h
+++ b/hal/msm8916/platform.h
@@ -220,17 +220,6 @@
 #define SPKR_PROT_CALIB_TX_PCM_DEVICE 26
 #define PLAYBACK_OFFLOAD_DEVICE 9
 
-#ifdef MULTIPLE_OFFLOAD_ENABLED
-#define PLAYBACK_OFFLOAD_DEVICE2 17
-#define PLAYBACK_OFFLOAD_DEVICE3 18
-#define PLAYBACK_OFFLOAD_DEVICE4 37
-#define PLAYBACK_OFFLOAD_DEVICE5 38
-#define PLAYBACK_OFFLOAD_DEVICE6 39
-#define PLAYBACK_OFFLOAD_DEVICE7 40
-#define PLAYBACK_OFFLOAD_DEVICE8 41
-#define PLAYBACK_OFFLOAD_DEVICE9 42
-#endif
-
 #define COMPRESS_VOIP_CALL_PCM_DEVICE 3
 
 /* Define macro for Internal FM volume mixer */