am 95fc9c80: More reformatting for uniformity

* commit '95fc9c80114e296a46e29fb577d532844f83cc0d':
  More reformatting for uniformity
diff --git a/BoardConfig.mk b/BoardConfig.mk
index 811bdf6..0df8bfd 100755
--- a/BoardConfig.mk
+++ b/BoardConfig.mk
@@ -30,6 +30,7 @@
 TARGET_CPU_SMP := true
 TARGET_ARCH := arm
 TARGET_ARCH_VARIANT := armv7-a-neon
+TARGET_CPU_VARIANT := cortex-a15
 ARCH_ARM_HAVE_TLS_REGISTER := true
 
 #Bluetooth
diff --git a/audio/Android.mk b/audio/Android.mk
index 1a09486..33969c3 100644
--- a/audio/Android.mk
+++ b/audio/Android.mk
@@ -19,17 +19,16 @@
 LOCAL_MODULE := audio.primary.manta
 LOCAL_MODULE_PATH := $(TARGET_OUT_SHARED_LIBRARIES)/hw
 LOCAL_SRC_FILES := \
-	audio_hw.c \
-	audio_route.c
+	audio_hw.c
 LOCAL_C_INCLUDES += \
 	external/tinyalsa/include \
-	external/expat/lib \
 	hardware/samsung_slsi/exynos5/include \
 	device/samsung/manta/bubblelevel \
 	device/samsung/manta/voicefx \
-	$(call include-path-for, audio-utils)
-LOCAL_SHARED_LIBRARIES := liblog libcutils libtinyalsa libaudioutils libexpat libbubblelevel \
-    libaudience_voicefx
+	$(call include-path-for, audio-utils) \
+	$(call include-path-for, audio-route)
+LOCAL_SHARED_LIBRARIES := liblog libcutils libtinyalsa libaudioutils libbubblelevel \
+	libaudience_voicefx libaudioroute
 LOCAL_MODULE_TAGS := optional
 
 include $(BUILD_SHARED_LIBRARY)
diff --git a/audio/audio_hw.c b/audio/audio_hw.c
index daaaf26..e316e82 100644
--- a/audio/audio_hw.c
+++ b/audio/audio_hw.c
@@ -39,11 +39,10 @@
 #include <tinyalsa/asoundlib.h>
 
 #include <audio_utils/resampler.h>
+#include <audio_route/audio_route.h>
 
 #include <BubbleLevel.h>
 
-#include "audio_route.h"
-
 #include <eS305VoiceProcessing.h>
 
 #define PCM_CARD 0
@@ -55,6 +54,8 @@
 #define PCM_DEVICE_VOICE 2
 #define PCM_DEVICE_SCO 3
 
+#define MIXER_CARD 0
+
 /* duration in ms of volume ramp applied when starting capture to remove plop */
 #define CAPTURE_START_RAMP_MS 100
 
@@ -137,6 +138,7 @@
     int es305_mode;
     int hdmi_drv_fd;
     struct bubble_level *bubble_level;
+    audio_channel_mask_t in_channel_mask;
 
     struct stream_out *outputs[OUTPUT_TOTAL];
 };
@@ -180,6 +182,7 @@
     uint16_t ramp_vol;
     uint16_t ramp_step;
     size_t  ramp_frames;
+    audio_channel_mask_t channel_mask;
 
     struct audio_device *dev;
 };
@@ -500,7 +503,7 @@
     int new_route_id;
     int new_es305_preset = -1;
 
-    reset_mixer_state(adev->ar);
+    audio_route_reset(adev->ar);
 
     enable_hdmi_audio(adev, adev->out_device & AUDIO_DEVICE_OUT_AUX_DIGITAL);
 
@@ -535,6 +538,10 @@
             new_es305_preset =
                 route_configs[input_source_id][output_device_id]->es305_preset[adev->es305_mode];
         }
+        // disable noise suppression when capturing front and back mic for voice recognition
+        if ((adev->input_source == AUDIO_SOURCE_VOICE_RECOGNITION) &&
+                (adev->in_channel_mask != AUDIO_CHANNEL_IN_FRONT_BACK))
+            new_es305_preset = -1;
     } else {
         if (output_device_id != OUT_DEVICE_NONE) {
             output_route =
@@ -561,7 +568,7 @@
         }
     }
 
-    update_mixer_state(adev->ar);
+    audio_route_update_mixer(adev->ar);
 }
 
 void bubblelevel_callback(bool is_level, void *user_data)
@@ -811,13 +818,15 @@
         in->frames_in = pcm_config_in.period_size;
 
         /* Do stereo to mono conversion in place by discarding right channel */
-        for (i = 1; i < in->frames_in; i++)
-            in->buffer[i] = in->buffer[i * 2];
+        if (in->channel_mask == AUDIO_CHANNEL_IN_MONO)
+            for (i = 1; i < in->frames_in; i++)
+                in->buffer[i] = in->buffer[i * 2];
     }
 
     buffer->frame_count = (buffer->frame_count > in->frames_in) ?
                                 in->frames_in : buffer->frame_count;
-    buffer->i16 = in->buffer + (pcm_config_in.period_size - in->frames_in);
+    buffer->i16 = in->buffer +
+            (pcm_config_in.period_size - in->frames_in) * popcount(in->channel_mask);
 
     return in->read_status;
 
@@ -1180,7 +1189,9 @@
 
 static audio_channel_mask_t in_get_channels(const struct audio_stream *stream)
 {
-    return AUDIO_CHANNEL_IN_MONO;
+    struct stream_in *in = (struct stream_in *)stream;
+
+    return in->channel_mask;
 }
 
 
@@ -1303,11 +1314,20 @@
 
     frames = (frames < in->ramp_frames) ? frames : in->ramp_frames;
 
-    for (i = 0; i < frames; i++)
-    {
-        buffer[i] = (int16_t)((buffer[i] * vol) >> 16);
-        vol += step;
-    }
+    if (in->channel_mask == AUDIO_CHANNEL_IN_MONO)
+        for (i = 0; i < frames; i++)
+        {
+            buffer[i] = (int16_t)((buffer[i] * vol) >> 16);
+            vol += step;
+        }
+    else
+        for (i = 0; i < frames; i++)
+        {
+            buffer[2*i] = (int16_t)((buffer[2*i] * vol) >> 16);
+            buffer[2*i + 1] = (int16_t)((buffer[2*i + 1] * vol) >> 16);
+            vol += step;
+        }
+
 
     in->ramp_vol = vol;
     in->ramp_frames -= frames;
