linux/sound/soc/codecs/rt5631.h

/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __RTCODEC5631_H__
#define __RTCODEC5631_H__


#define RT5631_RESET
#define RT5631_SPK_OUT_VOL
#define RT5631_HP_OUT_VOL
#define RT5631_MONO_AXO_1_2_VOL
#define RT5631_AUX_IN_VOL
#define RT5631_STEREO_DAC_VOL_1
#define RT5631_MIC_CTRL_1
#define RT5631_STEREO_DAC_VOL_2
#define RT5631_ADC_CTRL_1
#define RT5631_ADC_REC_MIXER
#define RT5631_ADC_CTRL_2
#define RT5631_VDAC_DIG_VOL
#define RT5631_OUTMIXER_L_CTRL
#define RT5631_OUTMIXER_R_CTRL
#define RT5631_AXO1MIXER_CTRL
#define RT5631_AXO2MIXER_CTRL
#define RT5631_MIC_CTRL_2
#define RT5631_DIG_MIC_CTRL
#define RT5631_MONO_INPUT_VOL
#define RT5631_SPK_MIXER_CTRL
#define RT5631_SPK_MONO_OUT_CTRL
#define RT5631_SPK_MONO_HP_OUT_CTRL
#define RT5631_SDP_CTRL
#define RT5631_MONO_SDP_CTRL
#define RT5631_STEREO_AD_DA_CLK_CTRL
#define RT5631_PWR_MANAG_ADD1
#define RT5631_PWR_MANAG_ADD2
#define RT5631_PWR_MANAG_ADD3
#define RT5631_PWR_MANAG_ADD4
#define RT5631_GEN_PUR_CTRL_REG
#define RT5631_GLOBAL_CLK_CTRL
#define RT5631_PLL_CTRL
#define RT5631_INT_ST_IRQ_CTRL_1
#define RT5631_INT_ST_IRQ_CTRL_2
#define RT5631_GPIO_CTRL
#define RT5631_MISC_CTRL
#define RT5631_DEPOP_FUN_CTRL_1
#define RT5631_DEPOP_FUN_CTRL_2
#define RT5631_JACK_DET_CTRL
#define RT5631_SOFT_VOL_CTRL
#define RT5631_ALC_CTRL_1
#define RT5631_ALC_CTRL_2
#define RT5631_ALC_CTRL_3
#define RT5631_PSEUDO_SPATL_CTRL
#define RT5631_INDEX_ADD
#define RT5631_INDEX_DATA
#define RT5631_EQ_CTRL
#define RT5631_VENDOR_ID
#define RT5631_VENDOR_ID1
#define RT5631_VENDOR_ID2

/* Index of Codec Private Register definition */
#define RT5631_EQ_BW_LOP
#define RT5631_EQ_GAIN_LOP
#define RT5631_EQ_FC_BP1
#define RT5631_EQ_BW_BP1
#define RT5631_EQ_GAIN_BP1
#define RT5631_EQ_FC_BP2
#define RT5631_EQ_BW_BP2
#define RT5631_EQ_GAIN_BP2
#define RT5631_EQ_FC_BP3
#define RT5631_EQ_BW_BP3
#define RT5631_EQ_GAIN_BP3
#define RT5631_EQ_BW_HIP
#define RT5631_EQ_GAIN_HIP
#define RT5631_EQ_HPF_A1
#define RT5631_EQ_HPF_A2
#define RT5631_EQ_HPF_GAIN
#define RT5631_EQ_PRE_VOL_CTRL
#define RT5631_EQ_POST_VOL_CTRL
#define RT5631_TEST_MODE_CTRL
#define RT5631_CP_INTL_REG2
#define RT5631_ADDA_MIXER_INTL_REG3
#define RT5631_SPK_INTL_CTRL


/* global definition */
#define RT5631_L_MUTE
#define RT5631_L_MUTE_SHIFT
#define RT5631_L_EN
#define RT5631_L_EN_SHIFT
#define RT5631_R_MUTE
#define RT5631_R_MUTE_SHIFT
#define RT5631_R_EN
#define RT5631_R_EN_SHIFT
#define RT5631_VOL_MASK
#define RT5631_L_VOL_SHIFT
#define RT5631_R_VOL_SHIFT

/* Speaker Output Control(0x02) */
#define RT5631_SPK_L_VOL_SEL_MASK
#define RT5631_SPK_L_VOL_SEL_VMID
#define RT5631_SPK_L_VOL_SEL_SPKMIX_L
#define RT5631_SPK_R_VOL_SEL_MASK
#define RT5631_SPK_R_VOL_SEL_VMID
#define RT5631_SPK_R_VOL_SEL_SPKMIX_R

