Merge "hal: msm8974: fix device selection for voice call" into audio-hal.lnx.6.0
This commit is contained in:
commit
7c52d43779
|
@ -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);
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue