blob: b20c65111a5b0e63bd00a5b7119777576ade12df [file] [log] [blame]
/*
* ASR Audio path definition of PM812
*
* Copyright (C) 2018 ASR Microelectronic Ltd.
*
* Author: Jackie Fan <yuanchunfan@asrmicro.com>
*
* This file contains proprietary information.
* No dissemination allowed without prior written permission from
* ASR Microelectronic Ltd.
*
* File Description:
*
* This file contains header for audio path definition of PM812
*/
#ifndef ACM_PM812_H
#define ACM_PM812_H
/*
* CODEC_PM812: Audio use SAI1
*/
#define SAI1_REG31_VALUE 0x49 //HiFi use SAI1: 44.1KHz,32fs
/*
* CODEC_PM812: Voice use SAI2
*/
#define CODEC_PM812_VOICE_REG35 0x35
#define CODEC_PM812_VOICE_MASTER 0x0d //16bits, one bit shift, master
#define CODEC_PM812_VOICE_SLAVE 0x0c //16bits, one bit shift, slave
#define CODEC_PM812_VOICE_REG36 0x36
#define CODEC_PM812_VOICE_WB 0xa1 //16KHz,32fs
#define CODEC_PM812_VOICE_NB 0x81 //8KHz,32fs
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
/////////////////////////APH_PATH_ID_HIFIPLAYTOEARPHONE//////////////////////////
ACMAPH_Register ACM_HiFiPlayToEarphone_Disable[]={
{ELBA, 0x29, 0x00},{ELBA, 0x90, 0x00},{ELBA, 0x30, 0x0},{ELBA, 0x31, SAI1_REG31_VALUE},{ELBA, 0x32, 0x0},{ELBA, 0x52, 0x00},{ELBA, 0x51, 0x15},
{ELBA, 0x50, 0},{ELBA, 0x55, 0x0}
};
ACMAPH_Register ACM_HiFiPlayToEarphone_Enable[]={
{ELBA, 0x90, 0x7e},{ELBA, 0x30, 0xf},{ELBA, 0x31, SAI1_REG31_VALUE},{ELBA, 0x32, 0x4},{ELBA, 0x52, 0x00},{ELBA, 0x51, 0x15},
{ELBA, 0x50, 0xf},{ELBA, 0x55, 0x20},{ELBA, 0x29, 0xb},{ELBA, 0x56, 0xb4}
};
/////////////////////////APH_PATH_ID_HIFIPLAYTOSPKR//////////////////////////
ACMAPH_Register ACM_HiFiPlayToSPKR_Disable[]={
{ELBA, 0x20, 0},{ELBA, 0x21, 0},{ELBA, 0x53, 0x0},{ELBA, 0x30, 0},{ELBA, 0x31, 0},{ELBA, 0x32, 0},
{ELBA, 0x51, 0},{ELBA, 0x50, 0},{ELBA, 0x55, 0x0},{USTICA, 0x48, 0x0},{USTICA, 0x4a, 0x70},{USTICA, 0x4b, 0x0}
};
ACMAPH_Register ACM_HiFiPlayToSPKR_Enable[]={
{ELBA, 0x31, SAI1_REG31_VALUE},{ELBA, 0x30, 0xf},{ELBA, 0x32, 0x4},{ELBA, 0x51, 0x15},{ELBA, 0x55, 0x20},{ELBA, 0x58, 0xb7},
{ELBA, 0x50, 0xf},{ELBA, 0x53, 0x00},{ELBA, 0x21, 0x40},{ELBA, 0x20, 0xc1},{USTICA, 0x48, 0xe0},{USTICA, 0x4a, 0x70},{USTICA, 0x4b, 0x7}
};
/////////////////////////APH_PATH_ID_HIFIPLAYTOHP//////////////////////////
ACMAPH_Register ACM_HiFiPlayToHP_Disable[]={
{ELBA, 0x90, 0},{ELBA, 0x26, 0},{ELBA, 0x30, 0},{ELBA, 0x31, 0},{ELBA, 0x32, 0},
{ELBA, 0x52, 0x00},{ELBA, 0x51, 0},{ELBA, 0x50, 0},{ELBA, 0x55, 0}
};
ACMAPH_Register ACM_HiFiPlayToHP_Enable[]={
{ELBA, 0x28, 0x0},{ELBA, 0x90, 0x7e},{ELBA, 0x30, 0xf},{ELBA, 0x31, SAI1_REG31_VALUE},{ELBA, 0x32, 0x4},{ELBA, 0x52, 0x00},{ELBA, 0x51, 0x15},
{ELBA, 0x50, 0xf},{ELBA, 0x55, 0x20},{ELBA, 0x56, 0x9b},{ELBA, 0x57, 0x9b},{ELBA, 0x26, 0x2b}
};
/////////////////////////APH_PATH_ID_HIFIRECORDFROMMIC1//////////////////////////
ACMAPH_Register ACM_HiFiRecordFromMic1_Disable[]={
{ELBA, 0x51, 0},{ELBA, 0x16, 0},{ELBA, 0x10, 0x14},{ELBA, 0x11, 0},{ELBA, 0x92, 0},{ELBA, 0x94, 0x3},{ELBA, 0x30, 0},
{ELBA, 0x31, SAI1_REG31_VALUE},{ELBA, 0x32, 0x0},{ELBA, 0x50, 0},{ELBA, 0x3c, 0}
};
ACMAPH_Register ACM_HiFiRecordFromMic1_Enable[]={
{ELBA, 0x11, 0x00},{ELBA, 0x12, 0x14},{ELBA, 0x16, 0x1},{ELBA, 0x10, 0x14},{ELBA, 0x92, 0x56},{ELBA, 0x94, 0x3},{ELBA, 0x30, 0xf},{ELBA, 0x31, SAI1_REG31_VALUE},
{ELBA, 0x32, 0x04},{ELBA, 0x3c, 0},{ELBA, 0x50, 0xf},{ELBA, 0x51, 0x15},
};
ACMAPH_Register ACM_HiFiRecordFromMic1_Mute[]={
{ELBA, 0x11, 0x03},
};
ACMAPH_Register ACM_HiFiRecordFromMic1_UnMute[]={
{ELBA, 0x11, 0x00},
};
/////////////////////////APH_PATH_ID_HIFIRECORDFROMHSMIC//////////////////////////
ACMAPH_Register ACM_HiFiRecordFromHsMic_Disable[]={
{ELBA, 0x51, 0},{ELBA, 0x16, 0},{ELBA, 0x10, 0x14},{ELBA, 0x11, 0},{ELBA, 0x92, 0},{ELBA, 0x94, 0x2},{ELBA, 0x30, 0},
{ELBA, 0x31, SAI1_REG31_VALUE},{ELBA, 0x32, 0x0},{ELBA, 0x50, 0},{ELBA, 0x3c, 0}
};
ACMAPH_Register ACM_HiFiRecordFromHsMic_Enable[]={
{ELBA, 0x11, 0x01},{ELBA, 0x12, 0x14},{ELBA, 0x16, 0x9},{ELBA, 0x10, 0x14},{ELBA, 0x92, 0x56},{ELBA, 0x94, 0x1},{ELBA, 0x30, 0xf},{ELBA, 0x31, SAI1_REG31_VALUE},
{ELBA, 0x32, 0x04},{ELBA, 0x3c, 0},{ELBA, 0x50, 0xf},{ELBA, 0x51, 0x15},
};
ACMAPH_Register ACM_HiFiRecordFromHsMic_Mute[]={
{ELBA, 0x11, 0x02},
};
ACMAPH_Register ACM_HiFiRecordFromHsMic_UnMute[]={
{ELBA, 0x11, 0x01},
};
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
/////////////////////////APH_PATH_ID_VOICEPLAYTOEARPHONE//////////////////////////
ACMAPH_Register ACM_VoicePlayToEarphone_Disable[]={
{ELBA, 0x29, 0},{ELBA, 0x90, 0x7e},{ELBA, 0x35, 0},{ELBA, 0x36, 0},{ELBA, 0x37, 0},{ELBA, 0x38, 0},{ELBA, 0x39, 0},
{ELBA, 0x52, 0x22},{ELBA, 0x51, 0},{ELBA, 0x50, 0},{ELBA, 0x55, 0x0}
};
ACMAPH_Register ACM_VoicePlayToEarphone_Enable[]={
{ELBA, 0x90, 0x7e},{ELBA, 0x35, CODEC_PM812_VOICE_MASTER},{ELBA, 0x36, CODEC_PM812_VOICE_WB},{ELBA, 0x37, 0x2},{ELBA, 0x38, 0x00},{ELBA, 0x39, 0x10},{ELBA, 0x52, 0x22},
{ELBA, 0x51, 0x2a},{ELBA, 0x50, 0xf},{ELBA, 0x55, 0x20},{ELBA, 0x29, 0x0b},{ELBA, 0x56, 0xb7}
};
/////////////////////////APH_PATH_ID_VOICEPLAYTOSPKR//////////////////////////
ACMAPH_Register ACM_VoicePlayToSPKR_Disable[]={
{ELBA, 0x53, 0},{ELBA, 0x20, 0},{ELBA, 0x21, 0},{ELBA, 0x90, 0x7e},{ELBA, 0x35, 0},{ELBA, 0x36, 0},{ELBA, 0x37, 0},
{ELBA, 0x51, 0},{ELBA, 0x50, 0},{ELBA, 0x55, 0x0},{USTICA, 0x48, 0},{USTICA, 0x4a, 0x70},{USTICA, 0x4b, 0}
};
ACMAPH_Register ACM_VoicePlayToSPKR_Enable[]={
{ELBA, 0x90, 0x7e},{ELBA, 0x35, CODEC_PM812_VOICE_MASTER},{ELBA, 0x36, CODEC_PM812_VOICE_WB},{ELBA, 0x37, 0x2},{ELBA, 0x38, 0x0},{ELBA, 0x39, 0x10},{ELBA, 0x53, 0x20},
{ELBA, 0x51, 0x2a},{ELBA, 0x50, 0xf},{ELBA, 0x55, 0x20},{ELBA, 0x21, 0x40},{ELBA, 0x20, 0xc1},{ELBA, 0x58, 0x97},{USTICA, 0x48, 0xe0},{USTICA, 0x4a, 0x70},{USTICA, 0x4b, 0x7}
};
/////////////////////////APH_PATH_ID_VOICEPLAYTOHP//////////////////////////
ACMAPH_Register ACM_VoicePlayToHP_Disable[]={
{ELBA, 0x26, 0},{ELBA, 0x90, 0x7e},{ELBA, 0x35, 0},{ELBA, 0x36, 0},{ELBA, 0x37, 0},{ELBA, 0x38, 0},{ELBA, 0x39, 0},
{ELBA, 0x52, 0x22},{ELBA, 0x51, 0},{ELBA, 0x50, 0},{ELBA, 0x55, 0}
};
ACMAPH_Register ACM_VoicePlayToHP_Enable[]={
{ELBA, 0x28, 0x0},{ELBA, 0x90, 0x7e},{ELBA, 0x35, CODEC_PM812_VOICE_MASTER},{ELBA, 0x36, CODEC_PM812_VOICE_WB},{ELBA, 0x37, 0x2},{ELBA, 0x38, 0},{ELBA, 0x39, 0},{ELBA, 0x52, 0x22},
{ELBA, 0x50, 0xf},{ELBA, 0x55, 0x20},{ELBA, 0x26, 0x2b},{ELBA, 0x56, 0x9b},{ELBA, 0x57, 0x9b},{ELBA, 0x51, 0x2a},
};
/////////////////////////APH_PATH_ID_VOICERECORDFROMMIC1//////////////////////////
ACMAPH_Register ACM_VoiceRecordFromMic1_Disable[]={
{ELBA, 0x12, 0},{ELBA, 0x51, 0},{ELBA, 0x16, 0},{ELBA, 0x92, 0},{ELBA, 0x94, 0x2},{ELBA, 0x10, 0x14},{ELBA, 0x11, 0},{ELBA, 0x3d, 0x1},
{ELBA, 0x50, 0},{ELBA, 0x35, 0},{ELBA, 0x36, 0},{ELBA, 0x37, 0}, {ELBA, 0x38, 0},
};
ACMAPH_Register ACM_VoiceRecordFromMic1_Enable[]={
{ELBA, 0x11, 0x00},{ELBA, 0x16, 0x1},{ELBA, 0x92, 0x56},{ELBA, 0x94, 0x1},{ELBA, 0x10, 0x14},{ELBA, 0x35, CODEC_PM812_VOICE_MASTER},{ELBA, 0x36, CODEC_PM812_VOICE_WB},
{ELBA, 0x37, 0x2},{ELBA, 0x38, 0},{ELBA, 0x3d, 0x1},{ELBA, 0x50, 0xf},{ELBA, 0x51, 0x2a}
};
ACMAPH_Register ACM_VoiceRecordFromMic1_Mute[]={
{ELBA, 0x11, 0x3},
};
ACMAPH_Register ACM_VoiceRecordFromMic1_UnMute[]={
{ELBA, 0x11, 0x00},
};
/////////////////////////APH_PATH_ID_VOICERECORDFROMHSMIC//////////////////////////
ACMAPH_Register ACM_VoiceRecordFromHsMic_Disable[]={
{ELBA, 0x51, 0},{ELBA, 0x16, 0},{ELBA, 0x10, 0x14},{ELBA, 0x11, 0},{ELBA, 0x92, 0},{ELBA, 0x94, 0x2},{ELBA, 0x3d, 1},
{ELBA, 0x50, 0},{ELBA, 0x35, 0},{ELBA, 0x36, 0},{ELBA, 0x37, 0},{ELBA, 0x38, 0}
};
ACMAPH_Register ACM_VoiceRecordFromHsMic_Enable[]={
{ELBA, 0x11, 0x01},{ELBA, 0x16, 0x49},{ELBA, 0x10, 0x14},{ELBA, 0x92, 0x56},{ELBA, 0x94, 0x1},{ELBA, 0x35, CODEC_PM812_VOICE_MASTER},{ELBA, 0x36, CODEC_PM812_VOICE_WB},
{ELBA, 0x37, 0x02},{ELBA, 0x38, 0},{ELBA, 0x3d, 1},{ELBA, 0x50, 0xf},{ELBA, 0x51, 0x2a},{ELBA, 0x12, 0x0}
};
ACMAPH_Register ACM_VoiceRecordFromHsMic_Mute[]={
{ELBA, 0x11, 0x2},
};
ACMAPH_Register ACM_VoiceRecordFromHsMic_UnMute[]={
{ELBA, 0x11, 0x01},
};
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
static ACMAPH_Component ACM_Disable[APH_PATH_ID_CNT]={
{APH_PATH_ID_HIFIPLAYTOEARPHONE, ACM_HiFiPlayToEarphone_Disable, sizeof(ACM_HiFiPlayToEarphone_Disable)/sizeof(ACMAPH_Register)},
{APH_PATH_ID_HIFIPLAYTOSPKR, ACM_HiFiPlayToSPKR_Disable, sizeof(ACM_HiFiPlayToSPKR_Disable)/sizeof(ACMAPH_Register)},
{APH_PATH_ID_HIFIPLAYTOHP, ACM_HiFiPlayToHP_Disable, sizeof(ACM_HiFiPlayToHP_Disable)/sizeof(ACMAPH_Register)},
{APH_PATH_ID_HIFIRECORDFROMMIC1, ACM_HiFiRecordFromMic1_Disable, sizeof(ACM_HiFiRecordFromMic1_Disable)/sizeof(ACMAPH_Register)},
{APH_PATH_ID_HIFIRECORDFROMHSMIC, ACM_HiFiRecordFromHsMic_Disable, sizeof(ACM_HiFiRecordFromHsMic_Disable)/sizeof(ACMAPH_Register)},
{APH_PATH_ID_VOICEPLAYTOEARPHONE, ACM_VoicePlayToEarphone_Disable, sizeof(ACM_VoicePlayToEarphone_Disable)/sizeof(ACMAPH_Register)},
{APH_PATH_ID_VOICEPLAYTOSPKR, ACM_VoicePlayToSPKR_Disable, sizeof(ACM_VoicePlayToSPKR_Disable)/sizeof(ACMAPH_Register)},
{APH_PATH_ID_VOICEPLAYTOHP, ACM_VoicePlayToHP_Disable, sizeof(ACM_VoicePlayToHP_Disable)/sizeof(ACMAPH_Register)},
{APH_PATH_ID_VOICERECORDFROMMIC1, ACM_VoiceRecordFromMic1_Disable, sizeof(ACM_VoiceRecordFromMic1_Disable)/sizeof(ACMAPH_Register)},
{APH_PATH_ID_VOICERECORDFROMHSMIC, ACM_VoiceRecordFromHsMic_Disable, sizeof(ACM_VoiceRecordFromHsMic_Disable)/sizeof(ACMAPH_Register)},
};
static ACMAPH_Component ACM_Enable[APH_PATH_ID_CNT]={
{APH_PATH_ID_HIFIPLAYTOEARPHONE, ACM_HiFiPlayToEarphone_Enable, sizeof(ACM_HiFiPlayToEarphone_Enable)/sizeof(ACMAPH_Register)},
{APH_PATH_ID_HIFIPLAYTOSPKR, ACM_HiFiPlayToSPKR_Enable, sizeof(ACM_HiFiPlayToSPKR_Enable)/sizeof(ACMAPH_Register)},
{APH_PATH_ID_HIFIPLAYTOHP, ACM_HiFiPlayToHP_Enable, sizeof(ACM_HiFiPlayToHP_Enable)/sizeof(ACMAPH_Register)},
{APH_PATH_ID_HIFIRECORDFROMMIC1, ACM_HiFiRecordFromMic1_Enable, sizeof(ACM_HiFiRecordFromMic1_Enable)/sizeof(ACMAPH_Register)},
{APH_PATH_ID_HIFIRECORDFROMHSMIC, ACM_HiFiRecordFromHsMic_Enable, sizeof(ACM_HiFiRecordFromHsMic_Enable)/sizeof(ACMAPH_Register)},
{APH_PATH_ID_VOICEPLAYTOEARPHONE, ACM_VoicePlayToEarphone_Enable, sizeof(ACM_VoicePlayToEarphone_Enable)/sizeof(ACMAPH_Register)},
{APH_PATH_ID_VOICEPLAYTOSPKR, ACM_VoicePlayToSPKR_Enable, sizeof(ACM_VoicePlayToSPKR_Enable)/sizeof(ACMAPH_Register)},
{APH_PATH_ID_VOICEPLAYTOHP, ACM_VoicePlayToHP_Enable, sizeof(ACM_VoicePlayToHP_Enable)/sizeof(ACMAPH_Register)},
{APH_PATH_ID_VOICERECORDFROMMIC1, ACM_VoiceRecordFromMic1_Enable, sizeof(ACM_VoiceRecordFromMic1_Enable)/sizeof(ACMAPH_Register)},
{APH_PATH_ID_VOICERECORDFROMHSMIC, ACM_VoiceRecordFromHsMic_Enable, sizeof(ACM_VoiceRecordFromHsMic_Enable)/sizeof(ACMAPH_Register)},
};
static ACMAPH_Component ACM_Mute[APH_PATH_IN_CNT]={
{APH_PATH_ID_HIFIRECORDFROMMIC1, ACM_HiFiRecordFromMic1_Mute, sizeof(ACM_HiFiRecordFromMic1_Mute)/sizeof(ACMAPH_Register)},
{APH_PATH_ID_HIFIRECORDFROMHSMIC, ACM_HiFiRecordFromHsMic_Mute, sizeof(ACM_HiFiRecordFromHsMic_Mute)/sizeof(ACMAPH_Register)},
{APH_PATH_ID_VOICERECORDFROMMIC1, ACM_VoiceRecordFromMic1_Mute, sizeof(ACM_VoiceRecordFromMic1_Mute)/sizeof(ACMAPH_Register)},
{APH_PATH_ID_VOICERECORDFROMHSMIC, ACM_VoiceRecordFromHsMic_Mute, sizeof(ACM_VoiceRecordFromHsMic_Mute)/sizeof(ACMAPH_Register)},
};
static ACMAPH_Component ACM_UnMute[APH_PATH_IN_CNT]={
{APH_PATH_ID_HIFIRECORDFROMMIC1, ACM_HiFiRecordFromMic1_UnMute, sizeof(ACM_HiFiRecordFromMic1_UnMute)/sizeof(ACMAPH_Register)},
{APH_PATH_ID_HIFIRECORDFROMHSMIC, ACM_HiFiRecordFromHsMic_UnMute, sizeof(ACM_HiFiRecordFromHsMic_UnMute)/sizeof(ACMAPH_Register)},
{APH_PATH_ID_VOICERECORDFROMMIC1, ACM_VoiceRecordFromMic1_UnMute, sizeof(ACM_VoiceRecordFromMic1_UnMute)/sizeof(ACMAPH_Register)},
{APH_PATH_ID_VOICERECORDFROMHSMIC, ACM_VoiceRecordFromHsMic_UnMute, sizeof(ACM_VoiceRecordFromHsMic_UnMute)/sizeof(ACMAPH_Register)},
};
extern ACH_ComponentHandler elba_handler;
extern ACH_ComponentHandler ustica_handler;
static APH_ACHComponent ACH_component_table[] = {
{ELBA, &elba_handler},
{USTICA, &ustica_handler},
};
//Sorted as APH_AudioComponent
static char APH_AudioComponent_Name[][16]= {
"ELBA",
"USTICA",
} ;
#endif