Merge "hal: msm8974: fix device selection for voice call" into audio-hal.lnx.6.0

This commit is contained in:
Linux Build Service Account 2019-04-08 23:36:16 -07:00 committed by Gerrit - the friendly Code Review server
commit 7c52d43779
2 changed files with 24 additions and 25 deletions

View File

@ -8816,6 +8816,7 @@ static int adev_open(const hw_module_t *module, const char *name,
adev->perf_lock_opts[1] = 0x20E;
adev->perf_lock_opts_size = 2;
adev->dsp_bit_width_enforce_mode = 0;
adev->enable_hfp = false;
/* Loads platform specific libraries dynamically */
adev->platform = platform_init(adev);

View File

@ -4764,12 +4764,6 @@ snd_device_t platform_get_output_snd_device(void *platform, struct stream_out *o
else
snd_device = SND_DEVICE_OUT_BT_SCO;
} else if (devices & (AUDIO_DEVICE_OUT_SPEAKER | AUDIO_DEVICE_OUT_SPEAKER_SAFE)) {
if (!adev->enable_hfp) {
snd_device = SND_DEVICE_OUT_VOICE_SPEAKER;
} else {
snd_device = SND_DEVICE_OUT_VOICE_SPEAKER_HFP;
}
} else if (devices & AUDIO_DEVICE_OUT_SPEAKER) {
if (my_data->is_vbat_speaker || my_data->is_bcl_speaker) {
if (hw_info_is_stereo_spkr(my_data->hw_info)) {
if (my_data->mono_speaker == SPKR_1)
@ -4782,13 +4776,17 @@ snd_device_t platform_get_output_snd_device(void *platform, struct stream_out *o
if (hw_info_is_stereo_spkr(my_data->hw_info)) {
if (my_data->voice_speaker_stereo)
snd_device = SND_DEVICE_OUT_VOICE_SPEAKER_STEREO;
else if (adev->enable_hfp)
snd_device = SND_DEVICE_OUT_VOICE_SPEAKER_HFP;
else {
if (my_data->mono_speaker == SPKR_1)
snd_device = SND_DEVICE_OUT_VOICE_SPEAKER;
else
snd_device = SND_DEVICE_OUT_VOICE_SPEAKER_2;
}
} else
} else if (adev->enable_hfp)
snd_device = SND_DEVICE_OUT_VOICE_SPEAKER_HFP;
else
snd_device = SND_DEVICE_OUT_VOICE_SPEAKER;
}
} else if (devices & AUDIO_DEVICE_OUT_ALL_A2DP) {