hal: Set default backend sample rate for headset device

When music playback at 22.05Khz with headset, the afe
backend sample rate is set to 22.05khz as well. When
there is touch tone, it requires afe backend sample
rate to 48Khz. The rate change will cause music playback
disable and reroute to cause interruption during playback.

Fix it by setting backend sample rate to 48Khz if sample
rate less than 44.1Khz.

CRs-Fixed: 2258133
Change-Id: I711407537c0c41dbac99fea059710912ba6d1af3
diff --git a/hal/msm8916/platform.c b/hal/msm8916/platform.c
index e6af9e0..27a6f13 100755
--- a/hal/msm8916/platform.c
+++ b/hal/msm8916/platform.c
@@ -6273,6 +6273,11 @@
             ALOGD("%s:becf: afe: napb not active - set non fractional rate",
                        __func__);
         }
+        /*ensure AFE set to 48khz when sample rate less than 44.1khz*/
+        if (sample_rate < OUTPUT_SAMPLING_RATE_44100) {
+            sample_rate = CODEC_BACKEND_DEFAULT_SAMPLE_RATE;
+            ALOGD("%s:becf: afe: napb set sample rate to default Sample Rate(48k)",__func__);
+        }
     }
 
     /*
diff --git a/hal/msm8974/platform.c b/hal/msm8974/platform.c
index d92b9d4..be302fd 100755
--- a/hal/msm8974/platform.c
+++ b/hal/msm8974/platform.c
@@ -6182,6 +6182,11 @@
             ALOGD("%s:becf: afe: napb not active - set non fractional rate",
                        __func__);
         }
+        /*ensure AFE set to 48khz when sample rate less than 44.1khz*/
+        if (sample_rate < OUTPUT_SAMPLING_RATE_44100) {
+            sample_rate = CODEC_BACKEND_DEFAULT_SAMPLE_RATE;
+            ALOGD("%s:becf: afe: napb set sample rate to default Sample Rate(48k)",__func__);
+        }
     }
 
     /*