Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 552b0832 authored by Aalique Grahame's avatar Aalique Grahame Committed by Gerrit - the friendly Code Review server
Browse files

hal: msm8974: fix device selection for voice call

Fix output device selection for voice call so that
stereo speaker is able to be selected.

CRs-Fixed: 2411983
Change-Id: If5872a5ba5bd8a4a31e686cadaf9d947c3ca30dc
parent 3493e771
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -8747,6 +8747,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);
+22 −24
Original line number Diff line number Diff line
@@ -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) {