audio: Add 48khz sampling rate to spkr prot tx uc

With 8Khz sampling rate afe fails to fetch calibration
information.
sdm660 & msm8998 acdb supports only 48Khz for speaker
protection calibration tx device, since 8Khz tables were
not added initially, addition of 8Khz would require
further tuning.
This change is to use sample rate based on property, the
default sample rate is not changed for other targets without
prop.

Change-Id: I29dc549c699396fc953f3f831cd0ea81ee033ae4
diff --git a/configs/msm8998/msm8998.mk b/configs/msm8998/msm8998.mk
index 889c17f..ecd9f6a 100644
--- a/configs/msm8998/msm8998.mk
+++ b/configs/msm8998/msm8998.mk
@@ -256,6 +256,10 @@
 PRODUCT_PROPERTY_OVERRIDES += \
 persist.vendor.bt.aac_frm_ctl.enabled=true
 
+#Set speaker protection cal tx path sampling rate to 48k
+PRODUCT_PROPERTY_OVERRIDES += \
+vendor.audio.spkr_prot.tx.sampling_rate=48000
+
 #add dynamic feature flags here
 PRODUCT_PROPERTY_OVERRIDES += \
 vendor.audio.feature.a2dp_offload.enable=true \
diff --git a/configs/sdm660/sdm660.mk b/configs/sdm660/sdm660.mk
index a4af966..4ebd7c9 100644
--- a/configs/sdm660/sdm660.mk
+++ b/configs/sdm660/sdm660.mk
@@ -267,6 +267,10 @@
 PRODUCT_PROPERTY_OVERRIDES += \
 persist.vendor.bt.aac_frm_ctl.enabled=true
 
+#Set speaker protection cal tx path sampling rate to 48k
+PRODUCT_PROPERTY_OVERRIDES += \
+vendor.audio.spkr_prot.tx.sampling_rate=48000
+
 #add dynamic feature flags here
 PRODUCT_PROPERTY_OVERRIDES += \
 vendor.audio.feature.a2dp_offload.enable=true \
diff --git a/hal/audio_extn/utils.c b/hal/audio_extn/utils.c
index 4f37ac3..8a518a9 100644
--- a/hal/audio_extn/utils.c
+++ b/hal/audio_extn/utils.c
@@ -1105,7 +1105,10 @@
             }
             sample_rate = usecase->stream.in->app_type_cfg.sample_rate;
         } else if (usecase->id == USECASE_AUDIO_SPKR_CALIB_TX) {
-            sample_rate = SAMPLE_RATE_8000;
+            if ((property_get("vendor.audio.spkr_prot.tx.sampling_rate", value, NULL) > 0))
+                sample_rate = atoi(value);
+            else
+                sample_rate = SAMPLE_RATE_8000;
         }
     } else if (usecase->type == TRANSCODE_LOOPBACK_RX) {
         sample_rate = usecase->stream.inout->out_config.sample_rate;