Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4c0dff20 authored by Banajit Goswami's avatar Banajit Goswami
Browse files

hal: add support for msmcobalt

Add initial audio support for MSMCOBALT target

Change-Id: I06cd6a558d8622c7b8ff82b5531478adea96e631
parent 8b11ffef
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
ifneq ($(filter mpq8092 msm8960 msm8226 msm8x26 msm8610 msm8974 msm8x74 apq8084 msm8916 msm8994 msm8992 msm8909 msm8996 msm8952 msm8937 thorium msm8953 msmgold,$(TARGET_BOARD_PLATFORM)),)
ifneq ($(filter mpq8092 msm8960 msm8226 msm8x26 msm8610 msm8974 msm8x74 apq8084 msm8916 msm8994 msm8992 msm8909 msm8996 msm8952 msm8937 thorium msm8953 msmgold msmcobalt,$(TARGET_BOARD_PLATFORM)),)

MY_LOCAL_PATH := $(call my-dir)

+26 −0
Original line number Diff line number Diff line
@@ -32,6 +32,32 @@
    <bit_width_configs>
        <device name="SND_DEVICE_OUT_SPEAKER" bit_width="24"/>
    </bit_width_configs>
    <pcm_ids>
        <usecase name="USECASE_AUDIO_PLAYBACK_OFFLOAD" type="out" id="8"/>
        <usecase name="USECASE_AUDIO_PLAYBACK_OFFLOAD2" type="out" id="15"/>
        <usecase name="USECASE_AUDIO_PLAYBACK_OFFLOAD3" type="out" id="16"/>
        <usecase name="USECASE_AUDIO_PLAYBACK_OFFLOAD4" type="out" id="28"/>
        <usecase name="USECASE_AUDIO_PLAYBACK_OFFLOAD5" type="out" id="29"/>
        <usecase name="USECASE_AUDIO_PLAYBACK_OFFLOAD6" type="out" id="30"/>
        <usecase name="USECASE_AUDIO_PLAYBACK_OFFLOAD7" type="out" id="31"/>
        <usecase name="USECASE_AUDIO_PLAYBACK_OFFLOAD8" type="out" id="32"/>
        <usecase name="USECASE_AUDIO_PLAYBACK_OFFLOAD9" type="out" id="33"/>
        <usecase name="USECASE_VOICEMMODE1_CALL" type="in" id="2"/>
        <usecase name="USECASE_VOICEMMODE1_CALL" type="out" id="2"/>
        <usecase name="USECASE_VOICEMMODE2_CALL" type="in" id="19"/>
        <usecase name="USECASE_VOICEMMODE2_CALL" type="out" id="19"/>
        <usecase name="USECASE_VOICE_CALL" type="in" id="42"/>
        <usecase name="USECASE_VOICE_CALL" type="out" id="42"/>
        <usecase name="USECASE_VOICE2_CALL" type="in" id="43"/>
        <usecase name="USECASE_VOICE2_CALL" type="out" id="43"/>
        <usecase name="USECASE_VOLTE_CALL" type="in" id="-1"/>
        <usecase name="USECASE_VOLTE_CALL" type="out" id="-1"/>
        <usecase name="USECASE_QCHAT_CALL" type="in" id="-1"/>
        <usecase name="USECASE_QCHAT_CALL" type="out" id="-1"/>
        <usecase name="USECASE_VOWLAN_CALL" type="in" id="-1"/>
        <usecase name="USECASE_VOWLAN_CALL" type="out" id="-1"/>
        <usecase name="USECASE_AUDIO_SPKR_CALIB_TX" type="in" id="34"/>
    </pcm_ids>
    <config_params>
        <param key="spkr_1_tz_name" value="wsatz.11"/>
        <param key="spkr_2_tz_name" value="wsatz.12"/>
+4 −1
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@ LOCAL_ARM_MODE := arm

AUDIO_PLATFORM := $(TARGET_BOARD_PLATFORM)

ifneq ($(filter msm8974 msm8226 msm8610 apq8084 msm8994 msm8992 msm8996,$(TARGET_BOARD_PLATFORM)),)
ifneq ($(filter msm8974 msm8226 msm8610 apq8084 msm8994 msm8992 msm8996 msmcobalt,$(TARGET_BOARD_PLATFORM)),)
  # B-family platform uses msm8974 code base
  AUDIO_PLATFORM = msm8974
  MULTIPLE_HW_VARIANTS_ENABLED := true
