ASR_BASE
Change-Id: Icf3719cc0afe3eeb3edc7fa80a2eb5199ca9dda1
diff --git a/marvell/services/audio/libacm/acm/inc/AuC.h b/marvell/services/audio/libacm/acm/inc/AuC.h
new file mode 100644
index 0000000..a39b182
--- /dev/null
+++ b/marvell/services/audio/libacm/acm/inc/AuC.h
@@ -0,0 +1,322 @@
+/*------------------------------------------------------------
+ (C) Copyright [2006-2008] Marvell International Ltd.
+ All Rights Reserved
+ ------------------------------------------------------------*/
+
+/*--------------------------------------------------------------------------------------------------------------------
+ INTEL CONFIDENTIAL
+ Copyright 2006 Intel Corporation All Rights Reserved.
+ The source code contained or described herein and all documents related to the source code ("Material") are owned
+ by Intel Corporation or its suppliers or licensors. Title to the Material remains with Intel Corporation or
+ its suppliers and licensors. The Material contains trade secrets and proprietary and confidential information of
+ Intel or its suppliers and licensors. The Material is protected by worldwide copyright and trade secret laws and
+ treaty provisions. No part of the Material may be used, copied, reproduced, modified, published, uploaded, posted,
+ transmitted, distributed, or disclosed in any way without Intel's prior express written permission.
+
+ No license under any patent, copyright, trade secret or other intellectual property right is granted to or
+ conferred upon you by disclosure or delivery of the Materials, either expressly, by implication, inducement,
+ estoppel or otherwise. Any license under such intellectual property rights must be express and approved by
+ Intel in writing.
+ -------------------------------------------------------------------------------------------------------------------*/
+
+/**********************************************************************
+*
+* Filename: AuC.h
+*
+* Programmers: Tal Rotbart
+*
+* Description: Declarations of Common AuC services and variables
+*
+* --------------------------------------------------------------------
+* Revision History
+*
+* Date Who Version Description
+* --------------------------------------------------------------------
+*
+**********************************************************************/
+#ifndef AUC_H
+#define AUC_H
+
+#if 0
+#define MAX_VOLUME_VALUE (0x31)
+#define MUTE_ON (0x0)
+#define MUTE_OFF (0x1)
+#endif
+
+//ICAT EXPORTED ENUM
+typedef enum {
+ NON_INITIALIZED // 0
+ , VOICE_IDLE // 1
+ , WAIT_FOR_CSDI_START // 2
+ , WAIT_FOR_CSDI_START_AND_PCM_STREAM // 3
+ , WBCDMA_VOICE // 4
+ , WBCDMA_VOICE_AND_PCM_STREAM // 5
+ , VOICE_HAND_OVER // 6
+ , VOICE_HAND_OVER_AND_PCM_STREAM // 7
+ , WAIT_FOR_CSDI_STOP // 8
+ , WAIT_FOR_CSDI_STOP_AND_PCM_STREAM // 9
+ , GSM_VOICE // 10
+ , GSM_VOICE_AND_PCM_STREAM // 11
+ , PCM_STREAM_ONLY // 12
+ , VOCODER_STREAM // 13
+ , VOCODER_STREAM_AND_PCM_STREAM // 14
+
+#ifdef SS_VT
+ //New state for VT(H.223 in CP side)
+ , VT_H223_VOICE
+#endif
+} Audio_Ctrl_State;
+
+
+typedef enum {
+ TRI_STATE = 0,
+ ACTIVE
+}TriStateMode;
+
+
+// Opcodes:
+enum AudioCtrlCmd {
+ START_VOICE_PATH = 0x0040
+ , END_VOICE_PATH = 0x0041
+ , VOICE_HANDOVER = 0x0042
+ , VOICE_RX_PACKET = 0x0043
+ , AUDIOTOOL_CONTROL = 0x0044
+ , CODEC_IF_CHANGE = 0x0045
+ , VOICE_TEST_CONTROL = 0x0046
+ , PCM_STREAM_CONTROL = 0x0047
+ , VOICE_ACTIVATE_PATH = 0x0048
+ , SELF_INVOCATION = 0x0049
+ , CONFIG_CODEC_DB = 0x004c
+ , AUDIO_DEVICE_CONTROL = 0x004d
+ , AUDIO_PLL_CONTROL = 0x004E
+ , AUDIO_MISCELLANEOUS_FUNC = 0x004F
+#ifdef OPT_IPC
+ , AUDIO_IPC_CONTROL = 0x0050
+ , INIT_IPC_CONTROL = 0x0051
+#endif
+ , COMPANDER_CONTROL_CMD = 0x0052
+ , VAD_DUMP_CMD = 0x0053
+ , COMPANDER_MODE_CMD = 0x0054
+ //,POCVOICE_RX_PCM = 0x0055 // Opcode : 0x55 CP send Rx PCM to MSA
+ , KWS_CONTROL = 0x0055 //
+ , VOICE_RXB_PCM = 0x005b
+ , VOCODER_CONTROL = 0x0060
+ , VOICE_CONTROL = 0x0061
+ , VOLUME_CONTROL = 0x0062
+ , MUTE_CONTROL = 0x0063
+ , NS_CONTROL = 0x0064
+ , EC_CONTROL = 0x0065
+ , EQ_CONTROL = 0x0066
+ , AVC_CONTROL = 0x0067
+ , DTMF_CONTROL = 0x0068
+ , AUX_MODE_CONTROL = 0x0069
+ , EC_TEST_CMD = 0x006a
+ , NS_TEST_CMD = 0x006b
+ , DMA_INT_IND = 0x006b
+ , AVC_TEST_CMD = 0x006c
+ , DITHER_GEN_CONTROL = 0x006d
+ , CTM_CONTROL = 0x006e
+ , EC_FIR_UPDATE_CMD = 0x006f //obsolete
+
+ /*
+ * Jackie, 2011-0107
+ * For the MSA detection of far-end DTMF.
+ * We need to set control parameters into MSA
+ */
+ , DTMFDETECTION_CONTROL = 0x0070
+#if defined (SAMSUNG_NXP)
+ , SPEECH_PLUGIN_TX_OUTPUT_CMD = 0x0071
+ , SPEECH_PLUGIN_CONTROL = 0x0072
+ , SPEECH_PLUGIN_MODULE_CONTROL = 0x0073
+#endif
+
+ , FILTERS_CONTROL = 0x0074 // Opcode : 0x74 for HPF&LPF
+
+#if defined (MSA_MISC_PARAMETERS)
+ , AUDIO_MISC_CONTROL = 0x0075 // Opcode : 0x75 for MISC ITEM new feature
+#endif
+
+ ////Samsung DiamondVoice
+#if defined (SAMSUNG_TOTORO_DIAMONDVOICE)
+ , DIAMONDVOICE_OUTPCMDATA = 0x0076 // DSP send tx/rx PCM to CP audio, which will be sent to DiamondVoice to process.
+#endif
+ , AUDIO_FM_MODE = 0x0076
+
+ , AUDIO_DUALMIC_CONTROL = 0x0077 // Opcode : 0x77 set dual mic parameters
+ , AUDIO_ECALL_CONTROL = 0x0078 // Opcode : 0x78 set ECALL parameters
+
+ , AUDIO_GSSP_CONTROL = 0x0079 // Opcode : 0x79 turn on/off GSSP clock
+ , AUDIO_SSPA_CONTROL = 0x0079 // Opcode : 0x79 turn on/off GSSP clock
+ , AUDIO_GSSP_READ = 0x007a // Opcode : 0x7a read GSSP count
+
+ , AUDIO_TX_PCM = 0x007b // Opcode : 0x7b CP send Tx PCM into MSA
+
+ , HEADPHONE_TYPE_CHECK_WAIT_ACK = 0x007c
+
+ , AUDIO_CODECSET = 0x007d // Opcode : 0x7d CP send codec setting into MSA
+ , AUDIO_CODECGET = 0x007e // Opcode : 0x7e CP request codec setting from MSA
+
+ , AUDIO_VIBRATION_CONTROL = 0x007F
+
+};
+
+enum AudioCtrlMsg {
+ VOICE_TX_PACKET = 0x0040
+ , VOICE_DRIFT_REPORT = 0x0041
+ , END_VOICE_ACK = 0x0042
+ , PCM_STREAM_RECORD = 0x0043
+ , GET_PCM_FRAME = 0x0044
+ , VOICE_DECODER_ACK = 0x0045
+ , VOICE_START_ACK = 0x0046
+ , VOICE_PCM_ACK = 0x0047
+ , VOICE_DEBUG_RX_PACKET = 0x0048
+ , VOICE_DEBUG_PCM = 0x004A
+ , VOICE_CTM_NEGO_REPORT = 0x004B
+
+ //MSA will report detected DTMF code(in ASCII code)
+ , VOICE_GET_DTMF = 0x004C
+
+#if defined (SAMSUNG_NXP)
+ , VOICE_RESERVED = 0x004D
+#endif
+ , VOICE_MISC_REPORT = 0x004E
+ , VOICE_CODEC_REPORT = 0x004F
+
+
+#ifdef OPT_IPC
+ , AUDIO_IPC_REPORT = 0x0050
+#endif
+
+#if defined (MSA_MISC_PARAMETERS)
+ , AUDIO_MISC_REPORT = 0x52 // AUDIO_MISC_REPORT OpCode : 0x52
+#endif
+
+////Samsung DiamondVoice
+//#if defined (SAMSUNG_TOTORO_DIAMONDVOICE)
+// ,DIAMONDVOICE_INPCMDATA = 0x0053 // DSP send tx/rx PCM to CP audio, which will be sent to DiamondVoice to process.
+//#endif
+ , VAD_DUMP_MSG = 0x0053
+ , COMPANDER_REPORT_MSG = 0x0054
+ , WISE_VOICE_MSG = 0x0055
+ , KWS_DETECT_MSG = 0x0056
+ , ECALL_REPORT_MSG = 0x0077
+
+ , AUDIO_GSSP_COUNT = 0x007a // Opcode : 0x7a got GSSP count
+
+ , AUDIO_RX_PCM = 0x007b // Opcode : 0x7b MSA send Rx PCM into CP
+ , HEADPHONE_EVENT_MSG = 0x007c //
+};
+
+
+#if 0
+typedef enum {
+ ECALL_DATA_SET = 0,
+ ECALL_DATA_GET = 1,
+ ECALL_VOICE_SET = 2,
+ ECALL_VOICE_GET = 3,
+ ECALL_TEST_CONTROL = 4,
+ ECALL_TEST_DATA_CONTROL = 5,
+ ECALL_CONNECTED = 6
+}EcallIpcCmdSubOpEnum;
+
+typedef enum {
+ ECALL_DATA_INDICATION = 0,
+ ECALL_DATA_GET_MSG = 1,
+ ECALL_VOICE_INDICATION = 2,
+ ECALL_VOICE_GET_MSG = 3,
+ ECALL_TEST_DATA_ACK = 4,
+ ECALL_TEST_TX_BUFFER_END = 5,
+ ECALL_TEST_RX_CTRL = 6,
+ ECALL_DEBUG = 7
+}EcallIpcMsgSubOpEnum;
+
+//ICAT EXPORTED ENUM
+typedef enum {
+ ECALL_CMD_EIM_ABORT_TERMINATED = 0,
+ ECALL_CMD_EIM_ARM_ACTIVATE = 1,
+ ECALL_CMD_UPDATE_MSD = 2,
+ ECALL_CMD_URC_CONTROL = 3,
+ ECALL_CMD_FEATURE_CONTROL = 4,
+ ECALL_CMD_TIMERS_UPDATE = 5,
+ ECALL_CMD_MSD_UPDATE_CONFIG = 6,
+ ECALL_CMD_RESERVED_3 = 7,
+ ECALL_CMD_NUM_OPCODES
+} EcallUecallDataCmdIdEnum;
+#endif
+
+enum VolumeSide {
+ TX_VOLUME
+ , RX_VOLUME
+ , SIDETONE_VOLUME
+};
+
+enum MuteSide {
+ TX_MUTE,
+ RX_MUTE
+};
+
+enum VoiceHandOver {
+ VOICE_RESUME,
+ VOICE_SUSPEND
+};
+
+
+#if 0
+typedef enum {
+ AMRInitFunc,
+ EnableHwPathCodecFunc,
+ DisableHwPathCodecFunc,
+ EnableHwPathBTFunc,
+ DisableHwPathBTFunc
+}CalledFunctionT;
+
+void AudioTriStateControl(CalledFunctionT CalledFunction);
+
+/*
+ Frame Type AMRcodec Total Class A Class B Class C
+ 0 4,75 95 42 53 0
+ 1 5,15 103 49 54 0
+ 2 5,90 118 55 63 0
+ 3 6,70 134 58 76 0
+ 4 7,40 148 61 87 0
+ 5 7,95 159 75 84 0
+ 6 10,2 204 65 99 40
+ 7 12,2 244 81 103 60 */
+#define CLASS_A_OCTETS_4_75 6
+#define CLASS_B_OCTETS_4_75 7
+#define CLASS_C_OCTETS_4_75 0
+
+#define CLASS_A_OCTETS_5_15 7
+#define CLASS_B_OCTETS_5_15 7
+#define CLASS_C_OCTETS_5_15 0
+
+#define CLASS_A_OCTETS_5_90 7
+#define CLASS_B_OCTETS_5_90 8
+#define CLASS_C_OCTETS_5_90 0
+
+#define CLASS_A_OCTETS_6_70 8
+#define CLASS_B_OCTETS_6_70 10
+#define CLASS_C_OCTETS_6_70 0
+
+#define CLASS_A_OCTETS_7_40 8
+#define CLASS_B_OCTETS_7_40 11
+#define CLASS_C_OCTETS_7_40 0
+
+#define CLASS_A_OCTETS_7_95 10
+#define CLASS_B_OCTETS_7_95 11
+#define CLASS_C_OCTETS_7_95 0
+
+#define CLASS_A_OCTETS_10_2 9
+#define CLASS_B_OCTETS_10_2 13
+#define CLASS_C_OCTETS_10_2 5
+
+#define CLASS_A_OCTETS_12_2 11
+#define CLASS_B_OCTETS_12_2 13
+#define CLASS_C_OCTETS_12_2 8
+
+#define MAX_CLASS_A_OCTETS 11
+#define MAX_CLASS_B_OCTETS 13
+#define MAX_CLASS_C_OCTETS 8
+#endif
+
+#endif // AUC_H
diff --git a/marvell/services/audio/libacm/acm/inc/ac_thread.h b/marvell/services/audio/libacm/acm/inc/ac_thread.h
new file mode 100644
index 0000000..7c84861
--- /dev/null
+++ b/marvell/services/audio/libacm/acm/inc/ac_thread.h
@@ -0,0 +1,43 @@
+/*
+* All Rights Reserved
+*
+* MARVELL CONFIDENTIAL
+* Copyright 2012 Marvell International Ltd All Rights Reserved.
+* The source code contained or described herein and all documents related to
+* the source code ("Material") are owned by Marvell International Ltd or its
+* suppliers or licensors. Title to the Material remains with Marvell International Ltd
+* or its suppliers and licensors. The Material contains trade secrets and
+* proprietary and confidential information of Marvell or its suppliers and
+* licensors. The Material is protected by worldwide copyright and trade secret
+* laws and treaty provisions. No part of the Material may be used, copied,
+* reproduced, modified, published, uploaded, posted, transmitted, distributed,
+* or disclosed in any way without Marvell's prior express written permission.
+*
+* No license under any patent, copyright, trade secret or other intellectual
+* property right is granted to or conferred upon you by disclosure or delivery
+* of the Materials, either expressly, by implication, inducement, estoppel or
+* otherwise. Any license under such intellectual property rights must be
+* express and approved by Marvell in writing.
+*
+*/
+
+#ifndef __H_AC_THREAD__
+#define __H_AC_THREAD__
+
+#define PATHSTATUS_MAX 2048
+
+#ifndef MAX_PATH
+# define MAX_PATH 100
+#endif
+
+#define PATHS_NUM_MAX 20 //no less than APH_PATH_ID_CNT
+
+typedef struct _paths_list{
+ char path[PATHS_NUM_MAX][MAX_PATH];
+ int num;
+} PathsList;
+
+void ACM_Init_Calibration_IPC(void);
+void ACM_Cancel_Calibration_IPC(void);
+
+#endif
diff --git a/marvell/services/audio/libacm/acm/inc/acm_ach.h b/marvell/services/audio/libacm/acm/inc/acm_ach.h
new file mode 100644
index 0000000..02ac7bf
--- /dev/null
+++ b/marvell/services/audio/libacm/acm/inc/acm_ach.h
@@ -0,0 +1,83 @@
+/*
+* All Rights Reserved
+*
+* MARVELL CONFIDENTIAL
+* Copyright 2012 Marvell International Ltd All Rights Reserved.
+* The source code contained or described herein and all documents related to
+* the source code ("Material") are owned by Marvell International Ltd or its
+* suppliers or licensors. Title to the Material remains with Marvell International Ltd
+* or its suppliers and licensors. The Material contains trade secrets and
+* proprietary and confidential information of Marvell or its suppliers and
+* licensors. The Material is protected by worldwide copyright and trade secret
+* laws and treaty provisions. No part of the Material may be used, copied,
+* reproduced, modified, published, uploaded, posted, transmitted, distributed,
+* or disclosed in any way without Marvell's prior express written permission.
+*
+* No license under any patent, copyright, trade secret or other intellectual
+* property right is granted to or conferred upon you by disclosure or delivery
+* of the Materials, either expressly, by implication, inducement, estoppel or
+* otherwise. Any license under such intellectual property rights must be
+* express and approved by Marvell in writing.
+*
+*/
+
+#ifndef __H_ACM_ACH__
+#define __H_ACM_ACH__
+
+#include "acm_debug.h"
+
+typedef enum {
+ ACH_RC_OK,
+ ACH_RC_NO_UPDATE_NEEDED,
+ ACH_RC_FAIL_TO_UPDATE
+} ACH_ReturnCode;
+
+typedef enum {
+ COMPONENT_INACTIVE,
+ COMPONENT_ACTIVE
+} ACH_ComponentStatus;
+
+typedef enum {
+ COMPONENT_TYPE_CODEC,
+ COMPONENT_TYPE_POWER,
+ COMPONENT_TYPE_BT,
+ COMPONENT_TYPE_FM,
+ COMPONENT_TYPE_GPIO,
+ COMPONENT_TYPE_MODEM,
+ COMPONENT_TYPE_SW,
+} ACH_ComponentType;
+
+typedef struct {
+ unsigned char active;
+ unsigned char ref_count;
+ void (*ACH_Enable)(void);
+ void (*ACH_Disable)(void);
+ void (*ACH_Reset)(void);
+ void (*ACH_GetTypeAndID)(int *type, unsigned char *id);
+ ACH_ReturnCode (*ACH_Handle)(void *setting);
+} ACH_ComponentHandler;
+
+typedef union {
+ struct {
+ unsigned char reg_index;
+ unsigned short reg_mask;
+ unsigned char reg_shift;
+ unsigned short length;
+ unsigned short *reg_value;
+ } i2c;
+ struct {
+ unsigned char gpio_port;
+ unsigned char gpio_value;
+ } gpio;
+ struct {
+ unsigned char hci_ocf;
+ unsigned char hci_ogf;
+ unsigned short length;
+ unsigned char *hci_parameters;
+ } hci;
+ struct {
+ unsigned int delay_value;
+ } delay;
+} ACH_ComponentParameter;
+
+#endif
diff --git a/marvell/services/audio/libacm/acm/inc/acm_alc5616_handle.h b/marvell/services/audio/libacm/acm/inc/acm_alc5616_handle.h
new file mode 100644
index 0000000..780be31
--- /dev/null
+++ b/marvell/services/audio/libacm/acm/inc/acm_alc5616_handle.h
@@ -0,0 +1,70 @@
+/*
+ * All Rights Reserved
+ *
+ * MARVELL CONFIDENTIAL
+ * Copyright 2012 Marvell International Ltd All Rights Reserved.
+ * The source code contained or described herein and all documents related to
+ * the source code ("Material") are owned by Marvell International Ltd or its
+ * suppliers or licensors. Title to the Material remains with Marvell International Ltd
+ * or its suppliers and licensors. The Material contains trade secrets and
+ * proprietary and confidential information of Marvell or its suppliers and
+ * licensors. The Material is protected by worldwide copyright and trade secret
+ * laws and treaty provisions. No part of the Material may be used, copied,
+ * reproduced, modified, published, uploaded, posted, transmitted, distributed,
+ * or disclosed in any way without Marvell's prior express written permission.
+ *
+ * No license under any patent, copyright, trade secret or other intellectual
+ * property right is granted to or conferred upon you by disclosure or delivery
+ * of the Materials, either expressly, by implication, inducement, estoppel or
+ * otherwise. Any license under such intellectual property rights must be
+ * express and approved by Marvell in writing.
+ *
+ */
+
+#ifndef __H_ACM_ALC5616_HANDLE__
+#define __H_ACM_ALC5616_HANDLE__
+
+#include "acm_ach.h"
+
+#define NUM_OF_REGS (sizeof(reg_cache)/sizeof(reg_cache[0]))
+#define REG_NUMID_BASE 0
+
+#define ALC5616_ID_REG 0xFE
+
+typedef struct {
+ unsigned char reg_index;
+ unsigned short reg_default;
+ unsigned short reg_value;
+ // Field of reg_prior represent when will this register be reset;
+ // 0x00 --- with this value, the register will not be reset,
+ // 0x01~0xff --- with these values, the register will be reset with ascending sequence;
+ // If someone would like to modify the resetting sequences in the table,
+ // only need to modify this field in reg_cache.
+ unsigned short reg_prior;
+} ALC5616_RegisterCache;
+
+static ALC5616_RegisterCache reg_cache[] = {
+ {0x00, 0x0000, 0x0000, 0x02}, {0x02, 0xc8c8, 0xc8c8, 0x02}, {0x03, 0xc8c8, 0xc8c8, 0x02}, {0x05, 0x0000, 0x0000, 0x02}, {0x0d, 0x0000, 0x0000, 0x02},
+ {0x0f, 0x0808, 0x0808, 0x02}, {0x19, 0xafaf, 0xafaf, 0x02}, {0x1c, 0x2f2f, 0x2f2f, 0x02}, {0x1e, 0x0000, 0x0000, 0x02}, {0x27, 0x7860, 0x7860, 0x02},
+ {0x29, 0x8080, 0x8080, 0x02}, {0x2a, 0x5252, 0x5252, 0x02}, {0x3b, 0x0000, 0x0000, 0x02}, {0x3c, 0x006f, 0x006f, 0x02}, {0x3d, 0x0000, 0x0000, 0x02},
+ {0x3e, 0x006f, 0x006f, 0x02}, {0x45, 0x6000, 0x6000, 0x02}, {0x4d, 0x0000, 0x0000, 0x02}, {0x4e, 0x0000, 0x0000, 0x02}, {0x4f, 0x0279, 0x0279, 0x02},
+ {0x50, 0x0000, 0x0000, 0x02}, {0x51, 0x0000, 0x0000, 0x02}, {0x52, 0x0279, 0x0279, 0x02}, {0x53, 0xf000, 0xf000, 0x02}, {0x61, 0x0000, 0x0000, 0x02},
+ {0x62, 0x0000, 0x0000, 0x02}, {0x63, 0x00c0, 0x00c0, 0x02}, {0x64, 0x0000, 0x0000, 0x02}, {0x65, 0x0000, 0x0000, 0x02}, {0x66, 0x0000, 0x0000, 0x02},
+ {0x6a, 0x0000, 0x0000, 0x02}, {0x6c, 0x0000, 0x0000, 0x02}, {0x70, 0x8000, 0x8000, 0x02}, {0x73, 0x1104, 0x1104, 0x02}, {0x74, 0x0c00, 0x0c00, 0x02},
+ {0x80, 0x0000, 0x0000, 0x02}, {0x81, 0x0000, 0x0000, 0x02}, {0x82, 0x0000, 0x0000, 0x02}, {0x8b, 0x0000, 0x0000, 0x02}, {0x8e, 0x0004, 0x0004, 0x02},
+ {0x8f, 0x1100, 0x1100, 0x02}, {0x90, 0x0000, 0x0000, 0x02}, {0x91, 0x0000, 0x0000, 0x02}, {0x92, 0x0000, 0x0000, 0x02}, {0x93, 0x2000, 0x2000, 0x02},
+ {0x94, 0x0200, 0x0200, 0x02}, {0x95, 0x0000, 0x0000, 0x02}, {0xb0, 0x2080, 0x2080, 0x02}, {0xb1, 0x0000, 0x0000, 0x02}, {0xb2, 0x0000, 0x0000, 0x02},
+ {0xb4, 0x2206, 0x2206, 0x02}, {0xb5, 0x1f00, 0x1f00, 0x02}, {0xb6, 0x0000, 0x0000, 0x02}, {0xb7, 0x0000, 0x0000, 0x02}, {0xbb, 0x0000, 0x0000, 0x02},
+ {0xbc, 0x0000, 0x0000, 0x02}, {0xbd, 0x0000, 0x0000, 0x02}, {0xbe, 0x0000, 0x0000, 0x02}, {0xbf, 0x0000, 0x0000, 0x02}, {0xc0, 0x0100, 0x0100, 0x02},
+ {0xc1, 0x0000, 0x0000, 0x02}, {0xc2, 0x0000, 0x0000, 0x02}, {0xc8, 0x0000, 0x0000, 0x02}, {0xc9, 0x0000, 0x0000, 0x02}, {0xca, 0x0000, 0x0000, 0x02},
+ {0xcb, 0x0000, 0x0000, 0x02}, {0xcc, 0x0000, 0x0000, 0x02}, {0xcd, 0x0000, 0x0000, 0x02}, {0xce, 0x0000, 0x0000, 0x02}, {0xcf, 0x0000, 0x0000, 0x02},
+ {0xd0, 0x0000, 0x0000, 0x02}, {0xd1, 0x0000, 0x0000, 0x02}, {0xd3, 0xb320, 0xb320, 0x02}, {0xd4, 0x0000, 0x0000, 0x02}, {0xd6, 0x0000, 0x0000, 0x02},
+ {0xd7, 0x0000, 0x0000, 0x02}, {0xd9, 0x0809, 0x0809, 0x02}, {0xda, 0x0000, 0x0000, 0x02}, {0xfa, 0x0010, 0x0010, 0x02}, {0xfb, 0x0000, 0x0000, 0x02},
+ {0xfc, 0x0000, 0x0000, 0x02}, {0xfd, 0x0000, 0x0000, 0x02}, {0xfe, 0x10ec, 0x10ec, 0x02}
+};
+
+void ALC5616_RegGet(unsigned char numid, unsigned char *value);
+void ALC5616_RegBurstGet(unsigned char numid, unsigned char *value, int size, int offset);
+unsigned char ALC5616_GetRegNumId(unsigned char reg_index);
+
+#endif
diff --git a/marvell/services/audio/libacm/acm/inc/acm_aph.h b/marvell/services/audio/libacm/acm/inc/acm_aph.h
new file mode 100644
index 0000000..964d194
--- /dev/null
+++ b/marvell/services/audio/libacm/acm/inc/acm_aph.h
@@ -0,0 +1,333 @@
+/*
+* All Rights Reserved
+*
+* MARVELL CONFIDENTIAL
+* Copyright 2012 Marvell International Ltd All Rights Reserved.
+* The source code contained or described herein and all documents related to
+* the source code ("Material") are owned by Marvell International Ltd or its
+* suppliers or licensors. Title to the Material remains with Marvell International Ltd
+* or its suppliers and licensors. The Material contains trade secrets and
+* proprietary and confidential information of Marvell or its suppliers and
+* licensors. The Material is protected by worldwide copyright and trade secret
+* laws and treaty provisions. No part of the Material may be used, copied,
+* reproduced, modified, published, uploaded, posted, transmitted, distributed,
+* or disclosed in any way without Marvell's prior express written permission.
+*
+* No license under any patent, copyright, trade secret or other intellectual
+* property right is granted to or conferred upon you by disclosure or delivery
+* of the Materials, either expressly, by implication, inducement, estoppel or
+* otherwise. Any license under such intellectual property rights must be
+* express and approved by Marvell in writing.
+*
+*/
+
+#ifndef __H_ACM_APH__
+#define __H_ACM_APH__
+
+#include "acm_debug.h"
+#include "acm_ach.h"
+#include "acm_api.h"
+#include "audio_protocol.h"
+#include "audio_profile.h"
+
+#define MAX_STRING_LEN 60
+#define MAX_VOLUME_INDEX 100
+#define INVALID_CTL_UNIT_ID 0
+#define INVALID_PATH_ID 0xFF
+#define INVALID_ORDER_INDEX 0xFF
+
+#define XML_NAME_LEN 128
+#define DIGITAL_GAIN_OFFSET 37
+#define GENERATE_XML_NAME(BUF, SIZE, PREFIX, APPENDIX) \
+do{\
+ (BUF) = (char *)malloc((SIZE)); \
+ if ((BUF)) {\
+ memset((BUF), 0, (SIZE)); \
+ snprintf((BUF), (SIZE), "%s%s.xml", (PREFIX), (APPENDIX));\
+ } \
+}while(0)
+
+#define PATHSTATUS_MAX 2048
+//--------------------------------------------------------------
+//-------- Basic Elements Definition
+//--------------------------------------------------------------
+typedef enum {
+ APH_PATH_ID_HIFIPLAYTOEARPHONE = 0,
+ APH_PATH_ID_HIFIPLAYTOSPKR,
+ APH_PATH_ID_HIFIPLAYTOHP,
+ APH_PATH_ID_HIFIRECORDFROMMIC1,
+ APH_PATH_ID_HIFIRECORDFROMHSMIC,
+ APH_PATH_ID_VOICEPLAYTOEARPHONE,
+ APH_PATH_ID_VOICEPLAYTOSPKR,
+ APH_PATH_ID_VOICEPLAYTOHP,
+ APH_PATH_ID_VOICERECORDFROMMIC1,
+ APH_PATH_ID_VOICERECORDFROMHSMIC,
+
+ APH_PATH_ID_CNT
+} APH_PATH_ID;
+
+#define APH_PATH_OUT_CNT 6
+#define APH_PATH_IN_CNT 4
+
+typedef enum {
+ APH_GAIN_ID_NB = 0,
+ APH_GAIN_ID_WB,
+ APH_GAIN_ID_NB_EXTRA,
+ APH_GAIN_ID_WB_EXTRA,
+
+ APH_GAIN_ID_CNT
+} APH_GAIN_ID;
+
+typedef enum {
+ ELBA,
+ USTICA,
+ DELAY,
+ NAU8810,
+ ALC5616,
+
+ AUDIO_COMPONENT_CNT
+} APH_AudioComponent;
+
+
+typedef enum {
+ ENABLE,
+ DISABLE,
+ MUTE,
+ SETVOLUME,
+ SWITCH,
+
+ PATH_OPERATION_CNT
+} APH_PathOperation;
+
+/* Force type is added for GELATO, as some registers are used as trigger/update signal, will repeatedly write a same value. For bit value with Force field type, just write to codec ignore ref_count/bind-writing/cache check features */
+typedef enum {
+ REG_FIELD_TYPE_INVALID = 0,
+ REG_FIELD_TYPE_NORMAL = 1,
+ REG_FIELD_TYPE_GAIN = 2,
+ REG_FIELD_TYPE_COEFF = 4,
+ REG_FIELD_TYPE_FORCE = 8
+} APH_RegisterFieldType;
+
+typedef enum {
+ REG_MISC_NONE,
+ REG_MISC_MIC1,
+ REG_MISC_MIC2,
+ REG_MISC_DUAL_MIC,
+ REG_MISC_SLAVE,
+ REG_MISC_MASTER,
+ REG_MISC_NB_RATE,
+ REG_MISC_WB_RATE,
+ REG_MISC_VOIP_RATE,
+ REG_MISC_DEFAULT_RATE,
+ REG_MISC_FORCE_DELAY
+} APH_RegisterMisc;
+
+typedef enum {
+ PATH_DIRECTION_IN,
+ PATH_DIRECTION_OUT,
+} APH_PathDirection;
+
+typedef enum {
+ HIFI_PATH,
+ FM_PATH,
+ VOICE_PATH,
+ UNKNOW_PATH,
+}APH_PathType;
+
+
+//--------------------------------------------------------------
+//-------- ACM_APH Related Data Structures
+//--------------------------------------------------------------
+typedef struct {
+ APH_AudioComponent Component;
+ unsigned char Address;
+ unsigned short Value;
+} ACMAPH_Register;
+
+typedef struct {
+ APH_PATH_ID PathID;
+ ACMAPH_Register *RegisterList;
+ unsigned char RegisterNum;
+} ACMAPH_Component;
+
+typedef struct {
+ int PathID;
+ char PathName[32];
+} ACMAPH_AudioPathID;
+
+typedef struct {
+ unsigned char Volume;
+ APH_AudioComponent Component;
+ unsigned char Address;
+ unsigned short Value;
+} ACMAPH_VolumeRegister;
+
+typedef struct {
+ APH_PATH_ID PathID;
+ ACMAPH_VolumeRegister *RegisterList;
+ unsigned char RegisterNum;
+} ACMAPH_VolumeComponent;
+
+
+typedef struct {
+ APH_GAIN_ID id;
+ unsigned char volume;
+ signed char gain;
+} ACMAPH_MSAGain;
+
+typedef struct {
+ APH_PATH_ID PathID;
+ ACMAPH_MSAGain *GainList;
+ unsigned char GainNum;
+} ACMAPH_MSAComponent;
+
+
+//--------------------------------------------------------------
+//-------- Path Configuration Related Data Structures
+//--------------------------------------------------------------
+typedef struct tag_APH_ControlUnitConfiguration {
+ union {
+ struct {
+ unsigned char reg_index;
+ unsigned char reg_mask;
+ unsigned char reg_shift;
+ unsigned char reg_type;
+ unsigned char reg_misc;
+ unsigned short length;
+ unsigned char *reg_value;
+ } i2c;
+ struct {
+ unsigned char gpio_port;
+ unsigned char gpio_value;
+ } gpio;
+ struct {
+ unsigned char hci_ocf;
+ unsigned char hci_ogf;
+ unsigned short length;
+ unsigned char *hci_parameters;
+ } hci;
+ struct {
+ unsigned int delay_value;
+ unsigned char delay_misc;
+ } delay;
+ } ctl_unit;
+ unsigned short control_unit_id;
+ struct tag_APH_ControlUnitConfiguration *next;
+} APH_ControlUnitConfiguration;
+
+
+//--------------------------------------------------------------
+//-------- APH Related Data Structures
+//--------------------------------------------------------------
+typedef struct {
+ APH_AudioComponent component_id;
+ ACH_ComponentHandler *component_handler;
+} APH_ACHComponent;
+
+typedef struct {
+ unsigned short enabled;
+ unsigned int value;
+ unsigned char mute;
+} APH_PathStatus;
+
+typedef enum
+{
+ AUDIOHAL_SPK_MUTE = 0,
+ AUDIOHAL_SPK_VOL_1,
+ AUDIOHAL_SPK_VOL_2,
+ AUDIOHAL_SPK_VOL_3,
+ AUDIOHAL_SPK_VOL_4,
+ AUDIOHAL_SPK_VOL_5,
+ AUDIOHAL_SPK_VOL_6,
+ AUDIOHAL_SPK_VOL_7,
+ AUDIOHAL_SPK_VOL_8,
+ AUDIOHAL_SPK_VOL_9,
+ AUDIOHAL_SPK_VOL_10,
+ AUDIOHAL_SPK_VOL_QTY //11
+} AUDIOHAL_SPK_LEVEL_T;
+
+typedef enum {
+ APH_CODEC_ID_NONE=0,
+ APH_CODEC_ID_PM805,
+ APH_CODEC_ID_PM812,
+ APH_CODEC_ID_NAU8810,
+ APH_CODEC_ID_ALC5616,
+
+ APH_CODEC_CNT
+} APH_CODEC_ID;
+
+typedef struct
+{
+ APH_AudioComponent Component_1;
+ unsigned short RegAddr_1;
+ unsigned short RegVal_1;
+
+ APH_AudioComponent Component_2;
+ unsigned short RegAddr_2;
+ unsigned short RegVal_2;
+
+ APH_AudioComponent Component_3;
+ unsigned short RegAddr_3;
+ unsigned short RegVal_3;
+
+ APH_AudioComponent Component_4;
+ unsigned short RegAddr_4;
+ unsigned short RegVal_4;
+} ACMCodec_GainInT;
+
+typedef struct
+{
+ APH_AudioComponent Component_1;
+ unsigned short RegAddr_1;
+ unsigned short RegVal_1;
+
+ APH_AudioComponent Component_2;
+ unsigned short RegAddr_2;
+ unsigned short RegVal_2;
+
+ APH_AudioComponent Component_3;
+ unsigned short RegAddr_3;
+ unsigned short RegVal_3;
+
+ APH_AudioComponent Component_4;
+ unsigned short RegAddr_4;
+ unsigned short RegVal_4;
+} ACMCodec_GainOutT;
+
+typedef struct
+{
+ AUDIO_PROFILE_ID Profile_id;
+ unsigned short CodecControl;
+ ACMCodec_GainInT Tx_CodecGain; //TX has the same gain for every volume
+ short Tx_DSPGain; //TX has the same gain for every volume, High 8bits: WB gain, Low 8bits: NB gain
+ ACMCodec_GainOutT Rx_CodecGain[AUDIOHAL_SPK_VOL_QTY];
+ short Rx_DSPGain[AUDIOHAL_SPK_VOL_QTY]; //High 8bits: WB gain, Low 8bits: NB gain
+ short Rx_DSPSideToneGain; //High 8bits: WB gain, Low 8bits: NB gain
+} ACMCodec_GainT;
+
+//--------------------------------------------------------------
+//-------- External APH APIs
+//--------------------------------------------------------------
+const ACMAPH_AudioPathID *ACM_GetPathConfigTable();
+
+void ACM_Init_Property(void);
+void ACM_APHInit(void);
+void ACM_APHDeInit(void);
+char * ACM_GetPathName(int PathID);
+ACM_ReturnCode APHAudioPathEnable(const char *path, unsigned int value);
+ACM_ReturnCode APHAudioPathDisable(const char *path);
+ACM_ReturnCode APHAudioPathCheck (const char * path_Rx, const char * path_Tx) ;
+void APHDisableAllPath(void);
+ACM_ReturnCode APHAudioPathSwitch (const char *path_Rx, const char *path_Tx, unsigned int value);
+ACM_ReturnCode APHAudioPathMute(const char *path, unsigned int value);
+ACM_ReturnCode APHAudioPathVolumeSet(const char *path, unsigned int value);
+ACM_ReturnCode ACM_ReloadCalibrationData(void);
+ACM_ReturnCode APHReloadNvm(void);
+ACM_ReturnCode APHAudioPathCheckPathId (int path_id_Rx, int path_id_Tx);
+ACM_ReturnCode ACM_GetEnabledPathId(int *path_id_Rx, int *path_id_Tx, int *volume_Rx, int *mute_Tx);
+ACM_ReturnCode APHGetMSAGain(const char *out_path, const char *path, unsigned char *volume, unsigned short id, signed short *gain, signed short *sidetone_gain);
+unsigned int ACM_GetEnabledPathVolume(void);
+ACM_ReturnCode ACM_GetPathStatus(char *buff, unsigned int maxsize);
+ACM_ReturnCode ACM_GetPathDirection(const char *path, unsigned char *path_direction);
+
+#endif
diff --git a/marvell/services/audio/libacm/acm/inc/acm_api.h b/marvell/services/audio/libacm/acm/inc/acm_api.h
new file mode 100644
index 0000000..59a418a
--- /dev/null
+++ b/marvell/services/audio/libacm/acm/inc/acm_api.h
@@ -0,0 +1,54 @@
+/*
+* All Rights Reserved
+*
+* MARVELL CONFIDENTIAL
+* Copyright 2012 Marvell International Ltd All Rights Reserved.
+* The source code contained or described herein and all documents related to
+* the source code ("Material") are owned by Marvell International Ltd or its
+* suppliers or licensors. Title to the Material remains with Marvell International Ltd
+* or its suppliers and licensors. The Material contains trade secrets and
+* proprietary and confidential information of Marvell or its suppliers and
+* licensors. The Material is protected by worldwide copyright and trade secret
+* laws and treaty provisions. No part of the Material may be used, copied,
+* reproduced, modified, published, uploaded, posted, transmitted, distributed,
+* or disclosed in any way without Marvell's prior express written permission.
+*
+* No license under any patent, copyright, trade secret or other intellectual
+* property right is granted to or conferred upon you by disclosure or delivery
+* of the Materials, either expressly, by implication, inducement, estoppel or
+* otherwise. Any license under such intellectual property rights must be
+* express and approved by Marvell in writing.
+*
+*/
+
+#ifndef __H_ACM__
+#define __H_ACM__
+
+typedef enum {
+ ACM_RC_OK,
+ ACM_RC_INVALID_PATH,
+ ACM_RC_PATH_CONFIG_NOT_EXIST,
+ ACM_RC_PATH_ALREADY_ENABLED,
+ ACM_RC_PATH_ALREADY_DISABLED,
+ ACM_RC_PATH_NOT_ENABLED,
+ ACM_RC_NO_MUTE_CHANGE_NEEDED,
+ ACM_RC_INVALID_VOLUME_CHANGE,
+ ACM_RC_INVALID_PARAMETER,
+ ACM_RC_FORCE_DELAY,
+ ACM_RC_FAIL_RELOADCALIBRATIONDATA,
+ ACM_RC_OK_HIFI_MATCHED,
+ ACM_RC_OK_VOICE_MATCHED
+} ACM_ReturnCode;
+
+
+void ACMInit(void);
+void ACMDeInit(void);
+ACM_ReturnCode ACMAudioPathEnable(const char * path, unsigned int value);
+ACM_ReturnCode ACMAudioPathDisable(const char * path);
+ACM_ReturnCode ACMAudioPathSwitch (const char * path_Rx, const char * path_Tx, unsigned int value);
+ACM_ReturnCode ACMAudioPathMute(const char * path, unsigned int value);
+ACM_ReturnCode ACMAudioPathVolumeSet(const char * path, unsigned int value);
+ACM_ReturnCode ACMGetParameter(unsigned int param_id, void *param, unsigned int *size);
+ACM_ReturnCode ACMSetParameter(unsigned int param_id, void *param, unsigned int size);
+ACM_ReturnCode ACMGetPathStatus(char * buff, unsigned int MaxSize);
+#endif
diff --git a/marvell/services/audio/libacm/acm/inc/acm_debug.h b/marvell/services/audio/libacm/acm/inc/acm_debug.h
new file mode 100644
index 0000000..714ca90
--- /dev/null
+++ b/marvell/services/audio/libacm/acm/inc/acm_debug.h
@@ -0,0 +1,37 @@
+/*
+* All Rights Reserved
+*
+* MARVELL CONFIDENTIAL
+* Copyright 2012 Marvell International Ltd All Rights Reserved.
+* The source code contained or described herein and all documents related to
+* the source code ("Material") are owned by Marvell International Ltd or its
+* suppliers or licensors. Title to the Material remains with Marvell International Ltd
+* or its suppliers and licensors. The Material contains trade secrets and
+* proprietary and confidential information of Marvell or its suppliers and
+* licensors. The Material is protected by worldwide copyright and trade secret
+* laws and treaty provisions. No part of the Material may be used, copied,
+* reproduced, modified, published, uploaded, posted, transmitted, distributed,
+* or disclosed in any way without Marvell's prior express written permission.
+*
+* No license under any patent, copyright, trade secret or other intellectual
+* property right is granted to or conferred upon you by disclosure or delivery
+* of the Materials, either expressly, by implication, inducement, estoppel or
+* otherwise. Any license under such intellectual property rights must be
+* express and approved by Marvell in writing.
+*
+*/
+
+#ifndef __H_ACM_DEBUG__
+#define __H_ACM_DEBUG__
+
+//summarize all debug macros here
+//#define DEBUG_XML_PARSER
+#define DEBUG_APH
+//#define DEBUG_ACH
+//#define DEBUG_FAKE_ACH
+#define DEBUG_ELBA
+#define DEBUG_USTICA
+//#define DEBUG_CODEC
+//#define DEBUG_PMIC
+
+#endif
diff --git a/marvell/services/audio/libacm/acm/inc/acm_elba.h b/marvell/services/audio/libacm/acm/inc/acm_elba.h
new file mode 100644
index 0000000..4fb0c94
--- /dev/null
+++ b/marvell/services/audio/libacm/acm/inc/acm_elba.h
@@ -0,0 +1,77 @@
+/*
+* All Rights Reserved
+*
+* MARVELL CONFIDENTIAL
+* Copyright 2012 Marvell International Ltd All Rights Reserved.
+* The source code contained or described herein and all documents related to
+* the source code ("Material") are owned by Marvell International Ltd or its
+* suppliers or licensors. Title to the Material remains with Marvell International Ltd
+* or its suppliers and licensors. The Material contains trade secrets and
+* proprietary and confidential information of Marvell or its suppliers and
+* licensors. The Material is protected by worldwide copyright and trade secret
+* laws and treaty provisions. No part of the Material may be used, copied,
+* reproduced, modified, published, uploaded, posted, transmitted, distributed,
+* or disclosed in any way without Marvell's prior express written permission.
+*
+* No license under any patent, copyright, trade secret or other intellectual
+* property right is granted to or conferred upon you by disclosure or delivery
+* of the Materials, either expressly, by implication, inducement, estoppel or
+* otherwise. Any license under such intellectual property rights must be
+* express and approved by Marvell in writing.
+*
+*/
+
+#ifndef __H_ACM_ELBA__
+#define __H_ACM_ELBA__
+
+#include "acm_ach.h"
+
+#define NUM_OF_REGS (sizeof(reg_cache)/sizeof(reg_cache[0]))
+#define REG_NUMID_BASE 0
+#define ELBA_MAIN_POWERUP_ID 1
+#define ELBA_SEQ_PU_READY 0
+#define ELBA_AUTO_SEQUENCE_STS_1 11
+#define ELBA_SRC_SET2_ID 44
+#define ELBA_ID_REG 0
+#define ELBA_COEFF_ID 63
+#define ELBA_HP_SHRT_AR_ID 10
+
+typedef struct {
+ unsigned char reg_index;
+ unsigned short reg_default;
+ unsigned short reg_value;
+// Field of reg_prior represent when will this register be reset;
+// 0x00 --- with this value, the register will not be reset,
+// 0x01~0xff --- with these values, the register will be reset with ascending sequence;
+// If someone would like to modify the resetting sequences in the table,
+// only need to modify this field in reg_cache.
+ unsigned short reg_prior;
+} Elba_RegisterCache;
+
+static Elba_RegisterCache reg_cache[] = {
+ {0x00, 0x03, 0x03, 0x02}, {0x01, 0x00, 0x00, 0x02}, {0x02, 0x00, 0x00, 0x02}, {0x03, 0x00, 0x00, 0x00}, {0x04, 0x00, 0x00, 0x00},
+ {0x05, 0x00, 0x00, 0x00}, {0x06, 0x00, 0x00, 0x00}, {0x07, 0x00, 0x00, 0x02}, {0x08, 0x00, 0x00, 0x02}, {0x09, 0x00, 0x00, 0x02},
+ {0x0A, 0x00, 0x00, 0x02}, {0x0B, 0xAA, 0xAA, 0x02}, {0x0C, 0x00, 0x00, 0x02}, {0x10, 0x00, 0x00, 0x02}, {0x11, 0x00, 0x00, 0x02},
+ {0x12, 0x02, 0x02, 0x02}, {0x13, 0x00, 0x00, 0x02}, {0x14, 0x00, 0x00, 0x02}, {0x15, 0x00, 0x00, 0x02}, {0x16, 0x00, 0x00, 0x02},
+ {0x17, 0x00, 0x00, 0x02}, {0x20, 0x00, 0x00, 0x02}, {0x21, 0x00, 0x00, 0x02}, {0x22, 0x00, 0x00, 0x02}, {0x23, 0x00, 0x00, 0x02},
+ {0x24, 0x00, 0x00, 0x02}, {0x25, 0x00, 0x00, 0x02}, {0x26, 0x00, 0x00, 0x03}, {0x27, 0x00, 0x00, 0x02}, {0x28, 0x00, 0x00, 0x02},
+ {0x29, 0x00, 0x00, 0x02}, {0x2A, 0x00, 0x00, 0x02}, {0x30, 0x00, 0x00, 0x02}, {0x31, 0x00, 0x00, 0x02}, {0x32, 0x00, 0x00, 0x02},
+ {0x33, 0x00, 0x00, 0x02}, {0x34, 0x00, 0x00, 0x02}, {0x35, 0x00, 0x00, 0x02}, {0x36, 0x00, 0x00, 0x02}, {0x37, 0x00, 0x00, 0x02},
+ {0x38, 0x00, 0x00, 0x02}, {0x39, 0x00, 0x00, 0x02}, {0x3A, 0x00, 0x00, 0x02}, {0x3B, 0x00, 0x00, 0x02}, {0x3C, 0x12, 0x12, 0x02},
+ {0x3D, 0x00, 0x00, 0x02}, {0x3E, 0x00, 0x00, 0x02}, {0x3F, 0x00, 0x00, 0x02}, {0x40, 0x00, 0x00, 0x02}, {0x41, 0x00, 0x00, 0x02},
+ {0x42, 0x00, 0x00, 0x02}, {0x50, 0x00, 0x00, 0x02}, {0x51, 0x00, 0x00, 0x02}, {0x52, 0x00, 0x00, 0x02}, {0x53, 0x00, 0x00, 0x02},
+ {0x54, 0x05, 0x05, 0x02}, {0x55, 0x00, 0x00, 0x02}, {0x56, 0x00, 0x00, 0x01}, {0x57, 0x00, 0x00, 0x01}, {0x58, 0x00, 0x00, 0x02},
+ {0x59, 0x00, 0x00, 0x02}, {0x5A, 0x00, 0x00, 0x02}, {0x5B, 0x00, 0x00, 0x02}, {0x5C, 0x00, 0x00, 0x02}, {0x5D, 0x00, 0x00, 0x02},
+ {0x5E, 0x00, 0x00, 0x02}, {0x5F, 0x00, 0x00, 0x02}, {0x60, 0x00, 0x00, 0x02}, {0x80, 0x00, 0x00, 0x02}, {0x81, 0x00, 0x00, 0x02},
+ {0x82, 0x10, 0x10, 0x02}, {0x83, 0x01, 0x01, 0x02}, {0x84, 0x88, 0x88, 0x02}, {0x85, 0x16, 0x16, 0x02}, {0x86, 0x16, 0x16, 0x02},
+ {0x87, 0x00, 0x00, 0x02}, {0x88, 0x40, 0x40, 0x02}, {0x89, 0x00, 0x00, 0x02}, {0x8A, 0x08, 0x08, 0x02}, {0x8B, 0x05, 0x05, 0x02},
+ {0x8C, 0x00, 0x00, 0x02}, {0x8D, 0x00, 0x00, 0x02}, {0x8E, 0x00, 0x00, 0x02}, {0x8F, 0x00, 0x00, 0x02}, {0x90, 0x04, 0x04, 0x02},
+ {0x91, 0x03, 0x03, 0x02}, {0x92, 0x00, 0x00, 0x02}, {0x93, 0x04, 0x04, 0x02}, {0x94, 0x02, 0x02, 0x02}, {0x95, 0x44, 0x44, 0x02},
+ {0x96, 0x71, 0x71, 0x02}, {0x97, 0x12, 0x12, 0x02}, {0x98, 0x00, 0x00, 0x02}
+};
+
+void Elba_RegGet(unsigned char numid, unsigned char *value);
+void Elba_RegBurstGet(unsigned char numid, unsigned char *value, int size, int offset);
+unsigned char Elba_GetRegNumId(unsigned char reg_index);
+
+#endif
diff --git a/marvell/services/audio/libacm/acm/inc/acm_gelato.h b/marvell/services/audio/libacm/acm/inc/acm_gelato.h
new file mode 100644
index 0000000..4313c70
--- /dev/null
+++ b/marvell/services/audio/libacm/acm/inc/acm_gelato.h
@@ -0,0 +1,103 @@
+/*
+* All Rights Reserved
+*
+* MARVELL CONFIDENTIAL
+* Copyright 2012 Marvell International Ltd All Rights Reserved.
+* The source code contained or described herein and all documents related to
+* the source code ("Material") are owned by Marvell International Ltd or its
+* suppliers or licensors. Title to the Material remains with Marvell International Ltd
+* or its suppliers and licensors. The Material contains trade secrets and
+* proprietary and confidential information of Marvell or its suppliers and
+* licensors. The Material is protected by worldwide copyright and trade secret
+* laws and treaty provisions. No part of the Material may be used, copied,
+* reproduced, modified, published, uploaded, posted, transmitted, distributed,
+* or disclosed in any way without Marvell's prior express written permission.
+*
+* No license under any patent, copyright, trade secret or other intellectual
+* property right is granted to or conferred upon you by disclosure or delivery
+* of the Materials, either expressly, by implication, inducement, estoppel or
+* otherwise. Any license under such intellectual property rights must be
+* express and approved by Marvell in writing.
+*
+*/
+
+#ifndef __H_ACM_GELATO__
+#define __H_ACM_GELATO__
+
+#include "acm_ach.h"
+
+#define NUM_OF_REGS (sizeof(reg_cache)/sizeof(reg_cache[0]))
+#define REG_NUMID_BASE 0
+
+typedef struct {
+ unsigned char reg_index;
+ unsigned char reg_default;
+ unsigned short reg_value;
+} GELATO_RegisterCache;
+
+static GELATO_RegisterCache reg_cache[] = {
+ {0x00, 0x00, 0x00}, {0x01, 0x10, 0x10}, {0x02, 0x66, 0x66}, {0x03, 0x10, 0x10},
+ {0x04, 0x06, 0x06}, {0x05, 0x24, 0x24}, {0x06, 0x00, 0x00}, {0x07, 0x00, 0x00},
+ {0x08, 0x40, 0x40}, {0x09, 0x07, 0x07}, {0x0a, 0x55, 0x55}, {0x0b, 0x20, 0x20},
+ {0x0c, 0x0a, 0x0a}, {0x0d, 0x00, 0x00}, {0x0e, 0x00, 0x00}, {0x0f, 0x00, 0x00},
+ {0x10, 0x00, 0x00}, {0x11, 0x01, 0x01}, {0x12, 0x00, 0x00}, {0x13, 0x20, 0x20},
+ {0x14, 0x00, 0x00}, {0x15, 0x00, 0x00}, {0x16, 0x03, 0x03}, {0x17, 0x00, 0x00},
+ {0x18, 0x00, 0x00}, {0x19, 0xFF, 0xFF}, {0x1a, 0x00, 0x00}, {0x1b, 0x00, 0x00},
+ {0x1c, 0x20, 0x20}, {0x1d, 0x00, 0x00}, {0x1e, 0x00, 0x00}, {0x1f, 0x00, 0x00},
+ {0x20, 0x00, 0x00}, {0x21, 0x00, 0x00}, {0x22, 0x00, 0x00}, {0x23, 0xEB, 0xEB},
+ {0x24, 0xEB, 0xEB}, {0x25, 0x01, 0x01}, {0x26, 0x04, 0x04}, {0x27, 0x00, 0x00},
+ {0x28, 0x00, 0x00}, {0x29, 0x80, 0x80}, {0x2a, 0x3F, 0x3F}, {0x2b, 0x00, 0x00},
+ {0x2c, 0x00, 0x00}, {0x2d, 0x21, 0x21}, {0x2e, 0x0C, 0x0C}, {0x2f, 0x00, 0x00},
+ {0x30, 0x00, 0x00}, {0x31, 0x0C, 0x0C}, {0x32, 0x00, 0x00}, {0x33, 0x00, 0x00},
+ {0x34, 0x00, 0x00}, {0x35, 0x00, 0x00}, {0x36, 0x0C, 0x0C}, {0x37, 0x00, 0x00},
+ {0x38, 0x00, 0x00}, {0x39, 0x00, 0x00}, {0x3a, 0x00, 0x00}, {0x3b, 0x0C, 0x0C},
+ {0x3c, 0x00, 0x00}, {0x3d, 0x00, 0x00}, {0x3e, 0x00, 0x00}, {0x3f, 0x00, 0x00},
+ {0x40, 0x0C, 0x0C}, {0x41, 0x00, 0x00}, {0x42, 0x00, 0x00}, {0x43, 0x00, 0x00},
+ {0x44, 0x00, 0x00}, {0x45, 0x0C, 0x0C}, {0x46, 0x00, 0x00}, {0x47, 0x00, 0x00},
+ {0x48, 0x00, 0x00}, {0x49, 0x00, 0x00}, {0x4a, 0x0C, 0x0C}, {0x4b, 0x00, 0x00},
+ {0x4c, 0x00, 0x00}, {0x4d, 0x00, 0x00}, {0x4e, 0x00, 0x00}, {0x4f, 0x0C, 0x0C},
+ {0x50, 0x00, 0x00}, {0x51, 0x00, 0x00}, {0x52, 0xF8, 0xF8}, {0x53, 0x07, 0x07},
+ {0x54, 0x00, 0x00}, {0x55, 0x00, 0x00}, {0x56, 0x10, 0x10}, {0x57, 0x01, 0x01},
+ {0x58, 0x54, 0x54}, {0x59, 0x02, 0x02}, {0x5a, 0xA4, 0xA4}, {0x5b, 0x00, 0x00},
+ {0x5c, 0x88, 0x88}, {0x5d, 0x40, 0x40}, {0x5e, 0x40, 0x40}, {0x5f, 0x40, 0x40},
+ {0x60, 0x40, 0x40}, {0x61, 0x00, 0x00}, {0x62, 0x00, 0x00}, {0x63, 0x00, 0x00},
+ {0x64, 0x00, 0x00}, {0x65, 0x80, 0x80}, {0x66, 0x40, 0x40}, {0x67, 0x40, 0x40},
+ {0x68, 0x00, 0x00}, {0x69, 0x00, 0x00}, {0x6a, 0x00, 0x00}, {0x6b, 0x00, 0x00},
+ {0x6c, 0x00, 0x00}, {0x6d, 0x70, 0x70}, {0x6e, 0x00, 0x00}, {0x6f, 0x00, 0x00}, // 0x6e, 0x6f are reserved
+ {0x70, 0x00, 0x00}, {0x71, 0x00, 0x00}, {0x72, 0x00, 0x00}, {0x73, 0xEB, 0xEB},
+ {0x74, 0xEB, 0xEB}, {0x75, 0x01, 0x01}, {0x76, 0xF8, 0xF8}, {0x77, 0x07, 0x07},
+ {0x78, 0xF4, 0xF4}, {0x79, 0x0B, 0x0B}, {0x7a, 0x00, 0x00}, {0x7b, 0x00, 0x00},
+ {0x7c, 0x10, 0x10}, {0x7d, 0x01, 0x01}, {0x7e, 0x54, 0x54}, {0x7f, 0x02, 0x02},
+ {0x80, 0xA4, 0xA4}, {0x81, 0x00, 0x00}, {0x82, 0x88, 0x88}, {0x83, 0xB0, 0xB0},
+ {0x84, 0x46, 0x46}, {0x85, 0x40, 0x40}, {0x86, 0x40, 0x40}, {0x87, 0x40, 0x40},
+ {0x88, 0x40, 0x40}, {0x89, 0x04, 0x04}, {0x8a, 0x00, 0x00}, {0x8b, 0x00, 0x00},
+ {0x8c, 0x80, 0x80}, {0x8d, 0x3F, 0x3F}, {0x8e, 0x00, 0x00}, {0x8f, 0x00, 0x00},
+ {0x90, 0x21, 0x21}, {0x91, 0x00, 0x00}, {0x92, 0x00, 0x00}, {0x93, 0x00, 0x00},
+ {0x94, 0x00, 0x00}, {0x95, 0x00, 0x00}, {0x96, 0x04, 0x04}, {0x97, 0x7F, 0x7F},
+ {0x98, 0x40, 0x40}, {0x99, 0x40, 0x40}, {0x9a, 0x00, 0x00}, {0x9b, 0x10, 0x10},
+ {0x9c, 0x1A, 0x1A}, {0x9d, 0x7E, 0x7E}, {0x9e, 0x14, 0x14}, {0x9f, 0x3E, 0x3E},
+ {0xa0, 0x00, 0x00}, {0xa1, 0x01, 0x01}, {0xa2, 0x00, 0x00}, {0xa3, 0x00, 0x00},
+ {0xa4, 0x00, 0x00}, {0xa5, 0x3F, 0x3F}, {0xa6, 0x70, 0x70}, {0xa7, 0x00, 0x00},
+ {0xa8, 0x22, 0x22}, {0xa9, 0x00, 0x00}, {0xaa, 0x35, 0x35}, {0xab, 0x00, 0x00},
+ {0xac, 0x00, 0x00}, {0xad, 0x00, 0x00}, {0xae, 0x00, 0x00}, {0xaf, 0x00, 0x00}, // 0xaf is reserved
+ {0xb0, 0x00, 0x00}, {0xb1, 0x00, 0x00}, {0xb2, 0x00, 0x00}, {0xb3, 0x00, 0x00},
+ {0xb4, 0x00, 0x00}, {0xb5, 0x00, 0x00}, {0xb6, 0x00, 0x00}, {0xb7, 0x00, 0x00},
+ {0xb8, 0x04, 0x04}, {0xb9, 0x00, 0x00}, {0xba, 0x00, 0x00}, {0xbb, 0x01, 0x01},
+ {0xbc, 0xA0, 0xA0}, {0xbd, 0x00, 0x00}, {0xbe, 0x00, 0x00}, {0xbf, 0x00, 0x00},
+ {0xc0, 0x00, 0x00}, {0xc1, 0x00, 0x00}, {0xc2, 0x00, 0x00}, {0xc3, 0x00, 0x00},
+ {0xc4, 0x00, 0x00}, {0xc5, 0x00, 0x00}, {0xc6, 0x00, 0x00}, {0xc7, 0x00, 0x00},
+ {0xc8, 0x20, 0x20}, {0xc9, 0x00, 0x00}, {0xca, 0x00, 0x00}, {0xcb, 0x00, 0x00},
+ {0xcc, 0x00, 0x00}, {0xcd, 0x00, 0x00}, {0xce, 0x00, 0x00}, {0xcf, 0x40, 0x00},
+ {0xd0, 0x00, 0x00}, {0xd1, 0x00, 0x00}, {0xd2, 0x00, 0x00}, {0xd3, 0x00, 0x00},
+ {0xd4, 0x65, 0x65}, {0xd5, 0x00, 0x00}, {0xd6, 0x00, 0x00}, {0xd7, 0x00, 0x00},
+ {0xd8, 0x00, 0x00}, {0xd9, 0x00, 0x00}, {0xda, 0x84, 0x84}, {0xdb, 0x80, 0x80},
+ {0xdc, 0x21, 0x21}, {0xdd, 0x17, 0x17}, {0xde, 0x0D, 0x0D}, {0xdf, 0x05, 0x05},
+ {0xe0, 0x4B, 0x4B}, {0xe1, 0x49, 0x49}, {0xe2, 0x30, 0x30}, {0xe3, 0x17, 0x17},
+ {0xe4, 0x23, 0x23}, {0xe5, 0x19, 0x19}, {0xe6, 0x0F, 0x0F}, {0xe7, 0x08, 0x08},
+ {0xe8, 0x4B, 0x4B}, {0xe9, 0x32, 0x32}, {0xea, 0x19, 0x19}, {0xeb, 0x66, 0x66},
+ {0xec, 0x06, 0x06}, {0xed, 0x24, 0x24}, {0xee, 0x00, 0x00}, {0xef, 0x00, 0x00},
+ {0xf0, 0x40, 0x40}, {0xf1, 0x07, 0x07}, {0xf2, 0x00, 0x00}, {0xf3, 0x00, 0x00},
+ {0xf4, 0x00, 0x00}, {0xf5, 0x00, 0x00}, {0xf6, 0x00, 0x00},
+};
+
+#endif
diff --git a/marvell/services/audio/libacm/acm/inc/acm_log.h b/marvell/services/audio/libacm/acm/inc/acm_log.h
new file mode 100644
index 0000000..4c2bf3a
--- /dev/null
+++ b/marvell/services/audio/libacm/acm/inc/acm_log.h
@@ -0,0 +1,55 @@
+/******************************************************************************
+*(C) Copyright 2014 Marvell International Ltd.
+* All Rights Reserved
+******************************************************************************/
+#ifdef PXA1826_AUDIO
+
+#ifndef ACM_LOG_h
+#define ACM_LOG_h
+
+/******************************************************************************
+ * Include files
+ ******************************************************************************/
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <pthread.h>
+
+/******************************************************************************
+ * Prototypes
+ ******************************************************************************/
+
+//extern int __android_log_print(int prio, const char *tag, const char *fmt, ...);
+/******************************************************************************
+ * Define
+ ******************************************************************************/
+#define LOG_BUF_SIZE 1024
+
+/* Android log priority values, in ascending priority order. */
+typedef enum android_LogPriority {
+ ANDROID_LOG_UNKNOWN = 0,
+ ANDROID_LOG_DEFAULT, /* only for SetMinPriority() */
+ ANDROID_LOG_VERBOSE,
+ ANDROID_LOG_DEBUG,
+ ANDROID_LOG_INFO,
+ ANDROID_LOG_WARN,
+ ANDROID_LOG_ERROR,
+ ANDROID_LOG_FATAL,
+ ANDROID_LOG_SILENT, /* only for SetMinPriority(); must be last */
+} android_LogPriority;
+
+#define ALOGD(...) __acm_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)
+#define ALOGE(...) __acm_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)
+#define ALOGI(...) __acm_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)
+#define ALOGV(...) __acm_log_print(ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)
+#define ALOGW(...) __acm_log_print(ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)
+
+#define LOGD(...) __acm_log_print(ANDROID_LOG_DEBUG, LOG_TAG, __VA_ARGS__)
+#define LOGE(...) __acm_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__)
+#define LOGI(...) __acm_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__)
+#define LOGV(...) __acm_log_print(ANDROID_LOG_VERBOSE, LOG_TAG, __VA_ARGS__)
+#define LOGW(...) __acm_log_print(ANDROID_LOG_WARN, LOG_TAG, __VA_ARGS__)
+
+#endif //ACM_LOG_h
+#endif //PXA1826_AUDIO
diff --git a/marvell/services/audio/libacm/acm/inc/acm_nau8810_handle.h b/marvell/services/audio/libacm/acm/inc/acm_nau8810_handle.h
new file mode 100644
index 0000000..ed1075c
--- /dev/null
+++ b/marvell/services/audio/libacm/acm/inc/acm_nau8810_handle.h
@@ -0,0 +1,64 @@
+/*
+ * All Rights Reserved
+ *
+ * MARVELL CONFIDENTIAL
+ * Copyright 2012 Marvell International Ltd All Rights Reserved.
+ * The source code contained or described herein and all documents related to
+ * the source code ("Material") are owned by Marvell International Ltd or its
+ * suppliers or licensors. Title to the Material remains with Marvell International Ltd
+ * or its suppliers and licensors. The Material contains trade secrets and
+ * proprietary and confidential information of Marvell or its suppliers and
+ * licensors. The Material is protected by worldwide copyright and trade secret
+ * laws and treaty provisions. No part of the Material may be used, copied,
+ * reproduced, modified, published, uploaded, posted, transmitted, distributed,
+ * or disclosed in any way without Marvell's prior express written permission.
+ *
+ * No license under any patent, copyright, trade secret or other intellectual
+ * property right is granted to or conferred upon you by disclosure or delivery
+ * of the Materials, either expressly, by implication, inducement, estoppel or
+ * otherwise. Any license under such intellectual property rights must be
+ * express and approved by Marvell in writing.
+ *
+ */
+
+#ifndef __H_ACM_NAU8810_HANDLE__
+#define __H_ACM_NAU8810_HANDLE__
+
+#include "acm_ach.h"
+
+#define NUM_OF_REGS (sizeof(reg_cache)/sizeof(reg_cache[0]))
+#define REG_NUMID_BASE 0
+
+#define NAU8810_ID_REG 0x3F
+
+typedef struct {
+ unsigned char reg_index;
+ unsigned short reg_default;
+ unsigned short reg_value;
+ // Field of reg_prior represent when will this register be reset;
+ // 0x00 --- with this value, the register will not be reset,
+ // 0x01~0xff --- with these values, the register will be reset with ascending sequence;
+ // If someone would like to modify the resetting sequences in the table,
+ // only need to modify this field in reg_cache.
+ unsigned short reg_prior;
+} NAU8810_RegisterCache;
+
+static NAU8810_RegisterCache reg_cache[] = {
+ {0x00, 0x000, 0x000, 0x02}, {0x01, 0x000, 0x000, 0x02}, {0x02, 0x000, 0x000, 0x02}, {0x03, 0x000, 0x000, 0x02}, {0x04, 0x050, 0x050, 0x02},
+ {0x05, 0x000, 0x000, 0x02}, {0x06, 0x000, 0x000, 0x02}, {0x07, 0x000, 0x000, 0x02}, {0x0A, 0x000, 0x000, 0x02}, {0x0B, 0x0FF, 0x0FF, 0x02},
+ {0x0E, 0x100, 0x100, 0x02}, {0x0F, 0x0FF, 0x0FF, 0x02}, {0x12, 0x12C, 0x12C, 0x02}, {0x13, 0x02C, 0x02C, 0x02}, {0x14, 0x02C, 0x02C, 0x02},
+ {0x15, 0x02C, 0x02C, 0x02}, {0x16, 0x02C, 0x02C, 0x02}, {0x18, 0x032, 0x032, 0x02}, {0x19, 0x000, 0x000, 0x02}, {0x1b, 0x000, 0x000, 0x02},
+ {0x1c, 0x000, 0x000, 0x02}, {0x1d, 0x000, 0x000, 0x02}, {0x1e, 0x000, 0x000, 0x02}, {0x20, 0x038, 0x038, 0x02}, {0x21, 0x00B, 0x00B, 0x02},
+ {0x22, 0x032, 0x032, 0x02}, {0x23, 0x000, 0x000, 0x02}, {0x24, 0x008, 0x008, 0x02}, {0x25, 0x00C, 0x00C, 0x02}, {0x26, 0x093, 0x093, 0x02},
+ {0x27, 0x0E9, 0x0E9, 0x02}, {0x28, 0x000, 0x000, 0x02}, {0x2C, 0x003, 0x003, 0x02}, {0x2D, 0x010, 0x010, 0x02}, {0x2F, 0x100, 0x100, 0x02},
+ {0x31, 0x002, 0x002, 0x02}, {0x32, 0x001, 0x001, 0x02}, {0x36, 0x039, 0x039, 0x02}, {0x38, 0x001, 0x001, 0x02}, {0x3A, 0x000, 0x000, 0x02},
+ {0x3B, 0x000, 0x000, 0x02}, {0x3C, 0x020, 0x020, 0x02}, {0x3E, 0x0EF, 0x0EF, 0x02}, {0x3F, 0x01A, 0x01A, 0x02}, {0x40, 0x0CA, 0x0CA, 0x02},
+ {0x41, 0x124, 0x124, 0x02}, {0x45, 0x001, 0x001, 0x02}, {0x46, 0x000, 0x000, 0x02}, {0x47, 0x039, 0x039, 0x02}, {0x49, 0x000, 0x000, 0x02},
+ {0x4B, 0x000, 0x000, 0x02}, {0x4C, 0x000, 0x000, 0x02}, {0x4D, 0x000, 0x000, 0x02}, {0x4E, 0x000, 0x000, 0x02}, {0x4F, 0x000, 0x000, 0x02}
+};
+
+void NAU8810_RegGet(unsigned char numid, unsigned char *value);
+void NAU8810_RegBurstGet(unsigned char numid, unsigned char *value, int size, int offset);
+unsigned char NAU8810_GetRegNumId(unsigned char reg_index);
+
+#endif
diff --git a/marvell/services/audio/libacm/acm/inc/acm_param.h b/marvell/services/audio/libacm/acm/inc/acm_param.h
new file mode 100644
index 0000000..f28c9a9
--- /dev/null
+++ b/marvell/services/audio/libacm/acm/inc/acm_param.h
@@ -0,0 +1,24 @@
+#ifndef __H_ACM_PARAM__
+#define __H_ACM_PARAM__
+#define PATH_LEN 30
+
+typedef enum {
+ ACM_MSA_GAIN,
+ ACM_MSA_GAIN_MODE
+} ACM_ParameterId;
+
+typedef enum {
+ MSA_GAIN_NORMAL_MODE = 0,
+ MSA_GAIN_EXTRA_MODE = 1
+} ACM_MsaGainMode;
+
+typedef struct tag_Msa_Gain {
+ const char *out_path_name;
+ const char *path_name;
+ unsigned char volume;
+ signed char gain, wbGain;
+ signed char sidetone_gain, sidetone_wbGain;
+ unsigned char path_direction;
+} ACM_MsaGain;
+
+#endif
diff --git a/marvell/services/audio/libacm/acm/inc/acm_pianosa.h b/marvell/services/audio/libacm/acm/inc/acm_pianosa.h
new file mode 100644
index 0000000..f7fa004
--- /dev/null
+++ b/marvell/services/audio/libacm/acm/inc/acm_pianosa.h
@@ -0,0 +1,53 @@
+/*
+* All Rights Reserved
+*
+* MARVELL CONFIDENTIAL
+* Copyright 2012 Marvell International Ltd All Rights Reserved.
+* The source code contained or described herein and all documents related to
+* the source code ("Material") are owned by Marvell International Ltd or its
+* suppliers or licensors. Title to the Material remains with Marvell International Ltd
+* or its suppliers and licensors. The Material contains trade secrets and
+* proprietary and confidential information of Marvell or its suppliers and
+* licensors. The Material is protected by worldwide copyright and trade secret
+* laws and treaty provisions. No part of the Material may be used, copied,
+* reproduced, modified, published, uploaded, posted, transmitted, distributed,
+* or disclosed in any way without Marvell's prior express written permission.
+*
+* No license under any patent, copyright, trade secret or other intellectual
+* property right is granted to or conferred upon you by disclosure or delivery
+* of the Materials, either expressly, by implication, inducement, estoppel or
+* otherwise. Any license under such intellectual property rights must be
+* express and approved by Marvell in writing.
+*
+*/
+
+#ifndef __H_ACM_PIANOSA__
+#define __H_ACM_PIANOSA__
+
+#include "acm_ach.h"
+
+#define NUM_OF_REGS (sizeof(reg_cache)/sizeof(reg_cache[0]))
+#define PIANOSA_ID_REG 0
+
+typedef struct {
+ unsigned char reg_index;
+ unsigned char reg_default;
+ unsigned char reg_value;
+// Field of reg_prior represent when will this register be reset;
+// 0x00 --- with this value, the register will not be reset,
+// 0x01~0xff --- with these values, the register will be reset with ascending sequence;
+// If someone would like to modify the resetting sequences in the table,
+// only need to modify this field in reg_cache.
+ unsigned char reg_prior;
+} Pianosa_RegisterCache;
+
+static Pianosa_RegisterCache reg_cache[] = {
+#ifdef CODEC_ELBA
+ {0x48, 0x00, 0x00, 0x01}, {0x61, 0xCE, 0xCE, 0x01}, {0x62, 0x30, 0x30, 0x01}
+#endif
+#ifdef CODEC_GELATO
+ {0x52, 0x00, 0x00, 0x01}
+#endif
+};
+
+#endif
diff --git a/marvell/services/audio/libacm/acm/inc/acm_ustica.h b/marvell/services/audio/libacm/acm/inc/acm_ustica.h
new file mode 100644
index 0000000..09b0dec
--- /dev/null
+++ b/marvell/services/audio/libacm/acm/inc/acm_ustica.h
@@ -0,0 +1,50 @@
+/*
+* All Rights Reserved
+*
+* MARVELL CONFIDENTIAL
+* Copyright 2012 Marvell International Ltd All Rights Reserved.
+* The source code contained or described herein and all documents related to
+* the source code ("Material") are owned by Marvell International Ltd or its
+* suppliers or licensors. Title to the Material remains with Marvell International Ltd
+* or its suppliers and licensors. The Material contains trade secrets and
+* proprietary and confidential information of Marvell or its suppliers and
+* licensors. The Material is protected by worldwide copyright and trade secret
+* laws and treaty provisions. No part of the Material may be used, copied,
+* reproduced, modified, published, uploaded, posted, transmitted, distributed,
+* or disclosed in any way without Marvell's prior express written permission.
+*
+* No license under any patent, copyright, trade secret or other intellectual
+* property right is granted to or conferred upon you by disclosure or delivery
+* of the Materials, either expressly, by implication, inducement, estoppel or
+* otherwise. Any license under such intellectual property rights must be
+* express and approved by Marvell in writing.
+*
+*/
+
+#ifndef __H_ACM_USTICA__
+#define __H_ACM_USTICA__
+
+#include "acm_ach.h"
+
+#define NUM_OF_REGS (sizeof(reg_cache)/sizeof(reg_cache[0]))
+#define USTICA_ID_REG 0
+
+typedef struct {
+ unsigned char reg_index;
+ unsigned char reg_default;
+ unsigned char reg_value;
+// Field of reg_prior represent when will this register be reset;
+// 0x00 --- with this value, the register will not be reset,
+// 0x01~0xff --- with these values, the register will be reset with ascending sequence;
+// If someone would like to modify the resetting sequences in the table,
+// only need to modify this field in reg_cache.
+ unsigned char reg_prior;
+} Ustica_RegisterCache;
+
+static Ustica_RegisterCache reg_cache[] = {
+ {0x48, 0x00, 0x00, 0x01}, {0x49, 0x00, 0x00, 0x01}, {0x4A, 0x00, 0x00, 0x01}, {0x4B, 0x00, 0x00, 0x01}, {0x4C, 0x00, 0x00, 0x01}
+};
+
+unsigned char Ustica_GetRegNumId(unsigned char reg_index);
+
+#endif
diff --git a/marvell/services/audio/libacm/acm/inc/acm_xml_parser.h b/marvell/services/audio/libacm/acm/inc/acm_xml_parser.h
new file mode 100644
index 0000000..b569094
--- /dev/null
+++ b/marvell/services/audio/libacm/acm/inc/acm_xml_parser.h
@@ -0,0 +1,52 @@
+/*
+* All Rights Reserved
+*
+* MARVELL CONFIDENTIAL
+* Copyright 2012 Marvell International Ltd All Rights Reserved.
+* The source code contained or described herein and all documents related to
+* the source code ("Material") are owned by Marvell International Ltd or its
+* suppliers or licensors. Title to the Material remains with Marvell International Ltd
+* or its suppliers and licensors. The Material contains trade secrets and
+* proprietary and confidential information of Marvell or its suppliers and
+* licensors. The Material is protected by worldwide copyright and trade secret
+* laws and treaty provisions. No part of the Material may be used, copied,
+* reproduced, modified, published, uploaded, posted, transmitted, distributed,
+* or disclosed in any way without Marvell's prior express written permission.
+*
+* No license under any patent, copyright, trade secret or other intellectual
+* property right is granted to or conferred upon you by disclosure or delivery
+* of the Materials, either expressly, by implication, inducement, estoppel or
+* otherwise. Any license under such intellectual property rights must be
+* express and approved by Marvell in writing.
+*
+*/
+
+#ifndef __H_ACM_XML_PARSER__
+#define __H_ACM_XML_PARSER__
+
+#include "acm_debug.h"
+#include "acm_aph.h"
+
+static const char *AUDIO_BASIC_ELEMENT_XML = "/system/etc/audio_basic_element";
+static const char *AUDIO_PATH_CONFIG_XML = "/system/etc/audio_path_config";
+static const char *AUDIO_GAIN_CONFIG_XML = "/system/etc/audio_gain_config";
+static const char *AUDIO_COEFF_CONFIG_XML = "/system/etc/audio_coeff_config";
+static const char *AUDIO_PATH_CALIBRATION_XML = "/NVM/audio_path_calibration.xml";
+static const char *AUDIO_GAIN_CALIBRATION_XML = "/NVM/audio_gain_calibration.xml";
+static const char *AUDIO_COEFF_CALIBRATION_XML = "/NVM/audio_coeff_calibration.xml";
+
+//--------------------------------------------------------------
+//-------- Externel XML Parsing APIs
+//--------------------------------------------------------------
+APH_BasicElementsTable *parse_basic_elements(const char *xml_file_name);
+APH_PathConfigurationTable *parse_path_configuration(const char *xml_file_name,
+ APH_BasicElementsTable *basic_info);
+APH_GainConfigurationTable *parse_gain_configuration(const char *xml_file_name,
+ APH_BasicElementsTable *basic_info,
+ APH_PathConfigurationTable *path_info);
+APH_CoeffConfigurationTable *parse_coeff_configuration(const char *xml_file_name,
+ APH_BasicElementsTable *basic_info,
+ APH_PathConfigurationTable *path_info);
+APH_EQCoeffConfigurationTable *parse_eqcoeff_configuration(const char *xml_file_name,
+ APH_BasicElementsTable *basic_info);
+#endif
diff --git a/marvell/services/audio/libacm/acm/inc/adsp_ve.h b/marvell/services/audio/libacm/acm/inc/adsp_ve.h
new file mode 100644
index 0000000..9a0e421
--- /dev/null
+++ b/marvell/services/audio/libacm/acm/inc/adsp_ve.h
@@ -0,0 +1,178 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Driver for Audio DSP.
+ *
+ * Copyright (C) 2022 ASRMicro
+ *
+ * Author: Yjg Wang <yjgwang@asrmicro.com>
+ */
+
+
+/******************************************************************************
+* MODULE IMPLEMENTATION FILE
+*******************************************************************************
+* Title: Header for ADSP in AP subsystem
+*
+* Filename: adsp_ve.h
+*
+* Authors: Yjg Wang
+*
+* Description: Header file for ADSP VE.
+*
+* Last Updated:
+*
+* Notes:
+******************************************************************************/
+#ifndef _ADSP_VE_H_
+#define _ADSP_VE_H_
+
+#define MAX_MUSIC_STREAM_NUM 6
+
+typedef signed short Word16;
+typedef unsigned short UWord16;
+
+//ICAT EXPORTED STRUCT
+typedef struct {
+ Word16 SampleDelay; // reference delay to echo
+ Word16 EchoLenInMs; // Fir filter length
+ Word16 ConvergenceSpeed; // slowdown
+ Word16 Ref2EchoPowerRatio; // ratio of ref to echo, [-12 ~30]db, decimal number
+} EcParamsStruct;
+
+//ICAT EXPORTED STRUCT
+typedef struct {
+ Word16 BoostGainDb; //
+ Word16 PeakGainDb;
+ Word16 BoostNoiseGainDb;
+ Word16 BoostRelease;
+ Word16 Reserved0;
+ Word16 Reserved1;
+} AgcParametersT;
+
+//ICAT EXPORTED STRUCT
+typedef struct {
+ UWord16 MASK;
+ Word16 EqCoff[7][6]; // a[0], a[1], a[2], b[0], b[1], b[2]
+} BiQuadCoeffT;
+
+// following is ns parametes typedef
+//ICAT EXPORTED STRUCT
+typedef struct {
+ Word16 MaxSuppressDb; // [-40 0)db.
+ Word16 PeakNoiseDb; // [-70 -12)db.
+ Word16 NoiseMatrix; // following is expert parameters
+ Word16 RnnParm;
+} NsParamsT; //noise suppression para, for both TX&RX
+
+//ICAT EXPORTED STRUCT
+typedef struct {
+ Word16 Enabled;
+ NsParamsT NsParams;
+}NSConfigT;
+
+//ICAT EXPORTED STRUCT
+typedef struct {
+ Word16 Enabled;
+ BiQuadCoeffT EqParams;
+}EQCongfigT;
+
+//ICAT EXPORTED STRUCT
+typedef struct {
+ Word16 Enabled;
+ AgcParametersT AgcParams;
+}AgcCongT;
+
+//ICAT EXPORTED STRUCT
+typedef struct {
+ Word16 Enabled;
+ EcParamsStruct EcParams;
+}EcConfigT;
+
+//ICAT EXPORTED STRUCT
+typedef struct {
+ Word16 Rnn0;
+ Word16 Rnn1;
+ Word16 Rnn2;
+ Word16 Rnn3;
+} RnnParamsT; //noise suppression para, for both TX&RX
+
+//ICAT EXPORTED STRUCT
+typedef struct { // res parameters
+ Word16 ResMode;
+ Word16 DtGainDb;
+ Word16 FestGainDb;
+ Word16 NoiseFloorDbov;
+ Word16 CnGaindb;
+ Word16 DtThresh;
+ Word16 Gamma;
+ //following is expert paramters
+ Word16 AuditoryMasking;
+ Word16 NonlinearModel;
+ Word16 WinitCntThresh;
+ Word16 EstResMatrix;
+ Word16 reserved;
+} NsResParamsT;
+
+//ICAT EXPORTED STRUCT
+typedef struct {
+ NsParamsT NsParams;
+ RnnParamsT NNParams;
+ NsResParamsT ResParams;
+} NsTxParamsT; //TX only
+
+//ICAT EXPORTED STRUCT
+typedef struct
+{ Word16 Enabled;
+ NsTxParamsT NsParamsTx; }NsTxConfigT;
+
+//VoiceStreamRX Parameters
+//ICAT EXPORTED STRUCT
+typedef struct {
+ NSConfigT NSRxConfig;
+ EQCongfigT EqConfig;
+ AgcCongT AgcConfig;
+ Word16 Gain; //need tool to compute 0x2000 is 0dB, 0x4000 6dB,
+ Word16 Reserved[4];
+}VeRxControlT;
+
+//VoiceStreamTX & Record Stream parameters
+//ICAT EXPORTED STRUCT
+typedef struct {
+ short DCFactor;
+ EcConfigT EcConfig;
+ NsTxConfigT NsTxConfig;
+ EQCongfigT EqConfig;
+ AgcCongT AgcConfig;
+ Word16 Gain; //need tool to compute 0x2000 is 0dB, 0x4000 6dB,
+ Word16 Reserved[4];
+}VeTxControlT;
+
+//ICAT EXPORTED STRUCT
+typedef struct {
+ EQCongfigT EqConfig;
+ AgcCongT AgcConfig;
+ Word16 Gain; //need tool to compute 0x2000 is 0dB, 0x4000 6dB,
+ Word16 Reserved[4];
+}MusicStreamControlT;
+
+/*important notes:
+ EnhanceParmsT reside in shared memory
+
+ */
+//ICAT EXPORTED STRUCT
+typedef struct {
+ short Profile; //Handset, headset, handfree, BT
+ VeRxControlT VoiceParmRX[3]; //VoiceStreamRx 8k,16, 32k rate
+ VeTxControlT VoiceParmTX[3]; //VoiceStreamTx 8k,16, 32k rate
+
+}VoiceParmsT;
+
+//ICAT EXPORTED STRUCT
+typedef struct {
+ MusicStreamControlT MusicParms[MAX_MUSIC_STREAM_NUM]; //musicstream parms
+ VoiceParmsT VoiceParms;
+ VeTxControlT RecordParms; //RecordStream, need only one rate
+ VeRxControlT FmStreamParm; // reserved for future usage ,need ns, drc, eq@32k
+}EnhanceParmsT;
+
+#endif //#define _ADSP_VE_H_
diff --git a/marvell/services/audio/libacm/acm/inc/audioCalibration.h b/marvell/services/audio/libacm/acm/inc/audioCalibration.h
new file mode 100644
index 0000000..ab7e2fb
--- /dev/null
+++ b/marvell/services/audio/libacm/acm/inc/audioCalibration.h
@@ -0,0 +1,139 @@
+/*
+* All Rights Reserved
+*
+* MARVELL CONFIDENTIAL
+* Copyright 2012 Marvell International Ltd All Rights Reserved.
+* The source code contained or described herein and all documents related to
+* the source code ("Material") are owned by Marvell International Ltd or its
+* suppliers or licensors. Title to the Material remains with Marvell International Ltd
+* or its suppliers and licensors. The Material contains trade secrets and
+* proprietary and confidential information of Marvell or its suppliers and
+* licensors. The Material is protected by worldwide copyright and trade secret
+* laws and treaty provisions. No part of the Material may be used, copied,
+* reproduced, modified, published, uploaded, posted, transmitted, distributed,
+* or disclosed in any way without Marvell's prior express written permission.
+*
+* No license under any patent, copyright, trade secret or other intellectual
+* property right is granted to or conferred upon you by disclosure or delivery
+* of the Materials, either expressly, by implication, inducement, estoppel or
+* otherwise. Any license under such intellectual property rights must be
+* express and approved by Marvell in writing.
+*
+*/
+
+#ifndef DIAG_AUDIO_H
+#define DIAG_AUDIO_H
+#define AC_TEST
+#include <sys/socket.h>
+#include <sys/un.h>
+
+#if 0
+
+#ifndef AUDIO_CALIBRATION_DIR
+#define AUDIO_CALIBRATION_DIR "/data/misc/audio"
+#endif
+
+#endif
+
+#define AUDIO_CALIBRATION_DIR "/system/etc"
+
+#define ACM_CALIBRATION_SOCKET AUDIO_CALIBRATION_DIR "/audio_calibration_ACM"
+#define NVM_CALIBRATION_SOCKET AUDIO_CALIBRATION_DIR "/nvm_calibration_ACM"
+
+#define QLEN 10
+//#define AC_BUFFER_SIZE 16384
+#define AC_BUFFER_SIZE 52
+#define PATH_STATUS_SIZE 6
+#define XML_APPENDIX_SIZE 3
+#define PHY_VERSION_LEN 36
+#define SW_VERSION_LEN 36
+
+typedef enum
+{
+ AUDIO_PHY_GetVersion = 0x01,
+ AUDIO_PHY_GetCurrentConfigure,
+ AUDIO_PHY_GetGainConfigure,
+ AUDIO_PHY_GetPathList,
+ AUDIO_PHY_GetPathStatus,
+ AUDIO_PHY_GetAudioMode,
+ AUDIO_PHY_ReloadCalibrationData,
+ AUDIO_PHY_SetPathVolume,
+ AUDIO_PHY_EnablePath,
+ AUDIO_PHY_DisablePath,
+ AUDIO_PHY_MutePath,
+ AUDIO_PHY_SwitchPath,
+ AUDIO_PHY_SendVEtoADSP,
+ AUDIO_NVM_GetGainConfigure,
+ AUDIO_NVM_GetVEConfigure,
+ AUDIO_NVM_ReloadCalibrationData,
+
+ AUDIO_SW_GetGainConfigure = 0x91,
+ AUDIO_SW_GetPathStatus,
+ AUDIO_SW_ReloadCalibrationData,
+ AUDIO_SW_SetVolume,
+ AUDIO_SW_MutePath,
+ AUDIO_SW_GetVersion,
+
+ AUDIO_AE_ReloadCalibrationData = 0x100,
+
+ AUDIO_AE_SendCmd = 0x200, // For voip AEC calibration
+ AUDIO_AE_GetDeviceStatus,
+ AUDIO_AE_ReloadFDI,
+ AUDIO_AE_GetCurrentProfile,
+ AUDIO_AE_GetVersion,
+} AC_IPC_Type;
+
+typedef struct
+{
+ unsigned short d1;
+ unsigned short d2;
+ unsigned short d3;
+ unsigned short d4;
+ uint32_t d5;
+ uint32_t d6;
+ uint32_t d7;
+ uint32_t d8;
+} AC_IPC_Package_Body;
+
+typedef struct {
+ AC_IPC_Type type;
+ AC_IPC_Package_Body body;
+ void *ptr;
+} AC_IPC_Package;
+
+typedef struct {
+ unsigned int ac_version;
+ char ac_xml_appendix[XML_APPENDIX_SIZE];
+} AC_CONFIG_VERSION;
+
+typedef struct {
+ unsigned char path_direction_Rx;
+ signed int digital_gain_Rx;
+ unsigned char volume_Rx;
+
+ unsigned char path_direction_Tx;
+ signed int digital_gain_Tx;
+ unsigned char volume_Tx;
+
+ unsigned char path_direction_SideTone;
+ signed int digital_gain_SideTone;
+ unsigned char volume_SideTone;
+} AC_Digital_Gain;
+
+typedef struct {
+ AC_Digital_Gain gain;
+ unsigned char status;
+} AC_Digital_Gain_Status;
+
+/* ICAT Exported Functions */
+void PHY_GetVersion(void); //Audio, ACM, AUDIO_PHY_GetVersion
+void PHY_GetCurrentConfigure(void); //Audio, ACM, AUDIO_PHY_GetCurrentConfigure
+void PHY_GetGainConfigure(void); //Audio, ACM, AUDIO_PHY_GetGainConfigure
+void PHY_GetPathStatus(void); //Audio, ACM, AUDIO_PHY_GetPathStatus
+void PHY_ReloadCalibrationData(void); //Audio, ACM, AUDIO_PHY_ReloadCalibrationData
+void PHY_SetPathVolume(void *data); //Audio, ACM, AUDIO_PHY_SetPathVolume
+void PHY_EnablePath(void *data); //Audio, ACM, AUDIO_PHY_EnablePath
+void PHY_DisablePath(void *data); //Audio, ACM, AUDIO_PHY_DisablePath
+void PHY_MutePath(void *data); //Audio, ACM, AUDIO_PHY_MutePath
+void PHY_SwitchPath(void *data); //Audio, ACM, AUDIO_PHY_SwitchPath
+#endif /*DIAG_AUDIO_H */
diff --git a/marvell/services/audio/libacm/acm/inc/audio_dsp.h b/marvell/services/audio/libacm/acm/inc/audio_dsp.h
new file mode 100644
index 0000000..721ebcd
--- /dev/null
+++ b/marvell/services/audio/libacm/acm/inc/audio_dsp.h
@@ -0,0 +1,102 @@
+/******************************************************************************
+*
+* (C)Copyright 2022 ASRMicro. All Rights Reserved.
+*
+* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF ASRMicro.
+* The copyright notice above does not evidence any actual or intended
+* publication of such source code.
+* This Module contains Proprietary Information of ASRMicro and should be
+* treated as Confidential.
+* The information in this file is provided for the exclusive use of the
+* licensees of ASRMicro.
+* Such users have the right to use, modify, and incorporate this code into
+* products for purposes authorized by the license agreement provided they
+* include this notice and the associated copyright notice with any such
+* product.
+* The information in this file is provided "AS IS" without warranty.
+*
+******************************************************************************/
+
+
+/******************************************************************************
+* MODULE IMPLEMENTATION FILE
+*******************************************************************************
+* Title: APIs in use spacer for ADSP in AP subsystem
+*
+* Filename: audio_dsp.h
+*
+* Authors: Yjg Wang
+*
+* Description: Header file for ADSP.
+*
+* Last Updated:
+*
+* Notes:
+******************************************************************************/
+
+
+/******************************************************************************
+* Macro definitions
+******************************************************************************/
+#ifndef __AUDIO_DSP_H__
+#define __AUDIO_DSP_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef TARGET_mmp_asr1901_KSTR901
+
+
+/******************************************************************************
+* Include files
+******************************************************************************/
+#include "AuC.h"
+
+
+/******************************************************************************
+* Macro definitions
+******************************************************************************/
+#define VOICE_START_COMMAND_LENGTH 7
+#define ADSP_SET_COMMAND_LENGTH 32
+
+
+/******************************************************************************
+* Data structure definitions
+******************************************************************************/
+typedef struct {
+ unsigned short opCode;
+ unsigned short cmdLength;
+ unsigned short *cmdData;
+}IPC_Command;
+
+
+/******************************************************************************
+* Global function definitions
+******************************************************************************/
+extern int audio_dsp_init(void);
+extern int audio_dsp_enable(void);
+extern int audio_dsp_disable(void);
+extern void audio_dsp_exit(void);
+extern int audio_dsp_set(char *cmd);
+extern int audio_dsp_send_ve(void *ve);
+extern int audio_dsp_dump_full_ddr(unsigned int val);
+extern int vpathStart(unsigned int voiceControl,
+ unsigned short voiceAuxMode,
+ unsigned short vocoderType,
+ unsigned short encoderMode,
+ unsigned short voiceTestControl,
+ unsigned short dtxFlag);
+extern int vpathStop(void);
+
+
+/******************************************************************************
+* End
+******************************************************************************/
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif //__AUDIO_DSP_H__
diff --git a/marvell/services/audio/libacm/acm/inc/audio_pa.h b/marvell/services/audio/libacm/acm/inc/audio_pa.h
new file mode 100644
index 0000000..853c9cc
--- /dev/null
+++ b/marvell/services/audio/libacm/acm/inc/audio_pa.h
@@ -0,0 +1,61 @@
+/******************************************************************************
+*
+* (C)Copyright 2022 ASRMicro. All Rights Reserved.
+*
+* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF ASRMicro.
+* The copyright notice above does not evidence any actual or intended
+* publication of such source code.
+* This Module contains Proprietary Information of ASRMicro and should be
+* treated as Confidential.
+* The information in this file is provided for the exclusive use of the
+* licensees of ASRMicro.
+* Such users have the right to use, modify, and incorporate this code into
+* products for purposes authorized by the license agreement provided they
+* include this notice and the associated copyright notice with any such
+* product.
+* The information in this file is provided "AS IS" without warranty.
+*
+******************************************************************************/
+
+
+/******************************************************************************
+* Macro definitions
+******************************************************************************/
+#ifndef __AUDIO_PA_H__
+#define __AUDIO_PA_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+/******************************************************************************
+* Data structure definitions
+******************************************************************************/
+typedef enum {
+ AUDIO_PA_NONE = 0,
+ AUDIO_PA_VOICE,
+ AUDIO_PA_MEDIA,
+ AUDIO_PA_ALL,
+
+ AUDIO_PA_CNT
+} AUDIO_PA_TYPE;
+
+
+/******************************************************************************
+* Global function definitions
+******************************************************************************/
+extern int audio_pa_init(void);
+extern int audio_pa_enable(AUDIO_PA_TYPE type);
+extern int audio_pa_disable(AUDIO_PA_TYPE type);
+extern void audio_pa_exit(void);
+
+
+/******************************************************************************
+* End
+******************************************************************************/
+#ifdef __cplusplus
+}
+#endif
+
+#endif //__AUDIO_PA_H__
\ No newline at end of file
diff --git a/marvell/services/audio/libacm/acm/inc/audio_protocol.h b/marvell/services/audio/libacm/acm/inc/audio_protocol.h
new file mode 100644
index 0000000..cbbea73
--- /dev/null
+++ b/marvell/services/audio/libacm/acm/inc/audio_protocol.h
@@ -0,0 +1,82 @@
+#ifndef __AUDIO_PROTOCOL_H__
+#define __AUDIO_PROTOCOL_H__
+
+#include <stdint.h>
+
+// Audio path handler clients
+#define INVALID_CLIENT_TYPE 0xFFFFFFFF
+#define HIFI_CLIENT 0x00000001
+#define VOICE_CLIENT 0x00000002
+#define PHONE_CLIENT 0x00000003
+#define FMRADIO_CLIENT 0x00000004
+#define VOIP_CLIENT 0x00000005
+#define VT_CLIENT 0x00000006
+
+// Plugin operation methods
+#define PLUGIN_CTL_WRITE 0x00000001
+#define PLUGIN_CTL_READ 0x00000002
+#define PLUGIN_PCM_WRITE 0x00000003
+#define PLUGIN_PCM_READ 0x00000004
+
+// Audio path operation methods
+#define INVALID_METHOD_ID 0xFFFFFFFF
+#define METHOD_ENABLE 0x00000001
+#define METHOD_DISABLE 0x00000002
+#define METHOD_MUTE 0x00000003
+#define METHOD_VOLUME_SET 0x00000004
+#define METHOD_SWITCH 0x00000005
+#define METHOD_GET_MSA_GAIN 0x0000000f
+
+// amixer ctl devices
+#define INVALID_DEVICE 0xFFFFFFFF
+#define EARPIECE_DEVICE 0x00000001
+#define SPEAKER_DEVICE 0x00000002
+#define BLUETOOTH_DEVICE 0x00000003
+#define HEADSET_DEVICE 0x00000004
+#define HEADPHONE_DEVICE 0x00000008
+#define BT_NREC_DEVICE 0x00000009
+#define FORCE_SPEAKER_DEVICE 0x0000000a
+
+/*amixer ctl value (32bit)
+----------------------------------------------------------
+| Bit | Description
+----------------------------------------------------------
+|31~29 | reserved
+| 28 | 1:voip/vt WB 0:voip/vt NB
+| 27 | 1:Extra volume path 0:default path
+| 26 | 1:sidetone enable, 0:sidetone disable
+| 25 | 1:loopback enable, 0:loopback disable
+| 24 | 1:codec rate is 16 kHz, 0:codec rate is 8 kHz
+| 23 | EC path enable
+| 22 | 1:mic2 is used, 0:mic2 is not used
+| 21 | 1:mic1 is used, 0:mic1 is not used
+| 20 | 1:stereo speaker, 0:mono speaker
+| 19 | 1:built-in mic is DMIC, 0:built-in mic is AMIC
+| 18 | 1:codec mode is slave, 0:codec mode is master
+| 17 | path direction is input
+| 16 | path direction is output
+| 15:0 | path volume
+----------------------------------------------------------
+*/
+#define OUTPUT 0x00010000
+#define INPUT 0x00020000
+#define CODEC_SLAVE 0x00040000
+#define USE_DMIC 0x00080000
+#define STEREO_SPKR 0x00100000
+#define USE_MIC1 0x00200000
+#define USE_MIC2 0x00400000
+#define ECENABLE 0x00800000
+#define CODEC_RATE_WB 0x01000000
+#define LOOPBACKTEST 0x02000000
+#define SIDETONE 0x04000000
+/* increase the voice call volume */
+#define EXTRA_VOLUME 0x08000000
+#define VOIP_WB 0x10000000
+#define VT_WB 0x10000000
+#define RECOGNITION 0x20000000
+#define CODEC_LOOPTEST 0x40000000
+
+#define VOLUME_MASK 0x0000ffff
+#define PARAM_MASK 0xffff0000
+
+#endif