blob: ab7e2fb1c0f09ca5f25386375726a548cf6a5745 [file] [log] [blame]
/*
* 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 */