Merge "hal: Prevent de-routing in case the usecase doesn't share codec backend"
diff --git a/Android.mk b/Android.mk
index 6d0ec5f..6e129a1 100644
--- a/Android.mk
+++ b/Android.mk
@@ -1,4 +1,4 @@
-ifneq ($(filter mpq8092 msm8960 msm8226 msm8x26 msm8610 msm8974 msm8x74 apq8084 msm8916 msm8994 msm8992 msm8909 msm8996,$(TARGET_BOARD_PLATFORM)),)
+ifneq ($(filter mpq8092 msm8960 msm8226 msm8x26 msm8610 msm8974 msm8x74 apq8084 msm8916 msm8994 msm8992 msm8909 msm8996 msm8952,$(TARGET_BOARD_PLATFORM)),)
MY_LOCAL_PATH := $(call my-dir)
diff --git a/hal/Android.mk b/hal/Android.mk
index c0cff58..9fa30c6 100644
--- a/hal/Android.mk
+++ b/hal/Android.mk
@@ -32,7 +32,7 @@
endif
endif
-ifneq ($(filter msm8916 msm8909,$(TARGET_BOARD_PLATFORM)),)
+ifneq ($(filter msm8916 msm8909 msm8952,$(TARGET_BOARD_PLATFORM)),)
AUDIO_PLATFORM = msm8916
MULTIPLE_HW_VARIANTS_ENABLED := true
LOCAL_CFLAGS := -DPLATFORM_MSM8916
diff --git a/hal/audio_extn/audio_extn.c b/hal/audio_extn/audio_extn.c
index ff485e5..de51542 100644
--- a/hal/audio_extn/audio_extn.c
+++ b/hal/audio_extn/audio_extn.c
@@ -332,7 +332,7 @@
int channel_count)
{
struct mixer_ctl *ctl;
- const char *mixer_ctl_name = "Playback Channel Map";
+ const char *mixer_ctl_name = "Playback Device Channel Map";
int set_values[8] = {0};
int ret;
ALOGV("%s channel_count:%d",__func__, channel_count);
diff --git a/hal/msm8916/hw_info.c b/hal/msm8916/hw_info.c
index 689e834..5fb5606 100644
--- a/hal/msm8916/hw_info.c
+++ b/hal/msm8916/hw_info.c
@@ -216,8 +216,26 @@
hw_info->snd_devices = NULL;
hw_info->num_snd_devices = 0;
strlcpy(hw_info->dev_extn, "", sizeof(hw_info->dev_extn));
+ } else if (!strcmp(snd_card_name, "msm8952-snd-card")) {
+ strlcpy(hw_info->type, "", sizeof(hw_info->type));
+ strlcpy(hw_info->name, "msm8952", sizeof(hw_info->name));
+ hw_info->snd_devices = NULL;
+ hw_info->num_snd_devices = 0;
+ strlcpy(hw_info->dev_extn, "", sizeof(hw_info->dev_extn));
+ } else if (!strcmp(snd_card_name, "msm8952-snd-card-mtp")) {
+ strlcpy(hw_info->type, "", sizeof(hw_info->type));
+ strlcpy(hw_info->name, "msm8952", sizeof(hw_info->name));
+ hw_info->snd_devices = NULL;
+ hw_info->num_snd_devices = 0;
+ strlcpy(hw_info->dev_extn, "", sizeof(hw_info->dev_extn));
+ } else if (!strcmp(snd_card_name, "msm8952-tomtom-snd-card")) {
+ strlcpy(hw_info->type, "", sizeof(hw_info->type));
+ strlcpy(hw_info->name, "msm8952", sizeof(hw_info->name));
+ hw_info->snd_devices = NULL;
+ hw_info->num_snd_devices = 0;
+ strlcpy(hw_info->dev_extn, "", sizeof(hw_info->dev_extn));
} else {
- ALOGW("%s: Not an 8x16/8939/8909 device", __func__);
+ ALOGW("%s: Not an 8x16/8939/8909/8952 device", __func__);
}
}
@@ -232,7 +250,7 @@
}
if (strstr(snd_card_name, "msm8x16") || strstr(snd_card_name, "msm8939") ||
- strstr(snd_card_name, "msm8909")) {
+ strstr(snd_card_name, "msm8909") || strstr(snd_card_name, "msm8952")) {
ALOGV("8x16 - variant soundcard");
update_hardware_info_8x16(hw_info, snd_card_name);
} else {
diff --git a/hal/msm8916/platform.c b/hal/msm8916/platform.c
index deec058..c0c92a6 100644
--- a/hal/msm8916/platform.c
+++ b/hal/msm8916/platform.c
@@ -789,6 +789,21 @@
msm_device_to_be_id = msm_device_to_be_id_internal_codec;
msm_be_id_array_len =
sizeof(msm_device_to_be_id_external_codec) / sizeof(msm_device_to_be_id_internal_codec[0]);
+ } else if (!strncmp(snd_card_name, "msm8952-snd-card-mtp",
+ sizeof("msm8952-snd-card-mtpmsm8952-snd-card-mtp"))) {
+ strlcpy(mixer_xml_path, MIXER_XML_PATH_MTP,
+ sizeof(MIXER_XML_PATH_MTP));
+ msm_device_to_be_id = msm_device_to_be_id_internal_codec;
+ msm_be_id_array_len =
+ sizeof(msm_device_to_be_id_internal_codec) / sizeof(msm_device_to_be_id_internal_codec[0]);
+ } else if (!strncmp(snd_card_name, "msm8952-tomtom-snd-card",
+ sizeof("msm8952-tomtom-snd-card"))) {
+ strlcpy(mixer_xml_path, MIXER_XML_PATH_WCD9330,
+ sizeof(MIXER_XML_PATH_WCD9330));
+ msm_device_to_be_id = msm_device_to_be_id_external_codec;
+ msm_be_id_array_len =
+ sizeof(msm_device_to_be_id_external_codec) / sizeof(msm_device_to_be_id_external_codec[0]);
+
} else {
strlcpy(mixer_xml_path, MIXER_XML_PATH,
sizeof(MIXER_XML_PATH));
diff --git a/hal/msm8916/platform.h b/hal/msm8916/platform.h
index dfb976d..5f34342 100644
--- a/hal/msm8916/platform.h
+++ b/hal/msm8916/platform.h
@@ -219,17 +219,6 @@
#define PLAYBACK_OFFLOAD_DEVICE 9
#ifdef MULTIPLE_OFFLOAD_ENABLED
-#ifdef PLATFORM_APQ8084
-#define PLAYBACK_OFFLOAD_DEVICE2 17
-#define PLAYBACK_OFFLOAD_DEVICE3 18
-#define PLAYBACK_OFFLOAD_DEVICE4 34
-#define PLAYBACK_OFFLOAD_DEVICE5 35
-#define PLAYBACK_OFFLOAD_DEVICE6 36
-#define PLAYBACK_OFFLOAD_DEVICE7 37
-#define PLAYBACK_OFFLOAD_DEVICE8 38
-#define PLAYBACK_OFFLOAD_DEVICE9 39
-#endif
-#if defined (PLATFORM_MSM8994)
#define PLAYBACK_OFFLOAD_DEVICE2 17
#define PLAYBACK_OFFLOAD_DEVICE3 18
#define PLAYBACK_OFFLOAD_DEVICE4 37
@@ -239,7 +228,6 @@
#define PLAYBACK_OFFLOAD_DEVICE8 41
#define PLAYBACK_OFFLOAD_DEVICE9 42
#endif
-#endif
#define COMPRESS_VOIP_CALL_PCM_DEVICE 3
diff --git a/hal/msm8974/platform.c b/hal/msm8974/platform.c
index d6261c1..d9d9d8e 100644
--- a/hal/msm8974/platform.c
+++ b/hal/msm8974/platform.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
* Not a Contribution.
*
* Copyright (C) 2013 The Android Open Source Project
@@ -3366,10 +3366,15 @@
ALOGE("%s: Invalid channel mapping used", __func__);
return -EINVAL;
}
- strlcpy(mixer_ctl_name, "Playback Channel Map", sizeof(mixer_ctl_name));
+
+ /*
+ * If snd_id is greater than 0, stream channel mapping
+ * If snd_id is below 0, typically -1, device channel mapping
+ */
if (snd_id >= 0) {
- snprintf(device_num, sizeof(device_num), "%d", snd_id);
- strncat(mixer_ctl_name, device_num, 13);
+ snprintf(mixer_ctl_name, sizeof(mixer_ctl_name), "Playback Channel Map%d", snd_id);
+ } else {
+ strlcpy(mixer_ctl_name, "Playback Device Channel Map", sizeof(mixer_ctl_name));
}
ALOGD("%s mixer_ctl_name:%s", __func__, mixer_ctl_name);