hal: audio_extn: enable speaker protection for tasha
Add speaker protection support for wsa speaker.
Change-Id: I5468b2875d0fd028e5c32f25c15b5de0095e7007
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index cd5437f..e248f56 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -516,11 +516,9 @@
if(SND_DEVICE_IN_USB_HEADSET_MIC == snd_device)
audio_extn_usb_start_capture(adev);
- if ((snd_device == SND_DEVICE_OUT_SPEAKER || snd_device == SND_DEVICE_OUT_SPEAKER_WSA ||
- snd_device == SND_DEVICE_OUT_SPEAKER_VBAT || snd_device == SND_DEVICE_OUT_VOICE_SPEAKER_VBAT ||
- snd_device == SND_DEVICE_OUT_VOICE_SPEAKER) &&
- audio_extn_spkr_prot_is_enabled()) {
- if (audio_extn_spkr_prot_get_acdb_id(snd_device) < 0) {
+ if (platform_can_enable_spkr_prot_on_device(snd_device) &&
+ audio_extn_spkr_prot_is_enabled()) {
+ if (platform_get_spkr_prot_acdb_id(snd_device) < 0) {
adev->snd_dev_ref_cnt[snd_device]--;
return -EINVAL;
}
@@ -584,10 +582,9 @@
/* exit usb capture thread */
if(SND_DEVICE_IN_USB_HEADSET_MIC == snd_device)
audio_extn_usb_stop_capture();
- if ((snd_device == SND_DEVICE_OUT_SPEAKER || snd_device == SND_DEVICE_OUT_SPEAKER_WSA ||
- snd_device == SND_DEVICE_OUT_SPEAKER_VBAT || snd_device == SND_DEVICE_OUT_VOICE_SPEAKER_VBAT ||
- snd_device == SND_DEVICE_OUT_VOICE_SPEAKER) &&
- audio_extn_spkr_prot_is_enabled()) {
+
+ if (platform_can_enable_spkr_prot_on_device(snd_device) &&
+ audio_extn_spkr_prot_is_enabled()) {
audio_extn_spkr_prot_stop_processing(snd_device);
} else {
audio_route_reset_and_update_path(adev->audio_route, device_name);