hal: limit AFE and ADM sample rate at 48 for speaker

Limit AFE and ADM Sample Rate at 48 for speaker, irrespective
of the bitwidth.

CRs-Fixed: 974913

Change-Id: I43db793dd6d1adede088f7a7c3d86bd39770e2d7
diff --git a/hal/audio_extn/utils.c b/hal/audio_extn/utils.c
index 6771bf9..8f49b8d 100644
--- a/hal/audio_extn/utils.c
+++ b/hal/audio_extn/utils.c
@@ -622,8 +622,7 @@
                __func__, platform_get_default_app_type(adev->platform), acdb_dev_id, sample_rate);
     } else if (usecase->type == PCM_PLAYBACK) {
 
-         if ((24 == usecase->stream.out->bit_width) &&
-             (usecase->stream.out->devices & AUDIO_DEVICE_OUT_SPEAKER)) {
+         if (usecase->stream.out->devices & AUDIO_DEVICE_OUT_SPEAKER) {
              usecase->stream.out->app_type_cfg.sample_rate = DEFAULT_OUTPUT_SAMPLING_RATE;
          } else if ((usecase->stream.out->app_type_cfg.sample_rate == OUTPUT_SAMPLING_RATE_44100 &&
                       !(audio_is_this_native_usecase(usecase))) ||
diff --git a/hal/msm8916/platform.c b/hal/msm8916/platform.c
index 9cd7928..378ca83 100644
--- a/hal/msm8916/platform.c
+++ b/hal/msm8916/platform.c
@@ -4291,16 +4291,15 @@
     }
 
 
+
     /*
-     * 24 bit playback on speakers is allowed through 48
-     * khz backend only
+     * hifi playback not supported on spkr devices, limit the Sample Rate
+     * to 48 khz.
      */
-    if ((24 == bit_width) &&
-            (usecase->stream.out->devices & AUDIO_DEVICE_OUT_SPEAKER)) {
-        bit_width = (uint32_t)platform_get_snd_device_bit_width(SND_DEVICE_OUT_SPEAKER);
+    if (usecase->stream.out->devices & AUDIO_DEVICE_OUT_SPEAKER) {
         sample_rate = CODEC_BACKEND_DEFAULT_SAMPLE_RATE;
-        ALOGD("%s:becf: afe: 24 bit playback on speakers"
-              "Configure afe to default Sample Rate(48k)", __func__);
+        ALOGD("%s:becf: afe: playback on speakers Configure afe to \
+            default Sample Rate(48k)", __func__);
     }
 
     /*
diff --git a/hal/msm8974/platform.c b/hal/msm8974/platform.c
index cd53ce4..516179a 100644
--- a/hal/msm8974/platform.c
+++ b/hal/msm8974/platform.c
@@ -3893,15 +3893,13 @@
     }
 
     /*
-     * 24 bit playback on speakers is allowed through 48
-     * khz backend only
+     * hifi playback not supported on spkr devices, limit the Sample Rate
+     * to 48 khz.
      */
-    if ((24 == bit_width) &&
-            (usecase->stream.out->devices & AUDIO_DEVICE_OUT_SPEAKER)) {
-        bit_width = (uint32_t)platform_get_snd_device_bit_width(SND_DEVICE_OUT_SPEAKER);
+    if (usecase->stream.out->devices & AUDIO_DEVICE_OUT_SPEAKER) {
         sample_rate = CODEC_BACKEND_DEFAULT_SAMPLE_RATE;
-        ALOGD("%s:becf: afe: 24 bit playback on speakers"
-              "Configure afe to default Sample Rate(48k)", __func__);
+        ALOGD("%s:becf: afe: playback on speakers Configure afe to \
+            default Sample Rate(48k)", __func__);
     }
 
     /*