@@ -30,6 +30,9 @@ endif
ifneq ($(filter msm8996,$(TARGET_BOARD_PLATFORM)),)
  LOCAL_CFLAGS := -DPLATFORM_MSM8996
endif
ifneq ($(filter msmcobalt,$(TARGET_BOARD_PLATFORM)),)
  LOCAL_CFLAGS := -DPLATFORM_MSMCOBALT
endif
endif

ifneq ($(filter msm8916 msm8909 msm8952 msm8937 thorium msm8953 msmgold,$(TARGET_BOARD_PLATFORM)),)
+3 −1
Original line number Diff line number Diff line
/* hfp.c
Copyright (c) 2012-2015, The Linux Foundation. All rights reserved.
Copyright (c) 2012-2016, 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
@@ -49,6 +49,8 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.*/
#define HFP_RX_VOLUME     "SEC AUXPCM LOOPBACK Volume"
#elif defined PLATFORM_MSM8996
#define HFP_RX_VOLUME     "PRI AUXPCM LOOPBACK Volume"
#elif defined PLATFORM_MSMCOBALT
#define HFP_RX_VOLUME     "SLIMBUS_7 LOOPBACK Volume"
#else
#define HFP_RX_VOLUME     "Internal HFP RX Volume"
#endif
+29 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2013-2015, The Linux Foundation. All rights reserved.
 * Copyright (c) 2013-2016, 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
@@ -306,6 +306,31 @@ static void update_hardware_info_8996(struct hardware_info *hw_info, const char
    }
}

static void  update_hardware_info_msmcobalt(struct hardware_info *hw_info, const char *snd_card_name)
{
    if (!strcmp(snd_card_name, "msmcobalt-tasha-fluid-snd-card")) {
        strlcpy(hw_info->type, " fluid", sizeof(hw_info->type));
        strlcpy(hw_info->name, "msmcobalt", sizeof(hw_info->name));
        hw_info->snd_devices = (snd_device_t *)tasha_fluid_variant_devices;
        hw_info->num_snd_devices = ARRAY_SIZE(tasha_fluid_variant_devices);
        strlcpy(hw_info->dev_extn, "-fluid", sizeof(hw_info->dev_extn));
    } else if (!strcmp(snd_card_name, "msmcobalt-tasha-liquid-snd-card")) {
        strlcpy(hw_info->type, " liquid", sizeof(hw_info->type));
        strlcpy(hw_info->name, "msmcobalt", sizeof(hw_info->name));
        hw_info->snd_devices = (snd_device_t *)tasha_liquid_variant_devices;
        hw_info->num_snd_devices = ARRAY_SIZE(tasha_liquid_variant_devices);
        strlcpy(hw_info->dev_extn, "-liquid", sizeof(hw_info->dev_extn));
    } else if (!strcmp(snd_card_name, "msmcobalt-tasha-db-snd-card")) {
        strlcpy(hw_info->type, " dragon-board", sizeof(hw_info->type));
        strlcpy(hw_info->name, "msmcobalt", sizeof(hw_info->name));
        hw_info->snd_devices = (snd_device_t *)tasha_DB_variant_devices;
        hw_info->num_snd_devices = ARRAY_SIZE(tasha_DB_variant_devices);
        strlcpy(hw_info->dev_extn, "-db", sizeof(hw_info->dev_extn));
    } else {
        ALOGW("%s: Not a msmcobalt 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")) {
@@ -434,6 +459,9 @@ void *hw_info_init(const char *snd_card_name)
    } else if(strstr(snd_card_name, "msm8996")) {
        ALOGV("8996 - variant soundcard");
        update_hardware_info_8996(hw_info, snd_card_name);
    } else if(strstr(snd_card_name, "msmcobalt")) {
        ALOGV("MSMCOBALT - variant soundcard");
        update_hardware_info_msmcobalt(hw_info, snd_card_name);
    } else {
        ALOGE("%s: Unsupported target %s:",__func__, snd_card_name);
        free(hw_info);
Loading