diff options
author | Aditya Bavanari <abavanar@codeaurora.org> | 2019-10-11 19:46:43 +0530 |
---|---|---|
committer | Aditya Bavanari <abavanar@codeaurora.org> | 2019-10-21 19:24:30 +0530 |
commit | f2be3c9a945ed8e3e14094de875c5995808a9f97 (patch) | |
tree | fe647c98e2039b43b537b07e67db8c1b458b7924 /hal | |
parent | 10d22b9b49a0208df18acef45bb5a0ad5c290d8d (diff) | |
download | android_hardware_qcom_audio-f2be3c9a945ed8e3e14094de875c5995808a9f97.tar.gz android_hardware_qcom_audio-f2be3c9a945ed8e3e14094de875c5995808a9f97.tar.bz2 android_hardware_qcom_audio-f2be3c9a945ed8e3e14094de875c5995808a9f97.zip |
hal: Reset HPH power mode to class AB for wcd9370 variant
As wcd9370 codec only supports Class AB HPH power mode,
reset the power mode for that variant
Change-Id: I791aad8447c89bf43e573f080f6c610c6c7c539b
Diffstat (limited to 'hal')
-rw-r--r-- | hal/msm8974/platform.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/hal/msm8974/platform.c b/hal/msm8974/platform.c index 91a04e76..742b1a43 100644 --- a/hal/msm8974/platform.c +++ b/hal/msm8974/platform.c @@ -298,6 +298,7 @@ struct platform_data { bool ec_ref_enabled; bool is_wsa_speaker; bool hifi_audio; + bool is_cls_ab_only_supported; bool is_i2s_ext_modem; bool is_acdb_initialized; /* Vbat monitor related flags */ @@ -3194,7 +3195,6 @@ void *platform_init(struct audio_device *adev) my_data->hifi_audio = true; set_platform_defaults(my_data); - /* Initialize ACDB ID's */ if (my_data->is_i2s_ext_modem && !is_auto_snd_card(snd_card_name)) platform_info_init(PLATFORM_INFO_XML_PATH_I2S, my_data, PLATFORM); @@ -3685,6 +3685,11 @@ acdb_init_fail: my_data->adev->snd_card, my_data->codec_version); + /* WCD9370 codec variant only supports Class AB power mode */ + if (strstr(my_data->codec_variant, "WCD9370")) { + my_data->is_cls_ab_only_supported = true; + } + if (NATIVE_AUDIO_MODE_INVALID != platform_get_native_support()) { /* * Native playback is enabled from the UI. @@ -8881,13 +8886,18 @@ static bool platform_check_codec_backend_cfg(struct audio_device* adev, if (snd_device == SND_DEVICE_OUT_HEADPHONES || snd_device == SND_DEVICE_OUT_HEADPHONES_44_1 || snd_device == SND_DEVICE_OUT_HEADPHONES_HIFI_FILTER) { - if (sample_rate > 48000 || - (bit_width >= 24 && (sample_rate == 48000 || sample_rate == 44100))) { - ALOGI("%s: apply HPH HQ mode\n", __func__); - audio_route_apply_and_update_path(adev->audio_route, "hph-highquality-mode"); + if (my_data->is_cls_ab_only_supported) { + ALOGI("%s: apply CLS AB HPH power mode\n", __func__); + audio_route_apply_and_update_path(adev->audio_route, "hph-class-ab-mode"); } else { - ALOGI("%s: apply HPH LP mode\n", __func__); - audio_route_apply_and_update_path(adev->audio_route, "hph-lowpower-mode"); + if (sample_rate > 48000 || + (bit_width >= 24 && (sample_rate == 48000 || sample_rate == 44100))) { + ALOGI("%s: apply HPH HQ mode\n", __func__); + audio_route_apply_and_update_path(adev->audio_route, "hph-highquality-mode"); + } else { + ALOGI("%s: apply HPH LP mode\n", __func__); + audio_route_apply_and_update_path(adev->audio_route, "hph-lowpower-mode"); + } } } |