/* Headphone Output Control(0x04) */
#define RT5631_HP_L_VOL_SEL_MASK
#define RT5631_HP_L_VOL_SEL_VMID
#define RT5631_HP_L_VOL_SEL_OUTMIX_L
#define RT5631_HP_R_VOL_SEL_MASK
#define RT5631_HP_R_VOL_SEL_VMID
#define RT5631_HP_R_VOL_SEL_OUTMIX_R

/* Output Control for AUXOUT/MONO(0x06) */
#define RT5631_AUXOUT_1_VOL_SEL_MASK
#define RT5631_AUXOUT_1_VOL_SEL_VMID
#define RT5631_AUXOUT_1_VOL_SEL_OUTMIX_L
#define RT5631_MUTE_MONO
#define RT5631_MUTE_MONO_SHIFT
#define RT5631_AUXOUT_2_VOL_SEL_MASK
#define RT5631_AUXOUT_2_VOL_SEL_VMID
#define RT5631_AUXOUT_2_VOL_SEL_OUTMIX_R

/* Microphone Input Control 1(0x0E) */
#define RT5631_MIC1_DIFF_INPUT_CTRL
#define RT5631_MIC1_DIFF_INPUT_SHIFT
#define RT5631_MIC2_DIFF_INPUT_CTRL
#define RT5631_MIC2_DIFF_INPUT_SHIFT

/* Stereo DAC Digital Volume2(0x10) */
#define RT5631_DAC_VOL_MASK

/* ADC Recording Mixer Control(0x14) */
#define RT5631_M_OUTMIXER_L_TO_RECMIXER_L
#define RT5631_M_OUTMIXL_RECMIXL_BIT
#define RT5631_M_MIC1_TO_RECMIXER_L
#define RT5631_M_MIC1_RECMIXL_BIT
#define RT5631_M_AXIL_TO_RECMIXER_L
#define RT5631_M_AXIL_RECMIXL_BIT
#define RT5631_M_MONO_IN_TO_RECMIXER_L
#define RT5631_M_MONO_IN_RECMIXL_BIT
#define RT5631_M_OUTMIXER_R_TO_RECMIXER_R
#define RT5631_M_OUTMIXR_RECMIXR_BIT
#define RT5631_M_MIC2_TO_RECMIXER_R
#define RT5631_M_MIC2_RECMIXR_BIT
#define RT5631_M_AXIR_TO_RECMIXER_R
#define RT5631_M_AXIR_RECMIXR_BIT
#define RT5631_M_MONO_IN_TO_RECMIXER_R
#define RT5631_M_MONO_IN_RECMIXR_BIT

/* Left Output Mixer Control(0x1A) */
#define RT5631_M_RECMIXER_L_TO_OUTMIXER_L
#define RT5631_M_RECMIXL_OUTMIXL_BIT
#define RT5631_M_RECMIXER_R_TO_OUTMIXER_L
#define RT5631_M_RECMIXR_OUTMIXL_BIT
#define RT5631_M_DAC_L_TO_OUTMIXER_L
#define RT5631_M_DACL_OUTMIXL_BIT
#define RT5631_M_MIC1_TO_OUTMIXER_L
#define RT5631_M_MIC1_OUTMIXL_BIT
#define RT5631_M_MIC2_TO_OUTMIXER_L
#define RT5631_M_MIC2_OUTMIXL_BIT
#define RT5631_M_MONO_IN_P_TO_OUTMIXER_L
#define RT5631_M_MONO_INP_OUTMIXL_BIT
#define RT5631_M_AXIL_TO_OUTMIXER_L
#define RT5631_M_AXIL_OUTMIXL_BIT
#define RT5631_M_AXIR_TO_OUTMIXER_L
#define RT5631_M_AXIR_OUTMIXL_BIT
#define RT5631_M_VDAC_TO_OUTMIXER_L
#define RT5631_M_VDAC_OUTMIXL_BIT

/* Right Output Mixer Control(0x1C) */
#define RT5631_M_RECMIXER_L_TO_OUTMIXER_R
#define RT5631_M_RECMIXL_OUTMIXR_BIT
#define RT5631_M_RECMIXER_R_TO_OUTMIXER_R
#define RT5631_M_RECMIXR_OUTMIXR_BIT
#define RT5631_M_DAC_R_TO_OUTMIXER_R
#define RT5631_M_DACR_OUTMIXR_BIT
#define RT5631_M_MIC1_TO_OUTMIXER_R
#define RT5631_M_MIC1_OUTMIXR_BIT
#define RT5631_M_MIC2_TO_OUTMIXER_R
#define RT5631_M_MIC2_OUTMIXR_BIT
#define RT5631_M_MONO_IN_N_TO_OUTMIXER_R
#define RT5631_M_MONO_INN_OUTMIXR_BIT
#define RT5631_M_AXIL_TO_OUTMIXER_R
#define RT5631_M_AXIL_OUTMIXR_BIT
#define RT5631_M_AXIR_TO_OUTMIXER_R
#define RT5631_M_AXIR_OUTMIXR_BIT
#define RT5631_M_VDAC_TO_OUTMIXER_R
#define RT5631_M_VDAC_OUTMIXR_BIT

