hal: Avoid setting wrong sample rate for headset device

On internal codec, headset is shared same backend with
speaker or handset. platform_check_codec_backend_cfg is
wrongly setting backend sample rate to 48 KHz for headset
when using native playback or hifi audio.

Avoid setting sample rate to default sample rate for headset.

CRs-Fixed: 2398845
Change-Id: Ia8e1831292370f8648e145e0aa715ab9471d3a71
diff --git a/hal/msm8916/platform.c b/hal/msm8916/platform.c
index ca98ccc..37dbcb2 100644
--- a/hal/msm8916/platform.c
+++ b/hal/msm8916/platform.c
@@ -6339,7 +6339,7 @@
      * Handset and speaker may have diffrent backend. Check if the device is speaker or handset,
      * and these devices are restricited to 48kHz.
      */
-    if ((platform_get_backend_index(snd_device) == DEFAULT_CODEC_BACKEND) &&
+    if (!codec_device_supports_native_playback(usecase->devices) &&
         (platform_check_backends_match(SND_DEVICE_OUT_SPEAKER, snd_device) ||
          platform_check_backends_match(SND_DEVICE_OUT_HANDSET, snd_device))) {
         sample_rate = CODEC_BACKEND_DEFAULT_SAMPLE_RATE;
diff --git a/hal/msm8974/platform.c b/hal/msm8974/platform.c
index d2af736..e64243a 100644
--- a/hal/msm8974/platform.c
+++ b/hal/msm8974/platform.c
@@ -6511,7 +6511,7 @@
      * Handset and speaker may have diffrent backend. Check if the device is speaker or handset,
      * and these devices are restricited to 48kHz.
      */
-    if ((platform_get_backend_index(snd_device) == DEFAULT_CODEC_BACKEND) &&
+    if (!codec_device_supports_native_playback(usecase->devices) &&
         (platform_check_backends_match(SND_DEVICE_OUT_SPEAKER, snd_device) ||
          platform_check_backends_match(SND_DEVICE_OUT_HANDSET, snd_device))) {
         if (bit_width >= 24) {