@@ -1605,7 +1625,8 @@
     *stream_in = NULL;
 
     /* Respond with a request for mono if a different format is given. */
-    if (config->channel_mask != AUDIO_CHANNEL_IN_MONO) {
+    if (config->channel_mask != AUDIO_CHANNEL_IN_MONO &&
+            config->channel_mask != AUDIO_CHANNEL_IN_FRONT_BACK) {
         config->channel_mask = AUDIO_CHANNEL_IN_MONO;
         return -EINVAL;
     }
@@ -1636,6 +1657,7 @@
     in->input_source = AUDIO_SOURCE_DEFAULT;
     in->device = devices;
     in->io_handle = handle;
+    in->channel_mask = config->channel_mask;
 
     in->buffer = malloc(pcm_config_in.period_size * pcm_config_in.channels
                                                * audio_stream_frame_size(&in->stream.common));
@@ -1651,7 +1673,7 @@
 
         ret = create_resampler(pcm_config_in.rate,
                                in->requested_rate,
-                               1,
+                               popcount(in->channel_mask),
                                RESAMPLER_QUALITY_DEFAULT,
                                &in->buf_provider,
                                &in->resampler);
@@ -1741,7 +1763,7 @@
     adev->hw_device.close_input_stream = adev_close_input_stream;
     adev->hw_device.dump = adev_dump;
 
-    adev->ar = audio_route_init();
+    adev->ar = audio_route_init(MIXER_CARD, NULL);
     adev->input_source = AUDIO_SOURCE_DEFAULT;
     /* adev->cur_route_id initial value is 0 and such that first device
      * selection is always applied by select_devices() */
diff --git a/audio/audio_route.c b/audio/audio_route.c
deleted file mode 100644
index 1fc1848..0000000
--- a/audio/audio_route.c
+++ /dev/null
@@ -1,696 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- * Inspired by TinyHW, written by Mark Brown at Wolfson Micro
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#define LOG_TAG "audio_hw_primary"
-/*#define LOG_NDEBUG 0*/
-
-#include <errno.h>
-#include <expat.h>
-#include <stdbool.h>
-#include <stdio.h>
-
-#include <cutils/log.h>
-
-#include <tinyalsa/asoundlib.h>
-
-#define BUF_SIZE 1024
-#define MIXER_XML_PATH "/system/etc/mixer_paths.xml"
-#define INITIAL_MIXER_PATH_SIZE 8
-
-#define MIXER_CARD 0
-
-struct mixer_state {
-    struct mixer_ctl *ctl;
-    unsigned int num_values;
-    int *old_value;
-    int *new_value;
-    int *reset_value;
-    /* If linked is true, only the first element in each array is valid */
-    bool old_linked;
-    bool new_linked;
-    bool reset_linked;
-};
-
-struct mixer_setting {
-    struct mixer_ctl *ctl;
-    unsigned int num_values;
-    int *value;
-    /* If linked is true, only the first element in each array is valid */
-    bool linked;
-};
-
-struct mixer_value {
-    struct mixer_ctl *ctl;
-    int index;
-    int value;
-};
-
-struct mixer_path {
-    char *name;
-    unsigned int size;
-    unsigned int length;
-    struct mixer_setting *setting;
-};
-
-struct audio_route {
-    struct mixer *mixer;
-    unsigned int num_mixer_ctls;
-    struct mixer_state *mixer_state;
-
-    unsigned int mixer_path_size;
-    unsigned int num_mixer_paths;
-    struct mixer_path *mixer_path;
-};
-
-struct config_parse_state {
-    struct audio_route *ar;
-    struct mixer_path *path;
-    int level;
-};
-
-/* path functions */
-
-static void path_print(struct mixer_path *path)
-{
-    unsigned int i;
-    unsigned int j;
-
-    ALOGE("Path: %s, length: %d", path->name, path->length);
-    for (i = 0; i < path->length; i++) {
-        ALOGE("  id=%d: ctl=%s linked=%c", i,
-              mixer_ctl_get_name(path->setting[i].ctl),
-              path->setting[i].linked ? 'y' : 'n');
-        for (j = 0; j < path->setting[i].num_values; j++)
-            ALOGE("    id=%d value=%d", j, path->setting[i].value[j]);
-    }
-}
-
-static void path_free(struct audio_route *ar)
-{
-    unsigned int i;
-
-    for (i = 0; i < ar->num_mixer_paths; i++) {
-        if (ar->mixer_path[i].name)
-            free(ar->mixer_path[i].name);
-        if (ar->mixer_path[i].setting) {
-            if (ar->mixer_path[i].setting->value)
-                free(ar->mixer_path[i].setting->value);
-            free(ar->mixer_path[i].setting);
-        }
-    }
-    free(ar->mixer_path);
-}
-
-static struct mixer_path *path_get_by_name(struct audio_route *ar,
-                                           const char *name)
-{
-    unsigned int i;
-
-    for (i = 0; i < ar->num_mixer_paths; i++)
-        if (strcmp(ar->mixer_path[i].name, name) == 0)
-            return &ar->mixer_path[i];
-
-    return NULL;
-}
-
-static struct mixer_path *path_create(struct audio_route *ar, const char *name)
-{
-    struct mixer_path *new_mixer_path = NULL;
-
-    if (path_get_by_name(ar, name)) {
-        ALOGE("Path name '%s' already exists", name);
-        return NULL;
-    }
-
-    /* check if we need to allocate more space for mixer paths */
-    if (ar->mixer_path_size <= ar->num_mixer_paths) {
-        if (ar->mixer_path_size == 0)
-            ar->mixer_path_size = INITIAL_MIXER_PATH_SIZE;
-        else
-            ar->mixer_path_size *= 2;
-
-        new_mixer_path = realloc(ar->mixer_path, ar->mixer_path_size *
-                                 sizeof(struct mixer_path));
-        if (new_mixer_path == NULL) {
-            ALOGE("Unable to allocate more paths");
-            return NULL;
-        } else {
-            ar->mixer_path = new_mixer_path;
-        }
-    }
-
-    /* initialise the new mixer path */
-    ar->mixer_path[ar->num_mixer_paths].name = strdup(name);
-    ar->mixer_path[ar->num_mixer_paths].size = 0;
-    ar->mixer_path[ar->num_mixer_paths].length = 0;
-    ar->mixer_path[ar->num_mixer_paths].setting = NULL;
-
-    /* return the mixer path just added, then increment number of them */
-    return &ar->mixer_path[ar->num_mixer_paths++];
-}
-
-static int find_ctl_in_path(struct mixer_path *path, struct mixer_ctl *ctl)
-{
-    unsigned int i;
-
-    for (i = 0; i < path->length; i++)
-        if (path->setting[i].ctl == ctl)
-            return i;
-
-    return -1;
-}
-
-static int alloc_path_setting(struct mixer_path *path)
-{
-    struct mixer_setting *new_path_setting;
-    int path_index;
-
-    /* check if we need to allocate more space for path settings */
-    if (path->size <= path->length) {
-        if (path->size == 0)
-            path->size = INITIAL_MIXER_PATH_SIZE;
-        else
-            path->size *= 2;
-
-        new_path_setting = realloc(path->setting,
-                                   path->size * sizeof(struct mixer_setting));
-        if (new_path_setting == NULL) {
-            ALOGE("Unable to allocate more path settings");
-            return -1;
-        } else {
-            path->setting = new_path_setting;
-        }
-    }
-
-    path_index = path->length;
-    path->length++;
-
-    return path_index;
-}
-
-static int path_add_setting(struct mixer_path *path,
-                            struct mixer_setting *setting)
-{
-    unsigned int i;
-    int path_index;
-
-    if (find_ctl_in_path(path, setting->ctl) != -1) {
-        ALOGE("Control '%s' already exists in path '%s'",
-              mixer_ctl_get_name(setting->ctl), path->name);
-        return -1;
-    }
-
-    path_index = alloc_path_setting(path);
-    if (path_index < 0)
-        return -1;
-
-    path->setting[path_index].ctl = setting->ctl;
-    path->setting[path_index].num_values = setting->num_values;
-    path->setting[path_index].value = malloc(setting->num_values * sizeof(int));
-    path->setting[path_index].linked = setting->linked;
-    if (setting->linked) {
-        path->setting[path_index].value[0] = setting->value[0];
-    } else {
-        for (i = 0; i < setting->num_values; i++)
-            path->setting[path_index].value[i] = setting->value[i];
-    }
-
-    return 0;
-}
-
-static int path_add_value(struct mixer_path *path,
-                          struct mixer_value *mixer_value)
-{
-    unsigned int i;
-    int path_index;
-    unsigned int num_values;
-
-    /* Check that mixer value index is within range */
-    num_values = mixer_ctl_get_num_values(mixer_value->ctl);
-    if (mixer_value->index >= (int)num_values) {
-        ALOGE("mixer index %d is out of range for '%s'", mixer_value->index,
-              mixer_ctl_get_name(mixer_value->ctl));
-        return -1;
-    }
-
-    path_index = find_ctl_in_path(path, mixer_value->ctl);
-    if (path_index < 0) {
-        /* New path */
-
-        path_index = alloc_path_setting(path);
-        if (path_index < 0)
-            return -1;
-
-        /* initialise the new path setting */
-        path->setting[path_index].ctl = mixer_value->ctl;
-        path->setting[path_index].num_values = num_values;
-        path->setting[path_index].value = malloc(num_values * sizeof(int));
-    }
-
-    if (mixer_value->index == -1) {
-        /* Linked, so only set the first value */
-        path->setting[path_index].linked = true;
-        path->setting[path_index].value[0] = mixer_value->value;
-    } else {
-        if (path->setting[path_index].linked && (num_values > 1)) {
-            /* Unlinking the values, so duplicate them across */
-            for (i = 1; i < num_values; i++) {
-                path->setting[path_index].value[i] =
-                        path->setting[path_index].value[0];
-            }
-            path->setting[path_index].linked = false;
-        }
-        path->setting[path_index].value[mixer_value->index] = mixer_value->value;
-    }
-
-    return 0;
-}
-
-static int path_add_path(struct mixer_path *path, struct mixer_path *sub_path)
-{
-    unsigned int i;
-
-    for (i = 0; i < sub_path->length; i++)
-        if (path_add_setting(path, &sub_path->setting[i]) < 0)
-            return -1;
-
-    return 0;
-}
-
-static int path_apply(struct audio_route *ar, struct mixer_path *path)
-{
-    unsigned int i;
-    unsigned int j;
-    unsigned int ctl_index;
-
-    for (i = 0; i < path->length; i++) {
-        struct mixer_ctl *ctl = path->setting[i].ctl;
-
-        /* locate the mixer ctl in the list */
-        for (ctl_index = 0; ctl_index < ar->num_mixer_ctls; ctl_index++)
-            if (ar->mixer_state[ctl_index].ctl == ctl)
-                break;
-
-        /* apply the new value(s) */
-        for (j = 0; j < ar->mixer_state[ctl_index].num_values; j++) {
-            ar->mixer_state[ctl_index].new_value[j] = path->setting[i].value[j];
-            if (path->setting[i].linked)
-                break;
-        }
-        ar->mixer_state[ctl_index].new_linked = path->setting[i].linked;
-    }
-
-    return 0;
-}
-
-/* mixer helper function */
-static int mixer_enum_string_to_value(struct mixer_ctl *ctl, const char *string)
-{
-    unsigned int i;
-
-    /* Search the enum strings for a particular one */
-    for (i = 0; i < mixer_ctl_get_num_enums(ctl); i++) {
-        if (strcmp(mixer_ctl_get_enum_string(ctl, i), string) == 0)
-            break;
-    }
-
-    return i;
-}
-
-static void start_tag(void *data, const XML_Char *tag_name,
-                      const XML_Char **attr)
-{
-    const XML_Char *attr_name = NULL;
-    const XML_Char *attr_id = NULL;
-    const XML_Char *attr_value = NULL;
-    struct config_parse_state *state = data;
-    struct audio_route *ar = state->ar;
-    unsigned int i;
-    unsigned int ctl_index;
-    struct mixer_ctl *ctl;
-    int value;
-    unsigned int id;
-    struct mixer_value mixer_value;
-
-    /* Get name, id and value attributes (these may be empty) */
-    for (i = 0; attr[i]; i += 2) {
-        if (strcmp(attr[i], "name") == 0)
-            attr_name = attr[i + 1];
-        if (strcmp(attr[i], "id") == 0)
-            attr_id = attr[i + 1];
-        else if (strcmp(attr[i], "value") == 0)
-            attr_value = attr[i + 1];
-    }
-
-    /* Look at tags */
-    if (strcmp(tag_name, "path") == 0) {
-        if (attr_name == NULL) {
-            ALOGE("Unnamed path!");
-        } else {
-            if (state->level == 1) {
-                /* top level path: create and stash the path */
-                state->path = path_create(ar, (char *)attr_name);
-            } else {
-                /* nested path */
-                struct mixer_path *sub_path = path_get_by_name(ar, attr_name);
-                path_add_path(state->path, sub_path);
-            }
-        }
-    }
-
-    else if (strcmp(tag_name, "ctl") == 0) {
-        /* Obtain the mixer ctl and value */
-        ctl = mixer_get_ctl_by_name(ar->mixer, attr_name);
-        switch (mixer_ctl_get_type(ctl)) {
-        case MIXER_CTL_TYPE_BOOL:
-        case MIXER_CTL_TYPE_INT:
-            value = atoi((char *)attr_value);
-            break;
-        case MIXER_CTL_TYPE_ENUM:
-            value = mixer_enum_string_to_value(ctl, (char *)attr_value);
-            break;
-        default:
-            value = 0;
-            break;
-        }
-
-        if (state->level == 1) {
-            /* top level ctl (initial setting) */
-
-            /* locate the mixer ctl in the list */
-            for (ctl_index = 0; ctl_index < ar->num_mixer_ctls; ctl_index++) {
-                if (ar->mixer_state[ctl_index].ctl == ctl)
-                    break;
-            }
-
-            /* apply the new value */
-            if (attr_id) {
-                /* set only one value */
-                id = atoi((char *)attr_id);
-                if (id < ar->mixer_state[ctl_index].num_values) {
-                    if (ar->mixer_state[ctl_index].new_linked) {
-                        /*
-                         * We're unlinking the values, so copy old_value[0] into
-                         * all the new_value elements.
-                         */
-                        for (i = 0; i < ar->mixer_state[ctl_index].num_values; i++) {
-                            ar->mixer_state[ctl_index].new_value[i] =
-                                    ar->mixer_state[ctl_index].old_value[0];
-                        }
-                        ar->mixer_state[ctl_index].new_linked = false;
-                    }
-                    ar->mixer_state[ctl_index].new_value[id] = value;
-                } else {
-                    ALOGE("value id out of range for mixer ctl '%s'",
-                          mixer_ctl_get_name(ctl));
-                }
-            } else {
-                ar->mixer_state[ctl_index].new_value[0] = value;
-                ar->mixer_state[ctl_index].new_linked = true;
-            }
-        } else {
-            /* nested ctl (within a path) */
-            mixer_value.ctl = ctl;
-            mixer_value.value = value;
-            if (attr_id)
-                mixer_value.index = atoi((char *)attr_id);
-            else
-                mixer_value.index = -1;
-            path_add_value(state->path, &mixer_value);
-        }
-    }
-
-    state->level++;
-}
-
-static void end_tag(void *data, const XML_Char *tag_name)
-{
-    struct config_parse_state *state = data;
-
-    state->level--;
-}
-
-static int alloc_mixer_state(struct audio_route *ar)
-{
-    unsigned int i;
-    unsigned int j;
-    unsigned int num_values;
-    struct mixer_ctl *ctl;
-    bool linked;
-
-    ar->num_mixer_ctls = mixer_get_num_ctls(ar->mixer);
-    ar->mixer_state = malloc(ar->num_mixer_ctls * sizeof(struct mixer_state));
-    if (!ar->mixer_state)
-        return -1;
-
-    for (i = 0; i < ar->num_mixer_ctls; i++) {
-        ctl = mixer_get_ctl(ar->mixer, i);
-        num_values = mixer_ctl_get_num_values(ctl);
-
-        ar->mixer_state[i].old_value = malloc(num_values * sizeof(int));
-        ar->mixer_state[i].new_value = malloc(num_values * sizeof(int));
-        ar->mixer_state[i].reset_value = malloc(num_values * sizeof(int));
-
-        /*
-         * Get all mixer values for controls with multiple values. If all
-         * values are the same, set the linked flag.
-         */
-        linked = true;
-        for (j = 0; j < num_values; j++) {
-            ar->mixer_state[i].old_value[j] = mixer_ctl_get_value(ctl, j);
-            ar->mixer_state[i].new_value[j] = ar->mixer_state[i].old_value[j];
-
-            /*
-             * If the next value is different from the last, set linked to
-             * false.
-             */
-            if ((j > 0) && (ar->mixer_state[i].old_value[j - 1] !=
-                            ar->mixer_state[i].old_value[j])) {
-                linked = false;
-            }
-        }
-        ar->mixer_state[i].ctl = ctl;
-        ar->mixer_state[i].old_linked = linked;
-        ar->mixer_state[i].new_linked = linked;
-        ar->mixer_state[i].num_values = num_values;
-    }
-
-    return 0;
-}
-
-static void free_mixer_state(struct audio_route *ar)
-{
-    unsigned int i;
-
-    for (i = 0; i < ar->num_mixer_ctls; i++) {
-        free(ar->mixer_state[i].old_value);
-        free(ar->mixer_state[i].new_value);
-        free(ar->mixer_state[i].reset_value);
-    }
-
-    free(ar->mixer_state);
-    ar->mixer_state = NULL;
-}
-
-void update_mixer_state(struct audio_route *ar)
-{
-    unsigned int i;
-    unsigned int j;
-
-    for (i = 0; i < ar->num_mixer_ctls; i++) {
-        unsigned int num_values = ar->mixer_state[i].num_values;
-
-        /* if the value has changed, update the mixer */
-        if (ar->mixer_state[i].new_linked) {
-            if (ar->mixer_state[i].old_value[0] != ar->mixer_state[i].new_value[0]) {
-                /* linked ctl, so set all ctl values the same */
-                for (j = 0; j < num_values; j++)
-                    mixer_ctl_set_value(ar->mixer_state[i].ctl, j,
-                                        ar->mixer_state[i].new_value[0]);
-                ar->mixer_state[i].old_value[0] = ar->mixer_state[i].new_value[0];
-            }
-        } else {
-            for (j = 0; j < num_values; j++) {
-                /*
-                 * unlinked ctl, so set each value if necessary.
-                 * Note that if the new value is unlinked but the old is
-                 * linked, only value 0 is valid, so we always have to
-                 * update the mixer for the other values.
-                 */
-                if (ar->mixer_state[i].old_linked ||
-                    (ar->mixer_state[i].old_value[j] !=
-                            ar->mixer_state[i].new_value[j])) {
-                    mixer_ctl_set_value(ar->mixer_state[i].ctl, j,
-                                        ar->mixer_state[i].new_value[j]);
-                    ar->mixer_state[i].old_value[j] = ar->mixer_state[i].new_value[j];
-                }
-            }
-        }
-        ar->mixer_state[i].old_linked = ar->mixer_state[i].new_linked;
-    }
-}
-
-/* saves the current state of the mixer, for resetting all controls */
-static void save_mixer_state(struct audio_route *ar)
-{
-    unsigned int i;
-    unsigned int j;
-
-    for (i = 0; i < ar->num_mixer_ctls; i++) {
-        for (j = 0; j < ar->mixer_state[i].num_values; j++) {
-            ar->mixer_state[i].reset_value[j] = ar->mixer_state[i].new_value[j];
-
-            /* if the values are linked, only need to save value 0 */
-            if (ar->mixer_state[i].new_linked)
-                break;
-        }
-        ar->mixer_state[i].reset_linked = ar->mixer_state[i].new_linked;
-    }
-}
-
-/* this resets all mixer settings to the saved values */
-void reset_mixer_state(struct audio_route *ar)
-{
-    unsigned int i;
-    unsigned int j;
-
-    /* load all of the saved values */
-    for (i = 0; i < ar->num_mixer_ctls; i++) {
-        for (j = 0; j < ar->mixer_state[i].num_values; j++) {
-            ar->mixer_state[i].new_value[j] = ar->mixer_state[i].reset_value[j];
-
-            /* if the values are linked, only need to save value 0 */
-            if (ar->mixer_state[i].reset_linked)
-                break;
-        }
-        ar->mixer_state[i].new_linked = ar->mixer_state[i].reset_linked;
-    }
-}
-
-void audio_route_apply_path(struct audio_route *ar, const char *name)
-{
-    struct mixer_path *path;
-
-    if (!ar) {
-        ALOGE("invalid audio_route");
-        return;
-    }
-
-    path = path_get_by_name(ar, name);
-    if (!path) {
-        ALOGE("unable to find path '%s'", name);
-        return;
-    }
-
-    path_apply(ar, path);
-}
-
-struct audio_route *audio_route_init(void)
-{
-    struct config_parse_state state;
-    XML_Parser parser;
-    FILE *file;
-    int bytes_read;
-    void *buf;
-    int i;
-    struct audio_route *ar;
-
-    ar = calloc(1, sizeof(struct audio_route));
-    if (!ar)
-        goto err_calloc;
-
-    ar->mixer = mixer_open(MIXER_CARD);
-    if (!ar->mixer) {
-        ALOGE("Unable to open the mixer, aborting.");
-        goto err_mixer_open;
-    }
-
-    ar->mixer_path = NULL;
-    ar->mixer_path_size = 0;
-    ar->num_mixer_paths = 0;
-
-    /* allocate space for and read current mixer settings */
-    if (alloc_mixer_state(ar) < 0)
-        goto err_mixer_state;
-
-    file = fopen(MIXER_XML_PATH, "r");
-
-    if (!file) {
-        ALOGE("Failed to open %s", MIXER_XML_PATH);
-        goto err_fopen;
-    }
-
-    parser = XML_ParserCreate(NULL);
-    if (!parser) {
-        ALOGE("Failed to create XML parser");
-        goto err_parser_create;
-    }
-
-    memset(&state, 0, sizeof(state));
-    state.ar = ar;
-    XML_SetUserData(parser, &state);
-    XML_SetElementHandler(parser, start_tag, end_tag);
-
-    for (;;) {
-        buf = XML_GetBuffer(parser, BUF_SIZE);
-        if (buf == NULL)
-            goto err_parse;
-
-        bytes_read = fread(buf, 1, BUF_SIZE, file);
-        if (bytes_read < 0)
-            goto err_parse;
-
-        if (XML_ParseBuffer(parser, bytes_read,
-                            bytes_read == 0) == XML_STATUS_ERROR) {
-            ALOGE("Error in mixer xml (%s)", MIXER_XML_PATH);
-            goto err_parse;
-        }
-
-        if (bytes_read == 0)
-            break;
-    }
-
-    /* apply the initial mixer values, and save them so we can reset the
-       mixer to the original values */
-    update_mixer_state(ar);
-    save_mixer_state(ar);
-
-    XML_ParserFree(parser);
-    fclose(file);
-    return ar;
-
-err_parse:
-    XML_ParserFree(parser);
-err_parser_create:
-    fclose(file);
-err_fopen:
-    free_mixer_state(ar);
-err_mixer_state:
-    mixer_close(ar->mixer);
-err_mixer_open:
-    free(ar);
-    ar = NULL;
-err_calloc:
-    return NULL;
-}
-
-void audio_route_free(struct audio_route *ar)
-{
-    free_mixer_state(ar);
-    mixer_close(ar->mixer);
-    free(ar);
-}
diff --git a/audio/audio_route.h b/audio/audio_route.h
deleted file mode 100644
index 31355dd..0000000
--- a/audio/audio_route.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (C) 2012 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef AUDIO_ROUTE_H
-#define AUDIO_ROUTE_H
-
-/* Initialises and frees the audio routes */
-struct audio_route *audio_route_init(void);
-void audio_route_free(struct audio_route *ar);
-
-/* Applies an audio route path by name */
-void audio_route_apply_path(struct audio_route *ar, const char *name);
-
-/* Resets the mixer back to its initial state */
-void reset_mixer_state(struct audio_route *ar);
-
-/* Updates the mixer with any changed values */
-void update_mixer_state(struct audio_route *ar);
-
-#endif
diff --git a/audio_policy.conf b/audio_policy.conf
index caa6ba1..1f827cc 100644
--- a/audio_policy.conf
+++ b/audio_policy.conf
@@ -47,7 +47,7 @@
     inputs {
       primary {
         sampling_rates 8000|11025|16000|22050|32000|44100|48000
-        channel_masks AUDIO_CHANNEL_IN_MONO|AUDIO_CHANNEL_IN_STEREO
+        channel_masks AUDIO_CHANNEL_IN_MONO|AUDIO_CHANNEL_IN_STEREO|AUDIO_CHANNEL_IN_FRONT_BACK
         formats AUDIO_FORMAT_PCM_16_BIT
         devices AUDIO_DEVICE_IN_BUILTIN_MIC|AUDIO_DEVICE_IN_BLUETOOTH_SCO_HEADSET|AUDIO_DEVICE_IN_WIRED_HEADSET
       }
@@ -79,4 +79,22 @@
       }
     }
   }
