summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRavi Kumar Alamanda <ralama@codeaurora.org>2015-09-24 02:15:27 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-09-24 02:15:27 +0000
commit550f6d33701c3f5ed5dd3ac40e9e1e6b5de680e5 (patch)
tree66efcd5fe53ebdfd9fb98b31d975fdc67b06e6a6
parent2cb23e903de5dd2db0a45dd89a158a7eac5052bd (diff)
parent425e154c046554deb7ba766e89b943e8870ee251 (diff)
downloadhardware_qcom_audio-550f6d33701c3f5ed5dd3ac40e9e1e6b5de680e5.tar.gz
hardware_qcom_audio-550f6d33701c3f5ed5dd3ac40e9e1e6b5de680e5.tar.bz2
hardware_qcom_audio-550f6d33701c3f5ed5dd3ac40e9e1e6b5de680e5.zip
am 425e154c: hal: msm8974: Conditional device switch to swap LR channels
* commit '425e154c046554deb7ba766e89b943e8870ee251': hal: msm8974: Conditional device switch to swap LR channels
-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 b2d6fa2d..83e2f912 100644
--- a/hal/msm8974/platform.c
+++ b/hal/msm8974/platform.c
@@ -2441,14 +2441,24 @@ int platform_swap_lr_channels(struct audio_device *adev, bool swap_channels)
list_for_each(node, &adev->usecase_list) {
usecase = node_to_item(node, struct audio_usecase, list);
if (usecase->type == PCM_PLAYBACK &&
- usecase->stream.out->devices & AUDIO_DEVICE_OUT_SPEAKER) {
- const char *mixer_path;
- if (swap_channels) {
- mixer_path = platform_get_snd_device_name(SND_DEVICE_OUT_SPEAKER_REVERSE);
- audio_route_apply_and_update_path(adev->audio_route, mixer_path);
+ usecase->stream.out->devices & AUDIO_DEVICE_OUT_SPEAKER) {
+ /*
+ * If acdb tuning is different for SPEAKER_REVERSE, it is must
+ * to perform device switch to disable the current backend to
+ * enable it with new acdb data.
+ */
+ if (acdb_device_table[SND_DEVICE_OUT_SPEAKER] !=
+ acdb_device_table[SND_DEVICE_OUT_SPEAKER_REVERSE]) {
+ select_devices(adev, usecase->id);
} else {
- mixer_path = platform_get_snd_device_name(SND_DEVICE_OUT_SPEAKER);
- audio_route_apply_and_update_path(adev->audio_route, mixer_path);
+ const char *mixer_path;
+ if (swap_channels) {
+ mixer_path = platform_get_snd_device_name(SND_DEVICE_OUT_SPEAKER_REVERSE);
+ audio_route_apply_and_update_path(adev->audio_route, mixer_path);
+ } else {
+ mixer_path = platform_get_snd_device_name(SND_DEVICE_OUT_SPEAKER);
+ audio_route_apply_and_update_path(adev->audio_route, mixer_path);
+ }
}
break;
}