From 6103299103c6205991e651cb07b66720311c2d39 Mon Sep 17 00:00:00 2001 From: Dheeraj CVR Date: Tue, 12 Aug 2014 19:45:59 +0530 Subject: audio: set noise suppression based on audio parameter Change-Id: Ie28205afda03280d9cc6437a7c98f7b995fd4f50 --- audio/audio_hw.c | 4 ++++ audio/audio_hw.h | 25 ++++++++++++++++--------- 2 files changed, 20 insertions(+), 9 deletions(-) (limited to 'audio') diff --git a/audio/audio_hw.c b/audio/audio_hw.c index d32596b..354aef0 100644 --- a/audio/audio_hw.c +++ b/audio/audio_hw.c @@ -2545,9 +2545,13 @@ static int adev_set_parameters(struct audio_hw_device *dev, const char *kvpairs) if (strcmp(value, "on") == 0) { ALOGE("%s: enabling two mic control", __func__); ril_set_two_mic_control(&adev->ril, AUDIENCE, TWO_MIC_SOLUTION_ON); + /* sub mic */ + set_bigroute_by_array(adev->mixer, noise_suppression, 1); } else { ALOGE("%s: disabling two mic control", __func__); ril_set_two_mic_control(&adev->ril, AUDIENCE, TWO_MIC_SOLUTION_OFF); + /* sub mic */ + set_bigroute_by_array(adev->mixer, noise_suppression_disable, 1); } } diff --git a/audio/audio_hw.h b/audio/audio_hw.h index bcb7485..ab1746d 100644 --- a/audio/audio_hw.h +++ b/audio/audio_hw.h @@ -132,15 +132,8 @@ struct route_setting default_input[] = { { .ctl_name = "AIF1ADCL Source", .intval = 0, }, { .ctl_name = "AIF2ADCL Source", .intval = 0, }, { .ctl_name = "MIXINL IN1L Switch", .intval = 1, }, - { .ctl_name = "Sub Mic Switch", .intval = 1, }, - { .ctl_name = "AIF1ADCR Source", .intval = 1, }, - { .ctl_name = "AIF2ADCR Source", .intval = 1, }, - { .ctl_name = "MIXINR IN1R Switch", .intval = 1, }, { .ctl_name = "IN1L Volume", .intval = 25, }, - { .ctl_name = "IN1R Volume", .intval = 25, }, { .ctl_name = "MIXINL IN1L Volume", .intval = 0, }, - { .ctl_name = "DAC2 Left Sidetone Volume", .intval = 12, }, - { .ctl_name = "DAC2 Right Sidetone Volume", .intval = 12, }, { .ctl_name = "AIF2ADC Volume", .intval = 96, }, { .ctl_name = "AIF2ADCL DRC Switch", .intval = 0, }, { .ctl_name = NULL, }, @@ -149,13 +142,27 @@ struct route_setting default_input[] = { struct route_setting default_input_disable[] = { { .ctl_name = "Main Mic Switch", .intval = 0, }, { .ctl_name = "MIXINL IN1L Switch", .intval = 0, }, - { .ctl_name = "Sub Mic Switch", .intval = 0, }, - { .ctl_name = "MIXINR IN1R Switch", .intval = 0, }, { .ctl_name = "AIF2DACL Source", .intval = 0, }, { .ctl_name = "AIF2DACR Source", .intval = 1, }, { .ctl_name = NULL, }, }; +struct route_setting noise_suppression[] = { + { .ctl_name = "Sub Mic Switch", .intval = 1, }, + { .ctl_name = "IN1R Volume", .intval = 25, }, + { .ctl_name = "MIXINR IN1R Switch", .intval = 1, }, + { .ctl_name = "MIXINR IN1R Volume", .intval = 0, }, + { .ctl_name = "AIF1ADCR Source", .intval = 1, }, + { .ctl_name = NULL, }, +}; + +struct route_setting noise_suppression_disable[] = { + { .ctl_name = "Sub Mic Switch", .intval = 0, }, + { .ctl_name = "MIXINR IN1R Switch", .intval = 0, }, + { .ctl_name = "MIXINR IN1R Volume", .intval = 0, }, + { .ctl_name = NULL, }, +}; + struct route_setting headset_input[] = { { .ctl_name = "AIF2DAC2L Mixer AIF2 Switch", .intval = 0, }, { .ctl_name = "AIF2DAC2R Mixer AIF2 Switch", .intval = 0, }, -- cgit v1.1