blob: 9387907f92baf24261b1a4082c150b5bc9c096fa [file] [log] [blame]
/*
* ASR Audio path definition of PM805
*
* 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 PM805
*/
#ifndef ACM_PM805_H
#define ACM_PM805_H
/*
* CODEC_PM805: Audio use SAI1
*/
#define CODEC_PM805_AUDIO_REG30 0x30
#define CODEC_PM805_AUDIO_MASTER 0x0f //16bits, one bit shift, master
#define CODEC_PM805_AUDIO_SLAVE 0x0e //16bits, one bit shift, slave
#define CODEC_PM805_AUDIO_REG31 0x31
#define CODEC_PM805_AUDIO_44100 0x49 //HiFi use SAI1: 44.1KHz,32fs
#define CODEC_PM805_AUDIO_8000 0x01 //HiFi use SAI1: 8KHz,32fs
#define CODEC_PM805_AUDIO_16000 0x21 //HiFi use SAI1: 16KHz,32fs
/*
* CODEC_PM805: Voice use SAI2
*/
#define CODEC_PM805_VOICE_REG35 0x35
#define CODEC_PM805_VOICE_MASTER 0x0d //16bits, one bit shift, master
#define CODEC_PM805_VOICE_SLAVE 0x0c //16bits, one bit shift, slave
#define CODEC_PM805_VOICE_REG36 0x36
#define CODEC_PM805_VOICE_WB 0xa1 //16KHz,32fs
#define CODEC_PM805_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, 0x0},{ELBA, 0x32, 0x0},{ELBA, 0x52, 0x00},{ELBA, 0x51, 0x00},
{ELBA, 0x50, 0},{ELBA, 0x55, 0x0}
};
ACMAPH_Register ACM_HiFiPlayToEarphone_Enable[]={
{ELBA, 0x90, 0x7e},{ELBA, 0x30, 0xf},{ELBA, 0x31, CODEC_PM805_AUDIO_44100},{ELBA, 0x32, 0xb},{ELBA, 0x52, 0x00},{ELBA, 0x51, 0x15},
{ELBA, 0x50, 0xf},{ELBA, 0x55, 0x20},{ELBA, 0x29, 0xb},{ELBA, 0x56, 0xb4}
};
/////////////////////////APH_PATH_ID_HIFIPLAYTOSPKR//////////////////////////
//NOTE:The LINE_P and LINE_N of SPKR are connected with EAR_P and EAR_N, so the register configuration is identical with EarPhone.
//use the following config in fact.
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}
};
ACMAPH_Register ACM_HiFiPlayToSPKR_Enable[]={
{ELBA, 0x31, CODEC_PM805_AUDIO_44100},{ELBA, 0x30, 0xf},{ELBA, 0x32, 0xb},{ELBA, 0x51, 0x15},{ELBA, 0x55, 0x20},{ELBA, 0x58, 0xb7},
{ELBA, 0x50, 0xf},{ELBA, 0x53, 0x00},{ELBA, 0x21, 0x40},{ELBA, 0x20, 0xc1}
};
/////////////////////////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, CODEC_PM805_AUDIO_44100},{ELBA, 0x32, 0xb},{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, 0x0},{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, CODEC_PM805_AUDIO_44100},
{ELBA, 0x32, 0x0b},{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, 0x0},{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, CODEC_PM805_AUDIO_44100},
{ELBA, 0x32, 0x0b},{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_PM805_VOICE_MASTER},{ELBA, 0x36, CODEC_PM805_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, 0xc7},{ELBA, 0x57, 0xc7}
};
/////////////////////////APH_PATH_ID_VOICEPLAYTOSPKR//////////////////////////
//NOTE:The LINE_P and LINE_N of SPKR are connected with EAR_P and EAR_N, so the register configuration is identical with EarPhone.
//use the following config in fact.
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}
};
ACMAPH_Register ACM_VoicePlayToSPKR_Enable[]={
{ELBA, 0x90, 0x7e},{ELBA, 0x35, CODEC_PM805_VOICE_MASTER},{ELBA, 0x36, CODEC_PM805_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}
};
/////////////////////////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_PM805_VOICE_MASTER},{ELBA, 0x36, CODEC_PM805_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_PM805_VOICE_MASTER},{ELBA, 0x36, CODEC_PM805_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_PM805_VOICE_MASTER},{ELBA, 0x36, CODEC_PM805_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},
};
//Sorted as APH_AudioComponent
static char APH_AudioComponent_Name[][16]= {
"ELBA",
} ;
#endif