+  r_submix {
+    outputs {
+      submix {
+        sampling_rates 44100|48000
+        channel_masks AUDIO_CHANNEL_OUT_STEREO
+        formats AUDIO_FORMAT_PCM_16_BIT
+        devices AUDIO_DEVICE_OUT_REMOTE_SUBMIX
+      }
+    }
+    inputs {
+      submix {
+        sampling_rates 44100|48000
+        channel_masks AUDIO_CHANNEL_IN_STEREO
+        formats AUDIO_FORMAT_PCM_16_BIT
+        devices AUDIO_DEVICE_IN_REMOTE_SUBMIX
+      }
+    }
+  }
 }
diff --git a/bcmdhd.cal b/bcmdhd.cal
index 50085d1..8c1a42e 100644
--- a/bcmdhd.cal
+++ b/bcmdhd.cal
@@ -17,7 +17,7 @@
 aa2g=3
 aa5g=3
 ccode=XY
-regrev=7
+regrev=9
 pa2gw0a0=0xFFB9
 pa2gw1a0=0x12AC
 pa2gw2a0=0xFED9
diff --git a/device.mk b/device.mk
index df8b390..13a82f7 100644
--- a/device.mk
+++ b/device.mk
@@ -99,8 +99,6 @@
 
 # NFC packages
 PRODUCT_PACKAGES += \
