Revert "hal: audio: add tz_names extn to support from audio platform_info xml"

tz_names support is added using key value pairs under
config params in audio_platform_info.xml.

This reverts commit 8225243c24793daba3e80930f3aef36c7b098267

Change-Id: I5bee7225f945b31e3df9372d00aeb003c2092d8b
diff --git a/hal/msm8916/platform.c b/hal/msm8916/platform.c
index 72a76b6..1d13972 100644
--- a/hal/msm8916/platform.c
+++ b/hal/msm8916/platform.c
@@ -4372,60 +4372,6 @@
     return ret;
 }
 
-/*
- * This is a lookup table to map names of speaker device with respective left and right TZ names.
- * Also the tz names for a particular left or right speaker can be overriden by adding
- * corresponding entry in audio_platform_info.xml file.
- */
-struct speaker_device_to_tz_names speaker_device_tz_names = {
-    {SND_DEVICE_OUT_SPEAKER, "", ""},
-};
-
-const char *platform_get_spkr_1_tz_name(snd_device_t snd_device)
-{
-    if (snd_device >= SND_DEVICE_MIN && snd_device < SND_DEVICE_MAX)
-        return speaker_device_tz_names.spkr_1_tz_name;
-    else
-        return "";
-}
-
-const char *platform_get_spkr_2_tz_name(snd_device_t snd_device)
-{
-    if (snd_device >= SND_DEVICE_MIN && snd_device < SND_DEVICE_MAX)
-        return speaker_device_tz_names.spkr_2_tz_name;
-    else
-        return "";
-}
-
-int platform_set_spkr_device_tz_names(snd_device_t index,
-                                      const char *spkr_1_tz_name, const char *spkr_2_tz_name)
-{
-    int ret = 0;
-
-    if (spkr_1_tz_name == NULL && spkr_2_tz_name == NULL) {
-        ALOGE("%s: Invalid input", __func__);
-        ret = -EINVAL;
-        goto done;
-    }
-    if (index != speaker_device_tz_names.snd_device) {
-        ALOGE("%s: not matching speaker device\n");
-        ret = -EINVAL;
-        goto done;
-    }
-    ALOGD("%s: Enter, spkr_1_tz_name :%s, spkr_2_tz_name:%s",
-            __func__, spkr_1_tz_name, spkr_2_tz_name);
-
-    if (spkr_1_tz_name != NULL)
-        strlcpy(speaker_device_tz_names.spkr_1_tz_name, spkr_1_tz_name,
-                sizeof(speaker_device_tz_names.spkr_1_tz_name));
-
-    if (spkr_2_tz_name != NULL)
-        strlcpy(speaker_device_tz_names.spkr_2_tz_name, spkr_2_tz_name,
-                sizeof(speaker_device_tz_names.spkr_2_tz_name));
-done:
-    return ret;
-}
-
 bool platform_send_gain_dep_cal(void *platform __unused,
                                 int level __unused)
 {
diff --git a/hal/msm8916/platform.h b/hal/msm8916/platform.h
index af2f6ae..9710147 100644
--- a/hal/msm8916/platform.h
+++ b/hal/msm8916/platform.h
@@ -322,10 +322,4 @@
     char device_name[100];
     char interface_name[100];
 };
-
-struct speaker_device_to_tz_names {
-    snd_device_t snd_device;
-    char spkr_1_tz_name[100];
-    char spkr_2_tz_name[100];
-};
 #endif // QCOM_AUDIO_PLATFORM_H
diff --git a/hal/msm8960/platform.c b/hal/msm8960/platform.c
index 861790e..6d2d478 100644
--- a/hal/msm8960/platform.c
+++ b/hal/msm8960/platform.c
@@ -1166,12 +1166,6 @@
     return -ENOSYS;
 }
 
