Lines Matching refs:adev
112 struct audio_device *adev;
618 static int init_be_dai_name_table(struct audio_device *adev);
734 struct audio_device *adev = my_data->adev;
748 if (!voice_is_in_call(adev)) {
753 list_for_each(node, &adev->usecase_list) {
796 void platform_set_echo_reference(struct audio_device *adev, bool enable, audio_devices_t out_device)
798 struct platform_data *my_data = (struct platform_data *)adev->platform;
803 audio_route_reset_and_update_path(adev->audio_route, my_data->ec_ref_mixer_path);
809 snd_device = platform_get_output_snd_device(adev->platform, out_device);
810 platform_add_backend_name(adev->platform, my_data->ec_ref_mixer_path, snd_device);
814 audio_route_apply_and_update_path(adev->audio_route, my_data->ec_ref_mixer_path);
1107 void get_cvd_version(char *cvd_version, struct audio_device *adev)
1113 ctl = mixer_get_ctl_by_name(adev->mixer, CVD_VERSION_MIXER_CTL);
1137 struct audio_device *adev = my_data->adev;
1154 get_cvd_version(cvd_version, adev);
1265 void *platform_init(struct audio_device *adev)
1280 my_data->adev = adev;
1298 adev->mixer = mixer_open(snd_card_num);
1299 snd_card_name = mixer_get_name(adev->mixer);
1350 adev->audio_route = audio_route_init(snd_card_num, mixer_xml_file);
1352 if (!adev->audio_route) {
1354 mixer_close(adev->mixer);
1355 adev->mixer = NULL;
1360 adev->snd_card = snd_card_num;
1509 int result = acdb_init(adev->snd_card);
1520 audio_extn_usb_init(adev);
1522 audio_extn_spkr_prot_init(adev);
1524 audio_extn_hwdep_cal_send(adev->snd_card, my_data->acdb_handle);
1531 init_be_dai_name_table(adev);
1534 platform_backend_app_type_cfg_init(my_data, adev->mixer);
1595 mixer_close(my_data->adev->mixer);
1921 voice_is_in_call(my_data->adev)) {
2013 my_data->adev->acdb_settings);
2067 void platform_set_speaker_gain_in_combo(struct audio_device *adev,
2101 audio_route_apply_and_update_path(adev->audio_route, name);
2107 struct audio_device *adev = my_data->adev;
2121 ctl = mixer_get_ctl_by_name(adev->mixer, mixer_ctl_name);
2143 struct audio_device *adev = my_data->adev;
2151 if (adev->mode != AUDIO_MODE_IN_CALL &&
2152 adev->mode != AUDIO_MODE_IN_COMMUNICATION)
2155 if (adev->enable_hfp)
2159 ctl = mixer_get_ctl_by_name(adev->mixer, mixer_ctl_name);
2181 struct audio_device *adev = my_data->adev;
2202 ctl = mixer_get_ctl_by_name(adev->mixer, mixer_ctl_name);
2287 struct audio_device *adev = my_data->adev;
2288 audio_mode_t mode = adev->mode;
2320 snd_device = adev->bt_wb_speech_enabled ?
2347 if (voice_is_in_call(adev) || adev->enable_voicerx || audio_extn_hfp_is_active(adev)) {
2351 if (voice_is_in_call(adev) &&
2352 (adev->voice.tty_mode == TTY_MODE_FULL))
2354 else if (voice_is_in_call(adev) &&
2355 (adev->voice.tty_mode == TTY_MODE_VCO))
2357 else if (voice_is_in_call(adev) &&
2358 (adev->voice.tty_mode == TTY_MODE_HCO))
2367 if (voice_is_in_call(adev)) {
2368 switch (adev->voice.tty_mode) {
2383 __func__, adev->voice.tty_mode);
2392 if (adev->bt_wb_speech_enabled) {
2398 if (!adev->enable_hfp) {
2404 if(adev->voice.hac)
2431 if (adev->bt_wb_speech_enabled) {
2445 if(adev->voice.hac)
2460 struct audio_device *adev = my_data->adev;
2461 audio_source_t source = (adev->active_input == NULL) ?
2462 AUDIO_SOURCE_DEFAULT : adev->active_input->source;
2464 audio_mode_t mode = adev->mode;
2465 audio_devices_t in_device = ((adev->active_input == NULL) ?
2466 AUDIO_DEVICE_NONE : adev->active_input->device)
2468 audio_channel_mask_t channel_mask = (adev->active_input == NULL) ?
2469 AUDIO_CHANNEL_IN_MONO : adev->active_input->channel_mask;
2475 if ((out_device != AUDIO_DEVICE_NONE) && (voice_is_in_call(adev) ||
2476 audio_extn_hfp_is_active(adev))) {
2477 if (adev->voice.tty_mode != TTY_MODE_OFF) {
2481 switch (adev->voice.tty_mode) {
2492 ALOGE("%s: Invalid TTY mode (%#x)", __func__, adev->voice.tty_mode);
2496 switch (adev->voice.tty_mode) {
2508 ALOGE("%s: Invalid TTY mode (%#x)", __func__, adev->voice.tty_mode);
2525 if (adev->bt_wb_speech_enabled) {
2526 if (adev->bluetooth_nrec)
2531 if (adev->bluetooth_nrec)
2550 if (!adev->enable_hfp) {
2554 platform_set_echo_reference(adev, true, out_device);
2580 if (adev->active_input->enable_aec)
2586 if (adev->active_input->enable_aec)
2593 if (adev->active_input->enable_aec)
2598 platform_set_echo_reference(adev, true, out_device);
2610 if (adev->active_input->enable_aec) {
2611 if (adev->active_input->enable_ns) {
2616 platform_set_echo_reference(adev, true, out_device);
2617 } else if (adev->active_input->enable_ns) {
2656 if (adev->active_input) {
2657 if (adev->active_input->enable_aec &&
2658 adev->active_input->enable_ns) {
2679 platform_set_echo_reference(adev, true, out_device);
2680 } else if (adev->active_input->enable_aec) {
2701 platform_set_echo_reference(adev, true, out_device);
2702 } else if (adev->active_input->enable_ns) {
2768 if (adev->bt_wb_speech_enabled) {
2769 if (adev->bluetooth_nrec)
2774 if (adev->bluetooth_nrec)
2810 if (adev->bt_wb_speech_enabled) {
2811 if (adev->bluetooth_nrec)
2816 if (adev->bluetooth_nrec)
2842 struct audio_device *adev = my_data->adev;
2862 ctl = mixer_get_ctl_by_name(adev->mixer, mixer_ctl_name);
2876 struct audio_device *adev = my_data->adev;
2886 ctl = mixer_get_ctl_by_name(adev->mixer, AUDIO_DATA_BLOCK_MIXER_CTL);
2933 struct audio_device *adev = my_data->adev;
2939 ctl = mixer_get_ctl_by_name(adev->mixer, mixer_ctl_name);
3142 int ramp_speaker_gain(struct audio_device *adev, bool ramp_up, int target_ramp_up_gain) {
3149 struct mixer_ctl *ctl_left = mixer_get_ctl_by_name(adev->mixer, mixer_ctl_name_gain_left);
3150 struct mixer_ctl *ctl_right = mixer_get_ctl_by_name(adev->mixer, mixer_ctl_name_gain_right);
3202 int platform_set_swap_mixer(struct audio_device *adev, bool swap_channels)
3207 struct platform_data *my_data = (struct platform_data *)adev->platform;
3217 audio_route_apply_and_update_path(adev->audio_route, mixer_path);
3220 audio_route_apply_and_update_path(adev->audio_route, mixer_path);
3223 ctl = mixer_get_ctl_by_name(adev->mixer, mixer_ctl_name);
3240 int platform_check_and_set_swap_lr_channels(struct audio_device *adev, bool swap_channels)
3245 struct platform_data *my_data = (struct platform_data *)adev->platform;
3249 return platform_set_swap_channels(adev, swap_channels);
3252 int platform_set_swap_channels(struct audio_device *adev, bool swap_channels)
3257 struct platform_data *my_data = (struct platform_data *)adev->platform;
3261 if ((adev->mode == AUDIO_MODE_IN_COMMUNICATION) || (adev->mode == AUDIO_MODE_IN_CALL)) {
3262 ALOGV("%s: will not swap due to audio mode %d", __func__, adev->mode);
3266 list_for_each(node, &adev->usecase_list) {
3277 const int initial_skpr_gain = ramp_speaker_gain(adev, false /*ramp_up*/, -1);
3278 select_devices(adev, usecase->id);
3280 ramp_speaker_gain(adev, true /*ramp_up*/, initial_skpr_gain);
3283 platform_set_swap_mixer(adev, swap_channels);
3345 struct audio_device *adev = my_data->adev;
3357 static int platform_set_backend_cfg(const struct audio_device* adev,
3364 struct platform_data *my_data = (struct platform_data *)adev->platform;
3381 ctl = mixer_get_ctl_by_name(adev->mixer,
3462 ctl = mixer_get_ctl_by_name(adev->mixer,
3501 ctl = mixer_get_ctl_by_name(adev->mixer,
3536 static int platform_get_voice_call_backend(struct audio_device* adev)
3544 if (voice_is_in_call(adev) || adev->mode == AUDIO_MODE_IN_COMMUNICATION) {
3545 list_for_each(node, &adev->usecase_list) {
3548 out_snd_device = platform_get_output_snd_device(adev->platform,
3562 static bool platform_check_capture_backend_cfg(struct audio_device* adev,
3570 struct platform_data *my_data = (struct platform_data *)adev->platform;
3583 if (voice_is_in_call(adev) || adev->mode == AUDIO_MODE_IN_COMMUNICATION) {
3617 static void pick_playback_cfg_for_uc(struct audio_device *adev,
3626 list_for_each(node, &adev->usecase_list) {
3674 static bool platform_check_playback_backend_cfg(struct audio_device* adev,
3684 struct platform_data *my_data = (struct platform_data *)adev->platform;
3702 if (backend_idx == platform_get_voice_call_backend(adev)) {
3718 pick_playback_cfg_for_uc(adev, usecase, snd_device,
3764 bool platform_check_and_set_playback_backend_cfg(struct audio_device* adev,
3771 struct platform_data *my_data = (struct platform_data *)adev->platform;
3793 if ((platform_check_playback_backend_cfg(adev, usecase, new_snd_devices[i],
3795 platform_set_backend_cfg(adev, new_snd_devices[i],
3803 bool platform_check_and_set_capture_backend_cfg(struct audio_device* adev,
3829 if (platform_check_capture_backend_cfg(adev, backend_idx, &backend_cfg)) {
3830 ret = platform_set_backend_cfg(adev, snd_device,
3847 static int init_be_dai_name_table(struct audio_device *adev)
3854 ctl = mixer_get_ctl_by_name(adev->mixer, mixer_ctl_name);
4090 int platform_set_sidetone(struct audio_device *adev,
4105 audio_route_apply_and_update_path(adev->audio_route, str);
4107 audio_route_reset_and_update_path(adev->audio_route, str);
4117 struct audio_device *adev = my_data->adev;
4124 adev->snd_card, HWDEP_FE_BASE+fe_dev);
4127 ALOGE("fe hw dep node open %d/%d failed", adev->snd_card, fe_dev);