hal: Specific Clip playing mute on 24bit USB-Headset and Display port.

- Specific Clip playing mute on 24bit USB-Headset and Display port.
- The Root Cause is that the copp is getting configured at stream
  sample rate which is not supported by ADM.
- Convert stream sample rate to ADM supported sample rate for
  USB-Headset and Display port.

Change-Id: I32e8b7b6f5bdbe625ca17d0e4a6cd1895f2e7f9f
diff --git a/hal/msm8916/platform.c b/hal/msm8916/platform.c
index 56d9aec..c31a8d8 100644
--- a/hal/msm8916/platform.c
+++ b/hal/msm8916/platform.c
@@ -6777,7 +6777,7 @@
          *sample_rate = stream_sr;
 
      if (snd_device == SND_DEVICE_OUT_HDMI)
-         *sample_rate = platform_get_supported_sampling_rate_on_hdmi(stream_sr);
+         *sample_rate = platform_get_supported_copp_sampling_rate(stream_sr);
 
      ALOGI("sn_device %d device sr %d stream sr %d copp sr %d", snd_device, device_sr, stream_sr
 , *sample_rate);
@@ -7882,7 +7882,7 @@
     return MAX_CODEC_BACKENDS;
 }
 
-int platform_get_supported_sampling_rate_on_hdmi(uint32_t stream_sr)
+int platform_get_supported_copp_sampling_rate(uint32_t stream_sr)
 {
     int sample_rate;
     switch (stream_sr){
diff --git a/hal/msm8974/platform.c b/hal/msm8974/platform.c
index bf66355..53dfa43 100644
--- a/hal/msm8974/platform.c
+++ b/hal/msm8974/platform.c
@@ -6816,8 +6816,9 @@
      } else
          *sample_rate = stream_sr;
 
-    if (snd_device == SND_DEVICE_OUT_HDMI)
-        *sample_rate = platform_get_supported_sampling_rate_on_hdmi(stream_sr);
+    if ((snd_device == SND_DEVICE_OUT_HDMI) || (snd_device == SND_DEVICE_OUT_DISPLAY_PORT) ||
+                  (snd_device == SND_DEVICE_OUT_USB_HEADSET))
+        *sample_rate = platform_get_supported_copp_sampling_rate(stream_sr);
 
      ALOGI("sn_device %d device sr %d stream sr %d copp sr %d", snd_device, device_sr, stream_sr, *sample_rate);
 
@@ -7627,7 +7628,7 @@
 
     return MAX_CODEC_BACKENDS;
 }
-int platform_get_supported_sampling_rate_on_hdmi(uint32_t stream_sr)
+int platform_get_supported_copp_sampling_rate(uint32_t stream_sr)
 {
     int sample_rate;
     switch (stream_sr){
diff --git a/hal/platform_api.h b/hal/platform_api.h
index 0674761..e72c6e9 100644
--- a/hal/platform_api.h
+++ b/hal/platform_api.h
@@ -184,7 +184,7 @@
 
 int platform_set_channel_allocation(void *platform, int channel_alloc);
 int platform_get_edid_info(void *platform);
-int platform_get_supported_sampling_rate_on_hdmi(uint32_t stream_sr);
+int platform_get_supported_copp_sampling_rate(uint32_t stream_sr);
 int platform_set_channel_map(void *platform, int ch_count, char *ch_map,
                              int snd_id);
 int platform_set_stream_channel_map(void *platform, audio_channel_mask_t channel_mask,