summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorMarcKe <herderkewitz@googlemail.com>2015-01-29 20:32:59 +0100
committertilaksidduram <tilaksidduram@gmail.com>2015-02-11 01:45:30 +0530
commit1c3ccd1cbf98430dc091240fe1aa494a51908980 (patch)
tree035e796b868e28ee034b171d90ad73a8de71724d /audio
parent2373d4ad07281d90a19a632e9cb652b07f8ec435 (diff)
downloaddevice_samsung_n7100-1c3ccd1cbf98430dc091240fe1aa494a51908980.zip
device_samsung_n7100-1c3ccd1cbf98430dc091240fe1aa494a51908980.tar.gz
device_samsung_n7100-1c3ccd1cbf98430dc091240fe1aa494a51908980.tar.bz2
audio: fix incall mute
Diffstat (limited to 'audio')
-rw-r--r--audio/audio_hw.c42
-rw-r--r--audio/audio_hw.h7
2 files changed, 49 insertions, 0 deletions
diff --git a/audio/audio_hw.c b/audio/audio_hw.c
index 31aecad..5335d7d 100644
--- a/audio/audio_hw.c
+++ b/audio/audio_hw.c
@@ -2603,10 +2603,52 @@ static int adev_set_mode(struct audio_hw_device *dev, audio_mode_t mode)
static int adev_set_mic_mute(struct audio_hw_device *dev, bool state)
{
+ int headset_on;
+ int headphone_on;
+ int speaker_on;
+ int earpiece_on;
+ int bt_on;
+
struct m0_audio_device *adev = (struct m0_audio_device *)dev;
+ headset_on = adev->out_device & AUDIO_DEVICE_OUT_WIRED_HEADSET;
+ headphone_on = adev->out_device & AUDIO_DEVICE_OUT_WIRED_HEADPHONE;
+ speaker_on = adev->out_device & AUDIO_DEVICE_OUT_SPEAKER;
+ earpiece_on = adev->out_device & AUDIO_DEVICE_OUT_EARPIECE;
+ bt_on = adev->out_device & AUDIO_DEVICE_OUT_ALL_SCO;
+
adev->mic_mute = state;
+ if (adev->mode == AUDIO_MODE_IN_CALL) {
+ if (state) {
+ if (speaker_on || earpiece_on || headphone_on) {
+ ALOGD("%s: set voicecall route: default_input_disable", __func__);
+ set_bigroute_by_array(adev->mixer, default_input_disable, 1);
+ }
+ if (headset_on) {
+ ALOGD("%s: set voicecall route: headset_input_disable", __func__);
+ set_bigroute_by_array(adev->mixer, headset_input_disable, 1);
+ }
+ if (bt_on) {
+ ALOGD("%s: set voicecall route: bt_input_disable", __func__);
+ set_bigroute_by_array(adev->mixer, bt_input_disable, 1);
+ }
+ } else {
+ if (speaker_on || earpiece_on || headphone_on) {
+ ALOGD("%s: set voicecall route: default_input", __func__);
+ set_bigroute_by_array(adev->mixer, default_input, 1);
+ }
+ if (headset_on) {
+ ALOGD("%s: set voicecall route: headset_input", __func__);
+ set_bigroute_by_array(adev->mixer, headset_input, 1);
+ }
+ if (bt_on) {
+ ALOGD("%s: set voicecall route: bt_input", __func__);
+ set_bigroute_by_array(adev->mixer, bt_input, 1);
+ }
+ }
+ }
+
return 0;
}
diff --git a/audio/audio_hw.h b/audio/audio_hw.h
index 5ba0e9e..3481501 100644
--- a/audio/audio_hw.h
+++ b/audio/audio_hw.h
@@ -237,6 +237,13 @@ struct route_setting bt_input[] = {
{ .ctl_name = NULL, },
};
+struct route_setting bt_input_disable[] = {
+ { .ctl_name = "AIF2ADC Mux", .intval = 0, },
+ { .ctl_name = "AIF1ADC1R Mixer AIF2 Switch", .intval = 0, },
+ { .ctl_name = "AIF1ADC1L Mixer AIF2 Switch", .intval = 0, },
+ { .ctl_name = NULL, },
+};
+
struct route_setting bt_disable[] = {
{ .ctl_name = "AIF1DAC1 Volume", .intval = 96, },
{ .ctl_name = "AIF1 Boost Volume", .intval = 0, },