Lines Matching refs:adev
132 struct audio_device *adev;
627 void platform_set_echo_reference(struct audio_device *adev, bool enable,
630 struct platform_data *my_data = (struct platform_data *)adev->platform;
635 audio_route_reset_and_update_path(adev->audio_route,
641 snd_device = platform_get_output_snd_device(adev->platform, out_device);
642 platform_add_backend_name(adev->platform, my_data->ec_ref_mixer_path, snd_device);
649 audio_route_apply_and_update_path(adev->audio_route,
685 void get_cvd_version(char *cvd_version, struct audio_device *adev)
691 ctl = mixer_get_ctl_by_name(adev->mixer, CVD_VERSION_MIXER_CTL);
789 fd = hw_util_open(plat_data->adev->snd_card);
820 get_cvd_version(cvd_version, my_data->adev);
824 snd_card_name = mixer_get_name(my_data->adev->mixer);
839 void *platform_init(struct audio_device *adev)
881 adev->mixer = mixer_open(snd_card_num);
883 if (!adev->mixer) {
892 snd_card_name = mixer_get_name(adev->mixer);
902 adev->audio_route = audio_route_init(snd_card_num,
904 if (!adev->audio_route) {
911 mixer_close(adev->mixer);
912 adev->mixer = NULL;
915 adev->snd_card = snd_card_num;
920 mixer_close(adev->mixer);
921 adev->mixer = NULL;
928 my_data->adev = adev;
1027 audio_extn_spkr_prot_init(adev);
1070 mixer_close(my_data->adev->mixer);
1110 bool platform_check_and_set_playback_backend_cfg(struct audio_device* adev __unused,
1117 bool platform_check_and_set_capture_backend_cfg(struct audio_device* adev __unused,
1418 void platform_set_speaker_gain_in_combo(struct audio_device *adev __unused,
1428 struct audio_device *adev = my_data->adev;
1442 ctl = mixer_get_ctl_by_name(adev->mixer, mixer_ctl_name);
1457 struct audio_device *adev = my_data->adev;
1465 if (audio_extn_hfp_is_active(adev))
1469 ctl = mixer_get_ctl_by_name(adev->mixer, mixer_ctl_name);
1477 if (audio_extn_hfp_is_active(adev))
1487 struct audio_device *adev = my_data->adev;
1508 ctl = mixer_get_ctl_by_name(adev->mixer, mixer_ctl_name);
1556 struct audio_device *adev = my_data->adev;
1557 audio_mode_t mode = adev->mode;
1560 audio_channel_mask_t channel_mask = (adev->active_input == NULL) ?
1561 AUDIO_CHANNEL_IN_MONO : adev->active_input->channel_mask;
1601 if (mode == AUDIO_MODE_IN_CALL || audio_extn_hfp_is_active(adev)) {
1605 if (adev->voice.tty_mode != TTY_MODE_OFF) {
1606 switch (adev->voice.tty_mode) {
1618 __func__, adev->voice.tty_mode);
1626 if (adev->bt_wb_speech_enabled)
1631 if (audio_extn_hfp_is_active(adev))
1659 if (adev->bt_wb_speech_enabled)
1681 struct audio_device *adev = my_data->adev;
1682 audio_source_t source = (adev->active_input == NULL) ?
1683 AUDIO_SOURCE_DEFAULT : adev->active_input->source;
1685 audio_mode_t mode = adev->mode;
1686 audio_devices_t in_device = ((adev->active_input == NULL) ?
1687 AUDIO_DEVICE_NONE : adev->active_input->device)
1689 audio_channel_mask_t channel_mask = (adev->active_input == NULL) ?
1690 AUDIO_CHANNEL_IN_MONO : adev->active_input->channel_mask;
1698 audio_extn_hfp_is_active(adev))) {
1699 if (adev->voice.tty_mode != TTY_MODE_OFF) {
1703 switch (adev->voice.tty_mode) {
1715 __func__, adev->voice.tty_mode);
1726 if (audio_extn_hfp_is_active(adev))
1727 platform_set_echo_reference(adev, true, out_device);
1730 adev->acdb_settings |= DMIC_FLAG;
1734 if (audio_extn_hfp_is_active(adev))
1735 platform_set_echo_reference(adev, true, out_device);
1737 if (adev->bt_wb_speech_enabled) {
1738 if (adev->bluetooth_nrec)
1743 if (adev->bluetooth_nrec)
1753 adev->acdb_settings |= QMIC_FLAG;
1756 adev->acdb_settings |= DMIC_FLAG;
1764 if (audio_extn_hfp_is_active(adev)) {
1766 platform_set_echo_reference(adev, true, out_device);
1786 adev->acdb_settings |= DMIC_FLAG;
1787 } else if (adev->active_input->enable_ns)
1792 adev->acdb_settings |= DMIC_FLAG;
1801 if (adev->active_input) {
1803 adev->active_input->enable_aec &&
1804 adev->active_input->enable_ns) {
1815 adev->acdb_settings |= DMIC_FLAG;
1821 adev->acdb_settings |= DMIC_FLAG;
1827 platform_set_echo_reference(adev, true, out_device);
1829 adev->active_input->enable_aec) {
1840 adev->acdb_settings |= DMIC_FLAG;
1846 adev->acdb_settings |= DMIC_FLAG;
1852 platform_set_echo_reference(adev, true, out_device);
1854 adev->active_input->enable_ns) {
1865 adev->acdb_settings |= DMIC_FLAG;
1871 adev->acdb_settings |= DMIC_FLAG;
1877 platform_set_echo_reference(adev, false, out_device);
1879 platform_set_echo_reference(adev, false, out_device);
1906 if (adev->bt_wb_speech_enabled) {
1907 if (adev->bluetooth_nrec)
1912 if (adev->bluetooth_nrec)
1943 if (adev->bt_wb_speech_enabled) {
1944 if (adev->bluetooth_nrec)
1949 if (adev->bluetooth_nrec)
1973 struct audio_device *adev = my_data->adev;
1993 ctl = mixer_get_ctl_by_name(adev->mixer, mixer_ctl_name);
2007 struct audio_device *adev = my_data->adev;
2017 ctl = mixer_get_ctl_by_name(adev->mixer, AUDIO_DATA_BLOCK_MIXER_CTL);
2065 struct audio_device *adev = my_data->adev;
2071 ctl = mixer_get_ctl_by_name(adev->mixer, mixer_ctl_name);
2136 audio_extn_hfp_set_parameters(my_data->adev, parms);
2206 int ramp_speaker_gain(struct audio_device *adev, bool ramp_up, int target_ramp_up_gain) {
2213 struct mixer_ctl *ctl_left = mixer_get_ctl_by_name(adev->mixer, mixer_ctl_name_gain_left);
2214 struct mixer_ctl *ctl_right = mixer_get_ctl_by_name(adev->mixer, mixer_ctl_name_gain_right);
2266 int platform_set_swap_mixer(struct audio_device *adev, bool swap_channels)
2271 struct platform_data *my_data = (struct platform_data *)adev->platform;
2281 audio_route_apply_and_update_path(adev->audio_route, mixer_path);
2284 audio_route_apply_and_update_path(adev->audio_route, mixer_path);
2287 ctl = mixer_get_ctl_by_name(adev->mixer, mixer_ctl_name);
2304 int platform_check_and_set_swap_lr_channels(struct audio_device *adev, bool swap_channels)
2309 struct platform_data *my_data = (struct platform_data *)adev->platform;
2313 return platform_set_swap_channels(adev, swap_channels);
2316 int platform_set_swap_channels(struct audio_device *adev, bool swap_channels)
2321 struct platform_data *my_data = (struct platform_data *)adev->platform;
2325 if ((adev->mode == AUDIO_MODE_IN_COMMUNICATION) || (adev->mode == AUDIO_MODE_IN_CALL)) {
2326 ALOGV("%s: will not swap due to audio mode %d", __func__, adev->mode);
2330 list_for_each(node, &adev->usecase_list) {
2341 const int initial_skpr_gain = ramp_speaker_gain(adev, false /*ramp_up*/, -1);
2342 select_devices(adev, usecase->id);
2344 ramp_speaker_gain(adev, true /*ramp_up*/, initial_skpr_gain);
2347 platform_set_swap_mixer(adev, swap_channels);
2398 int platform_set_sidetone(struct audio_device *adev,
2414 audio_route_apply_and_update_path(adev->audio_route, str);
2416 audio_route_reset_and_update_path(adev->audio_route, str);