-    libnfc-nci \
-    libnfc_nci_jni \
     nfc_nci.manta \
     NfcNci \
     Tag \
@@ -149,7 +147,8 @@
     audio.primary.manta \
     audio.a2dp.default \
     audio.usb.default \
-    libbubblelevel
+    libbubblelevel \
+    audio.r_submix.default
 
 PRODUCT_PACKAGES += \
     power.manta
@@ -167,6 +166,7 @@
     ro.sf.lcd_density=320 \
     ro.hwui.texture_cache_size=72 \
     ro.hwui.layer_cache_size=48 \
+    ro.hwui.r_buffer_cache_size=8 \
     ro.hwui.path_cache_size=16 \
     ro.hwui.shape_cache_size=4 \
     ro.hwui.gradient_cache_size=1 \
diff --git a/gps/gps.exynos5.so b/gps/gps.exynos5.so
index 54c3bac..50d3689 100755
--- a/gps/gps.exynos5.so
+++ b/gps/gps.exynos5.so
Binary files differ
diff --git a/gps/gpsd b/gps/gpsd
index d524c9d..9410677 100755
--- a/gps/gpsd
+++ b/gps/gpsd
Binary files differ
diff --git a/init.manta.rc b/init.manta.rc
index 0f0f361..4b49437 100644
--- a/init.manta.rc
+++ b/init.manta.rc
@@ -142,6 +142,11 @@
     disabled
     oneshot
 