/* Lout Mixer Control(0x1E) */
#define RT5631_M_MIC1_TO_AXO1MIXER
#define RT5631_M_MIC1_AXO1MIX_BIT
#define RT5631_M_MIC2_TO_AXO1MIXER
#define RT5631_M_MIC2_AXO1MIX_BIT
#define RT5631_M_OUTMIXER_L_TO_AXO1MIXER
#define RT5631_M_OUTMIXL_AXO1MIX_BIT
#define RT5631_M_OUTMIXER_R_TO_AXO1MIXER
#define RT5631_M_OUTMIXR_AXO1MIX_BIT

/* Rout Mixer Control(0x20) */
#define RT5631_M_MIC1_TO_AXO2MIXER
#define RT5631_M_MIC1_AXO2MIX_BIT
#define RT5631_M_MIC2_TO_AXO2MIXER
#define RT5631_M_MIC2_AXO2MIX_BIT
#define RT5631_M_OUTMIXER_L_TO_AXO2MIXER
#define RT5631_M_OUTMIXL_AXO2MIX_BIT
#define RT5631_M_OUTMIXER_R_TO_AXO2MIXER
#define RT5631_M_OUTMIXR_AXO2MIX_BIT

/* Micphone Input Control 2(0x22) */
#define RT5631_MIC_BIAS_90_PRECNET_AVDD
#define RT5631_MIC_BIAS_75_PRECNET_AVDD

#define RT5631_MIC1_BOOST_CTRL_MASK
#define RT5631_MIC1_BOOST_CTRL_BYPASS
#define RT5631_MIC1_BOOST_CTRL_20DB
#define RT5631_MIC1_BOOST_CTRL_24DB
#define RT5631_MIC1_BOOST_CTRL_30DB
#define RT5631_MIC1_BOOST_CTRL_35DB
#define RT5631_MIC1_BOOST_CTRL_40DB
#define RT5631_MIC1_BOOST_CTRL_34DB
#define RT5631_MIC1_BOOST_CTRL_50DB
#define RT5631_MIC1_BOOST_CTRL_52DB
#define RT5631_MIC1_BOOST_SHIFT

#define RT5631_MIC2_BOOST_CTRL_MASK
#define RT5631_MIC2_BOOST_CTRL_BYPASS
#define RT5631_MIC2_BOOST_CTRL_20DB
#define RT5631_MIC2_BOOST_CTRL_24DB
#define RT5631_MIC2_BOOST_CTRL_30DB
#define RT5631_MIC2_BOOST_CTRL_35DB
#define RT5631_MIC2_BOOST_CTRL_40DB
#define RT5631_MIC2_BOOST_CTRL_34DB
#define RT5631_MIC2_BOOST_CTRL_50DB
#define RT5631_MIC2_BOOST_CTRL_52DB
#define RT5631_MIC2_BOOST_SHIFT

#define RT5631_MICBIAS1_VOLT_CTRL_MASK
#define RT5631_MICBIAS1_VOLT_CTRL_90P
#define RT5631_MICBIAS1_VOLT_CTRL_75P

#define RT5631_MICBIAS1_S_C_DET_MASK
#define RT5631_MICBIAS1_S_C_DET_DIS
#define RT5631_MICBIAS1_S_C_DET_ENA

#define RT5631_MICBIAS1_SHORT_CURR_DET_MASK
#define RT5631_MICBIAS1_SHORT_CURR_DET_600UA
#define RT5631_MICBIAS1_SHORT_CURR_DET_1500UA
#define RT5631_MICBIAS1_SHORT_CURR_DET_2000UA

#define RT5631_MICBIAS2_VOLT_CTRL_MASK
#define RT5631_MICBIAS2_VOLT_CTRL_90P
#define RT5631_MICBIAS2_VOLT_CTRL_75P

#define RT5631_MICBIAS2_S_C_DET_MASK
#define RT5631_MICBIAS2_S_C_DET_DIS
#define RT5631_MICBIAS2_S_C_DET_ENA

#define RT5631_MICBIAS2_SHORT_CURR_DET_MASK
#define RT5631_MICBIAS2_SHORT_CURR_DET_600UA
#define RT5631_MICBIAS2_SHORT_CURR_DET_1500UA
#define RT5631_MICBIAS2_SHORT_CURR_DET_2000UA