-int platform_set_spkr_device_tz_names(snd_device_t index,
-                                      const char *spkr_1_tz_name, const char *spkr_2_tz_name)
-{
-    return -ENOSYS;
-}
-
 bool platform_send_gain_dep_cal(void *platform __unused,
                                 int level __unused)
 {
diff --git a/hal/msm8974/platform.c b/hal/msm8974/platform.c
index a803f21..4be172e 100644
--- a/hal/msm8974/platform.c
+++ b/hal/msm8974/platform.c
@@ -704,14 +704,6 @@
 static int msm_be_id_array_len  =
     sizeof(msm_device_to_be_id) / sizeof(msm_device_to_be_id[0]);
 
-/*
- * This is a lookup table to map names of speaker device with respective left and right TZ names.
- * Also the tz names for a particular left or right speaker can be overriden by adding
- * corresponding entry in audio_platform_info.xml file.
- */
-struct speaker_device_to_tz_names speaker_device_tz_names = {
-    {SND_DEVICE_OUT_SPEAKER, "", ""},
-};
 
 #define DEEP_BUFFER_PLATFORM_DELAY (29*1000LL)
 #define LOW_LATENCY_PLATFORM_DELAY (13*1000LL)
@@ -1517,22 +1509,6 @@
         return "";
 }
 
-const char *platform_get_spkr_1_tz_name(snd_device_t snd_device)
-{
-    if (snd_device >= SND_DEVICE_MIN && snd_device < SND_DEVICE_MAX)
-        return speaker_device_tz_names.spkr_1_tz_name;
-    else
-        return "";
-}
-
-const char *platform_get_spkr_2_tz_name(snd_device_t snd_device)
-{
-    if (snd_device >= SND_DEVICE_MIN && snd_device < SND_DEVICE_MAX)
-        return speaker_device_tz_names.spkr_2_tz_name;
-    else
-        return "";
-}
-
 int platform_get_snd_device_name_extn(void *platform, snd_device_t snd_device,
                                       char *device_name)
 {
@@ -4153,32 +4129,3 @@
 done:
     return ret;
 }
-
-int platform_set_spkr_device_tz_names(snd_device_t index,
-                                      const char *spkr_1_tz_name, const char *spkr_2_tz_name)
-{
-    int ret = 0;
-
-    if (spkr_1_tz_name == NULL && spkr_2_tz_name == NULL) {
-        ALOGE("%s: Invalid input", __func__);
-        ret = -EINVAL;
-        goto done;
-    }
-    if (index != speaker_device_tz_names.snd_device) {
-        ALOGE("%s: not matching speaker device\n", __func__);
-        ret = -EINVAL;
-        goto done;
-    }
-    ALOGD("%s: Enter, spkr_1_tz_name :%s, spkr_2_tz_name:%s",
-           __func__, spkr_1_tz_name, spkr_2_tz_name);
-
-    if (spkr_1_tz_name != NULL)
-        strlcpy(speaker_device_tz_names.spkr_1_tz_name, spkr_1_tz_name,
-                sizeof(speaker_device_tz_names.spkr_1_tz_name));
-
-    if (spkr_2_tz_name != NULL)
-        strlcpy(speaker_device_tz_names.spkr_2_tz_name, spkr_2_tz_name,
-                sizeof(speaker_device_tz_names.spkr_2_tz_name));
-done:
-    return ret;
-}
diff --git a/hal/msm8974/platform.h b/hal/msm8974/platform.h
index fa9f4bb..5471b3c 100644
--- a/hal/msm8974/platform.h
+++ b/hal/msm8974/platform.h
@@ -407,10 +407,4 @@
     char device_name[100];
     char interface_name[100];
 };
-
-struct speaker_device_to_tz_names {
-    snd_device_t snd_device;
-    char spkr_1_tz_name[100];
-    char spkr_2_tz_name[100];
-};
 #endif // QCOM_AUDIO_PLATFORM_H
diff --git a/hal/platform_api.h b/hal/platform_api.h
index 5e2ce45..8ea5b93 100644
--- a/hal/platform_api.h
+++ b/hal/platform_api.h
@@ -119,8 +119,4 @@
 int platform_set_device_params(struct stream_out *out, int param, int value);
 int platform_set_audio_device_interface(const char * device_name, const char *intf_name,
                                         const char * codec_type);
