From 90f2a4c5412d1735a53c7f5341c7386c40a32aba Mon Sep 17 00:00:00 2001 From: Meng Wang Date: Tue, 12 Apr 2016 16:20:41 +0800 Subject: hal: add support for msm8917 tmo, msm8917 sku5 and msm8940 sku6 add sound card entry for the following devices: msm8917 tmo,msm8917 sku5 and msm8940 sku6. CRs-Fixed: 1002168 Change-Id: Ifc08af12c9d86031fba11128323c9f40d1d92e5e --- hal/msm8916/hw_info.c | 27 +++++++++++++++++++++++---- hal/msm8916/platform.c | 21 +++++++++++++++++++++ 2 files changed, 44 insertions(+), 4 deletions(-) diff --git a/hal/msm8916/hw_info.c b/hal/msm8916/hw_info.c index fb8d6483..083a7a12 100644 --- a/hal/msm8916/hw_info.c +++ b/hal/msm8916/hw_info.c @@ -269,13 +269,13 @@ static void update_hardware_info_8x16(struct hardware_info *hw_info, const char strlcpy(hw_info->dev_extn, "", sizeof(hw_info->dev_extn)); } else if (!strcmp(snd_card_name, "msm8952-sku1-snd-card")) { strlcpy(hw_info->type, "", sizeof(hw_info->type)); - strlcpy(hw_info->name, "msm8952", sizeof(hw_info->name)); + strlcpy(hw_info->name, "msm8937", 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-sku2-snd-card")) { strlcpy(hw_info->type, "", sizeof(hw_info->type)); - strlcpy(hw_info->name, "msm8952", sizeof(hw_info->name)); + strlcpy(hw_info->name, "msm8937", 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)); @@ -339,8 +339,26 @@ static void update_hardware_info_8x16(struct hardware_info *hw_info, const char 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, "msm8917-sku5-snd-card")) { + strlcpy(hw_info->type, "", sizeof(hw_info->type)); + strlcpy(hw_info->name, "msm8917", 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, "msm8917-tmo-snd-card")) { + strlcpy(hw_info->type, "", sizeof(hw_info->type)); + strlcpy(hw_info->name, "msm8917", 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, "msm8940-sku6-snd-card")) { + strlcpy(hw_info->type, "", sizeof(hw_info->type)); + strlcpy(hw_info->name, "msm8940", 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/8952 device", __func__); + ALOGW("%s: Not an 8x16/8909/8917/8937/8939/8940/8952/8953 device", __func__); } hw_info->is_wsa_combo_suppported = false; @@ -359,7 +377,8 @@ void *hw_info_init(const char *snd_card_name) if (strstr(snd_card_name, "msm8x16") || strstr(snd_card_name, "msm8939") || strstr(snd_card_name, "msm8909") || strstr(snd_card_name, "msm8952") || strstr(snd_card_name, "msm8976") || strstr(snd_card_name, "msm8953") || - strstr(snd_card_name, "msm8937")) { + strstr(snd_card_name, "msm8937") || strstr(snd_card_name, "msm8917") || + strstr(snd_card_name, "msm8940") ) { 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 923135ee..63eaec62 100644 --- a/hal/msm8916/platform.c +++ b/hal/msm8916/platform.c @@ -1064,6 +1064,27 @@ static void query_platform(const char *snd_card_name, 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 if (!strncmp(snd_card_name, "msm8917-tmo-snd-card", + sizeof("msm8917-tmo-snd-card"))) { + strlcpy(mixer_xml_path, MIXER_XML_PATH_SKU2, + MAX_MIXER_XML_PATH); + 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, "msm8917-sku5-snd-card", + sizeof("msm8917-sku5-snd-card"))) { + strlcpy(mixer_xml_path, MIXER_XML_PATH_SKU2, + MAX_MIXER_XML_PATH); + 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, "msm8940-sku6-snd-card", + sizeof("msm8940-sku6-snd-card"))) { + strlcpy(mixer_xml_path, MIXER_XML_PATH_SKU1, + MAX_MIXER_XML_PATH); + 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 { strlcpy(mixer_xml_path, MIXER_XML_PATH, sizeof(MIXER_XML_PATH)); -- cgit v1.2.3