/* Digital Microphone Control(0x24) */
#define RT5631_DMIC_ENA_MASK
#define RT5631_DMIC_ENA_SHIFT
/* DMIC_ENA: DMIC to ADC Digital filter */
#define RT5631_DMIC_ENA
/* DMIC_DIS: ADC mixer to ADC Digital filter */
#define RT5631_DMIC_DIS
#define RT5631_DMIC_L_CH_MUTE
#define RT5631_DMIC_L_CH_MUTE_SHIFT
#define RT5631_DMIC_R_CH_MUTE
#define RT5631_DMIC_R_CH_MUTE_SHIFT
#define RT5631_DMIC_L_CH_LATCH_MASK
#define RT5631_DMIC_L_CH_LATCH_RISING
#define RT5631_DMIC_L_CH_LATCH_FALLING
#define RT5631_DMIC_R_CH_LATCH_MASK
#define RT5631_DMIC_R_CH_LATCH_RISING
#define RT5631_DMIC_R_CH_LATCH_FALLING
#define RT5631_DMIC_CLK_CTRL_MASK
#define RT5631_DMIC_CLK_CTRL_TO_128FS
#define RT5631_DMIC_CLK_CTRL_TO_64FS
#define RT5631_DMIC_CLK_CTRL_TO_32FS

/* Microphone Input Volume(0x26) */
#define RT5631_MONO_DIFF_INPUT_SHIFT

/* Speaker Mixer Control(0x28) */
#define RT5631_M_RECMIXER_L_TO_SPKMIXER_L
#define RT5631_M_RECMIXL_SPKMIXL_BIT
#define RT5631_M_MIC1_P_TO_SPKMIXER_L
#define RT5631_M_MIC1P_SPKMIXL_BIT
#define RT5631_M_DAC_L_TO_SPKMIXER_L
#define RT5631_M_DACL_SPKMIXL_BIT
#define RT5631_M_OUTMIXER_L_TO_SPKMIXER_L
#define RT5631_M_OUTMIXL_SPKMIXL_BIT

#define RT5631_M_RECMIXER_R_TO_SPKMIXER_R
#define RT5631_M_RECMIXR_SPKMIXR_BIT
#define RT5631_M_MIC2_P_TO_SPKMIXER_R
#define RT5631_M_MIC2P_SPKMIXR_BIT
#define RT5631_M_DAC_R_TO_SPKMIXER_R
#define RT5631_M_DACR_SPKMIXR_BIT
#define RT5631_M_OUTMIXER_R_TO_SPKMIXER_R
#define RT5631_M_OUTMIXR_SPKMIXR_BIT

/* Speaker/Mono Output Control(0x2A) */
#define RT5631_M_SPKVOL_L_TO_SPOL_MIXER
#define RT5631_M_SPKVOLL_SPOLMIX_BIT
#define RT5631_M_SPKVOL_R_TO_SPOL_MIXER
#define RT5631_M_SPKVOLR_SPOLMIX_BIT
#define RT5631_M_SPKVOL_L_TO_SPOR_MIXER
#define RT5631_M_SPKVOLL_SPORMIX_BIT
#define RT5631_M_SPKVOL_R_TO_SPOR_MIXER
#define RT5631_M_SPKVOLR_SPORMIX_BIT
#define RT5631_M_OUTVOL_L_TO_MONOMIXER
#define RT5631_M_OUTVOLL_MONOMIX_BIT
#define RT5631_M_OUTVOL_R_TO_MONOMIXER
#define RT5631_M_OUTVOLR_MONOMIX_BIT

/* Speaker/Mono/HP Output Control(0x2C) */
#define RT5631_SPK_L_MUX_SEL_MASK
#define RT5631_SPK_L_MUX_SEL_SPKMIXER_L
#define RT5631_SPK_L_MUX_SEL_MONO_IN
#define RT5631_SPK_L_MUX_SEL_DAC_L
#define RT5631_SPK_L_MUX_SEL_SHIFT

#define RT5631_SPK_R_MUX_SEL_MASK
#define RT5631_SPK_R_MUX_SEL_SPKMIXER_R
#define RT5631_SPK_R_MUX_SEL_MONO_IN
#define RT5631_SPK_R_MUX_SEL_DAC_R
#define RT5631_SPK_R_MUX_SEL_SHIFT

#define RT5631_MONO_MUX_SEL_MASK
#define RT5631_MONO_MUX_SEL_MONOMIXER
#define RT5631_MONO_MUX_SEL_MONO_IN
#define RT5631_MONO_MUX_SEL_SHIFT

#define RT5631_HP_L_MUX_SEL_MASK
#define RT5631_HP_L_MUX_SEL_HPVOL_L
#define RT5631_HP_L_MUX_SEL_DAC_L
#define RT5631_HP_L_MUX_SEL_SHIFT