-int platform_set_spkr_device_tz_names(snd_device_t index,
-                                       const char *spkr_1_tz_name, const char *spkr_2_tz_name);
-const char *platform_get_spkr_1_tz_name(snd_device_t snd_device);
-const char *platform_get_spkr_2_tz_name(snd_device_t snd_device);
 #endif // AUDIO_PLATFORM_API_H
diff --git a/hal/platform_info.c b/hal/platform_info.c
index b57c90a..4a788ab 100644
--- a/hal/platform_info.c
+++ b/hal/platform_info.c
@@ -49,7 +49,6 @@
     PCM_ID,
     BACKEND_NAME,
     INTERFACE_NAME,
-    TZ_NAME,
     CONFIG_PARAMS,
 } section_t;
 
@@ -61,7 +60,6 @@
 static void process_pcm_id(const XML_Char **attr);
 static void process_backend_name(const XML_Char **attr);
 static void process_interface_name(const XML_Char **attr);
-static void process_tz_name(const XML_Char **attr);
 static void process_config_params(const XML_Char **attr);
 static void process_root(const XML_Char **attr);
 
@@ -73,7 +71,6 @@
     [PCM_ID] = process_pcm_id,
     [BACKEND_NAME] = process_backend_name,
     [INTERFACE_NAME] = process_interface_name,
-    [TZ_NAME] = process_tz_name,
     [CONFIG_PARAMS] = process_config_params,
 };
 
@@ -108,11 +105,6 @@
  * ...
  * ...
  * </interface_names>
- * <tz_names>
- * <device name="???" spkr_1_tz_name="???" spkr_2_tz_name="???"/>
- * ...
- * ...
- * </tz_names>
  * <config_params>
  *      <param key="snd_card_name" value="msm8994-tomtom-mtp-snd-card"/>
  *      ...
@@ -333,42 +325,6 @@
     return;
 }
 
-static void process_tz_name(const XML_Char **attr)
-{
-    int ret, index;
-
-    if (strcmp(attr[0], "name") != 0) {
-        ALOGE("%s: 'name' not found, no Audio Interface set!", __func__);
-        goto done;
-    }
-
-    index = platform_get_snd_device_index((char *)attr[1]);
-    if (index < 0) {
-        ALOGE("%s: Device %s not found, no snd device set!",
-              __func__, attr[1]);
-        goto done;
-    }
-
-    if (strcmp(attr[2], "spkr_1_tz_name") != 0) {
-        ALOGE("%s: Device %s has no spkr_1_tz_name set!",
-              __func__, attr[1]);
-    }
-
-    if (strcmp(attr[4], "spkr_2_tz_name") != 0) {
-        ALOGE("%s: Device %s has no spkr_2_tz_name set!",
-              __func__, attr[1]);
-    }
-
-    ret = platform_set_spkr_device_tz_names(index, (char *)attr[3], (char *)attr[5]);
-    if (ret < 0) {
-        ALOGE("%s: Audio Interface not set!", __func__);
-        goto done;
-    }
-
-done:
-    return;
-}
-
 static void process_config_params(const XML_Char **attr)
 {
     if (strcmp(attr[0], "key") != 0) {
@@ -386,7 +342,6 @@
     return;
 }
 
-
 static void start_tag(void *userdata __unused, const XML_Char *tag_name,
                       const XML_Char **attr)
 {
@@ -408,12 +363,10 @@
         section = INTERFACE_NAME;
     } else if (strcmp(tag_name, "native_configs") == 0) {
         section = NATIVESUPPORT;
-    } else if (strcmp(tag_name, "tz_names") == 0) {
-        section = TZ_NAME;
     } else if (strcmp(tag_name, "device") == 0) {
         if ((section != ACDB) && (section != BACKEND_NAME) && (section != BITWIDTH) &&
-            (section != INTERFACE_NAME) && (section != TZ_NAME)) {
-            ALOGE("device tag only supported for acdb/backend names/bitwitdh/interface/tz names");
+            (section != INTERFACE_NAME)) {
+            ALOGE("device tag only supported for acdb/backend names/bitwitdh/interface names");
             return;
         }