summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcodeworkx <daniel.hillenbrand@codeworkx.de>2012-07-26 14:06:37 +0200
committercodeworkx <daniel.hillenbrand@codeworkx.de>2012-07-26 14:06:37 +0200
commit6d6f5da4b94e25155c712fa95e68a275636bad2e (patch)
tree71a1811af8679ffe17930dfa470a7b2c16b8a664
parent5fe50a8c2d506c1c6dda52ded9b669ae296aa1e3 (diff)
downloaddevice_samsung_i9300-6d6f5da4b94e25155c712fa95e68a275636bad2e.zip
device_samsung_i9300-6d6f5da4b94e25155c712fa95e68a275636bad2e.tar.gz
device_samsung_i9300-6d6f5da4b94e25155c712fa95e68a275636bad2e.tar.bz2
audio: use main-mic on headphones, fix mic issue when unplugging hs during call
Change-Id: I9111eb0d80be59a721f7c850e3795a51fc91746d
-rwxr-xr-xaudio/audio_hw.c23
-rw-r--r--audio/audio_hw.h24
2 files changed, 41 insertions, 6 deletions
diff --git a/audio/audio_hw.c b/audio/audio_hw.c
index 4ba97bf..9d9342d 100755
--- a/audio/audio_hw.c
+++ b/audio/audio_hw.c
@@ -581,25 +581,36 @@ static void select_output_device(struct m0_audio_device *adev)
}
if (headset_on || headphone_on || speaker_on || earpiece_on) {
- LOGD("%s: set bigroute: voicecall_input_default", __func__);
+ LOGD("%s: set voicecall route: voicecall_default", __func__);
set_bigroute_by_array(adev->mixer, voicecall_default, 1);
} else {
- LOGD("%s: set bigroute: voicecall_input_default_disable", __func__);
+ LOGD("%s: set voicecall route: voicecall_default_disable", __func__);
set_bigroute_by_array(adev->mixer, voicecall_default_disable, 1);
}
- if (headset_on || headphone_on) {
- LOGD("%s: set bigroute: headset_input", __func__);
+ if (speaker_on || earpiece_on || headphone_on) {
+ LOGD("%s: set voicecall route: default_input", __func__);
+ set_bigroute_by_array(adev->mixer, default_input, 1);
+ } else {
+ LOGD("%s: set voicecall route: default_input_disable", __func__);
+ set_bigroute_by_array(adev->mixer, default_input_disable, 1);
+ }
+
+ if (headset_on) {
+ LOGD("%s: set voicecall route: headset_input", __func__);
set_bigroute_by_array(adev->mixer, headset_input, 1);
+ } else {
+ LOGD("%s: set voicecall route: headset_input_disable", __func__);
+ set_bigroute_by_array(adev->mixer, headset_input_disable, 1);
}
if (bt_on) {
// bt uses a different port (PORT_BT) for playback, reopen the pcms
end_call(adev);
start_call(adev);
- LOGD("%s: set bigroute: bt_input", __func__);
+ LOGD("%s: set voicecall route: bt_input", __func__);
set_bigroute_by_array(adev->mixer, bt_input, 1);
- LOGD("%s: set bigroute: bt_output", __func__);
+ LOGD("%s: set voicecall route: bt_output", __func__);
set_bigroute_by_array(adev->mixer, bt_output, 1);
}
set_incall_device(adev);
diff --git a/audio/audio_hw.h b/audio/audio_hw.h
index e264c4a..b9030de 100644
--- a/audio/audio_hw.h
+++ b/audio/audio_hw.h
@@ -89,6 +89,22 @@ struct route_setting voicecall_default_disable[] = {
{ .ctl_name = NULL, },
};
+struct route_setting default_input[] = {
+ { .ctl_name = "Main Mic Switch", .intval = 1, },
+ { .ctl_name = "MIXINL IN1L Switch", .intval = 1, },
+ { .ctl_name = "AIF1ADC1 HPF Mode", .intval = 0, },
+ { .ctl_name = "AIF1ADC1 HPF Switch", .intval = 1, },
+ { .ctl_name = NULL, },
+};
+
+struct route_setting default_input_disable[] = {
+ { .ctl_name = "Main Mic Switch", .intval = 0, },
+ { .ctl_name = "MIXINL IN1L Switch", .intval = 0, },
+ { .ctl_name = "AIF1ADC1 HPF Mode", .intval = 0, },
+ { .ctl_name = "AIF1ADC1 HPF Switch", .intval = 0, },
+ { .ctl_name = NULL, },
+};
+
struct route_setting headset_input[] = {
{ .ctl_name = "MIXINL IN1L Switch", .intval = 0, },
{ .ctl_name = "MIXINR IN1R Switch", .intval = 0, },
@@ -105,6 +121,14 @@ struct route_setting headset_input[] = {
{ .ctl_name = NULL, },
};
+struct route_setting headset_input_disable[] = {
+ { .ctl_name = "Headset Mic Switch", .intval = 0, },
+ { .ctl_name = "MIXINL IN2L Switch", .intval = 0, },
+ { .ctl_name = "AIF1ADC1 HPF Mode", .intval = 0, },
+ { .ctl_name = "AIF1ADC1 HPF Switch", .intval = 0, },
+ { .ctl_name = NULL, },
+};
+
struct route_setting bt_output[] = {
{ .ctl_name = "DAC1L Mixer AIF1.1 Switch", .intval = 1, },
{ .ctl_name = "DAC1R Mixer AIF1.1 Switch", .intval = 1, },