hal: send audio calibration for speaker protection Tx device
Device specific calibration needs to send to DSP for speaker
protection algorithm to work. Currently audio HAL does not send
speaker protection TX device calibration to DSP due to improper
input device checks. Fix this issue by adding appropriate check
to get speaker protection TX device.
Change-Id: I65a2e9079736a9104788e79977f2bd46975b9903
diff --git a/hal/msm8974/platform.c b/hal/msm8974/platform.c
index 3c90a8e..204c349 100644
--- a/hal/msm8974/platform.c
+++ b/hal/msm8974/platform.c
@@ -1775,11 +1775,10 @@
int snd_device = SND_DEVICE_OUT_SPEAKER;
if (usecase->type == PCM_PLAYBACK)
- snd_device = platform_get_output_snd_device(adev->platform,
- usecase->stream.out);
+ snd_device = usecase->out_snd_device;
else if ((usecase->type == PCM_HFP_CALL) || (usecase->type == PCM_CAPTURE))
- snd_device = platform_get_input_snd_device(adev->platform,
- adev->primary_output->devices);
+ snd_device = usecase->in_snd_device;
+
acdb_dev_id = acdb_device_table[audio_extn_get_spkr_prot_snd_device(snd_device)];
if (acdb_dev_id < 0) {
ALOGE("%s: Could not find acdb id for device(%d)",