+service dhcpcd_bt-pan /system/bin/dhcpcd -ABKL
+    class main
+    disabled
+    oneshot
+
 service iprenew_wlan0 /system/bin/dhcpcd -n
     class main
     disabled
@@ -152,6 +157,16 @@
     disabled
     oneshot
 
+service iprenew_eth0 /system/bin/dhcpcd -n
+    class main
+    disabled
+    oneshot
+
+service iprenew_bt-pan /system/bin/dhcpcd -n
+    class main
+    disabled
+    oneshot
+
 service battery_charger /charger
     class charger
 
diff --git a/kernel b/kernel
index d41cc2a..6fa5b84 100644
--- a/kernel
+++ b/kernel
Binary files differ
diff --git a/libsensors/IioSensorBase.cpp b/libsensors/IioSensorBase.cpp
index 5e0eddf..437d095 100644
--- a/libsensors/IioSensorBase.cpp
+++ b/libsensors/IioSensorBase.cpp
@@ -48,9 +48,9 @@
       mHasPendingEvent(false),
       mInputReader(MAX_BUFFER_FOR_EVENT),
       mIioChanType(iio_chan_type),
-      mIioSysfsChanFp(NULL),
-      mLock(PTHREAD_MUTEX_INITIALIZER)
+      mIioSysfsChanFp(NULL)
 {
+    pthread_mutex_init(&mLock, NULL);
     ALOGV("%s(): dev_name=%s", __func__, dev_name);
     mPendingEvent.version = sizeof(sensors_event_t);
     memset(mPendingEvent.data, 0, sizeof(mPendingEvent.data));
diff --git a/libsensors/sensors.cpp b/libsensors/sensors.cpp
index 33853eb..fa77ec6 100644
--- a/libsensors/sensors.cpp
+++ b/libsensors/sensors.cpp
@@ -41,17 +41,6 @@
 
 #define DELAY_OUT_TIME 0x7FFFFFFF
 
-#define SENSORS_ROTATION_VECTOR  (1<<ID_RV)
-#define SENSORS_LINEAR_ACCEL     (1<<ID_LA)
-#define SENSORS_GRAVITY          (1<<ID_GR)
-#define SENSORS_GYROSCOPE        (1<<ID_GY)
-#define SENSORS_ACCELERATION     (1<<ID_A)
-#define SENSORS_MAGNETIC_FIELD   (1<<ID_M)
-#define SENSORS_ORIENTATION      (1<<ID_O)
-#define SENSORS_LIGHT            (1<<ID_L)
-#define SENSORS_PROXIMITY        (1<<ID_P)
-#define SENSORS_PRESSURE         (1<<ID_PR)
-
 #define SENSORS_ROTATION_VECTOR_HANDLE  (ID_RV)
 #define SENSORS_LINEAR_ACCEL_HANDLE     (ID_LA)
 #define SENSORS_GRAVITY_HANDLE          (ID_GR)
@@ -70,7 +59,7 @@
 /*****************************************************************************/
 
 /* The SENSORS Module */
-#define LOCAL_SENSORS (2)
+#define LOCAL_SENSORS 2
 static struct sensor_t sSensorList[LOCAL_SENSORS + MPLSensor::numSensors] = {
       { "BH1721fvc Light sensor",
           "Rohm",
@@ -132,6 +121,9 @@
     enum {
         mpl = 0,
         compass,
+#ifdef ENABLE_DMP_DISPL_ORIENT_FEAT
+        dmpOrient,
+#endif
         light,
         pressure,
         numSensorDrivers,       // wake pipe goes here
@@ -155,6 +147,10 @@
             case ID_M:
             case ID_O:
                 return mpl;
+#ifdef ENABLE_DMP_DISPL_ORIENT_FEAT
+            case ID_SO:
+                return dmpOrient;
+#endif
             case ID_L:
                 return light;
             case ID_PR:
@@ -175,11 +171,6 @@
     // Must clean this up early or else the destructor will make a mess.
     memset(mSensors, 0, sizeof(mSensors));
 
-    if (!p_mplsen->isValid()) {
-        delete p_compasssensor;
-        return;
-    }
-
     setCallbackObject(p_mplsen); //setup the callback object for handing mpl callbacks
     numSensors =
         LOCAL_SENSORS +
@@ -196,6 +187,11 @@
     mPollFds[compass].events = POLLIN;
     mPollFds[compass].revents = 0;
 
+#ifdef ENABLE_DMP_DISPL_ORIENT_FEAT
+    mPollFds[dmpOrient].fd = ((MPLSensor*)mSensors[mpl])->getDmpOrientFd();
+    mPollFds[dmpOrient].events = POLLPRI;
+    mPollFds[dmpOrient].revents = 0;
+#endif
     mSensors[light] = new LightSensor();
     mPollFds[light].fd = mSensors[light]->getFd();
     mPollFds[light].events = POLLIN;
@@ -276,6 +272,16 @@
                     nb = ((MPLSensor*) mSensors[mpl])->executeOnData(data, count);
                     mPollFds[i].revents = 0;
                 }
+#ifdef ENABLE_DMP_DISPL_ORIENT_FEAT
+                else if (i == dmpOrient) {
+                    nb = ((MPLSensor*) mSensors[mpl])->readDmpOrientEvents(data, count);
+                    mPollFds[dmpOrient].revents= 0;
+                    if (!isDmpScreenAutoRotationEnabled()) {
+                            /* ignore the data */
+                            nb = 0;
+                    }
+                }
+#endif
                 else {
                     nb = sensor->readEvents(data, count);
                 }
diff --git a/libsensors/sensors.h b/libsensors/sensors.h
index ffe026d..e2c812d 100644
--- a/libsensors/sensors.h
+++ b/libsensors/sensors.h
@@ -31,7 +31,7 @@
 
 #define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
 
-#define ID_SAMSUNG_BASE (0x1000)
+#define ID_SAMSUNG_BASE 12
 #define ID_L  (ID_SAMSUNG_BASE)
 #define ID_PR (ID_L + 1)
 
diff --git a/media_codecs.xml b/media_codecs.xml
index f381a42..83199ef 100644
--- a/media_codecs.xml
+++ b/media_codecs.xml
@@ -101,6 +101,7 @@
         <MediaCodec name="OMX.google.g711.alaw.decoder" type="audio/g711-alaw" />
         <MediaCodec name="OMX.google.g711.mlaw.decoder" type="audio/g711-mlaw" />
         <MediaCodec name="OMX.google.vorbis.decoder" type="audio/vorbis" />
+        <MediaCodec name="OMX.google.gsm.decoder" type="audio/gsm" />
 
         <MediaCodec name="OMX.google.mpeg4.decoder" type="video/mp4v-es" />
         <MediaCodec name="OMX.google.h263.decoder" type="video/3gpp" />
@@ -126,5 +127,6 @@
         <MediaCodec name="OMX.google.amrwb.encoder" type="audio/amr-wb" />
         <MediaCodec name="OMX.google.aac.encoder" type="audio/mp4a-latm" />
         <MediaCodec name="OMX.google.flac.encoder" type="audio/flac" />
+        <MediaCodec name="OMX.google.vpx.encoder" type="video/x-vnd.on2.vp8" />
     </Encoders>
 </MediaCodecs>
diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml
index 71ac9b8..80be669 100644
--- a/overlay/frameworks/base/core/res/res/values/config.xml
+++ b/overlay/frameworks/base/core/res/res/values/config.xml
@@ -179,4 +179,5 @@
          true forces it to use the/dev/input/event subsystem. -->
     <bool name="config_useDevInputEventForAudioJack">true</bool>
 
+    <bool name="config_enableWifiDisplay">true</bool>
 </resources>
diff --git a/power/power_manta.c b/power/power_manta.c
index aa200be..295162f 100644
--- a/power/power_manta.c
+++ b/power/power_manta.c
@@ -100,21 +100,20 @@
     struct manta_power_module *manta = (struct manta_power_module *) module;
     struct dirent **namelist;
     int n;
-    /*
-     * cpufreq interactive governor: timer 20ms, min sample 40ms,
-     * hispeed 1G at load 90%, 140ms load burst needed to move above hispeed.
-     */
 
     sysfs_write("/sys/devices/system/cpu/cpufreq/interactive/timer_rate",
                 "20000");
+    sysfs_write("/sys/devices/system/cpu/cpufreq/interactive/timer_slack",
+                "20000");
     sysfs_write("/sys/devices/system/cpu/cpufreq/interactive/min_sample_time",
                 "40000");
     sysfs_write("/sys/devices/system/cpu/cpufreq/interactive/hispeed_freq",
                 "1000000");
     sysfs_write("/sys/devices/system/cpu/cpufreq/interactive/go_hispeed_load",
-                "90");
+                "99");
+    sysfs_write("/sys/devices/system/cpu/cpufreq/interactive/target_loads", "70 1200000:70 1300000:75 1400000:80 1500000:99");
     sysfs_write("/sys/devices/system/cpu/cpufreq/interactive/above_hispeed_delay",
-                "140000");
+                "80000");
     sysfs_write("/sys/devices/system/cpu/cpufreq/interactive/boostpulse_duration",
                 "500000");
 
diff --git a/proprietary-blobs.txt b/proprietary-blobs.txt
index 6d993c5..c0dc358 100644
--- a/proprietary-blobs.txt
+++ b/proprietary-blobs.txt
@@ -26,13 +26,9 @@
 /system/vendor/firmware/setfile_4e5.bin
 /system/vendor/firmware/setfile_6a3.bin
 /system/vendor/lib/egl/libGLES_mali.so
-/system/vendor/lib/libbccArm.sha1.so
-/system/vendor/lib/libbccArm.so
-/system/vendor/lib/libbcinfoArm.so
-/system/vendor/lib/libclcoreArm.bc
-/system/vendor/lib/libclcore_neonArm.bc
 /system/vendor/lib/libdrmdecrypt.so
-/system/vendor/lib/libRSDriverArm.so
+/system/vendor/lib/libstagefright_hdcp.so
 /system/vendor/secapp/00060308060501020000000000000000.tlbin
 /system/vendor/secapp/020a0000000000000000000000000000.drbin
 /system/vendor/secapp/07060000000000000000000000000000.tlbin
+/system/vendor/secapp/ffffffff000000000000000000000005.tlbin
diff --git a/ueventd.manta.rc b/ueventd.manta.rc
index f60b330..6eccc2a 100755
--- a/ueventd.manta.rc
+++ b/ueventd.manta.rc
@@ -30,6 +30,12 @@
 /sys/devices/platform/s3c2440-i2c.1/i2c-1/1-0068/iio:device*    power_state                      0660    system    system
 /sys/devices/platform/s3c2440-i2c.1/i2c-1/1-0068/iio:device*    buffer/enable                    0660    system    system
 /sys/devices/platform/s3c2440-i2c.1/i2c-1/1-0068/iio:device*    buffer/length                    0660    system    system
+/sys/devices/platform/s3c2440-i2c.1/i2c-1/1-0068/iio:device*    firmware_loaded                  0660    system    system
+
+/sys/devices/platform/s3c2440-i2c.1/i2c-1/1-0068/iio:device*    dmp_firmware                     0660    system    system
+/sys/devices/platform/s3c2440-i2c.1/i2c-1/1-0068/iio:device*    dmp_on                           0660    system    system
+/sys/devices/platform/s3c2440-i2c.1/i2c-1/1-0068/iio:device*    dmp_int_on                       0660    system    system
+/sys/devices/platform/s3c2440-i2c.1/i2c-1/1-0068/iio:device*    dmp_output_rate                  0660    system    system
 
 /sys/devices/platform/s3c2440-i2c.1/i2c-1/1-0068/iio:device*    scan_elements/in_accel_x_en      0660    system    system
 /sys/devices/platform/s3c2440-i2c.1/i2c-1/1-0068/iio:device*    scan_elements/in_accel_y_en      0660    system    system
@@ -47,13 +53,13 @@
 /sys/devices/platform/s3c2440-i2c.1/i2c-1/1-0068/iio:device*    scan_elements/in_timestamp_en    0660    system    system
 
 # led
-/sys/devices/platform/s3c2440-i2c.1/i2c-1/1-0042/leds/as3668	color       0660   system   system
-/sys/devices/platform/s3c2440-i2c.1/i2c-1/1-0042/leds/as3668	brightness  0660   system   system
-/sys/devices/platform/s3c2440-i2c.1/i2c-1/1-0042/leds/as3668	delay_on    0660   system   system
-/sys/devices/platform/s3c2440-i2c.1/i2c-1/1-0042/leds/as3668	delay_off   0660   system   system
-/sys/devices/platform/s3c2440-i2c.1/i2c-1/1-0042/leds/as3668	trigger     0660   system   system
-/sys/devices/platform/s3c2440-i2c.1/i2c-1/1-0042/leds/as3668	slope_up    0660   system   system
-/sys/devices/platform/s3c2440-i2c.1/i2c-1/1-0042/leds/as3668	slope_down  0660   system   system
+/sys/devices/platform/s3c2440-i2c.1/i2c-1/1-0042/leds/as3668    color       0660   system   system
+/sys/devices/platform/s3c2440-i2c.1/i2c-1/1-0042/leds/as3668    brightness  0660   system   system
+/sys/devices/platform/s3c2440-i2c.1/i2c-1/1-0042/leds/as3668    delay_on    0660   system   system
+/sys/devices/platform/s3c2440-i2c.1/i2c-1/1-0042/leds/as3668    delay_off   0660   system   system
+/sys/devices/platform/s3c2440-i2c.1/i2c-1/1-0042/leds/as3668    trigger     0660   system   system
+/sys/devices/platform/s3c2440-i2c.1/i2c-1/1-0042/leds/as3668    slope_up    0660   system   system
+/sys/devices/platform/s3c2440-i2c.1/i2c-1/1-0042/leds/as3668    slope_down  0660   system   system
 
 # gscalers
 /dev/video23              0660   media      graphics
@@ -100,3 +106,6 @@
 
 # secure mem driver
 /dev/s5p-smem             0660   drm        drmrpc
+
+# G2D
+/dev/fimg2d               0660   media      media
diff --git a/voicefx/eS305VoiceProcessing.cpp b/voicefx/eS305VoiceProcessing.cpp
index a9ec133..9a90685 100644
--- a/voicefx/eS305VoiceProcessing.cpp
+++ b/voicefx/eS305VoiceProcessing.cpp
@@ -948,35 +948,6 @@
 //------------------------------------------------------------------------------
 // Effect Library Interface Implementation
 //------------------------------------------------------------------------------
-int adnc_query_number_effects(uint32_t *pNumEffects)
-{
-    if (pNumEffects == NULL) {
-        return -EINVAL;
-    }
-    *pNumEffects = PFX_ID_CNT;
-    return sAdncBundleInitStatus;
-}
-
-int adnc_query_effect(uint32_t index, effect_descriptor_t *pDescriptor)
-{
-    int status = 0;
-
-    pthread_mutex_lock(&sAdncBundleLock);
-
-    if (AdncBundle_Init_l() != 0) {
-        status = sAdncBundleInitStatus;
-        goto exit;
-    }
-    if (index >= PFX_ID_CNT) {
-        status = -EINVAL;
-        goto exit;
-    }
-    memcpy(pDescriptor, adnc_pfx_descriptors[index], sizeof(effect_descriptor_t));
-
-exit:
-    pthread_mutex_unlock(&sAdncBundleLock);
-    return status;
-}
 
 int adnc_create(const effect_uuid_t *uuid,
             int32_t         sessionId,
@@ -1091,8 +1062,6 @@
     version : EFFECT_LIBRARY_API_VERSION,
     name : "Audience Voice Preprocessing Library",
     implementor : "The Android Open Source Project",
-    query_num_effects : adnc_query_number_effects,
-    query_effect : adnc_query_effect,
     create_effect : adnc_create,
     release_effect : adnc_release,
     get_descriptor : adnc_get_descriptor