#define RT5631_HP_R_MUX_SEL_MASK
#define RT5631_HP_R_MUX_SEL_HPVOL_R
#define RT5631_HP_R_MUX_SEL_DAC_R
#define RT5631_HP_R_MUX_SEL_SHIFT

/* Stereo I2S Serial Data Port Control(0x34) */
#define RT5631_SDP_MODE_SEL_MASK
#define RT5631_SDP_MODE_SEL_MASTER
#define RT5631_SDP_MODE_SEL_SLAVE

#define RT5631_SDP_ADC_CPS_SEL_MASK
#define RT5631_SDP_ADC_CPS_SEL_OFF
#define RT5631_SDP_ADC_CPS_SEL_U_LAW
#define RT5631_SDP_ADC_CPS_SEL_A_LAW

#define RT5631_SDP_DAC_CPS_SEL_MASK
#define RT5631_SDP_DAC_CPS_SEL_OFF
#define RT5631_SDP_DAC_CPS_SEL_U_LAW
#define RT5631_SDP_DAC_CPS_SEL_A_LAW
/* 0:Normal 1:Invert */
#define RT5631_SDP_I2S_BCLK_POL_CTRL
/* 0:Normal 1:Invert */
#define RT5631_SDP_DAC_R_INV
/* 0:ADC data appear at left phase of LRCK
 * 1:ADC data appear at right phase of LRCK
 */
#define RT5631_SDP_ADC_DATA_L_R_SWAP
/* 0:DAC data appear at left phase of LRCK
 * 1:DAC data appear at right phase of LRCK
 */
#define RT5631_SDP_DAC_DATA_L_R_SWAP

/* Data Length Slection */
#define RT5631_SDP_I2S_DL_MASK
#define RT5631_SDP_I2S_DL_16
#define RT5631_SDP_I2S_DL_20
#define RT5631_SDP_I2S_DL_24
#define RT5631_SDP_I2S_DL_8

/* PCM Data Format Selection */
#define RT5631_SDP_I2S_DF_MASK
#define RT5631_SDP_I2S_DF_I2S
#define RT5631_SDP_I2S_DF_LEFT
#define RT5631_SDP_I2S_DF_PCM_A
#define RT5631_SDP_I2S_DF_PCM_B

/* Stereo AD/DA Clock Control(0x38h) */
#define RT5631_I2S_PRE_DIV_MASK
#define RT5631_I2S_PRE_DIV_1
#define RT5631_I2S_PRE_DIV_2
#define RT5631_I2S_PRE_DIV_4
#define RT5631_I2S_PRE_DIV_8
#define RT5631_I2S_PRE_DIV_16
#define RT5631_I2S_PRE_DIV_32
/* CLOCK RELATIVE OF BCLK AND LCRK */
#define RT5631_I2S_LRCK_SEL_N_BCLK_MASK
#define RT5631_I2S_LRCK_SEL_64_BCLK
#define RT5631_I2S_LRCK_SEL_32_BCLK

#define RT5631_DAC_OSR_SEL_MASK
#define RT5631_DAC_OSR_SEL_128FS
#define RT5631_DAC_OSR_SEL_64FS
#define RT5631_DAC_OSR_SEL_32FS
#define RT5631_DAC_OSR_SEL_16FS

#define RT5631_ADC_OSR_SEL_MASK
#define RT5631_ADC_OSR_SEL_128FS
#define RT5631_ADC_OSR_SEL_64FS
#define RT5631_ADC_OSR_SEL_32FS
#define RT5631_ADC_OSR_SEL_16FS

#define RT5631_ADDA_FILTER_CLK_SEL_256FS
#define RT5631_ADDA_FILTER_CLK_SEL_384FS

/* Power managment addition 1 (0x3A) */
#define RT5631_PWR_MAIN_I2S_EN
#define RT5631_PWR_MAIN_I2S_BIT
#define RT5631_PWR_CLASS_D
#define RT5631_PWR_CLASS_D_BIT
#define RT5631_PWR_ADC_L_CLK
#define RT5631_PWR_ADC_L_CLK_BIT
#define RT5631_PWR_ADC_R_CLK
#define RT5631_PWR_ADC_R_CLK_BIT
#define RT5631_PWR_DAC_L_CLK
#define RT5631_PWR_DAC_L_CLK_BIT
#define RT5631_PWR_DAC_R_CLK
#define RT5631_PWR_DAC_R_CLK_BIT
#define RT5631_PWR_DAC_REF
#define RT5631_PWR_DAC_REF_BIT
#define RT5631_PWR_DAC_L_TO_MIXER
#define RT5631_PWR_DAC_L_TO_MIXER_BIT
#define RT5631_PWR_DAC_R_TO_MIXER
#define RT5631_PWR_DAC_R_TO_MIXER_BIT

