hal: Correct compilation errors in hal

Correct compilation errors due to merge of new changes

Change-Id: I83cea7c5d672d24b81bbb767eafc3e1564be561a
diff --git a/hal/audio_extn/passthru.c b/hal/audio_extn/passthru.c
index 1ee0008..f8974c7 100644
--- a/hal/audio_extn/passthru.c
+++ b/hal/audio_extn/passthru.c
@@ -535,7 +535,7 @@
           platform_get_snd_device_name(out_snd_device));
 
     /* Check if the channels are supported */
-    if (max_edid_channels < backend_cfg.channels) {
+    if (max_edid_channels < (int)backend_cfg.channels) {
 
         ALOGE("%s: ERROR: Unsupported channels in passthru mode!!!"
               " max_edid_channels - %d backend_channels - %d",
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 32eb459..d1538de 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -2060,12 +2060,9 @@
     int ret = 0;
     struct audio_usecase *uc_info;
     struct audio_device *adev = in->dev;
-    int snd_card_status;
     struct pcm_config config = in->config;
-    int usecase;
+    int usecase = platform_update_usecase_from_source(in->source,in->usecase);
 
-    snd_card_status = get_snd_card_state(adev);
-    usecase = platform_update_usecase_from_source(in->source,in->usecase);
     if (get_usecase_from_list(adev, usecase) == NULL)
         in->usecase = usecase;
     ALOGD("%s: enter: stream(%p)usecase(%d: %s)",
@@ -2166,7 +2163,7 @@
 
         while (1) {
             in->pcm = pcm_open(adev->snd_card, in->pcm_device_id,
-                               flags, &in->config);
+                               flags, &config);
             if (in->pcm == NULL || !pcm_is_ready(in->pcm)) {
                 ALOGE("%s: %s", __func__, pcm_get_error(in->pcm));
                 if (in->pcm != NULL) {
@@ -3773,13 +3770,6 @@
         goto exit;
     }
 
-    if (out->devices & AUDIO_DEVICE_OUT_AUX_DIGITAL) {
-        channels = platform_edid_get_max_channels(out->dev->platform);
-        if (audio_extn_passthru_is_enabled() &&
-            !out->is_iec61937_info_available &&
-            audio_extn_passthru_is_passthrough_stream(out)) {
-            audio_extn_passthru_update_stream_configuration(adev, out,
-                    buffer, bytes);
     if ((out->devices & AUDIO_DEVICE_OUT_AUX_DIGITAL) &&
          !out->is_iec61937_info_available) {
 
@@ -3824,7 +3814,6 @@
                     goto exit;
             }
         }
-       }
     }
 
     if ((out->devices & AUDIO_DEVICE_OUT_ALL_A2DP) &&
diff --git a/hal/msm8916/platform.h b/hal/msm8916/platform.h
index d9f203c..13247ff 100644
--- a/hal/msm8916/platform.h
+++ b/hal/msm8916/platform.h
@@ -444,12 +444,4 @@
     char interface_name[100];
 };
 
-struct audio_backend_cfg {
-    unsigned int   sample_rate;
-    unsigned int   channels;
-    unsigned int   bit_width;
-    bool           passthrough_enabled;
-    audio_format_t format;
-};
-
 #endif // QCOM_AUDIO_PLATFORM_H
diff --git a/hal/msm8974/platform.h b/hal/msm8974/platform.h
index 113c0f2..ba1a195 100644
--- a/hal/msm8974/platform.h
+++ b/hal/msm8974/platform.h
@@ -562,12 +562,4 @@
     char interface_name[100];
 };
 
-struct audio_backend_cfg {
-    unsigned int   sample_rate;
-    unsigned int   channels;
-    unsigned int   bit_width;
-    bool           passthrough_enabled;
-    audio_format_t format;
-};
-
 #endif // QCOM_AUDIO_PLATFORM_H
diff --git a/hal/platform_api.h b/hal/platform_api.h
index e36f994..924c1a4 100644
--- a/hal/platform_api.h
+++ b/hal/platform_api.h
@@ -37,6 +37,14 @@
     ACDB_EXTN,
 } caller_t;
 
+struct audio_backend_cfg {
+    unsigned int   sample_rate;
+    unsigned int   channels;
+    unsigned int   bit_width;
+    bool           passthrough_enabled;
+    audio_format_t format;
+};
+
 struct amp_db_and_gain_table {
     float amp;
     float db;
@@ -153,6 +161,9 @@
 
 struct audio_offload_info_t;
 uint32_t platform_get_compress_offload_buffer_size(audio_offload_info_t* info);
+int platform_get_codec_backend_cfg(struct audio_device* adev,
+                                   snd_device_t snd_device,
+                                   struct audio_backend_cfg *backend_cfg);
 
 bool platform_check_and_set_codec_backend_cfg(struct audio_device* adev,
                    struct audio_usecase *usecase, snd_device_t snd_device);