hal: add support for msm8994
- Adding msm8994 target support in makefile
Change-Id: Id924e4a7d5df21e605429d85c7c49ede00d7f402
diff --git a/hal/msm8974/hw_info.c b/hal/msm8974/hw_info.c
index f43a3b0..85a9771 100644
--- a/hal/msm8974/hw_info.c
+++ b/hal/msm8974/hw_info.c
@@ -83,6 +83,31 @@
SND_DEVICE_IN_SPEAKER_STEREO_DMIC,
};
+static const snd_device_t tomtom_msm8994_CDP_variant_devices[] = {
+ SND_DEVICE_IN_HANDSET_MIC,
+};
+
+static const snd_device_t tomtom_liquid_variant_devices[] = {
+ SND_DEVICE_OUT_SPEAKER,
+ SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES,
+ SND_DEVICE_OUT_SPEAKER_AND_ANC_HEADSET,
+ SND_DEVICE_IN_SPEAKER_MIC,
+ SND_DEVICE_IN_HEADSET_MIC,
+ SND_DEVICE_IN_VOICE_DMIC,
+ SND_DEVICE_IN_VOICE_SPEAKER_DMIC,
+ SND_DEVICE_IN_VOICE_REC_DMIC_STEREO,
+ SND_DEVICE_IN_VOICE_REC_DMIC_FLUENCE,
+ SND_DEVICE_IN_QUAD_MIC,
+ SND_DEVICE_IN_HANDSET_STEREO_DMIC,
+ SND_DEVICE_IN_SPEAKER_STEREO_DMIC,
+};
+
+static const snd_device_t tomtom_stp_variant_devices[] = {
+ SND_DEVICE_OUT_SPEAKER,
+ SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES,
+ SND_DEVICE_OUT_SPEAKER_AND_ANC_HEADSET,
+};
+
static const snd_device_t taiko_DB_variant_devices[] = {
SND_DEVICE_OUT_SPEAKER,
SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES,
@@ -173,6 +198,37 @@
}
}
+static void update_hardware_info_8994(struct hardware_info *hw_info, const char *snd_card_name)
+{
+ if (!strcmp(snd_card_name, "msm8994-tomtom-mtp-snd-card")) {
+ strlcpy(hw_info->type, " mtp", sizeof(hw_info->type));
+ strlcpy(hw_info->name, "msm8994", 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, "msm8994-tomtom-cdp-snd-card ")) {
+ strlcpy(hw_info->type, " cdp", sizeof(hw_info->type));
+ strlcpy(hw_info->name, "msm8994", sizeof(hw_info->name));
+ hw_info->snd_devices = (snd_device_t *)tomtom_msm8994_CDP_variant_devices;
+ hw_info->num_snd_devices = ARRAY_SIZE(tomtom_msm8994_CDP_variant_devices);
+ strlcpy(hw_info->dev_extn, "-cdp", sizeof(hw_info->dev_extn));
+ } else if (!strcmp(snd_card_name, "msm8994-tomtom-stp-snd-card ")) {
+ strlcpy(hw_info->type, " stp", sizeof(hw_info->type));
+ strlcpy(hw_info->name, "msm8994", sizeof(hw_info->name));
+ hw_info->snd_devices = (snd_device_t *)tomtom_stp_variant_devices;
+ hw_info->num_snd_devices = ARRAY_SIZE(tomtom_stp_variant_devices);
+ strlcpy(hw_info->dev_extn, "-stp", sizeof(hw_info->dev_extn));
+ } else if (!strcmp(snd_card_name, "msm8994-tomtom-liquid-snd-card ")) {
+ strlcpy(hw_info->type, " liquid", sizeof(hw_info->type));
+ strlcpy(hw_info->name, "msm8994", sizeof(hw_info->name));
+ hw_info->snd_devices = (snd_device_t *)tomtom_liquid_variant_devices;
+ hw_info->num_snd_devices = ARRAY_SIZE(tomtom_liquid_variant_devices);
+ strlcpy(hw_info->dev_extn, "-liquid", sizeof(hw_info->dev_extn));
+ } else {
+ ALOGW("%s: Not an 8994 device", __func__);
+ }
+}
+
static void update_hardware_info_8974(struct hardware_info *hw_info, const char *snd_card_name)
{
if (!strcmp(snd_card_name, "msm8974-taiko-mtp-snd-card")) {
@@ -273,6 +329,9 @@
hw_info = malloc(sizeof(struct hardware_info));
hw_info->snd_devices = NULL;
hw_info->num_snd_devices = 0;
+ strlcpy(hw_info->dev_extn, "", sizeof(hw_info->dev_extn));
+ strlcpy(hw_info->type, "", sizeof(hw_info->type));
+ strlcpy(hw_info->name, "", sizeof(hw_info->name));
if(strstr(snd_card_name, "msm8974") ||
strstr(snd_card_name, "apq8074")) {
@@ -287,6 +346,9 @@
} else if(strstr(snd_card_name, "apq8084")) {
ALOGV("8084 - variant soundcard");
update_hardware_info_8084(hw_info, snd_card_name);
+ } else if(strstr(snd_card_name, "msm8994")) {
+ ALOGV("8994 - variant soundcard");
+ update_hardware_info_8994(hw_info, snd_card_name);
} else {
ALOGE("%s: Unsupported target %s:",__func__, snd_card_name);
free(hw_info);