/* Power managment addition 2 (0x3B) */
#define RT5631_PWR_OUTMIXER_L
#define RT5631_PWR_OUTMIXER_L_BIT
#define RT5631_PWR_OUTMIXER_R
#define RT5631_PWR_OUTMIXER_R_BIT
#define RT5631_PWR_SPKMIXER_L
#define RT5631_PWR_SPKMIXER_L_BIT
#define RT5631_PWR_SPKMIXER_R
#define RT5631_PWR_SPKMIXER_R_BIT
#define RT5631_PWR_RECMIXER_L
#define RT5631_PWR_RECMIXER_L_BIT
#define RT5631_PWR_RECMIXER_R
#define RT5631_PWR_RECMIXER_R_BIT
#define RT5631_PWR_MIC1_BOOT_GAIN
#define RT5631_PWR_MIC1_BOOT_GAIN_BIT
#define RT5631_PWR_MIC2_BOOT_GAIN
#define RT5631_PWR_MIC2_BOOT_GAIN_BIT
#define RT5631_PWR_MICBIAS1_VOL
#define RT5631_PWR_MICBIAS1_VOL_BIT
#define RT5631_PWR_MICBIAS2_VOL
#define RT5631_PWR_MICBIAS2_VOL_BIT
#define RT5631_PWR_PLL1
#define RT5631_PWR_PLL1_BIT
#define RT5631_PWR_PLL2
#define RT5631_PWR_PLL2_BIT

/* Power managment addition 3(0x3C) */
#define RT5631_PWR_VREF
#define RT5631_PWR_VREF_BIT
#define RT5631_PWR_FAST_VREF_CTRL
#define RT5631_PWR_FAST_VREF_CTRL_BIT
#define RT5631_PWR_MAIN_BIAS
#define RT5631_PWR_MAIN_BIAS_BIT
#define RT5631_PWR_AXO1MIXER
#define RT5631_PWR_AXO1MIXER_BIT
#define RT5631_PWR_AXO2MIXER
#define RT5631_PWR_AXO2MIXER_BIT
#define RT5631_PWR_MONOMIXER
#define RT5631_PWR_MONOMIXER_BIT
#define RT5631_PWR_MONO_DEPOP_DIS
#define RT5631_PWR_MONO_DEPOP_DIS_BIT
#define RT5631_PWR_MONO_AMP_EN
#define RT5631_PWR_MONO_AMP_EN_BIT
#define RT5631_PWR_CHARGE_PUMP
#define RT5631_PWR_CHARGE_PUMP_BIT
#define RT5631_PWR_HP_L_AMP
#define RT5631_PWR_HP_L_AMP_BIT
#define RT5631_PWR_HP_R_AMP
#define RT5631_PWR_HP_R_AMP_BIT
#define RT5631_PWR_HP_DEPOP_DIS
#define RT5631_PWR_HP_DEPOP_DIS_BIT
#define RT5631_PWR_HP_AMP_DRIVING
#define RT5631_PWR_HP_AMP_DRIVING_BIT

/* Power managment addition 4(0x3E) */
#define RT5631_PWR_SPK_L_VOL
#define RT5631_PWR_SPK_L_VOL_BIT
#define RT5631_PWR_SPK_R_VOL
#define RT5631_PWR_SPK_R_VOL_BIT
#define RT5631_PWR_LOUT_VOL
#define RT5631_PWR_LOUT_VOL_BIT
#define RT5631_PWR_ROUT_VOL
#define RT5631_PWR_ROUT_VOL_BIT
#define RT5631_PWR_HP_L_OUT_VOL
#define RT5631_PWR_HP_L_OUT_VOL_BIT
#define RT5631_PWR_HP_R_OUT_VOL
#define RT5631_PWR_HP_R_OUT_VOL_BIT
#define RT5631_PWR_AXIL_IN_VOL
#define RT5631_PWR_AXIL_IN_VOL_BIT
#define RT5631_PWR_AXIR_IN_VOL
#define RT5631_PWR_AXIR_IN_VOL_BIT
#define RT5631_PWR_MONO_IN_P_VOL
#define RT5631_PWR_MONO_IN_P_VOL_BIT
#define RT5631_PWR_MONO_IN_N_VOL
#define RT5631_PWR_MONO_IN_N_VOL_BIT

/* General Purpose Control Register(0x40) */
#define RT5631_SPK_AMP_AUTO_RATIO_EN

