Merge "post_proc: disable Bassboost and Virtualizer for certain devices"
diff --git a/hal/audio_extn/audio_extn.h b/hal/audio_extn/audio_extn.h
index 8bbd2cf..f631653 100644
--- a/hal/audio_extn/audio_extn.h
+++ b/hal/audio_extn/audio_extn.h
@@ -166,7 +166,7 @@
 #endif
 
 #ifndef DS1_DOLBY_DDP_ENABLED
-#define audio_extn_dolby_set_endpoint()                 (0)
+#define audio_extn_dolby_set_endpoint(adev)                 (0)
 #else
 void audio_extn_dolby_set_endpoint(struct audio_device *adev);
 #endif
@@ -174,7 +174,7 @@
 #ifndef DS1_DOLBY_DDP_ENABLED
 #define audio_extn_ddp_set_parameters(adev, parms)      (0)
 #define audio_extn_is_dolby_format(format)              (0)
-#define audio_extn_dolby_get_snd_codec_id(format)       (0)
+#define audio_extn_dolby_get_snd_codec_id(adev, out, format)       (0)
 #define audio_extn_dolby_send_ddp_endp_params(adev)     (0)
 #else
 bool audio_extn_is_dolby_format(audio_format_t format);
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 69e9561..4787ab3 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -551,21 +551,6 @@
     return ret;
 }
 
-static void update_devices_for_all_voice_usecases(struct audio_device *adev)
-{
-    struct listnode *node;
-    struct audio_usecase *usecase;
-
-    list_for_each(node, &adev->usecase_list) {
-        usecase = node_to_item(node, struct audio_usecase, list);
-        if (usecase->type == VOICE_CALL) {
-            ALOGV("%s: updating device for usecase:%s", __func__,
-                  use_case_table[usecase->id]);
-            select_devices(adev, usecase->id);
-        }
-    }
-}
-
 static audio_usecase_t get_voice_usecase_id_from_list(struct audio_device *adev)
 {
     struct audio_usecase *usecase;
@@ -1467,7 +1452,7 @@
             } else if ((adev->mode == AUDIO_MODE_IN_CALL) &&
                             voice_is_in_call(adev) &&
                             (out == adev->primary_output)) {
-                update_devices_for_all_voice_usecases(adev);
+                voice_update_devices_for_all_voice_usecases(adev);
             }
         }
 
diff --git a/hal/msm8974/platform.h b/hal/msm8974/platform.h
index c22b2b8..fca534e 100644
--- a/hal/msm8974/platform.h
+++ b/hal/msm8974/platform.h
@@ -180,7 +180,17 @@
 #define HFP_PCM_RX 5
 
 #define INCALL_MUSIC_UPLINK_PCM_DEVICE 1
+
+#ifdef PLATFORM_MSM8610
+#define INCALL_MUSIC_UPLINK2_PCM_DEVICE 14
+#elif PLATFORM_MSM8x26
 #define INCALL_MUSIC_UPLINK2_PCM_DEVICE 16
+#elif PLATFORM_MSM8974
+#define INCALL_MUSIC_UPLINK2_PCM_DEVICE 35
+#else
+#define INCALL_MUSIC_UPLINK2_PCM_DEVICE -1
+#endif
+
 #define SPKR_PROT_CALIB_RX_PCM_DEVICE 5
 #define SPKR_PROT_CALIB_TX_PCM_DEVICE 25
 #define PLAYBACK_OFFLOAD_DEVICE 9
diff --git a/hal/voice.c b/hal/voice.c
index 1c3ab38..ac067a3 100644
--- a/hal/voice.c
+++ b/hal/voice.c
@@ -405,8 +405,7 @@
             adev->voice.tty_mode = tty_mode;
             adev->acdb_settings = (adev->acdb_settings & TTY_MODE_CLEAR) | tty_mode;
             if (voice_is_in_call(adev))
-                //todo: what about voice2, volte and qchat usecases?
-                select_devices(adev, USECASE_VOICE_CALL);
+               voice_update_devices_for_all_voice_usecases(adev);
         }
     }
 
@@ -446,4 +445,19 @@
     voice_extn_init(adev);
 }
 
+void voice_update_devices_for_all_voice_usecases(struct audio_device *adev)
+{
+    struct listnode *node;
+    struct audio_usecase *usecase;
+
+    list_for_each(node, &adev->usecase_list) {
+        usecase = node_to_item(node, struct audio_usecase, list);
+        if (usecase->type == VOICE_CALL) {
+            ALOGV("%s: updating device for usecase:%s", __func__,
+                  use_case_table[usecase->id]);
+            select_devices(adev, usecase->id);
+        }
+    }
+}
+
 
diff --git a/hal/voice.h b/hal/voice.h
index 5e4ce7f..d160569 100644
--- a/hal/voice.h
+++ b/hal/voice.h
@@ -86,4 +86,5 @@
                                              struct stream_out *out);
 int voice_check_and_stop_incall_rec_usecase(struct audio_device *adev,
                                             struct stream_in *in);
+void voice_update_devices_for_all_voice_usecases(struct audio_device *adev);
 #endif //VOICE_H
diff --git a/post_proc/effect_api.c b/post_proc/effect_api.c
index 0b77969..b7cf469 100644
--- a/post_proc/effect_api.c
+++ b/post_proc/effect_api.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
 
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions are
@@ -391,7 +391,7 @@
 {
     ALOGV("%s", __func__);
     if (preset && (preset <= NUM_OSL_REVERB_PRESETS_SUPPORTED))
-        reverb->preset = map_reverb_opensl_preset_2_offload_preset[preset][1];
+        reverb->preset = map_reverb_opensl_preset_2_offload_preset[preset-1][1];
 }
 
 void offload_reverb_set_wet_mix(struct reverb_params *reverb, int wet_mix)