Home | History | Annotate | Download | only in audio_extn

Lines Matching refs:adev

43 static int32_t start_hfp(struct audio_device *adev,
46 static int32_t stop_hfp(struct audio_device *adev);
84 static int32_t hfp_set_volume(struct audio_device *adev, float value)
119 ctl = mixer_get_ctl_by_name(adev->mixer, hfpmod.hfp_vol_mixer_ctl);
139 static int hfp_set_mic_volume(struct audio_device *adev, float value)
163 ctl = mixer_get_ctl_by_name(adev->mixer, mixer_ctl_name);
180 static float hfp_get_mic_volume(struct audio_device *adev)
196 ctl = mixer_get_ctl_by_name(adev->mixer, mixer_ctl_name);
226 int audio_extn_hfp_set_mic_mute(struct audio_device *adev, bool state)
234 hfpmod.mic_volume = hfp_get_mic_volume(adev);
236 rc = hfp_set_mic_volume(adev, (state == true) ? 0.0 : hfpmod.mic_volume);
237 adev->voice.mic_mute = state;
243 static int32_t start_hfp(struct audio_device *adev,
252 if (adev->enable_hfp == true) {
256 adev->enable_hfp = true;
257 platform_set_mic_mute(adev->platform, false);
262 uc_info->stream.out = adev->primary_output;
263 uc_info->devices = adev->primary_output->devices;
267 list_add_tail(&adev->usecase_list, &uc_info->list);
271 select_devices(adev, hfpmod.ucid);
289 __func__, adev->snd_card, pcm_dev_rx_id);
290 hfpmod.hfp_sco_rx = pcm_open(adev->snd_card,
299 __func__, adev->snd_card, pcm_dev_tx_id);
302 hfpmod.hfp_pcm_rx = pcm_open(adev->snd_card,
311 hfpmod.hfp_sco_tx = pcm_open(adev->snd_card,
320 __func__, adev->snd_card, pcm_dev_tx_id);
323 hfpmod.hfp_pcm_tx = pcm_open(adev->snd_card,
342 hfp_set_volume(adev, hfpmod.hfp_volume);
346 audio_extn_hfp_set_mic_mute(adev, adev->mic_muted);
352 stop_hfp(adev);
357 static int32_t stop_hfp(struct audio_device *adev)
383 uc_info = get_usecase_from_list(adev, hfpmod.ucid);
391 disable_audio_route(adev, uc_info);
394 disable_snd_device(adev, uc_info->out_snd_device);
395 disable_snd_device(adev, uc_info->in_snd_device);
398 platform_set_echo_reference(adev, false, AUDIO_DEVICE_NONE);
401 if (voice_get_mic_mute(adev)) {
402 platform_set_mic_mute(adev->platform, false);
405 adev->enable_hfp = false;
414 bool audio_extn_hfp_is_active(struct audio_device *adev)
417 hfp_usecase = get_usecase_from_list(adev, hfpmod.ucid);
430 void audio_extn_hfp_set_parameters(struct audio_device *adev, struct str_parms *parms)
442 ret = start_hfp(adev,parms);
444 stop_hfp(adev);
468 select_devices(adev, hfpmod.ucid);
491 hfp_set_volume(adev, vol);
504 hfp_set_mic_volume(adev, vol);