#define RT5631_SPK_AMP_RATIO_CTRL_MASK
#define RT5631_SPK_AMP_RATIO_CTRL_2_34
#define RT5631_SPK_AMP_RATIO_CTRL_1_99
#define RT5631_SPK_AMP_RATIO_CTRL_1_68
#define RT5631_SPK_AMP_RATIO_CTRL_1_56
#define RT5631_SPK_AMP_RATIO_CTRL_1_44
#define RT5631_SPK_AMP_RATIO_CTRL_1_27
#define RT5631_SPK_AMP_RATIO_CTRL_1_09
#define RT5631_SPK_AMP_RATIO_CTRL_1_00
#define RT5631_SPK_AMP_RATIO_CTRL_SHIFT

#define RT5631_STEREO_DAC_HI_PASS_FILT_EN
#define RT5631_STEREO_ADC_HI_PASS_FILT_EN
/* Select ADC Wind Filter Clock type */
#define RT5631_ADC_WIND_FILT_MASK
#define RT5631_ADC_WIND_FILT_8_16_32K
#define RT5631_ADC_WIND_FILT_11_22_44K
#define RT5631_ADC_WIND_FILT_12_24_48K
#define RT5631_ADC_WIND_FILT_EN
/* SelectADC Wind Filter Corner Frequency */
#define RT5631_ADC_WIND_CNR_FREQ_MASK
#define RT5631_ADC_WIND_CNR_FREQ_82_113_122
#define RT5631_ADC_WIND_CNR_FREQ_102_141_153
#define RT5631_ADC_WIND_CNR_FREQ_131_180_156
#define RT5631_ADC_WIND_CNR_FREQ_163_225_245
#define RT5631_ADC_WIND_CNR_FREQ_204_281_306
#define RT5631_ADC_WIND_CNR_FREQ_261_360_392
#define RT5631_ADC_WIND_CNR_FREQ_327_450_490
#define RT5631_ADC_WIND_CNR_FREQ_408_563_612

/* Global Clock Control Register(0x42) */
#define RT5631_SYSCLK_SOUR_SEL_MASK
#define RT5631_SYSCLK_SOUR_SEL_MCLK
#define RT5631_SYSCLK_SOUR_SEL_PLL
#define RT5631_SYSCLK_SOUR_SEL_PLL_TCK

#define RT5631_PLLCLK_SOUR_SEL_MASK
#define RT5631_PLLCLK_SOUR_SEL_MCLK
#define RT5631_PLLCLK_SOUR_SEL_BCLK
#define RT5631_PLLCLK_SOUR_SEL_VBCLK

#define RT5631_PLLCLK_PRE_DIV1
#define RT5631_PLLCLK_PRE_DIV2

/* PLL Control(0x44) */
#define RT5631_PLL_CTRL_M_VAL(m)
#define RT5631_PLL_CTRL_K_VAL(k)
#define RT5631_PLL_CTRL_N_VAL(n)

/* Internal Status and IRQ Control2(0x4A) */
#define RT5631_ADC_DATA_SEL_MASK
#define RT5631_ADC_DATA_SEL_Disable
#define RT5631_ADC_DATA_SEL_MIC1
#define RT5631_ADC_DATA_SEL_MIC1_SHIFT
#define RT5631_ADC_DATA_SEL_MIC2
#define RT5631_ADC_DATA_SEL_MIC2_SHIFT
#define RT5631_ADC_DATA_SEL_STO
#define RT5631_ADC_DATA_SEL_SHIFT

/* GPIO Pin Configuration(0x4C) */
#define RT5631_GPIO_PIN_FUN_SEL_MASK
#define RT5631_GPIO_PIN_FUN_SEL_IRQ
#define RT5631_GPIO_PIN_FUN_SEL_GPIO_DIMC

#define RT5631_GPIO_DMIC_FUN_SEL_MASK
#define RT5631_GPIO_DMIC_FUN_SEL_DIMC
#define RT5631_GPIO_DMIC_FUN_SEL_GPIO

#define RT5631_GPIO_PIN_CON_MASK
#define RT5631_GPIO_PIN_SET_INPUT
#define RT5631_GPIO_PIN_SET_OUTPUT

/* De-POP function Control 1(0x54) */
#define RT5631_POW_ON_SOFT_GEN
#define RT5631_EN_MUTE_UNMUTE_DEPOP
#define RT5631_EN_DEPOP2_FOR_HP
/* Power Down HPAMP_L Starts Up Signal */
#define RT5631_PD_HPAMP_L_ST_UP
/* Power Down HPAMP_R Starts Up Signal */
#define RT5631_PD_HPAMP_R_ST_UP
/* Enable left HP mute/unmute depop */
#define RT5631_EN_HP_L_M_UN_MUTE_DEPOP
/* Enable right HP mute/unmute depop */
#define RT5631_EN_HP_R_M_UN_MUTE_DEPOP

/* De-POP Fnction Control(0x56) */
#define RT5631_EN_ONE_BIT_DEPOP
#define RT5631_EN_CAP_FREE_DEPOP

