Promotion of audio-userspace.lnx.2.1-00003.

CRs      Change ID                                   Subject
--------------------------------------------------------------------------------------------------------------
1028547   Ie8a8ff5e4d65c5a73641f925a46d03235d1a0f50   audio: Fix three-way deadlock
1002168   Ifc08af12c9d86031fba11128323c9f40d1d92e5e   hal: add support for msm8917 tmo, msm8917 sku5 and msm89

Change-Id: Idbe87bb5dd3ad0fa57e955d8033cbca0763f4492
CRs-Fixed: 1028547, 1002168
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 7978adf..ec99175 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -2185,6 +2185,9 @@
         if (adev->adm_deregister_stream)
             adev->adm_deregister_stream(adev->adm_data, out->handle);
 
+        if (is_offload_usecase(out->usecase))
+            stop_compressed_output_l(out);
+
         pthread_mutex_lock(&adev->lock);
         out->standby = true;
         if (!is_offload_usecase(out->usecase)) {
@@ -2194,7 +2197,6 @@
             }
         } else {
             ALOGD("copl(%p):standby", out);
-            stop_compressed_output_l(out);
             out->send_next_track_params = false;
             out->is_compr_metadata_avail = false;
             out->gapless_mdata.encoder_delay = 0;
diff --git a/hal/msm8916/hw_info.c b/hal/msm8916/hw_info.c
index e18f2ec..07a060f 100644
--- a/hal/msm8916/hw_info.c
+++ b/hal/msm8916/hw_info.c
@@ -197,13 +197,13 @@
         strlcpy(hw_info->dev_extn, "", sizeof(hw_info->dev_extn));
     } else if (!strcmp(snd_card_name, "msm8952-sku1-snd-card")) {
         strlcpy(hw_info->type, "", sizeof(hw_info->type));
-        strlcpy(hw_info->name, "msm8952", sizeof(hw_info->name));
+        strlcpy(hw_info->name, "msm8937", sizeof(hw_info->name));
         hw_info->snd_devices = NULL;
         hw_info->num_snd_devices = 0;
         strlcpy(hw_info->dev_extn, "", sizeof(hw_info->dev_extn));
     } else if (!strcmp(snd_card_name, "msm8952-sku2-snd-card")) {
         strlcpy(hw_info->type, "", sizeof(hw_info->type));
-        strlcpy(hw_info->name, "msm8952", sizeof(hw_info->name));
+        strlcpy(hw_info->name, "msm8937", sizeof(hw_info->name));
         hw_info->snd_devices = NULL;
         hw_info->num_snd_devices = 0;
         strlcpy(hw_info->dev_extn, "", sizeof(hw_info->dev_extn));
@@ -267,8 +267,26 @@
         hw_info->snd_devices = NULL;
         hw_info->num_snd_devices = 0;
         strlcpy(hw_info->dev_extn, "", sizeof(hw_info->dev_extn));
+     } else if (!strcmp(snd_card_name, "msm8917-sku5-snd-card")) {
+        strlcpy(hw_info->type, "", sizeof(hw_info->type));
+        strlcpy(hw_info->name, "msm8917", sizeof(hw_info->name));
+        hw_info->snd_devices = NULL;
+        hw_info->num_snd_devices = 0;
+        strlcpy(hw_info->dev_extn, "", sizeof(hw_info->dev_extn));
+     } else if (!strcmp(snd_card_name, "msm8917-tmo-snd-card")) {
+        strlcpy(hw_info->type, "", sizeof(hw_info->type));
+        strlcpy(hw_info->name, "msm8917", sizeof(hw_info->name));
+        hw_info->snd_devices = NULL;
+        hw_info->num_snd_devices = 0;
+        strlcpy(hw_info->dev_extn, "", sizeof(hw_info->dev_extn));
+     } else if (!strcmp(snd_card_name, "msm8940-sku6-snd-card")) {
+        strlcpy(hw_info->type, "", sizeof(hw_info->type));
+        strlcpy(hw_info->name, "msm8940", sizeof(hw_info->name));
+        hw_info->snd_devices = NULL;
+        hw_info->num_snd_devices = 0;
+        strlcpy(hw_info->dev_extn, "", sizeof(hw_info->dev_extn));
     } else {
-        ALOGW("%s: Not an  8x16/8939/8909/8952 device", __func__);
+        ALOGW("%s: Not an 8x16/8909/8917/8937/8939/8940/8952/8953 device", __func__);
     }
 
     hw_info->is_wsa_combo_suppported = false;
@@ -287,7 +305,8 @@
     if (strstr(snd_card_name, "msm8x16") || strstr(snd_card_name, "msm8939") ||
         strstr(snd_card_name, "msm8909") || strstr(snd_card_name, "msm8952") ||
         strstr(snd_card_name, "msm8976") || strstr(snd_card_name, "msm8953") ||
-        strstr(snd_card_name, "msm8937")) {
+        strstr(snd_card_name, "msm8937") || strstr(snd_card_name, "msm8917") ||
+        strstr(snd_card_name, "msm8940") ) {
         ALOGV("8x16 - variant soundcard");
         update_hardware_info_8x16(hw_info, snd_card_name);
     } else {
diff --git a/hal/msm8916/platform.c b/hal/msm8916/platform.c
index c66fd38..40f26de 100644
--- a/hal/msm8916/platform.c
+++ b/hal/msm8916/platform.c
@@ -1086,6 +1086,27 @@
         msm_device_to_be_id = msm_device_to_be_id_external_codec;
         msm_be_id_array_len  =
             sizeof(msm_device_to_be_id_external_codec) / sizeof(msm_device_to_be_id_external_codec[0]);
+    } else if (!strncmp(snd_card_name, "msm8917-tmo-snd-card",
+                  sizeof("msm8917-tmo-snd-card"))) {
+        strlcpy(mixer_xml_path, MIXER_XML_PATH_SKU2,
+               MAX_MIXER_XML_PATH);
+        msm_device_to_be_id = msm_device_to_be_id_internal_codec;
+        msm_be_id_array_len  =
+            sizeof(msm_device_to_be_id_internal_codec) / sizeof(msm_device_to_be_id_internal_codec[0]);
+    } else if (!strncmp(snd_card_name, "msm8917-sku5-snd-card",
+                  sizeof("msm8917-sku5-snd-card"))) {
+        strlcpy(mixer_xml_path, MIXER_XML_PATH_SKU2,
+               MAX_MIXER_XML_PATH);
+        msm_device_to_be_id = msm_device_to_be_id_internal_codec;
+        msm_be_id_array_len  =
+            sizeof(msm_device_to_be_id_internal_codec) / sizeof(msm_device_to_be_id_internal_codec[0]);
+    } else if (!strncmp(snd_card_name, "msm8940-sku6-snd-card",
+                  sizeof("msm8940-sku6-snd-card"))) {
+        strlcpy(mixer_xml_path, MIXER_XML_PATH_SKU1,
+               MAX_MIXER_XML_PATH);
+        msm_device_to_be_id = msm_device_to_be_id_internal_codec;
+        msm_be_id_array_len  =
+            sizeof(msm_device_to_be_id_internal_codec) / sizeof(msm_device_to_be_id_internal_codec[0]);
     } else {
         strlcpy(mixer_xml_path, MIXER_XML_PATH,
                 sizeof(MIXER_XML_PATH));