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

Commit bd470a37 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "hal: change voice call sequence on APQ targets"

parents 9f54827a 1fd2179b
Loading
Loading
Loading
Loading
+10 −1
Original line number Diff line number Diff line
@@ -657,8 +657,8 @@ int select_devices(struct audio_device *adev, audio_usecase_t uc_id)
     * device.
     */
    if (usecase->type == VOICE_CALL || usecase->type == VOIP_CALL) {
        disable_all_usecases_of_type(adev, usecase->type, true);
        status = platform_switch_voice_call_device_pre(adev->platform);
        disable_all_usecases_of_type(adev, VOICE_CALL, true);
    }

    /* Disable current sound devices */
@@ -699,6 +699,15 @@ int select_devices(struct audio_device *adev, audio_usecase_t uc_id)
    else
        enable_audio_route(adev, usecase, true);

    /* Applicable only on the targets that has external modem.
     * Enable device command should be sent to modem only after
     * enabling voice call mixer controls
     */
    if (usecase->type == VOICE_CALL)
        status = platform_switch_voice_call_usecase_route_post(adev->platform,
                                                               out_snd_device,
                                                               in_snd_device);

    return status;
}

+20 −6
Original line number Diff line number Diff line
@@ -640,7 +640,8 @@ int platform_switch_voice_call_device_pre(void *platform)
    struct platform_data *my_data = (struct platform_data *)platform;
    int ret = 0;

    if (my_data->csd != NULL) {
    if (my_data->csd != NULL &&
        my_data->adev->mode == AUDIO_MODE_IN_CALL) {
        /* This must be called before disabling mixer controls on APQ side */
        ret = my_data->csd->disable_device();
        if (ret < 0) {
@@ -657,14 +658,13 @@ int platform_switch_voice_call_device_post(void *platform,
{
    struct platform_data *my_data = (struct platform_data *)platform;
    int acdb_rx_id, acdb_tx_id;
    int ret = 0;

    acdb_rx_id = acdb_device_table[out_snd_device];
    acdb_tx_id = acdb_device_table[in_snd_device];

    if (my_data->acdb_send_voice_cal == NULL) {
        ALOGE("%s: dlsym error for acdb_send_voice_call", __func__);
    } else {
        acdb_rx_id = acdb_device_table[out_snd_device];
        acdb_tx_id = acdb_device_table[in_snd_device];

        if (acdb_rx_id > 0 && acdb_tx_id > 0)
            my_data->acdb_send_voice_cal(acdb_rx_id, acdb_tx_id);
        else
@@ -672,8 +672,22 @@ int platform_switch_voice_call_device_post(void *platform,
                  acdb_rx_id, acdb_tx_id);
    }

    return 0;
}

int platform_switch_voice_call_usecase_route_post(void *platform,
                                                  snd_device_t out_snd_device,
                                                  snd_device_t in_snd_device)
{
    struct platform_data *my_data = (struct platform_data *)platform;
    int acdb_rx_id, acdb_tx_id;
    int ret = 0;

    acdb_rx_id = acdb_device_table[out_snd_device];
    acdb_tx_id = acdb_device_table[in_snd_device];

    if (my_data->csd != NULL) {
        if (acdb_rx_id > 0 || acdb_tx_id > 0) {
        if (acdb_rx_id > 0 && acdb_tx_id > 0) {
            ret = my_data->csd->enable_device(acdb_rx_id, acdb_tx_id,
                                              my_data->adev->acdb_settings);
            if (ret < 0) {
+3 −0
Original line number Diff line number Diff line
@@ -32,6 +32,9 @@ int platform_switch_voice_call_device_pre(void *platform);
int platform_switch_voice_call_device_post(void *platform,
                                           snd_device_t out_snd_device,
                                           snd_device_t in_snd_device);
int platform_switch_voice_call_usecase_route_post(void *platform,
                                                  snd_device_t out_snd_device,
                                                  snd_device_t in_snd_device);
int platform_start_voice_call(void *platform, uint32_t vsid);
int platform_stop_voice_call(void *platform, uint32_t vsid);
int platform_set_voice_volume(void *platform, int volume);