/* Jack Detect Control Register(0x5A) */
#define RT5631_JD_USE_MASK
#define RT5631_JD_USE_JD2
#define RT5631_JD_USE_JD1
#define RT5631_JD_USE_GPIO
#define RT5631_JD_OFF
/* JD trigger enable for HP */
#define RT5631_JD_HP_EN
#define RT5631_JD_HP_TRI_MASK
#define RT5631_JD_HP_TRI_HI
#define RT5631_JD_HP_TRI_LO
/* JD trigger enable for speaker LP/LN */
#define RT5631_JD_SPK_L_EN
#define RT5631_JD_SPK_L_TRI_MASK
#define RT5631_JD_SPK_L_TRI_HI
#define RT5631_JD_SPK_L_TRI_LO
/* JD trigger enable for speaker RP/RN */
#define RT5631_JD_SPK_R_EN
#define RT5631_JD_SPK_R_TRI_MASK
#define RT5631_JD_SPK_R_TRI_HI
#define RT5631_JD_SPK_R_TRI_LO
/* JD trigger enable for monoout */
#define RT5631_JD_MONO_EN
#define RT5631_JD_MONO_TRI_MASK
#define RT5631_JD_MONO_TRI_HI
#define RT5631_JD_MONO_TRI_LO
/* JD trigger enable for Lout */
#define RT5631_JD_AUX_1_EN
#define RT5631_JD_AUX_1_MASK
#define RT5631_JD_AUX_1_TRI_HI
#define RT5631_JD_AUX_1_TRI_LO
/* JD trigger enable for Rout */
#define RT5631_JD_AUX_2_EN
#define RT5631_JD_AUX_2_MASK
#define RT5631_JD_AUX_2_TRI_HI
#define RT5631_JD_AUX_2_TRI_LO

/* ALC CONTROL 1(0x64) */
#define RT5631_ALC_ATTACK_RATE_MASK
#define RT5631_ALC_RECOVERY_RATE_MASK

/* ALC CONTROL 2(0x65) */
/* select Compensation gain for Noise gate function */
#define RT5631_ALC_COM_NOISE_GATE_MASK

/* ALC CONTROL 3(0x66) */
#define RT5631_ALC_FUN_MASK
#define RT5631_ALC_FUN_DIS
#define RT5631_ALC_ENA_DAC_PATH
#define RT5631_ALC_ENA_ADC_PATH
#define RT5631_ALC_PARA_UPDATE
#define RT5631_ALC_LIMIT_LEVEL_MASK
#define RT5631_ALC_NOISE_GATE_FUN_MASK
#define RT5631_ALC_NOISE_GATE_FUN_DIS
#define RT5631_ALC_NOISE_GATE_FUN_ENA
/* ALC noise gate hold data function */
#define RT5631_ALC_NOISE_GATE_H_D_MASK
#define RT5631_ALC_NOISE_GATE_H_D_DIS
#define RT5631_ALC_NOISE_GATE_H_D_ENA

/* Psedueo Stereo & Spatial Effect Block Control(0x68) */
#define RT5631_SPATIAL_CTRL_EN
#define RT5631_ALL_PASS_FILTER_EN
#define RT5631_PSEUDO_STEREO_EN
#define RT5631_STEREO_EXPENSION_EN
/* 3D gain parameter */
#define RT5631_GAIN_3D_PARA_MASK
#define RT5631_GAIN_3D_PARA_1_00
#define RT5631_GAIN_3D_PARA_1_50
#define RT5631_GAIN_3D_PARA_2_00
/* 3D ratio parameter */
#define RT5631_RATIO_3D_MASK
#define RT5631_RATIO_3D_0_0
#define RT5631_RATIO_3D_0_66
#define RT5631_RATIO_3D_1_0
/* select samplerate for all pass filter */
#define RT5631_APF_FUN_SLE_MASK
#define RT5631_APF_FUN_SEL_48K
#define RT5631_APF_FUN_SEL_44_1K
#define RT5631_APF_FUN_SEL_32K
#define RT5631_APF_FUN_DIS

/* EQ CONTROL 1(0x6E) */
#define RT5631_HW_EQ_PATH_SEL_MASK
#define RT5631_HW_EQ_PATH_SEL_DAC
#define RT5631_HW_EQ_PATH_SEL_ADC
#define RT5631_HW_EQ_UPDATE_CTRL

#define RT5631_EN_HW_EQ_HPF2
#define RT5631_EN_HW_EQ_HPF1
#define RT5631_EN_HW_EQ_BP3
#define RT5631_EN_HW_EQ_BP2
#define RT5631_EN_HW_EQ_BP1
#define RT5631_EN_HW_EQ_LPF


#endif /* __RTCODEC5631_H__ */