summaryrefslogtreecommitdiffstats
path: root/hal
diff options
context:
space:
mode:
authorqctecmdr <qctecmdr@localhost>2019-10-25 18:33:35 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2019-10-25 18:33:35 -0700
commit4493ee23cb38f68870f731839cb9aa5fc8b9a492 (patch)
tree9e2fb08105d56dccf1981a5018d70f2d50b15645 /hal
parent1074acfb849942c0d883410c48b1a1dbfed3f0a1 (diff)
parentf2be3c9a945ed8e3e14094de875c5995808a9f97 (diff)
downloadandroid_hardware_qcom_audio-4493ee23cb38f68870f731839cb9aa5fc8b9a492.tar.gz
android_hardware_qcom_audio-4493ee23cb38f68870f731839cb9aa5fc8b9a492.tar.bz2
android_hardware_qcom_audio-4493ee23cb38f68870f731839cb9aa5fc8b9a492.zip
Merge "hal: Reset HPH power mode to class AB for wcd9370 variant"
Diffstat (limited to 'hal')
-rw-r--r--hal/msm8974/platform.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/hal/msm8974/platform.c b/hal/msm8974/platform.c
index fa175a8a..0da267c9 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");
+ }
}
}