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

Commit 3075fcc2 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Audio: Bear(8916) Audio HAL bringup changes"

parents 8735d8d1 db72d1eb
Loading
Loading
Loading
Loading
+6 −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 msm8916,$(TARGET_BOARD_PLATFORM)),)
ifneq ($(filter msm8974 msm8226 msm8610 apq8084,$(TARGET_BOARD_PLATFORM)),)
  # B-family platform uses msm8974 code base
  AUDIO_PLATFORM = msm8974
  MULTIPLE_HW_VARIANTS_ENABLED := true
@@ -23,6 +23,11 @@ ifneq ($(filter apq8084,$(TARGET_BOARD_PLATFORM)),)
endif
endif

ifneq ($(filter msm8916,$(TARGET_BOARD_PLATFORM)),)
  AUDIO_PLATFORM = msm8916
  MULTIPLE_HW_VARIANTS_ENABLED := true
  LOCAL_CFLAGS := -DPLATFORM_MSM8916
endif

LOCAL_SRC_FILES := \
	audio_hw.c \
+35 −127
Original line number Diff line number Diff line
@@ -51,11 +51,6 @@ struct hardware_info {

#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))

#define LITERAL_TO_STRING(x) #x
#define CHECK(condition) LOG_ALWAYS_FATAL_IF(!(condition), "%s",\
            __FILE__ ":" LITERAL_TO_STRING(__LINE__)\
            " ASSERT_FATAL(" #condition ") failed.")

static const snd_device_t taiko_fluid_variant_devices[] = {
    SND_DEVICE_OUT_SPEAKER,
    SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES,
@@ -66,6 +61,11 @@ static const snd_device_t taiko_CDP_variant_devices[] = {
    SND_DEVICE_OUT_SPEAKER,
    SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES,
    SND_DEVICE_OUT_SPEAKER_AND_ANC_HEADSET,
    SND_DEVICE_IN_QUAD_MIC,
};

static const snd_device_t taiko_apq8084_CDP_variant_devices[] = {
    SND_DEVICE_IN_HANDSET_MIC,
};

static const snd_device_t taiko_liquid_variant_devices[] = {
@@ -74,6 +74,13 @@ static const snd_device_t taiko_liquid_variant_devices[] = {
    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 taiko_DB_variant_devices[] = {
@@ -81,28 +88,33 @@ static const snd_device_t taiko_DB_variant_devices[] = {
    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_QUAD_MIC,
};

static const snd_device_t tapan_lite_variant_devices[] = {
    SND_DEVICE_OUT_SPEAKER,
    SND_DEVICE_OUT_HEADPHONES,
    SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES,
    SND_DEVICE_OUT_SPEAKER_AND_ANC_HEADSET,
    SND_DEVICE_OUT_VOICE_HEADPHONES,
    SND_DEVICE_OUT_VOICE_TTY_FULL_HEADPHONES,
    SND_DEVICE_OUT_VOICE_TTY_VCO_HEADPHONES,
};

static const snd_device_t tapan_skuf_variant_devices[] = {
    SND_DEVICE_OUT_SPEAKER,
    SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES,
    SND_DEVICE_OUT_SPEAKER_AND_ANC_HEADSET,
    /*SND_DEVICE_OUT_SPEAKER_AND_ANC_FB_HEADSET,*/
};

static const snd_device_t tapan_lite_skuf_variant_devices[] = {
    SND_DEVICE_OUT_SPEAKER,
    SND_DEVICE_OUT_ANC_HANDSET,
    SND_DEVICE_OUT_ANC_HEADSET,
    SND_DEVICE_OUT_ANC_FB_HEADSET,
    SND_DEVICE_OUT_HEADPHONES,
    SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES,
    SND_DEVICE_OUT_SPEAKER_AND_ANC_HEADSET,
    SND_DEVICE_IN_AANC_HANDSET_MIC,
    SND_DEVICE_OUT_VOICE_HEADPHONES,
    SND_DEVICE_OUT_VOICE_TTY_FULL_HEADPHONES,
    SND_DEVICE_OUT_VOICE_TTY_VCO_HEADPHONES,
};

static const snd_device_t helicon_skuab_variant_devices[] = {
@@ -111,121 +123,28 @@ static const snd_device_t helicon_skuab_variant_devices[] = {
    SND_DEVICE_OUT_SPEAKER_AND_ANC_HEADSET,
};

static void  update_hardware_info_8084(struct hardware_info *hw_info, const char *snd_card_name)
static void update_hardware_info_8x16(struct hardware_info *hw_info, const char *snd_card_name)
{
    if (!strcmp(snd_card_name, "apq8084-taiko-mtp-snd-card")) {
        strlcpy(hw_info->type, "mtp", sizeof(hw_info->type));
        strlcpy(hw_info->name, "apq8084", 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, "apq8084-taiko-cdp-snd-card")) {
        strlcpy(hw_info->type, " cdp", sizeof(hw_info->type));
        strlcpy(hw_info->name, "apq8084", sizeof(hw_info->name));
        hw_info->snd_devices = (snd_device_t *)taiko_CDP_variant_devices;
        hw_info->num_snd_devices = ARRAY_SIZE(taiko_CDP_variant_devices);
        strlcpy(hw_info->dev_extn, "", sizeof(hw_info->dev_extn));
    } else if (!strcmp(snd_card_name, "apq8084-taiko-liquid-snd-card")) {
        strlcpy(hw_info->type , " liquid", sizeof(hw_info->type));
        strlcpy(hw_info->name, "apq8084", sizeof(hw_info->type));
        hw_info->snd_devices = (snd_device_t *)taiko_liquid_variant_devices;
        hw_info->num_snd_devices = ARRAY_SIZE(taiko_liquid_variant_devices);
        strlcpy(hw_info->dev_extn, "", sizeof(hw_info->dev_extn));
    } else {
        ALOGW("%s: Not an 8084 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")) {
        strlcpy(hw_info->type, " mtp", sizeof(hw_info->type));
        strlcpy(hw_info->name, "msm8974", 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, "msm8974-taiko-cdp-snd-card")) {
        strlcpy(hw_info->type, " cdp", sizeof(hw_info->type));
        strlcpy(hw_info->name, "msm8974", sizeof(hw_info->name));
        hw_info->snd_devices = (snd_device_t *)taiko_CDP_variant_devices;
        hw_info->num_snd_devices = ARRAY_SIZE(taiko_CDP_variant_devices);
        strlcpy(hw_info->dev_extn, "-fluid", sizeof(hw_info->dev_extn));
    } else if (!strcmp(snd_card_name, "msm8974-taiko-fluid-snd-card")) {
        strlcpy(hw_info->type, " fluid", sizeof(hw_info->type));
        strlcpy(hw_info->name, "msm8974", sizeof(hw_info->name));
        hw_info->snd_devices = (snd_device_t *) taiko_fluid_variant_devices;
        hw_info->num_snd_devices = ARRAY_SIZE(taiko_fluid_variant_devices);
        strlcpy(hw_info->dev_extn, "-fluid", sizeof(hw_info->dev_extn));
    } else if (!strcmp(snd_card_name, "msm8974-taiko-liquid-snd-card")) {
        strlcpy(hw_info->type, " liquid", sizeof(hw_info->type));
        strlcpy(hw_info->name, "msm8974", sizeof(hw_info->name));
        hw_info->snd_devices = (snd_device_t *)taiko_liquid_variant_devices;
        hw_info->num_snd_devices = ARRAY_SIZE(taiko_liquid_variant_devices);
        strlcpy(hw_info->dev_extn, "-liquid", sizeof(hw_info->dev_extn));
    } else if (!strcmp(snd_card_name, "apq8074-taiko-db-snd-card")) {
        strlcpy(hw_info->type, " dragon-board", sizeof(hw_info->type));
        strlcpy(hw_info->name, "msm8974", sizeof(hw_info->name));
        hw_info->snd_devices = (snd_device_t *)taiko_DB_variant_devices;
        hw_info->num_snd_devices = ARRAY_SIZE(taiko_DB_variant_devices);
        strlcpy(hw_info->dev_extn, "-DB", sizeof(hw_info->dev_extn));
    } else {
        ALOGW("%s: Not an 8974 device", __func__);
    }
}

static void update_hardware_info_8610(struct hardware_info *hw_info, const char *snd_card_name)
{
    if (!strcmp(snd_card_name, "msm8x10-snd-card")) {
    if (!strcmp(snd_card_name, "msm8x16-snd-card")) {
        strlcpy(hw_info->type, "", sizeof(hw_info->type));
        strlcpy(hw_info->name, "msm8x10", sizeof(hw_info->name));
        strlcpy(hw_info->name, "msm8x16", 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, "msm8x10-skuab-snd-card")) {
    } else if (!strcmp(snd_card_name, "msm8x16-skuab-snd-card")) {
        strlcpy(hw_info->type, "skuab", sizeof(hw_info->type));
        strlcpy(hw_info->name, "msm8x10", sizeof(hw_info->name));
        strlcpy(hw_info->name, "msm8x16", sizeof(hw_info->name));
        hw_info->snd_devices = (snd_device_t *)helicon_skuab_variant_devices;
        hw_info->num_snd_devices = ARRAY_SIZE(helicon_skuab_variant_devices);
        strlcpy(hw_info->dev_extn, "-skuab", sizeof(hw_info->dev_extn));
    } else if (!strcmp(snd_card_name, "msm8x10-skuaa-snd-card")) {
    } else if (!strcmp(snd_card_name, "msm8x16-skuaa-snd-card")) {
        strlcpy(hw_info->type, " skuaa", sizeof(hw_info->type));
        strlcpy(hw_info->name, "msm8x10", 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  8x10 device", __func__);
    }
}

static void update_hardware_info_8226(struct hardware_info *hw_info, const char *snd_card_name)
{
    if (!strcmp(snd_card_name, "msm8226-tapan-snd-card")) {
        strlcpy(hw_info->type, "", sizeof(hw_info->type));
        strlcpy(hw_info->name, "msm8226", sizeof(hw_info->name));
        strlcpy(hw_info->name, "msm8x16", 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, "msm8226-tapan9302-snd-card")) {
        strlcpy(hw_info->type, "tapan_lite", sizeof(hw_info->type));
        strlcpy(hw_info->name, "msm8226", sizeof(hw_info->name));
        hw_info->snd_devices = (snd_device_t *)tapan_lite_variant_devices;
        hw_info->num_snd_devices = ARRAY_SIZE(tapan_lite_variant_devices);
        strlcpy(hw_info->dev_extn, "-lite", sizeof(hw_info->dev_extn));
    } else if (!strcmp(snd_card_name, "msm8226-tapan-skuf-snd-card")) {
        strlcpy(hw_info->type, " skuf", sizeof(hw_info->type));
        strlcpy(hw_info->name, "msm8226", sizeof(hw_info->name));
        hw_info->snd_devices = (snd_device_t *) tapan_skuf_variant_devices;
        hw_info->num_snd_devices = ARRAY_SIZE(tapan_skuf_variant_devices);
        strlcpy(hw_info->dev_extn, "-skuf", sizeof(hw_info->dev_extn));
    } else if (!strcmp(snd_card_name, "msm8226-tapan9302-skuf-snd-card")) {
        strlcpy(hw_info->type, " tapan9302-skuf", sizeof(hw_info->type));
        strlcpy(hw_info->name, "msm8226", sizeof(hw_info->name));
        hw_info->snd_devices = (snd_device_t *)tapan_lite_skuf_variant_devices;
        hw_info->num_snd_devices = ARRAY_SIZE(tapan_lite_skuf_variant_devices);
        strlcpy(hw_info->dev_extn, "-skuf-lite", sizeof(hw_info->dev_extn));
    } else {
        ALOGW("%s: Not an  8x26 device", __func__);
        ALOGW("%s: Not an  8x16 device", __func__);
    }
}

@@ -235,22 +154,11 @@ void *hw_info_init(const char *snd_card_name)

    hw_info = malloc(sizeof(struct hardware_info));

    if(strstr(snd_card_name, "msm8974") ||
              strstr(snd_card_name, "apq8074")) {
        ALOGV("8974 - variant soundcard");
        update_hardware_info_8974(hw_info, snd_card_name);
    } else if(strstr(snd_card_name, "msm8226")) {
        ALOGV("8x26 - variant soundcard");
        update_hardware_info_8226(hw_info, snd_card_name);
    } else if(strstr(snd_card_name, "msm8x10")) {
        ALOGV("8x10 - variant soundcard");
        update_hardware_info_8610(hw_info, snd_card_name);
    } else if(strstr(snd_card_name, "apq8084")) {
        ALOGV("8084 - variant soundcard");
        update_hardware_info_8084(hw_info, snd_card_name);
    if(strstr(snd_card_name, "msm8x16")) {
        ALOGV("8x16 - variant soundcard");
        update_hardware_info_8x16(hw_info, snd_card_name);
    } else {
        ALOGE("%s: Unupported target %s:",__func__, snd_card_name);
        CHECK(0);
        ALOGE("%s: Unsupported target %s:",__func__, snd_card_name);
        free(hw_info);
        hw_info = NULL;
    }
+1266 −215

File changed.

Preview size limit exceeded, changes collapsed.

+129 −21
Original line number Diff line number Diff line
/*
 * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved.
 * Not a Contribution.
 *
 * Copyright (C) 2013 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
@@ -17,6 +20,12 @@
#ifndef QCOM_AUDIO_PLATFORM_H
#define QCOM_AUDIO_PLATFORM_H

enum {
    FLUENCE_NONE,
    FLUENCE_DUAL_MIC = 0x1,
    FLUENCE_QUAD_MIC = 0x2,
};

/*
 * Below are the devices for which is back end is same, SLIMBUS_0_RX.
 * All these devices are handled by the internal HW codec. We can
@@ -47,10 +56,21 @@ enum {
    SND_DEVICE_OUT_HDMI,
    SND_DEVICE_OUT_SPEAKER_AND_HDMI,
    SND_DEVICE_OUT_BT_SCO,
    SND_DEVICE_OUT_VOICE_HANDSET_TMUS,
    SND_DEVICE_OUT_BT_SCO_WB,
    SND_DEVICE_OUT_VOICE_TTY_FULL_HEADPHONES,
    SND_DEVICE_OUT_VOICE_TTY_VCO_HEADPHONES,
    SND_DEVICE_OUT_VOICE_TTY_HCO_HANDSET,
    SND_DEVICE_OUT_AFE_PROXY,
    SND_DEVICE_OUT_USB_HEADSET,
    SND_DEVICE_OUT_SPEAKER_AND_USB_HEADSET,
    SND_DEVICE_OUT_TRANSMISSION_FM,
    SND_DEVICE_OUT_ANC_HEADSET,
    SND_DEVICE_OUT_ANC_FB_HEADSET,
    SND_DEVICE_OUT_VOICE_ANC_HEADSET,
    SND_DEVICE_OUT_VOICE_ANC_FB_HEADSET,
    SND_DEVICE_OUT_SPEAKER_AND_ANC_HEADSET,
    SND_DEVICE_OUT_ANC_HANDSET,
    SND_DEVICE_OUT_SPEAKER_PROTECTED,
    SND_DEVICE_OUT_END,

    /*
@@ -60,40 +80,64 @@ enum {
    /* Capture devices */
    SND_DEVICE_IN_BEGIN = SND_DEVICE_OUT_END,
    SND_DEVICE_IN_HANDSET_MIC  = SND_DEVICE_IN_BEGIN,
    SND_DEVICE_IN_SPEAKER_MIC,
    SND_DEVICE_IN_HEADSET_MIC,
    SND_DEVICE_IN_HANDSET_MIC_AEC,
    SND_DEVICE_IN_HANDSET_MIC_NS,
    SND_DEVICE_IN_HANDSET_MIC_AEC_NS,
    SND_DEVICE_IN_HANDSET_DMIC,
    SND_DEVICE_IN_HANDSET_DMIC_AEC,
    SND_DEVICE_IN_HANDSET_DMIC_NS,
    SND_DEVICE_IN_HANDSET_DMIC_AEC_NS,
    SND_DEVICE_IN_SPEAKER_MIC,
    SND_DEVICE_IN_SPEAKER_MIC_AEC,
    SND_DEVICE_IN_HEADSET_MIC_AEC,
    SND_DEVICE_IN_SPEAKER_MIC_NS,
    SND_DEVICE_IN_SPEAKER_MIC_AEC_NS,
    SND_DEVICE_IN_SPEAKER_DMIC,
    SND_DEVICE_IN_SPEAKER_DMIC_AEC,
    SND_DEVICE_IN_SPEAKER_DMIC_NS,
    SND_DEVICE_IN_SPEAKER_DMIC_AEC_NS,
    SND_DEVICE_IN_HEADSET_MIC,
    SND_DEVICE_IN_HEADSET_MIC_FLUENCE,
    SND_DEVICE_IN_VOICE_SPEAKER_MIC,
    SND_DEVICE_IN_VOICE_HEADSET_MIC,
    SND_DEVICE_IN_HDMI_MIC,
    SND_DEVICE_IN_BT_SCO_MIC,
    SND_DEVICE_IN_BT_SCO_MIC_WB,
    SND_DEVICE_IN_CAMCORDER_MIC,
    SND_DEVICE_IN_VOICE_DMIC_EF,
    SND_DEVICE_IN_VOICE_DMIC_BS,
    SND_DEVICE_IN_VOICE_DMIC_EF_TMUS,
    SND_DEVICE_IN_VOICE_SPEAKER_DMIC_EF,
    SND_DEVICE_IN_VOICE_SPEAKER_DMIC_BS,
    SND_DEVICE_IN_VOICE_DMIC,
    SND_DEVICE_IN_VOICE_SPEAKER_DMIC,
    SND_DEVICE_IN_VOICE_SPEAKER_QMIC,
    SND_DEVICE_IN_VOICE_TTY_FULL_HEADSET_MIC,
    SND_DEVICE_IN_VOICE_TTY_VCO_HANDSET_MIC,
    SND_DEVICE_IN_VOICE_TTY_HCO_HEADSET_MIC,
    SND_DEVICE_IN_VOICE_REC_MIC,
    SND_DEVICE_IN_VOICE_REC_DMIC_EF,
    SND_DEVICE_IN_VOICE_REC_DMIC_BS,
    SND_DEVICE_IN_VOICE_REC_DMIC_EF_FLUENCE,
    SND_DEVICE_IN_VOICE_REC_DMIC_BS_FLUENCE,
    SND_DEVICE_IN_VOICE_REC_MIC_NS,
    SND_DEVICE_IN_VOICE_REC_DMIC_STEREO,
    SND_DEVICE_IN_VOICE_REC_DMIC_FLUENCE,
    SND_DEVICE_IN_USB_HEADSET_MIC,
    SND_DEVICE_IN_CAPTURE_FM,
    SND_DEVICE_IN_AANC_HANDSET_MIC,
    SND_DEVICE_IN_QUAD_MIC,
    SND_DEVICE_IN_HANDSET_STEREO_DMIC,
    SND_DEVICE_IN_SPEAKER_STEREO_DMIC,
    SND_DEVICE_IN_CAPTURE_VI_FEEDBACK,
    SND_DEVICE_IN_END,

    SND_DEVICE_MAX = SND_DEVICE_IN_END,

};

#define MIXER_CARD 0
#define SOUND_CARD 0

#define DEFAULT_OUTPUT_SAMPLING_RATE 48000

#define ALL_SESSION_VSID                0xFFFFFFFF
#define DEFAULT_MUTE_RAMP_DURATION      500
#define DEFAULT_VOLUME_RAMP_DURATION_MS 20
#define MIXER_PATH_MAX_LENGTH 100

#define MAX_VOL_INDEX 5
#define MIN_VOL_INDEX 0
#define percent_to_index(val, min, max) \
            ((val) * ((max) - (min)) * 0.01 + (min) + .5)

/*
 * tinyAlsa library interprets period size as number of frames
 * one frame = channel_count * sizeof (pcm sample)
@@ -102,9 +146,9 @@ enum {
 * We should take care of returning proper size when AudioFlinger queries for
 * the buffer size of an input/output stream
 */
#define DEEP_BUFFER_OUTPUT_PERIOD_SIZE 1024
#define DEEP_BUFFER_OUTPUT_PERIOD_COUNT 8
#define LOW_LATENCY_OUTPUT_PERIOD_SIZE 256
#define DEEP_BUFFER_OUTPUT_PERIOD_SIZE 960
#define DEEP_BUFFER_OUTPUT_PERIOD_COUNT 4
#define LOW_LATENCY_OUTPUT_PERIOD_SIZE 240
#define LOW_LATENCY_OUTPUT_PERIOD_COUNT 2

#define HDMI_MULTI_PERIOD_SIZE  336
@@ -112,7 +156,71 @@ enum {
#define HDMI_MULTI_DEFAULT_CHANNEL_COUNT 6
#define HDMI_MULTI_PERIOD_BYTES (HDMI_MULTI_PERIOD_SIZE * HDMI_MULTI_DEFAULT_CHANNEL_COUNT * 2)

#define AUDIO_CAPTURE_PERIOD_SIZE 512
#define AUDIO_CAPTURE_PERIOD_COUNT 16
#define AUDIO_CAPTURE_PERIOD_DURATION_MSEC 20
#define AUDIO_CAPTURE_PERIOD_COUNT 2

#define DEVICE_NAME_MAX_SIZE 128
#define HW_INFO_ARRAY_MAX_SIZE 32

#define DEEP_BUFFER_PCM_DEVICE 0
#define AUDIO_RECORD_PCM_DEVICE 0
#define MULTIMEDIA2_PCM_DEVICE 1
#define FM_PLAYBACK_PCM_DEVICE 5
#define FM_CAPTURE_PCM_DEVICE  6
#define HFP_PCM_RX 5
#define HFP_SCO_RX 23
#define HFP_ASM_RX_TX 24

#define INCALL_MUSIC_UPLINK_PCM_DEVICE 1
#define INCALL_MUSIC_UPLINK2_PCM_DEVICE 16
#define SPKR_PROT_CALIB_RX_PCM_DEVICE 5
#define SPKR_PROT_CALIB_TX_PCM_DEVICE 22
#define PLAYBACK_OFFLOAD_DEVICE 9
#define COMPRESS_VOIP_CALL_PCM_DEVICE 3


#define LOWLATENCY_PCM_DEVICE 12
#define EC_REF_RX "I2S_RX"
#define COMPRESS_CAPTURE_DEVICE 19

#define VOICE_CALL_PCM_DEVICE 2
#define VOICE2_CALL_PCM_DEVICE 13
#define VOLTE_CALL_PCM_DEVICE 15
#define QCHAT_CALL_PCM_DEVICE 14

#define LIB_CSD_CLIENT "libcsd-client.so"
/* CSD-CLIENT related functions */
typedef int (*init_t)();
typedef int (*deinit_t)();
typedef int (*disable_device_t)();
typedef int (*enable_device_config_t)(int, int);
typedef int (*enable_device_t)(int, int, uint32_t);
typedef int (*volume_t)(uint32_t, int);
typedef int (*mic_mute_t)(uint32_t, int);
typedef int (*slow_talk_t)(uint32_t, uint8_t);
typedef int (*start_voice_t)(uint32_t);
typedef int (*stop_voice_t)(uint32_t);
typedef int (*start_playback_t)(uint32_t);
typedef int (*stop_playback_t)(uint32_t);
typedef int (*start_record_t)(uint32_t, int);
typedef int (*stop_record_t)(uint32_t);
/* CSD Client structure */
struct csd_data {
    void *csd_client;
    init_t init;
    deinit_t deinit;
    disable_device_t disable_device;
    enable_device_config_t enable_device_config;
    enable_device_t enable_device;
    volume_t volume;
    mic_mute_t mic_mute;
    slow_talk_t slow_talk;
    start_voice_t start_voice;
    stop_voice_t stop_voice;
    start_playback_t start_playback;
    stop_playback_t stop_playback;
    start_record_t start_record;
    stop_record_t stop_record;
};

#endif // QCOM_AUDIO_PLATFORM_H