summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorDheeraj CVR <cvr.dheeraj@gmail.com>2014-08-12 22:33:18 +0530
committertilaksidduram <tilaksidduram@gmail.com>2014-08-17 13:21:28 +0530
commitde7462ec9b0dd4ee101b70fb7132cd64560e4112 (patch)
tree6a83b7a674808bce364732c28382a531abaa529b /audio
parent52b7c332c29b7736f180fee0e51b0d101644091c (diff)
downloaddevice_samsung_n7100-de7462ec9b0dd4ee101b70fb7132cd64560e4112.zip
device_samsung_n7100-de7462ec9b0dd4ee101b70fb7132cd64560e4112.tar.gz
device_samsung_n7100-de7462ec9b0dd4ee101b70fb7132cd64560e4112.tar.bz2
audio: set noise suppression based on audio parameter
Change-Id: I014541ead917f2385c9ec8d88910f11e8a6b6e92
Diffstat (limited to 'audio')
-rw-r--r--audio/audio_hw.c4
-rw-r--r--audio/audio_hw.h26
2 files changed, 20 insertions, 10 deletions
diff --git a/audio/audio_hw.c b/audio/audio_hw.c
index e567e38..31aecad 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, "true") == 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 b4919c4..5ba0e9e 100644
--- a/audio/audio_hw.h
+++ b/audio/audio_hw.h
@@ -133,16 +133,8 @@ struct route_setting default_input[] = {
{ .ctl_name = "AIF1ADCL Source", .intval = 0, },
{ .ctl_name = "AIF2ADCL Source", .intval = 0, },
{ .ctl_name = "MIXINL IN2L Switch", .intval = 1, },
- { .ctl_name = "Sub Mic Switch", .intval = 1, },
- { .ctl_name = "SubMicBias Mode", .intval = 1, },
- { .ctl_name = "AIF1ADCR Source", .intval = 1, },
- { .ctl_name = "AIF2ADCR Source", .intval = 1, },
- { .ctl_name = "MIXINR IN1R Switch", .intval = 1, },
{ .ctl_name = "IN2L Volume", .intval = 25, },
- { .ctl_name = "IN1R Volume", .intval = 25, },
{ .ctl_name = "MIXINL IN2L 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, },
@@ -152,11 +144,25 @@ struct route_setting default_input_disable[] = {
{ .ctl_name = "Main Mic Switch", .intval = 0, },
{ .ctl_name = "MainMicBias Mode", .intval = 0, },
{ .ctl_name = "MIXINL IN2L 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 = "SubMicBias Mode", .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 = "SubMicBias Mode", .intval = 0, },
{ .ctl_name = "MIXINR IN1R Switch", .intval = 0, },
- { .ctl_name = "AIF2DACL Source", .intval = 0, },
- { .ctl_name = "AIF2DACR Source", .intval = 1, },
+ { .ctl_name = "MIXINR IN1R Volume", .intval = 0, },
{ .ctl_name = NULL, },
};