am bd29edec: am 6d859969: flounder: Speaker L/R channel based on orientation
* commit 'bd29edecbfd77b32da57d65e484c0d2f840fb4d3':
flounder: Speaker L/R channel based on orientation
diff --git a/audio/hal/audio_hw.c b/audio/hal/audio_hw.c
index f2e117d..943a7b1 100644
--- a/audio/hal/audio_hw.c
+++ b/audio/hal/audio_hw.c
@@ -258,7 +258,6 @@
/* Playback sound devices */
[SND_DEVICE_OUT_HANDSET] = "handset",
[SND_DEVICE_OUT_SPEAKER] = "speaker",
- [SND_DEVICE_OUT_SPEAKER_REVERSE] = "speaker-reverse",
[SND_DEVICE_OUT_HEADPHONES] = "headphones",
[SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES] = "speaker-and-headphones",
[SND_DEVICE_OUT_VOICE_HANDSET] = "voice-handset",
@@ -523,10 +522,7 @@
devices & AUDIO_DEVICE_OUT_WIRED_HEADSET) {
snd_device = SND_DEVICE_OUT_HEADPHONES;
} else if (devices & AUDIO_DEVICE_OUT_SPEAKER) {
- if (adev->speaker_lr_swap)
- snd_device = SND_DEVICE_OUT_SPEAKER_REVERSE;
- else
- snd_device = SND_DEVICE_OUT_SPEAKER;
+ snd_device = SND_DEVICE_OUT_SPEAKER;
} else if (devices & AUDIO_DEVICE_OUT_ALL_SCO) {
snd_device = SND_DEVICE_OUT_BT_SCO;
} else if (devices & AUDIO_DEVICE_OUT_EARPIECE) {
@@ -3921,6 +3917,8 @@
usecase = node_to_item(node, struct audio_usecase, adev_list_node);
if (usecase->type == PCM_PLAYBACK) {
select_devices(adev, usecase->id);
+ if (adev->htc_acoustic_spk_reverse)
+ adev->htc_acoustic_spk_reverse(adev->speaker_lr_swap);
break;
}
}
@@ -4422,6 +4420,11 @@
adev->htc_acoustic_set_amp_mode =
(int (*)(int , int, int, int, bool))dlsym(adev->htc_acoustic_lib,
"set_amp_mode");
+ adev->htc_acoustic_spk_reverse =
+ (int (*)(bool))dlsym(adev->htc_acoustic_lib,
+ "spk_reverse");
+ if (adev->htc_acoustic_spk_reverse)
+ adev->htc_acoustic_spk_reverse(adev->speaker_lr_swap);
}
}
diff --git a/audio/hal/audio_hw.h b/audio/hal/audio_hw.h
index 34d8ea9..63a0c1d 100644
--- a/audio/hal/audio_hw.h
+++ b/audio/hal/audio_hw.h
@@ -74,7 +74,6 @@
SND_DEVICE_OUT_BEGIN = SND_DEVICE_MIN,
SND_DEVICE_OUT_HANDSET = SND_DEVICE_OUT_BEGIN,
SND_DEVICE_OUT_SPEAKER,
- SND_DEVICE_OUT_SPEAKER_REVERSE,
SND_DEVICE_OUT_HEADPHONES,
SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES,
SND_DEVICE_OUT_VOICE_HANDSET,
@@ -415,6 +414,7 @@
int (*htc_acoustic_init_rt5506)();
int (*htc_acoustic_set_rt5506_amp)(int, int);
int (*htc_acoustic_set_amp_mode)(int, int, int, int, bool);
+ int (*htc_acoustic_spk_reverse)(bool);
void* sound_trigger_lib;
int (*sound_trigger_open_for_streaming)();
diff --git a/mixer_paths_0.xml b/mixer_paths_0.xml
index e08d8ea..f7b15df 100644
--- a/mixer_paths_0.xml
+++ b/mixer_paths_0.xml
@@ -13,9 +13,6 @@
<path name="speaker">
</path>
- <path name="speaker-reverse">
- </path>
-
<path name="headphones">
<ctl name="Headphone Jack Switch" value="1"/>
</path>