hal: audio_extn: enable speaker protection for wsa analog mono speaker
Update required acdb ids and channel config for supporting
speaker protection in 8952 WSA Analog mode.
Change-Id: I2642ba8cf0fc5854cd26ceaf6f773786b87bff74
diff --git a/hal/audio_extn/fm.c b/hal/audio_extn/fm.c
index efc2307..0ef7c7e 100644
--- a/hal/audio_extn/fm.c
+++ b/hal/audio_extn/fm.c
@@ -251,7 +251,7 @@
* Currently, platform_get_wsa_mode will directly return
* 1 when wsa is in analog mode.
*/
- if (platform_get_wsa_mode(adev->platform) == 1) {
+ if (platform_get_wsa_mode(adev) == 1) {
fm_stop(adev);
fm_start(adev);
} else {
diff --git a/hal/audio_extn/spkr_protection.c b/hal/audio_extn/spkr_protection.c
index 391a501..4ab7776 100644
--- a/hal/audio_extn/spkr_protection.c
+++ b/hal/audio_extn/spkr_protection.c
@@ -925,6 +925,12 @@
handle.spkr_prot_t0 = -1;
if (is_wsa_present()) {
+ if (platform_get_wsa_mode(adev) == 1) {
+ ALOGD("%s: WSA analog mode", __func__);
+ platform_set_snd_device_acdb_id(SND_DEVICE_OUT_SPEAKER_PROTECTED, 136);
+ platform_set_snd_device_acdb_id(SND_DEVICE_IN_CAPTURE_VI_FEEDBACK, 137);
+ pcm_config_skr_prot.channels = 2;
+ }
pthread_cond_init(&handle.spkr_calib_cancel, NULL);
pthread_cond_init(&handle.spkr_calibcancel_ack, NULL);
pthread_mutex_init(&handle.mutex_spkr_prot, NULL);