blob: 5183cfe18d39af8425736b4f9f8f6a7e9dd0970c [file] [log] [blame]
/*
* ASR Audio path definition of NAU8810
*
* Copyright (C) 2018 ASR Microelectronic Ltd.
*
* Author: Chen wen<wenchen@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 NAU8810
*/
#ifndef ACM_NAU8810_H
#define ACM_NAU8810_H
#define CODEC_NAU8810_VOICE_REG06 0x06
#define CODEC_NAU8810_VOICE_MASTER 0x01 //bit0=1 master
#define CODEC_NAU8810_VOICE_SLAVE 0x00 //bit0=0 slave
#define CODEC_NAU8810_VOICE_REG07 0x07
#define CODEC_NAU8810_VOICE_WB 0x06 //FS:16KHz, BCLK:256FS; Keep identical with the config when GSSP is master
#define CODEC_NAU8810_VOICE_NB 0x0a //FS:8KHz, BCLK:256FS
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
/////////////////////////APH_PATH_ID_HIFIPLAYTOEARPHONE//////////////////////////
ACMAPH_Register ACM_HiFiPlayToEarphone_Disable[]={
{NAU8810, 0x01, 0x00},{NAU8810, 0x02, 0x00},{NAU8810, 0x03, 0x00},{NAU8810, 0x31, 0x00},{NAU8810, 0x32, 0x00}
};
ACMAPH_Register ACM_HiFiPlayToEarphone_Enable[]={
{NAU8810, 0x04, 0x118},{NAU8810, 0x06, CODEC_NAU8810_VOICE_SLAVE},{NAU8810, 0x07, CODEC_NAU8810_VOICE_NB},{NAU8810, 0x24, 0x00},{NAU8810, 0x25, 0x00},{NAU8810, 0x26, 0x00},{NAU8810, 0x27, 0x00},
{NAU8810, 0x0e, 0x00},{NAU8810, 0x12, 0x00},{NAU8810, 0x13, 0x00},{NAU8810, 0x14, 0x00},{NAU8810, 0x15, 0x00},{NAU8810, 0x16, 0x00},{NAU8810, 0x1b, 0x00},
{NAU8810, 0x1c, 0x00},{NAU8810, 0x1d, 0x00},{NAU8810, 0x1e, 0x00},{NAU8810, 0x01, 0x19},{NAU8810, 0x02, 0x15},{NAU8810, 0x03, 0x89},{NAU8810, 0x19, 0x0c},
{NAU8810, 0x31, 0x0a},{NAU8810, 0x32, 0x00},{NAU8810, 0x36, 0x00}
};
/////////////////////////APH_PATH_ID_HIFIPLAYTOSPKR//////////////////////////
ACMAPH_Register ACM_HiFiPlayToSPKR_Disable[]={
{NAU8810, 0x01, 0x00},{NAU8810, 0x02, 0x00},{NAU8810, 0x03, 0x00},{NAU8810, 0x31, 0x00},{NAU8810, 0x32, 0x00}
};
ACMAPH_Register ACM_HiFiPlayToSPKR_Enable[]={
{NAU8810, 0x04, 0x118},{NAU8810, 0x06, CODEC_NAU8810_VOICE_SLAVE},{NAU8810, 0x07, CODEC_NAU8810_VOICE_NB},{NAU8810, 0x24, 0x00},{NAU8810, 0x25, 0x00},{NAU8810, 0x26, 0x00},{NAU8810, 0x27, 0x00},
{NAU8810, 0x0e, 0x00},{NAU8810, 0x12, 0x00},{NAU8810, 0x13, 0x00},{NAU8810, 0x14, 0x00},{NAU8810, 0x15, 0x00},{NAU8810, 0x16, 0x00},{NAU8810, 0x1b, 0x00},
{NAU8810, 0x1c, 0x00},{NAU8810, 0x1d, 0x00},{NAU8810, 0x1e, 0x00},{NAU8810, 0x01, 0x19},{NAU8810, 0x02, 0x15},{NAU8810, 0x03, 0x65},{NAU8810, 0x19, 0x0c},
{NAU8810, 0x31, 0x02},{NAU8810, 0x32, 0x01},{NAU8810, 0x36, 0x20}
};
/////////////////////////APH_PATH_ID_HIFIPLAYTOHP//////////////////////////
ACMAPH_Register ACM_HiFiPlayToHP_Disable[]={
{NAU8810, 0x01, 0x00},{NAU8810, 0x02, 0x00},{NAU8810, 0x03, 0x00},{NAU8810, 0x32, 0x00}
};
ACMAPH_Register ACM_HiFiPlayToHP_Enable[]={
{NAU8810, 0x04, 0x118},{NAU8810, 0x06, CODEC_NAU8810_VOICE_SLAVE},{NAU8810, 0x07, CODEC_NAU8810_VOICE_NB},{NAU8810, 0x24, 0x00},{NAU8810, 0x25, 0x00},{NAU8810, 0x26, 0x00},{NAU8810, 0x27, 0x00},
{NAU8810, 0x0e, 0x00},{NAU8810, 0x12, 0x00},{NAU8810, 0x13, 0x00},{NAU8810, 0x14, 0x00},{NAU8810, 0x15, 0x00},{NAU8810, 0x16, 0x00},{NAU8810, 0x1b, 0x00},
{NAU8810, 0x1c, 0x00},{NAU8810, 0x1d, 0x00},{NAU8810, 0x1e, 0x00},{NAU8810, 0x01, 0x19},{NAU8810, 0x02, 0x15},{NAU8810, 0x03, 0x65},{NAU8810, 0x19, 0x0c},
{NAU8810, 0x32, 0x01},{NAU8810, 0x36, 0x20}
};
/////////////////////////APH_PATH_ID_HIFIRECORDFROMMIC1//////////////////////////
ACMAPH_Register ACM_HiFiRecordFromMic1_Disable[]={
{NAU8810, 0x01, 0x00},{NAU8810, 0x02, 0x00}
};
ACMAPH_Register ACM_HiFiRecordFromMic1_Enable[]={
{NAU8810, 0x04, 0x118},{NAU8810, 0x06, CODEC_NAU8810_VOICE_SLAVE},{NAU8810, 0x07, CODEC_NAU8810_VOICE_NB},{NAU8810, 0x24, 0x00},{NAU8810, 0x25, 0x00},{NAU8810, 0x26, 0x00},{NAU8810, 0x27, 0x00},
{NAU8810, 0x0e, 0x00},{NAU8810, 0x12, 0x00},{NAU8810, 0x13, 0x00},{NAU8810, 0x14, 0x00},{NAU8810, 0x15, 0x00},{NAU8810, 0x16, 0x00},{NAU8810, 0x1b, 0x00},
{NAU8810, 0x1c, 0x00},{NAU8810, 0x1d, 0x00},{NAU8810, 0x1e, 0x00},{NAU8810, 0x01, 0x19},{NAU8810, 0x02, 0x15},{NAU8810, 0x2c, 0x03},{NAU8810, 0x2d, 0x20},
{NAU8810, 0x2f, 0x00}
};
ACMAPH_Register ACM_HiFiRecordFromMic1_Mute[]={
{NAU8810, 0x02, 0x011},{NAU8810, 0x2c, 0x000},
};
ACMAPH_Register ACM_HiFiRecordFromMic1_UnMute[]={
{NAU8810, 0x02, 0x015},{NAU8810, 0x2c, 0x003},
};
/////////////////////////APH_PATH_ID_HIFIRECORDFROMHSMIC//////////////////////////
ACMAPH_Register ACM_HiFiRecordFromHsMic_Disable[]={
{NAU8810, 0x01, 0x00},{NAU8810, 0x02, 0x00}
};
ACMAPH_Register ACM_HiFiRecordFromHsMic_Enable[]={
{NAU8810, 0x04, 0x118},{NAU8810, 0x06, CODEC_NAU8810_VOICE_SLAVE},{NAU8810, 0x07, CODEC_NAU8810_VOICE_NB},{NAU8810, 0x24, 0x00},{NAU8810, 0x25, 0x00},{NAU8810, 0x26, 0x00},{NAU8810, 0x27, 0x00},
{NAU8810, 0x0e, 0x00},{NAU8810, 0x12, 0x00},{NAU8810, 0x13, 0x00},{NAU8810, 0x14, 0x00},{NAU8810, 0x15, 0x00},{NAU8810, 0x16, 0x00},{NAU8810, 0x1b, 0x00},
{NAU8810, 0x1c, 0x00},{NAU8810, 0x1d, 0x00},{NAU8810, 0x1e, 0x00},{NAU8810, 0x01, 0x19},{NAU8810, 0x02, 0x15},{NAU8810, 0x2c, 0x03},{NAU8810, 0x2d, 0x20},
{NAU8810, 0x2f, 0x00}
};
ACMAPH_Register ACM_HiFiRecordFromHsMic_Mute[]={
{NAU8810, 0x02, 0x011},{NAU8810, 0x2c, 0x000},
};
ACMAPH_Register ACM_HiFiRecordFromHsMic_UnMute[]={
{NAU8810, 0x02, 0x015},{NAU8810, 0x2c, 0x003},
};
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
/////////////////////////APH_PATH_ID_VOICEPLAYTOEARPHONE//////////////////////////
ACMAPH_Register ACM_VoicePlayToEarphone_Disable[]={
{NAU8810, 0x01, 0x00},{NAU8810, 0x02, 0x00},{NAU8810, 0x03, 0x00},{NAU8810, 0x31, 0x00}
};
ACMAPH_Register ACM_VoicePlayToEarphone_Enable[]={
{NAU8810, 0x04, 0x118},{NAU8810, 0x06, CODEC_NAU8810_VOICE_SLAVE},{NAU8810, 0x07, CODEC_NAU8810_VOICE_NB},{NAU8810, 0x24, 0x00},{NAU8810, 0x25, 0x00},{NAU8810, 0x26, 0x00},{NAU8810, 0x27, 0x00},
{NAU8810, 0x0e, 0x00},{NAU8810, 0x12, 0x00},{NAU8810, 0x13, 0x00},{NAU8810, 0x14, 0x00},{NAU8810, 0x15, 0x00},{NAU8810, 0x16, 0x00},{NAU8810, 0x1b, 0x00},
{NAU8810, 0x1c, 0x00},{NAU8810, 0x1d, 0x00},{NAU8810, 0x1e, 0x00},{NAU8810, 0x01, 0x19},{NAU8810, 0x02, 0x15},{NAU8810, 0x03, 0x89},{NAU8810, 0x19, 0x0c},
{NAU8810, 0x31, 0x0a},{NAU8810, 0x32, 0x00},{NAU8810, 0x36, 0x20}
};
/////////////////////////APH_PATH_ID_VOICEPLAYTOSPKR//////////////////////////
ACMAPH_Register ACM_VoicePlayToSPKR_Disable[]={
{NAU8810, 0x01, 0x00},{NAU8810, 0x02, 0x00},{NAU8810, 0x03, 0x00},{NAU8810, 0x32, 0x00}
};
ACMAPH_Register ACM_VoicePlayToSPKR_Enable[]={
{NAU8810, 0x04, 0x118},{NAU8810, 0x06, CODEC_NAU8810_VOICE_SLAVE},{NAU8810, 0x07, CODEC_NAU8810_VOICE_NB},{NAU8810, 0x24, 0x00},{NAU8810, 0x25, 0x00},{NAU8810, 0x26, 0x00},{NAU8810, 0x27, 0x00},
{NAU8810, 0x0e, 0x00},{NAU8810, 0x12, 0x00},{NAU8810, 0x13, 0x00},{NAU8810, 0x14, 0x00},{NAU8810, 0x15, 0x00},{NAU8810, 0x16, 0x00},{NAU8810, 0x1b, 0x00},
{NAU8810, 0x1c, 0x00},{NAU8810, 0x1d, 0x00},{NAU8810, 0x1e, 0x00},{NAU8810, 0x01, 0x19},{NAU8810, 0x02, 0x15},{NAU8810, 0x03, 0x65},{NAU8810, 0x19, 0x0c},
{NAU8810, 0x31, 0x02},{NAU8810, 0x32, 0x01},{NAU8810, 0x36, 0x20}
};
/////////////////////////APH_PATH_ID_VOICEPLAYTOHP//////////////////////////
ACMAPH_Register ACM_VoicePlayToHP_Disable[]={
{NAU8810, 0x01, 0x00},{NAU8810, 0x02, 0x00},{NAU8810, 0x03, 0x00},{NAU8810, 0x32, 0x00}
};
ACMAPH_Register ACM_VoicePlayToHP_Enable[]={
{NAU8810, 0x04, 0x118},{NAU8810, 0x06, CODEC_NAU8810_VOICE_SLAVE},{NAU8810, 0x07, CODEC_NAU8810_VOICE_NB},{NAU8810, 0x24, 0x00},{NAU8810, 0x25, 0x00},{NAU8810, 0x26, 0x00},{NAU8810, 0x27, 0x00},
{NAU8810, 0x0e, 0x00},{NAU8810, 0x12, 0x00},{NAU8810, 0x13, 0x00},{NAU8810, 0x14, 0x00},{NAU8810, 0x15, 0x00},{NAU8810, 0x16, 0x00},{NAU8810, 0x1b, 0x00},
{NAU8810, 0x1c, 0x00},{NAU8810, 0x1d, 0x00},{NAU8810, 0x1e, 0x00},{NAU8810, 0x01, 0x19},{NAU8810, 0x02, 0x15},{NAU8810, 0x03, 0x65},{NAU8810, 0x19, 0x0c},
{NAU8810, 0x32, 0x01},{NAU8810, 0x36, 0x20}
};
/////////////////////////APH_PATH_ID_VOICERECORDFROMMIC1//////////////////////////
ACMAPH_Register ACM_VoiceRecordFromMic1_Disable[]={
{NAU8810, 0x01, 0x00},{NAU8810, 0x02, 0x00}
};
ACMAPH_Register ACM_VoiceRecordFromMic1_Enable[]={
{NAU8810, 0x04, 0x118},{NAU8810, 0x06, CODEC_NAU8810_VOICE_SLAVE},{NAU8810, 0x07, CODEC_NAU8810_VOICE_NB},{NAU8810, 0x24, 0x00},{NAU8810, 0x25, 0x00},{NAU8810, 0x26, 0x00},{NAU8810, 0x27, 0x00},
{NAU8810, 0x0e, 0x00},{NAU8810, 0x12, 0x00},{NAU8810, 0x13, 0x00},{NAU8810, 0x14, 0x00},{NAU8810, 0x15, 0x00},{NAU8810, 0x16, 0x00},{NAU8810, 0x1b, 0x00},
{NAU8810, 0x1c, 0x00},{NAU8810, 0x1d, 0x00},{NAU8810, 0x1e, 0x00},{NAU8810, 0x01, 0x19},{NAU8810, 0x02, 0x15},{NAU8810, 0x2c, 0x03},{NAU8810, 0x2d, 0x20},
{NAU8810, 0x2f, 0x00}
};
ACMAPH_Register ACM_VoiceRecordFromMic1_Mute[]={
{NAU8810, 0x02, 0x011},{NAU8810, 0x2c, 0x000},
};
ACMAPH_Register ACM_VoiceRecordFromMic1_UnMute[]={
{NAU8810, 0x02, 0x015},{NAU8810, 0x2c, 0x003},
};
/////////////////////////APH_PATH_ID_VOICERECORDFROMHSMIC//////////////////////////
ACMAPH_Register ACM_VoiceRecordFromHsMic_Disable[]={
{NAU8810, 0x01, 0x00},{NAU8810, 0x02, 0x00}
};
ACMAPH_Register ACM_VoiceRecordFromHsMic_Enable[]={
{NAU8810, 0x04, 0x118},{NAU8810, 0x06, CODEC_NAU8810_VOICE_SLAVE},{NAU8810, 0x07, CODEC_NAU8810_VOICE_NB},{NAU8810, 0x24, 0x00},{NAU8810, 0x25, 0x00},{NAU8810, 0x26, 0x00},{NAU8810, 0x27, 0x00},
{NAU8810, 0x0e, 0x00},{NAU8810, 0x12, 0x00},{NAU8810, 0x13, 0x00},{NAU8810, 0x14, 0x00},{NAU8810, 0x15, 0x00},{NAU8810, 0x16, 0x00},{NAU8810, 0x1b, 0x00},
{NAU8810, 0x1c, 0x00},{NAU8810, 0x1d, 0x00},{NAU8810, 0x1e, 0x00},{NAU8810, 0x01, 0x19},{NAU8810, 0x02, 0x15},{NAU8810, 0x2c, 0x03},{NAU8810, 0x2d, 0x20},
{NAU8810, 0x2f, 0x00}
};
ACMAPH_Register ACM_VoiceRecordFromHsMic_Mute[]={
{NAU8810, 0x02, 0x011},{NAU8810, 0x2c, 0x000},
};
ACMAPH_Register ACM_VoiceRecordFromHsMic_UnMute[]={
{NAU8810, 0x02, 0x015},{NAU8810, 0x2c, 0x003},
};
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
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 NAU8810_handler;
static APH_ACHComponent ACH_component_table[] = {
{NAU8810, &NAU8810_handler},
};
//Sorted as APH_AudioComponent
static char APH_AudioComponent_Name[][16]= {
"ELBA",
"USTICA",
"DELAY",
"NAU8810",
"ALC5616"
} ;
#endif