Loading msm8909/hal/audio_extn/audio_extn.h +2 −0 Original line number Diff line number Diff line Loading @@ -319,9 +319,11 @@ void audio_extn_dolby_send_ddp_endp_params(struct audio_device *adev); #ifndef HFP_ENABLED #define audio_extn_hfp_is_active(adev) (0) #define audio_extn_hfp_get_usecase() (-1) #define hfp_set_mic_mute(dev, state) (0) #else bool audio_extn_hfp_is_active(struct audio_device *adev); audio_usecase_t audio_extn_hfp_get_usecase(); int hfp_set_mic_mute(struct audio_device *dev, bool state); #endif #ifndef DEV_ARBI_ENABLED Loading msm8909/hal/audio_extn/hfp.c +23 −0 Original line number Diff line number Diff line Loading @@ -302,6 +302,29 @@ bool audio_extn_hfp_is_active(struct audio_device *adev) return false; } int hfp_set_mic_mute(struct audio_device *adev, bool state) { struct mixer_ctl *ctl; const char *mixer_ctl_name = "HFP TX Mute"; uint32_t set_values[ ] = {0}; ALOGI("%s: enter, state=%d", __func__, state); if (adev->mode == AUDIO_MODE_IN_COMMUNICATION) { set_values[0] = state; ctl = mixer_get_ctl_by_name(adev->mixer, mixer_ctl_name); if (!ctl) { ALOGE("%s: Could not get ctl for mixer cmd - %s", __func__, mixer_ctl_name); return -EINVAL; } mixer_ctl_set_array(ctl, set_values, ARRAY_SIZE(set_values)); } ALOGV("%s: exit", __func__); return 0; } audio_usecase_t audio_extn_hfp_get_usecase() { return hfpmod.ucid; Loading msm8909/hal/voice.c +4 −1 Original line number Diff line number Diff line Loading @@ -331,8 +331,11 @@ int voice_set_mic_mute(struct audio_device *adev, bool state) adev->voice.mic_mute = state; if (adev->mode == AUDIO_MODE_IN_CALL) err = platform_set_mic_mute(adev->platform, state); if (adev->mode == AUDIO_MODE_IN_COMMUNICATION) if (adev->mode == AUDIO_MODE_IN_COMMUNICATION && audio_extn_hfp_is_active(adev)) { err = hfp_set_mic_mute(adev, state); } else if (adev->mode == AUDIO_MODE_IN_COMMUNICATION) { err = voice_extn_compress_voip_set_mic_mute(adev, state); } return err; } Loading Loading
msm8909/hal/audio_extn/audio_extn.h +2 −0 Original line number Diff line number Diff line Loading @@ -319,9 +319,11 @@ void audio_extn_dolby_send_ddp_endp_params(struct audio_device *adev); #ifndef HFP_ENABLED #define audio_extn_hfp_is_active(adev) (0) #define audio_extn_hfp_get_usecase() (-1) #define hfp_set_mic_mute(dev, state) (0) #else bool audio_extn_hfp_is_active(struct audio_device *adev); audio_usecase_t audio_extn_hfp_get_usecase(); int hfp_set_mic_mute(struct audio_device *dev, bool state); #endif #ifndef DEV_ARBI_ENABLED Loading
msm8909/hal/audio_extn/hfp.c +23 −0 Original line number Diff line number Diff line Loading @@ -302,6 +302,29 @@ bool audio_extn_hfp_is_active(struct audio_device *adev) return false; } int hfp_set_mic_mute(struct audio_device *adev, bool state) { struct mixer_ctl *ctl; const char *mixer_ctl_name = "HFP TX Mute"; uint32_t set_values[ ] = {0}; ALOGI("%s: enter, state=%d", __func__, state); if (adev->mode == AUDIO_MODE_IN_COMMUNICATION) { set_values[0] = state; ctl = mixer_get_ctl_by_name(adev->mixer, mixer_ctl_name); if (!ctl) { ALOGE("%s: Could not get ctl for mixer cmd - %s", __func__, mixer_ctl_name); return -EINVAL; } mixer_ctl_set_array(ctl, set_values, ARRAY_SIZE(set_values)); } ALOGV("%s: exit", __func__); return 0; } audio_usecase_t audio_extn_hfp_get_usecase() { return hfpmod.ucid; Loading
msm8909/hal/voice.c +4 −1 Original line number Diff line number Diff line Loading @@ -331,8 +331,11 @@ int voice_set_mic_mute(struct audio_device *adev, bool state) adev->voice.mic_mute = state; if (adev->mode == AUDIO_MODE_IN_CALL) err = platform_set_mic_mute(adev->platform, state); if (adev->mode == AUDIO_MODE_IN_COMMUNICATION) if (adev->mode == AUDIO_MODE_IN_COMMUNICATION && audio_extn_hfp_is_active(adev)) { err = hfp_set_mic_mute(adev, state); } else if (adev->mode == AUDIO_MODE_IN_COMMUNICATION) { err = voice_extn_compress_voip_set_mic_mute(adev, state); } return err; } Loading