162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */ 262306a36Sopenharmony_ci/* 362306a36Sopenharmony_ci * rt5616.h -- RT5616 ALSA SoC audio driver 462306a36Sopenharmony_ci * 562306a36Sopenharmony_ci * Copyright 2011 Realtek Microelectronics 662306a36Sopenharmony_ci * Author: Johnny Hsu <johnnyhsu@realtek.com> 762306a36Sopenharmony_ci */ 862306a36Sopenharmony_ci 962306a36Sopenharmony_ci#ifndef __RT5616_H__ 1062306a36Sopenharmony_ci#define __RT5616_H__ 1162306a36Sopenharmony_ci 1262306a36Sopenharmony_ci/* Info */ 1362306a36Sopenharmony_ci#define RT5616_RESET 0x00 1462306a36Sopenharmony_ci#define RT5616_VERSION_ID 0xfd 1562306a36Sopenharmony_ci#define RT5616_VENDOR_ID 0xfe 1662306a36Sopenharmony_ci#define RT5616_DEVICE_ID 0xff 1762306a36Sopenharmony_ci/* I/O - Output */ 1862306a36Sopenharmony_ci#define RT5616_HP_VOL 0x02 1962306a36Sopenharmony_ci#define RT5616_LOUT_CTRL1 0x03 2062306a36Sopenharmony_ci#define RT5616_LOUT_CTRL2 0x05 2162306a36Sopenharmony_ci/* I/O - Input */ 2262306a36Sopenharmony_ci#define RT5616_IN1_IN2 0x0d 2362306a36Sopenharmony_ci#define RT5616_INL1_INR1_VOL 0x0f 2462306a36Sopenharmony_ci/* I/O - ADC/DAC/DMIC */ 2562306a36Sopenharmony_ci#define RT5616_DAC1_DIG_VOL 0x19 2662306a36Sopenharmony_ci#define RT5616_ADC_DIG_VOL 0x1c 2762306a36Sopenharmony_ci#define RT5616_ADC_BST_VOL 0x1e 2862306a36Sopenharmony_ci/* Mixer - D-D */ 2962306a36Sopenharmony_ci#define RT5616_STO1_ADC_MIXER 0x27 3062306a36Sopenharmony_ci#define RT5616_AD_DA_MIXER 0x29 3162306a36Sopenharmony_ci#define RT5616_STO_DAC_MIXER 0x2a 3262306a36Sopenharmony_ci 3362306a36Sopenharmony_ci/* Mixer - ADC */ 3462306a36Sopenharmony_ci#define RT5616_REC_L1_MIXER 0x3b 3562306a36Sopenharmony_ci#define RT5616_REC_L2_MIXER 0x3c 3662306a36Sopenharmony_ci#define RT5616_REC_R1_MIXER 0x3d 3762306a36Sopenharmony_ci#define RT5616_REC_R2_MIXER 0x3e 3862306a36Sopenharmony_ci/* Mixer - DAC */ 3962306a36Sopenharmony_ci#define RT5616_HPO_MIXER 0x45 4062306a36Sopenharmony_ci#define RT5616_OUT_L1_MIXER 0x4d 4162306a36Sopenharmony_ci#define RT5616_OUT_L2_MIXER 0x4e 4262306a36Sopenharmony_ci#define RT5616_OUT_L3_MIXER 0x4f 4362306a36Sopenharmony_ci#define RT5616_OUT_R1_MIXER 0x50 4462306a36Sopenharmony_ci#define RT5616_OUT_R2_MIXER 0x51 4562306a36Sopenharmony_ci#define RT5616_OUT_R3_MIXER 0x52 4662306a36Sopenharmony_ci#define RT5616_LOUT_MIXER 0x53 4762306a36Sopenharmony_ci/* Power */ 4862306a36Sopenharmony_ci#define RT5616_PWR_DIG1 0x61 4962306a36Sopenharmony_ci#define RT5616_PWR_DIG2 0x62 5062306a36Sopenharmony_ci#define RT5616_PWR_ANLG1 0x63 5162306a36Sopenharmony_ci#define RT5616_PWR_ANLG2 0x64 5262306a36Sopenharmony_ci#define RT5616_PWR_MIXER 0x65 5362306a36Sopenharmony_ci#define RT5616_PWR_VOL 0x66 5462306a36Sopenharmony_ci/* Private Register Control */ 5562306a36Sopenharmony_ci#define RT5616_PRIV_INDEX 0x6a 5662306a36Sopenharmony_ci#define RT5616_PRIV_DATA 0x6c 5762306a36Sopenharmony_ci/* Format - ADC/DAC */ 5862306a36Sopenharmony_ci#define RT5616_I2S1_SDP 0x70 5962306a36Sopenharmony_ci#define RT5616_ADDA_CLK1 0x73 6062306a36Sopenharmony_ci#define RT5616_ADDA_CLK2 0x74 6162306a36Sopenharmony_ci 6262306a36Sopenharmony_ci/* Function - Analog */ 6362306a36Sopenharmony_ci#define RT5616_GLB_CLK 0x80 6462306a36Sopenharmony_ci#define RT5616_PLL_CTRL1 0x81 6562306a36Sopenharmony_ci#define RT5616_PLL_CTRL2 0x82 6662306a36Sopenharmony_ci#define RT5616_HP_OVCD 0x8b 6762306a36Sopenharmony_ci#define RT5616_DEPOP_M1 0x8e 6862306a36Sopenharmony_ci#define RT5616_DEPOP_M2 0x8f 6962306a36Sopenharmony_ci#define RT5616_DEPOP_M3 0x90 7062306a36Sopenharmony_ci#define RT5616_CHARGE_PUMP 0x91 7162306a36Sopenharmony_ci#define RT5616_PV_DET_SPK_G 0x92 7262306a36Sopenharmony_ci#define RT5616_MICBIAS 0x93 7362306a36Sopenharmony_ci#define RT5616_A_JD_CTL1 0x94 7462306a36Sopenharmony_ci#define RT5616_A_JD_CTL2 0x95 7562306a36Sopenharmony_ci/* Function - Digital */ 7662306a36Sopenharmony_ci#define RT5616_EQ_CTRL1 0xb0 7762306a36Sopenharmony_ci#define RT5616_EQ_CTRL2 0xb1 7862306a36Sopenharmony_ci#define RT5616_WIND_FILTER 0xb2 7962306a36Sopenharmony_ci#define RT5616_DRC_AGC_1 0xb4 8062306a36Sopenharmony_ci#define RT5616_DRC_AGC_2 0xb5 8162306a36Sopenharmony_ci#define RT5616_DRC_AGC_3 0xb6 8262306a36Sopenharmony_ci#define RT5616_SVOL_ZC 0xb7 8362306a36Sopenharmony_ci#define RT5616_JD_CTRL1 0xbb 8462306a36Sopenharmony_ci#define RT5616_JD_CTRL2 0xbc 8562306a36Sopenharmony_ci#define RT5616_IRQ_CTRL1 0xbd 8662306a36Sopenharmony_ci#define RT5616_IRQ_CTRL2 0xbe 8762306a36Sopenharmony_ci#define RT5616_INT_IRQ_ST 0xbf 8862306a36Sopenharmony_ci#define RT5616_GPIO_CTRL1 0xc0 8962306a36Sopenharmony_ci#define RT5616_GPIO_CTRL2 0xc1 9062306a36Sopenharmony_ci#define RT5616_GPIO_CTRL3 0xc2 9162306a36Sopenharmony_ci#define RT5616_PGM_REG_ARR1 0xc8 9262306a36Sopenharmony_ci#define RT5616_PGM_REG_ARR2 0xc9 9362306a36Sopenharmony_ci#define RT5616_PGM_REG_ARR3 0xca 9462306a36Sopenharmony_ci#define RT5616_PGM_REG_ARR4 0xcb 9562306a36Sopenharmony_ci#define RT5616_PGM_REG_ARR5 0xcc 9662306a36Sopenharmony_ci#define RT5616_SCB_FUNC 0xcd 9762306a36Sopenharmony_ci#define RT5616_SCB_CTRL 0xce 9862306a36Sopenharmony_ci#define RT5616_BASE_BACK 0xcf 9962306a36Sopenharmony_ci#define RT5616_MP3_PLUS1 0xd0 10062306a36Sopenharmony_ci#define RT5616_MP3_PLUS2 0xd1 10162306a36Sopenharmony_ci#define RT5616_ADJ_HPF_CTRL1 0xd3 10262306a36Sopenharmony_ci#define RT5616_ADJ_HPF_CTRL2 0xd4 10362306a36Sopenharmony_ci#define RT5616_HP_CALIB_AMP_DET 0xd6 10462306a36Sopenharmony_ci#define RT5616_HP_CALIB2 0xd7 10562306a36Sopenharmony_ci#define RT5616_SV_ZCD1 0xd9 10662306a36Sopenharmony_ci#define RT5616_SV_ZCD2 0xda 10762306a36Sopenharmony_ci#define RT5616_D_MISC 0xfa 10862306a36Sopenharmony_ci/* Dummy Register */ 10962306a36Sopenharmony_ci#define RT5616_DUMMY2 0xfb 11062306a36Sopenharmony_ci#define RT5616_DUMMY3 0xfc 11162306a36Sopenharmony_ci 11262306a36Sopenharmony_ci 11362306a36Sopenharmony_ci/* Index of Codec Private Register definition */ 11462306a36Sopenharmony_ci#define RT5616_BIAS_CUR1 0x12 11562306a36Sopenharmony_ci#define RT5616_BIAS_CUR3 0x14 11662306a36Sopenharmony_ci#define RT5616_CLSD_INT_REG1 0x1c 11762306a36Sopenharmony_ci#define RT5616_MAMP_INT_REG2 0x37 11862306a36Sopenharmony_ci#define RT5616_CHOP_DAC_ADC 0x3d 11962306a36Sopenharmony_ci#define RT5616_3D_SPK 0x63 12062306a36Sopenharmony_ci#define RT5616_WND_1 0x6c 12162306a36Sopenharmony_ci#define RT5616_WND_2 0x6d 12262306a36Sopenharmony_ci#define RT5616_WND_3 0x6e 12362306a36Sopenharmony_ci#define RT5616_WND_4 0x6f 12462306a36Sopenharmony_ci#define RT5616_WND_5 0x70 12562306a36Sopenharmony_ci#define RT5616_WND_8 0x73 12662306a36Sopenharmony_ci#define RT5616_DIP_SPK_INF 0x75 12762306a36Sopenharmony_ci#define RT5616_HP_DCC_INT1 0x77 12862306a36Sopenharmony_ci#define RT5616_EQ_BW_LOP 0xa0 12962306a36Sopenharmony_ci#define RT5616_EQ_GN_LOP 0xa1 13062306a36Sopenharmony_ci#define RT5616_EQ_FC_BP1 0xa2 13162306a36Sopenharmony_ci#define RT5616_EQ_BW_BP1 0xa3 13262306a36Sopenharmony_ci#define RT5616_EQ_GN_BP1 0xa4 13362306a36Sopenharmony_ci#define RT5616_EQ_FC_BP2 0xa5 13462306a36Sopenharmony_ci#define RT5616_EQ_BW_BP2 0xa6 13562306a36Sopenharmony_ci#define RT5616_EQ_GN_BP2 0xa7 13662306a36Sopenharmony_ci#define RT5616_EQ_FC_BP3 0xa8 13762306a36Sopenharmony_ci#define RT5616_EQ_BW_BP3 0xa9 13862306a36Sopenharmony_ci#define RT5616_EQ_GN_BP3 0xaa 13962306a36Sopenharmony_ci#define RT5616_EQ_FC_BP4 0xab 14062306a36Sopenharmony_ci#define RT5616_EQ_BW_BP4 0xac 14162306a36Sopenharmony_ci#define RT5616_EQ_GN_BP4 0xad 14262306a36Sopenharmony_ci#define RT5616_EQ_FC_HIP1 0xae 14362306a36Sopenharmony_ci#define RT5616_EQ_GN_HIP1 0xaf 14462306a36Sopenharmony_ci#define RT5616_EQ_FC_HIP2 0xb0 14562306a36Sopenharmony_ci#define RT5616_EQ_BW_HIP2 0xb1 14662306a36Sopenharmony_ci#define RT5616_EQ_GN_HIP2 0xb2 14762306a36Sopenharmony_ci#define RT5616_EQ_PRE_VOL 0xb3 14862306a36Sopenharmony_ci#define RT5616_EQ_PST_VOL 0xb4 14962306a36Sopenharmony_ci 15062306a36Sopenharmony_ci 15162306a36Sopenharmony_ci/* global definition */ 15262306a36Sopenharmony_ci#define RT5616_L_MUTE (0x1 << 15) 15362306a36Sopenharmony_ci#define RT5616_L_MUTE_SFT 15 15462306a36Sopenharmony_ci#define RT5616_VOL_L_MUTE (0x1 << 14) 15562306a36Sopenharmony_ci#define RT5616_VOL_L_SFT 14 15662306a36Sopenharmony_ci#define RT5616_R_MUTE (0x1 << 7) 15762306a36Sopenharmony_ci#define RT5616_R_MUTE_SFT 7 15862306a36Sopenharmony_ci#define RT5616_VOL_R_MUTE (0x1 << 6) 15962306a36Sopenharmony_ci#define RT5616_VOL_R_SFT 6 16062306a36Sopenharmony_ci#define RT5616_L_VOL_MASK (0x3f << 8) 16162306a36Sopenharmony_ci#define RT5616_L_VOL_SFT 8 16262306a36Sopenharmony_ci#define RT5616_R_VOL_MASK (0x3f) 16362306a36Sopenharmony_ci#define RT5616_R_VOL_SFT 0 16462306a36Sopenharmony_ci 16562306a36Sopenharmony_ci/* LOUT Control 2(0x05) */ 16662306a36Sopenharmony_ci#define RT5616_EN_DFO (0x1 << 15) 16762306a36Sopenharmony_ci 16862306a36Sopenharmony_ci/* IN1 and IN2 Control (0x0d) */ 16962306a36Sopenharmony_ci/* IN3 and IN4 Control (0x0e) */ 17062306a36Sopenharmony_ci#define RT5616_BST_MASK1 (0xf<<12) 17162306a36Sopenharmony_ci#define RT5616_BST_SFT1 12 17262306a36Sopenharmony_ci#define RT5616_BST_MASK2 (0xf<<8) 17362306a36Sopenharmony_ci#define RT5616_BST_SFT2 8 17462306a36Sopenharmony_ci#define RT5616_IN_DF1 (0x1 << 7) 17562306a36Sopenharmony_ci#define RT5616_IN_SFT1 7 17662306a36Sopenharmony_ci#define RT5616_IN_DF2 (0x1 << 6) 17762306a36Sopenharmony_ci#define RT5616_IN_SFT2 6 17862306a36Sopenharmony_ci 17962306a36Sopenharmony_ci/* INL1 and INR1 Volume Control (0x0f) */ 18062306a36Sopenharmony_ci#define RT5616_INL_VOL_MASK (0x1f << 8) 18162306a36Sopenharmony_ci#define RT5616_INL_VOL_SFT 8 18262306a36Sopenharmony_ci#define RT5616_INR_SEL_MASK (0x1 << 7) 18362306a36Sopenharmony_ci#define RT5616_INR_SEL_SFT 7 18462306a36Sopenharmony_ci#define RT5616_INR_SEL_IN4N (0x0 << 7) 18562306a36Sopenharmony_ci#define RT5616_INR_SEL_MONON (0x1 << 7) 18662306a36Sopenharmony_ci#define RT5616_INR_VOL_MASK (0x1f) 18762306a36Sopenharmony_ci#define RT5616_INR_VOL_SFT 0 18862306a36Sopenharmony_ci 18962306a36Sopenharmony_ci/* DAC1 Digital Volume (0x19) */ 19062306a36Sopenharmony_ci#define RT5616_DAC_L1_VOL_MASK (0xff << 8) 19162306a36Sopenharmony_ci#define RT5616_DAC_L1_VOL_SFT 8 19262306a36Sopenharmony_ci#define RT5616_DAC_R1_VOL_MASK (0xff) 19362306a36Sopenharmony_ci#define RT5616_DAC_R1_VOL_SFT 0 19462306a36Sopenharmony_ci 19562306a36Sopenharmony_ci/* DAC2 Digital Volume (0x1a) */ 19662306a36Sopenharmony_ci#define RT5616_DAC_L2_VOL_MASK (0xff << 8) 19762306a36Sopenharmony_ci#define RT5616_DAC_L2_VOL_SFT 8 19862306a36Sopenharmony_ci#define RT5616_DAC_R2_VOL_MASK (0xff) 19962306a36Sopenharmony_ci#define RT5616_DAC_R2_VOL_SFT 0 20062306a36Sopenharmony_ci 20162306a36Sopenharmony_ci/* ADC Digital Volume Control (0x1c) */ 20262306a36Sopenharmony_ci#define RT5616_ADC_L_VOL_MASK (0x7f << 8) 20362306a36Sopenharmony_ci#define RT5616_ADC_L_VOL_SFT 8 20462306a36Sopenharmony_ci#define RT5616_ADC_R_VOL_MASK (0x7f) 20562306a36Sopenharmony_ci#define RT5616_ADC_R_VOL_SFT 0 20662306a36Sopenharmony_ci 20762306a36Sopenharmony_ci/* Mono ADC Digital Volume Control (0x1d) */ 20862306a36Sopenharmony_ci#define RT5616_M_MONO_ADC_L (0x1 << 15) 20962306a36Sopenharmony_ci#define RT5616_M_MONO_ADC_L_SFT 15 21062306a36Sopenharmony_ci#define RT5616_MONO_ADC_L_VOL_MASK (0x7f << 8) 21162306a36Sopenharmony_ci#define RT5616_MONO_ADC_L_VOL_SFT 8 21262306a36Sopenharmony_ci#define RT5616_M_MONO_ADC_R (0x1 << 7) 21362306a36Sopenharmony_ci#define RT5616_M_MONO_ADC_R_SFT 7 21462306a36Sopenharmony_ci#define RT5616_MONO_ADC_R_VOL_MASK (0x7f) 21562306a36Sopenharmony_ci#define RT5616_MONO_ADC_R_VOL_SFT 0 21662306a36Sopenharmony_ci 21762306a36Sopenharmony_ci/* ADC Boost Volume Control (0x1e) */ 21862306a36Sopenharmony_ci#define RT5616_ADC_L_BST_MASK (0x3 << 14) 21962306a36Sopenharmony_ci#define RT5616_ADC_L_BST_SFT 14 22062306a36Sopenharmony_ci#define RT5616_ADC_R_BST_MASK (0x3 << 12) 22162306a36Sopenharmony_ci#define RT5616_ADC_R_BST_SFT 12 22262306a36Sopenharmony_ci#define RT5616_ADC_COMP_MASK (0x3 << 10) 22362306a36Sopenharmony_ci#define RT5616_ADC_COMP_SFT 10 22462306a36Sopenharmony_ci 22562306a36Sopenharmony_ci/* Stereo ADC1 Mixer Control (0x27) */ 22662306a36Sopenharmony_ci#define RT5616_M_STO1_ADC_L1 (0x1 << 14) 22762306a36Sopenharmony_ci#define RT5616_M_STO1_ADC_L1_SFT 14 22862306a36Sopenharmony_ci#define RT5616_M_STO1_ADC_R1 (0x1 << 6) 22962306a36Sopenharmony_ci#define RT5616_M_STO1_ADC_R1_SFT 6 23062306a36Sopenharmony_ci 23162306a36Sopenharmony_ci/* ADC Mixer to DAC Mixer Control (0x29) */ 23262306a36Sopenharmony_ci#define RT5616_M_ADCMIX_L (0x1 << 15) 23362306a36Sopenharmony_ci#define RT5616_M_ADCMIX_L_SFT 15 23462306a36Sopenharmony_ci#define RT5616_M_IF1_DAC_L (0x1 << 14) 23562306a36Sopenharmony_ci#define RT5616_M_IF1_DAC_L_SFT 14 23662306a36Sopenharmony_ci#define RT5616_M_ADCMIX_R (0x1 << 7) 23762306a36Sopenharmony_ci#define RT5616_M_ADCMIX_R_SFT 7 23862306a36Sopenharmony_ci#define RT5616_M_IF1_DAC_R (0x1 << 6) 23962306a36Sopenharmony_ci#define RT5616_M_IF1_DAC_R_SFT 6 24062306a36Sopenharmony_ci 24162306a36Sopenharmony_ci/* Stereo DAC Mixer Control (0x2a) */ 24262306a36Sopenharmony_ci#define RT5616_M_DAC_L1_MIXL (0x1 << 14) 24362306a36Sopenharmony_ci#define RT5616_M_DAC_L1_MIXL_SFT 14 24462306a36Sopenharmony_ci#define RT5616_DAC_L1_STO_L_VOL_MASK (0x1 << 13) 24562306a36Sopenharmony_ci#define RT5616_DAC_L1_STO_L_VOL_SFT 13 24662306a36Sopenharmony_ci#define RT5616_M_DAC_R1_MIXL (0x1 << 9) 24762306a36Sopenharmony_ci#define RT5616_M_DAC_R1_MIXL_SFT 9 24862306a36Sopenharmony_ci#define RT5616_DAC_R1_STO_L_VOL_MASK (0x1 << 8) 24962306a36Sopenharmony_ci#define RT5616_DAC_R1_STO_L_VOL_SFT 8 25062306a36Sopenharmony_ci#define RT5616_M_DAC_R1_MIXR (0x1 << 6) 25162306a36Sopenharmony_ci#define RT5616_M_DAC_R1_MIXR_SFT 6 25262306a36Sopenharmony_ci#define RT5616_DAC_R1_STO_R_VOL_MASK (0x1 << 5) 25362306a36Sopenharmony_ci#define RT5616_DAC_R1_STO_R_VOL_SFT 5 25462306a36Sopenharmony_ci#define RT5616_M_DAC_L1_MIXR (0x1 << 1) 25562306a36Sopenharmony_ci#define RT5616_M_DAC_L1_MIXR_SFT 1 25662306a36Sopenharmony_ci#define RT5616_DAC_L1_STO_R_VOL_MASK (0x1) 25762306a36Sopenharmony_ci#define RT5616_DAC_L1_STO_R_VOL_SFT 0 25862306a36Sopenharmony_ci 25962306a36Sopenharmony_ci/* DD Mixer Control (0x2b) */ 26062306a36Sopenharmony_ci#define RT5616_M_STO_DD_L1 (0x1 << 14) 26162306a36Sopenharmony_ci#define RT5616_M_STO_DD_L1_SFT 14 26262306a36Sopenharmony_ci#define RT5616_STO_DD_L1_VOL_MASK (0x1 << 13) 26362306a36Sopenharmony_ci#define RT5616_DAC_DD_L1_VOL_SFT 13 26462306a36Sopenharmony_ci#define RT5616_M_STO_DD_L2 (0x1 << 12) 26562306a36Sopenharmony_ci#define RT5616_M_STO_DD_L2_SFT 12 26662306a36Sopenharmony_ci#define RT5616_STO_DD_L2_VOL_MASK (0x1 << 11) 26762306a36Sopenharmony_ci#define RT5616_STO_DD_L2_VOL_SFT 11 26862306a36Sopenharmony_ci#define RT5616_M_STO_DD_R2_L (0x1 << 10) 26962306a36Sopenharmony_ci#define RT5616_M_STO_DD_R2_L_SFT 10 27062306a36Sopenharmony_ci#define RT5616_STO_DD_R2_L_VOL_MASK (0x1 << 9) 27162306a36Sopenharmony_ci#define RT5616_STO_DD_R2_L_VOL_SFT 9 27262306a36Sopenharmony_ci#define RT5616_M_STO_DD_R1 (0x1 << 6) 27362306a36Sopenharmony_ci#define RT5616_M_STO_DD_R1_SFT 6 27462306a36Sopenharmony_ci#define RT5616_STO_DD_R1_VOL_MASK (0x1 << 5) 27562306a36Sopenharmony_ci#define RT5616_STO_DD_R1_VOL_SFT 5 27662306a36Sopenharmony_ci#define RT5616_M_STO_DD_R2 (0x1 << 4) 27762306a36Sopenharmony_ci#define RT5616_M_STO_DD_R2_SFT 4 27862306a36Sopenharmony_ci#define RT5616_STO_DD_R2_VOL_MASK (0x1 << 3) 27962306a36Sopenharmony_ci#define RT5616_STO_DD_R2_VOL_SFT 3 28062306a36Sopenharmony_ci#define RT5616_M_STO_DD_L2_R (0x1 << 2) 28162306a36Sopenharmony_ci#define RT5616_M_STO_DD_L2_R_SFT 2 28262306a36Sopenharmony_ci#define RT5616_STO_DD_L2_R_VOL_MASK (0x1 << 1) 28362306a36Sopenharmony_ci#define RT5616_STO_DD_L2_R_VOL_SFT 1 28462306a36Sopenharmony_ci 28562306a36Sopenharmony_ci/* Digital Mixer Control (0x2c) */ 28662306a36Sopenharmony_ci#define RT5616_M_STO_L_DAC_L (0x1 << 15) 28762306a36Sopenharmony_ci#define RT5616_M_STO_L_DAC_L_SFT 15 28862306a36Sopenharmony_ci#define RT5616_STO_L_DAC_L_VOL_MASK (0x1 << 14) 28962306a36Sopenharmony_ci#define RT5616_STO_L_DAC_L_VOL_SFT 14 29062306a36Sopenharmony_ci#define RT5616_M_DAC_L2_DAC_L (0x1 << 13) 29162306a36Sopenharmony_ci#define RT5616_M_DAC_L2_DAC_L_SFT 13 29262306a36Sopenharmony_ci#define RT5616_DAC_L2_DAC_L_VOL_MASK (0x1 << 12) 29362306a36Sopenharmony_ci#define RT5616_DAC_L2_DAC_L_VOL_SFT 12 29462306a36Sopenharmony_ci#define RT5616_M_STO_R_DAC_R (0x1 << 11) 29562306a36Sopenharmony_ci#define RT5616_M_STO_R_DAC_R_SFT 11 29662306a36Sopenharmony_ci#define RT5616_STO_R_DAC_R_VOL_MASK (0x1 << 10) 29762306a36Sopenharmony_ci#define RT5616_STO_R_DAC_R_VOL_SFT 10 29862306a36Sopenharmony_ci#define RT5616_M_DAC_R2_DAC_R (0x1 << 9) 29962306a36Sopenharmony_ci#define RT5616_M_DAC_R2_DAC_R_SFT 9 30062306a36Sopenharmony_ci#define RT5616_DAC_R2_DAC_R_VOL_MASK (0x1 << 8) 30162306a36Sopenharmony_ci#define RT5616_DAC_R2_DAC_R_VOL_SFT 8 30262306a36Sopenharmony_ci 30362306a36Sopenharmony_ci/* DSP Path Control 1 (0x2d) */ 30462306a36Sopenharmony_ci#define RT5616_RXDP_SRC_MASK (0x1 << 15) 30562306a36Sopenharmony_ci#define RT5616_RXDP_SRC_SFT 15 30662306a36Sopenharmony_ci#define RT5616_RXDP_SRC_NOR (0x0 << 15) 30762306a36Sopenharmony_ci#define RT5616_RXDP_SRC_DIV3 (0x1 << 15) 30862306a36Sopenharmony_ci#define RT5616_TXDP_SRC_MASK (0x1 << 14) 30962306a36Sopenharmony_ci#define RT5616_TXDP_SRC_SFT 14 31062306a36Sopenharmony_ci#define RT5616_TXDP_SRC_NOR (0x0 << 14) 31162306a36Sopenharmony_ci#define RT5616_TXDP_SRC_DIV3 (0x1 << 14) 31262306a36Sopenharmony_ci 31362306a36Sopenharmony_ci/* DSP Path Control 2 (0x2e) */ 31462306a36Sopenharmony_ci#define RT5616_DAC_L2_SEL_MASK (0x3 << 14) 31562306a36Sopenharmony_ci#define RT5616_DAC_L2_SEL_SFT 14 31662306a36Sopenharmony_ci#define RT5616_DAC_L2_SEL_IF2 (0x0 << 14) 31762306a36Sopenharmony_ci#define RT5616_DAC_L2_SEL_IF3 (0x1 << 14) 31862306a36Sopenharmony_ci#define RT5616_DAC_L2_SEL_TXDC (0x2 << 14) 31962306a36Sopenharmony_ci#define RT5616_DAC_L2_SEL_BASS (0x3 << 14) 32062306a36Sopenharmony_ci#define RT5616_DAC_R2_SEL_MASK (0x3 << 12) 32162306a36Sopenharmony_ci#define RT5616_DAC_R2_SEL_SFT 12 32262306a36Sopenharmony_ci#define RT5616_DAC_R2_SEL_IF2 (0x0 << 12) 32362306a36Sopenharmony_ci#define RT5616_DAC_R2_SEL_IF3 (0x1 << 12) 32462306a36Sopenharmony_ci#define RT5616_DAC_R2_SEL_TXDC (0x2 << 12) 32562306a36Sopenharmony_ci#define RT5616_IF2_ADC_L_SEL_MASK (0x1 << 11) 32662306a36Sopenharmony_ci#define RT5616_IF2_ADC_L_SEL_SFT 11 32762306a36Sopenharmony_ci#define RT5616_IF2_ADC_L_SEL_TXDP (0x0 << 11) 32862306a36Sopenharmony_ci#define RT5616_IF2_ADC_L_SEL_PASS (0x1 << 11) 32962306a36Sopenharmony_ci#define RT5616_IF2_ADC_R_SEL_MASK (0x1 << 10) 33062306a36Sopenharmony_ci#define RT5616_IF2_ADC_R_SEL_SFT 10 33162306a36Sopenharmony_ci#define RT5616_IF2_ADC_R_SEL_TXDP (0x0 << 10) 33262306a36Sopenharmony_ci#define RT5616_IF2_ADC_R_SEL_PASS (0x1 << 10) 33362306a36Sopenharmony_ci#define RT5616_RXDC_SEL_MASK (0x3 << 8) 33462306a36Sopenharmony_ci#define RT5616_RXDC_SEL_SFT 8 33562306a36Sopenharmony_ci#define RT5616_RXDC_SEL_NOR (0x0 << 8) 33662306a36Sopenharmony_ci#define RT5616_RXDC_SEL_L2R (0x1 << 8) 33762306a36Sopenharmony_ci#define RT5616_RXDC_SEL_R2L (0x2 << 8) 33862306a36Sopenharmony_ci#define RT5616_RXDC_SEL_SWAP (0x3 << 8) 33962306a36Sopenharmony_ci#define RT5616_RXDP_SEL_MASK (0x3 << 6) 34062306a36Sopenharmony_ci#define RT5616_RXDP_SEL_SFT 6 34162306a36Sopenharmony_ci#define RT5616_RXDP_SEL_NOR (0x0 << 6) 34262306a36Sopenharmony_ci#define RT5616_RXDP_SEL_L2R (0x1 << 6) 34362306a36Sopenharmony_ci#define RT5616_RXDP_SEL_R2L (0x2 << 6) 34462306a36Sopenharmony_ci#define RT5616_RXDP_SEL_SWAP (0x3 << 6) 34562306a36Sopenharmony_ci#define RT5616_TXDC_SEL_MASK (0x3 << 4) 34662306a36Sopenharmony_ci#define RT5616_TXDC_SEL_SFT 4 34762306a36Sopenharmony_ci#define RT5616_TXDC_SEL_NOR (0x0 << 4) 34862306a36Sopenharmony_ci#define RT5616_TXDC_SEL_L2R (0x1 << 4) 34962306a36Sopenharmony_ci#define RT5616_TXDC_SEL_R2L (0x2 << 4) 35062306a36Sopenharmony_ci#define RT5616_TXDC_SEL_SWAP (0x3 << 4) 35162306a36Sopenharmony_ci#define RT5616_TXDP_SEL_MASK (0x3 << 2) 35262306a36Sopenharmony_ci#define RT5616_TXDP_SEL_SFT 2 35362306a36Sopenharmony_ci#define RT5616_TXDP_SEL_NOR (0x0 << 2) 35462306a36Sopenharmony_ci#define RT5616_TXDP_SEL_L2R (0x1 << 2) 35562306a36Sopenharmony_ci#define RT5616_TXDP_SEL_R2L (0x2 << 2) 35662306a36Sopenharmony_ci#define RT5616_TRXDP_SEL_SWAP (0x3 << 2) 35762306a36Sopenharmony_ci 35862306a36Sopenharmony_ci/* REC Left Mixer Control 1 (0x3b) */ 35962306a36Sopenharmony_ci#define RT5616_G_LN_L2_RM_L_MASK (0x7 << 13) 36062306a36Sopenharmony_ci#define RT5616_G_IN_L2_RM_L_SFT 13 36162306a36Sopenharmony_ci#define RT5616_G_LN_L1_RM_L_MASK (0x7 << 10) 36262306a36Sopenharmony_ci#define RT5616_G_IN_L1_RM_L_SFT 10 36362306a36Sopenharmony_ci#define RT5616_G_BST3_RM_L_MASK (0x7 << 4) 36462306a36Sopenharmony_ci#define RT5616_G_BST3_RM_L_SFT 4 36562306a36Sopenharmony_ci#define RT5616_G_BST2_RM_L_MASK (0x7 << 1) 36662306a36Sopenharmony_ci#define RT5616_G_BST2_RM_L_SFT 1 36762306a36Sopenharmony_ci 36862306a36Sopenharmony_ci/* REC Left Mixer Control 2 (0x3c) */ 36962306a36Sopenharmony_ci#define RT5616_G_BST1_RM_L_MASK (0x7 << 13) 37062306a36Sopenharmony_ci#define RT5616_G_BST1_RM_L_SFT 13 37162306a36Sopenharmony_ci#define RT5616_G_OM_L_RM_L_MASK (0x7 << 10) 37262306a36Sopenharmony_ci#define RT5616_G_OM_L_RM_L_SFT 10 37362306a36Sopenharmony_ci#define RT5616_M_IN2_L_RM_L (0x1 << 6) 37462306a36Sopenharmony_ci#define RT5616_M_IN2_L_RM_L_SFT 6 37562306a36Sopenharmony_ci#define RT5616_M_IN1_L_RM_L (0x1 << 5) 37662306a36Sopenharmony_ci#define RT5616_M_IN1_L_RM_L_SFT 5 37762306a36Sopenharmony_ci#define RT5616_M_BST3_RM_L (0x1 << 3) 37862306a36Sopenharmony_ci#define RT5616_M_BST3_RM_L_SFT 3 37962306a36Sopenharmony_ci#define RT5616_M_BST2_RM_L (0x1 << 2) 38062306a36Sopenharmony_ci#define RT5616_M_BST2_RM_L_SFT 2 38162306a36Sopenharmony_ci#define RT5616_M_BST1_RM_L (0x1 << 1) 38262306a36Sopenharmony_ci#define RT5616_M_BST1_RM_L_SFT 1 38362306a36Sopenharmony_ci#define RT5616_M_OM_L_RM_L (0x1) 38462306a36Sopenharmony_ci#define RT5616_M_OM_L_RM_L_SFT 0 38562306a36Sopenharmony_ci 38662306a36Sopenharmony_ci/* REC Right Mixer Control 1 (0x3d) */ 38762306a36Sopenharmony_ci#define RT5616_G_IN2_R_RM_R_MASK (0x7 << 13) 38862306a36Sopenharmony_ci#define RT5616_G_IN2_R_RM_R_SFT 13 38962306a36Sopenharmony_ci#define RT5616_G_IN1_R_RM_R_MASK (0x7 << 10) 39062306a36Sopenharmony_ci#define RT5616_G_IN1_R_RM_R_SFT 10 39162306a36Sopenharmony_ci#define RT5616_G_BST3_RM_R_MASK (0x7 << 4) 39262306a36Sopenharmony_ci#define RT5616_G_BST3_RM_R_SFT 4 39362306a36Sopenharmony_ci#define RT5616_G_BST2_RM_R_MASK (0x7 << 1) 39462306a36Sopenharmony_ci#define RT5616_G_BST2_RM_R_SFT 1 39562306a36Sopenharmony_ci 39662306a36Sopenharmony_ci/* REC Right Mixer Control 2 (0x3e) */ 39762306a36Sopenharmony_ci#define RT5616_G_BST1_RM_R_MASK (0x7 << 13) 39862306a36Sopenharmony_ci#define RT5616_G_BST1_RM_R_SFT 13 39962306a36Sopenharmony_ci#define RT5616_G_OM_R_RM_R_MASK (0x7 << 10) 40062306a36Sopenharmony_ci#define RT5616_G_OM_R_RM_R_SFT 10 40162306a36Sopenharmony_ci#define RT5616_M_IN2_R_RM_R (0x1 << 6) 40262306a36Sopenharmony_ci#define RT5616_M_IN2_R_RM_R_SFT 6 40362306a36Sopenharmony_ci#define RT5616_M_IN1_R_RM_R (0x1 << 5) 40462306a36Sopenharmony_ci#define RT5616_M_IN1_R_RM_R_SFT 5 40562306a36Sopenharmony_ci#define RT5616_M_BST3_RM_R (0x1 << 3) 40662306a36Sopenharmony_ci#define RT5616_M_BST3_RM_R_SFT 3 40762306a36Sopenharmony_ci#define RT5616_M_BST2_RM_R (0x1 << 2) 40862306a36Sopenharmony_ci#define RT5616_M_BST2_RM_R_SFT 2 40962306a36Sopenharmony_ci#define RT5616_M_BST1_RM_R (0x1 << 1) 41062306a36Sopenharmony_ci#define RT5616_M_BST1_RM_R_SFT 1 41162306a36Sopenharmony_ci#define RT5616_M_OM_R_RM_R (0x1) 41262306a36Sopenharmony_ci#define RT5616_M_OM_R_RM_R_SFT 0 41362306a36Sopenharmony_ci 41462306a36Sopenharmony_ci/* HPMIX Control (0x45) */ 41562306a36Sopenharmony_ci#define RT5616_M_DAC1_HM (0x1 << 14) 41662306a36Sopenharmony_ci#define RT5616_M_DAC1_HM_SFT 14 41762306a36Sopenharmony_ci#define RT5616_M_HPVOL_HM (0x1 << 13) 41862306a36Sopenharmony_ci#define RT5616_M_HPVOL_HM_SFT 13 41962306a36Sopenharmony_ci#define RT5616_G_HPOMIX_MASK (0x1 << 12) 42062306a36Sopenharmony_ci#define RT5616_G_HPOMIX_SFT 12 42162306a36Sopenharmony_ci 42262306a36Sopenharmony_ci/* SPK Left Mixer Control (0x46) */ 42362306a36Sopenharmony_ci#define RT5616_G_RM_L_SM_L_MASK (0x3 << 14) 42462306a36Sopenharmony_ci#define RT5616_G_RM_L_SM_L_SFT 14 42562306a36Sopenharmony_ci#define RT5616_G_IN_L_SM_L_MASK (0x3 << 12) 42662306a36Sopenharmony_ci#define RT5616_G_IN_L_SM_L_SFT 12 42762306a36Sopenharmony_ci#define RT5616_G_DAC_L1_SM_L_MASK (0x3 << 10) 42862306a36Sopenharmony_ci#define RT5616_G_DAC_L1_SM_L_SFT 10 42962306a36Sopenharmony_ci#define RT5616_G_DAC_L2_SM_L_MASK (0x3 << 8) 43062306a36Sopenharmony_ci#define RT5616_G_DAC_L2_SM_L_SFT 8 43162306a36Sopenharmony_ci#define RT5616_G_OM_L_SM_L_MASK (0x3 << 6) 43262306a36Sopenharmony_ci#define RT5616_G_OM_L_SM_L_SFT 6 43362306a36Sopenharmony_ci#define RT5616_M_RM_L_SM_L (0x1 << 5) 43462306a36Sopenharmony_ci#define RT5616_M_RM_L_SM_L_SFT 5 43562306a36Sopenharmony_ci#define RT5616_M_IN_L_SM_L (0x1 << 4) 43662306a36Sopenharmony_ci#define RT5616_M_IN_L_SM_L_SFT 4 43762306a36Sopenharmony_ci#define RT5616_M_DAC_L1_SM_L (0x1 << 3) 43862306a36Sopenharmony_ci#define RT5616_M_DAC_L1_SM_L_SFT 3 43962306a36Sopenharmony_ci#define RT5616_M_DAC_L2_SM_L (0x1 << 2) 44062306a36Sopenharmony_ci#define RT5616_M_DAC_L2_SM_L_SFT 2 44162306a36Sopenharmony_ci#define RT5616_M_OM_L_SM_L (0x1 << 1) 44262306a36Sopenharmony_ci#define RT5616_M_OM_L_SM_L_SFT 1 44362306a36Sopenharmony_ci 44462306a36Sopenharmony_ci/* SPK Right Mixer Control (0x47) */ 44562306a36Sopenharmony_ci#define RT5616_G_RM_R_SM_R_MASK (0x3 << 14) 44662306a36Sopenharmony_ci#define RT5616_G_RM_R_SM_R_SFT 14 44762306a36Sopenharmony_ci#define RT5616_G_IN_R_SM_R_MASK (0x3 << 12) 44862306a36Sopenharmony_ci#define RT5616_G_IN_R_SM_R_SFT 12 44962306a36Sopenharmony_ci#define RT5616_G_DAC_R1_SM_R_MASK (0x3 << 10) 45062306a36Sopenharmony_ci#define RT5616_G_DAC_R1_SM_R_SFT 10 45162306a36Sopenharmony_ci#define RT5616_G_DAC_R2_SM_R_MASK (0x3 << 8) 45262306a36Sopenharmony_ci#define RT5616_G_DAC_R2_SM_R_SFT 8 45362306a36Sopenharmony_ci#define RT5616_G_OM_R_SM_R_MASK (0x3 << 6) 45462306a36Sopenharmony_ci#define RT5616_G_OM_R_SM_R_SFT 6 45562306a36Sopenharmony_ci#define RT5616_M_RM_R_SM_R (0x1 << 5) 45662306a36Sopenharmony_ci#define RT5616_M_RM_R_SM_R_SFT 5 45762306a36Sopenharmony_ci#define RT5616_M_IN_R_SM_R (0x1 << 4) 45862306a36Sopenharmony_ci#define RT5616_M_IN_R_SM_R_SFT 4 45962306a36Sopenharmony_ci#define RT5616_M_DAC_R1_SM_R (0x1 << 3) 46062306a36Sopenharmony_ci#define RT5616_M_DAC_R1_SM_R_SFT 3 46162306a36Sopenharmony_ci#define RT5616_M_DAC_R2_SM_R (0x1 << 2) 46262306a36Sopenharmony_ci#define RT5616_M_DAC_R2_SM_R_SFT 2 46362306a36Sopenharmony_ci#define RT5616_M_OM_R_SM_R (0x1 << 1) 46462306a36Sopenharmony_ci#define RT5616_M_OM_R_SM_R_SFT 1 46562306a36Sopenharmony_ci 46662306a36Sopenharmony_ci/* SPOLMIX Control (0x48) */ 46762306a36Sopenharmony_ci#define RT5616_M_DAC_R1_SPM_L (0x1 << 15) 46862306a36Sopenharmony_ci#define RT5616_M_DAC_R1_SPM_L_SFT 15 46962306a36Sopenharmony_ci#define RT5616_M_DAC_L1_SPM_L (0x1 << 14) 47062306a36Sopenharmony_ci#define RT5616_M_DAC_L1_SPM_L_SFT 14 47162306a36Sopenharmony_ci#define RT5616_M_SV_R_SPM_L (0x1 << 13) 47262306a36Sopenharmony_ci#define RT5616_M_SV_R_SPM_L_SFT 13 47362306a36Sopenharmony_ci#define RT5616_M_SV_L_SPM_L (0x1 << 12) 47462306a36Sopenharmony_ci#define RT5616_M_SV_L_SPM_L_SFT 12 47562306a36Sopenharmony_ci#define RT5616_M_BST1_SPM_L (0x1 << 11) 47662306a36Sopenharmony_ci#define RT5616_M_BST1_SPM_L_SFT 11 47762306a36Sopenharmony_ci 47862306a36Sopenharmony_ci/* SPORMIX Control (0x49) */ 47962306a36Sopenharmony_ci#define RT5616_M_DAC_R1_SPM_R (0x1 << 13) 48062306a36Sopenharmony_ci#define RT5616_M_DAC_R1_SPM_R_SFT 13 48162306a36Sopenharmony_ci#define RT5616_M_SV_R_SPM_R (0x1 << 12) 48262306a36Sopenharmony_ci#define RT5616_M_SV_R_SPM_R_SFT 12 48362306a36Sopenharmony_ci#define RT5616_M_BST1_SPM_R (0x1 << 11) 48462306a36Sopenharmony_ci#define RT5616_M_BST1_SPM_R_SFT 11 48562306a36Sopenharmony_ci 48662306a36Sopenharmony_ci/* SPOLMIX / SPORMIX Ratio Control (0x4a) */ 48762306a36Sopenharmony_ci#define RT5616_SPO_CLSD_RATIO_MASK (0x7) 48862306a36Sopenharmony_ci#define RT5616_SPO_CLSD_RATIO_SFT 0 48962306a36Sopenharmony_ci 49062306a36Sopenharmony_ci/* Mono Output Mixer Control (0x4c) */ 49162306a36Sopenharmony_ci#define RT5616_M_DAC_R2_MM (0x1 << 15) 49262306a36Sopenharmony_ci#define RT5616_M_DAC_R2_MM_SFT 15 49362306a36Sopenharmony_ci#define RT5616_M_DAC_L2_MM (0x1 << 14) 49462306a36Sopenharmony_ci#define RT5616_M_DAC_L2_MM_SFT 14 49562306a36Sopenharmony_ci#define RT5616_M_OV_R_MM (0x1 << 13) 49662306a36Sopenharmony_ci#define RT5616_M_OV_R_MM_SFT 13 49762306a36Sopenharmony_ci#define RT5616_M_OV_L_MM (0x1 << 12) 49862306a36Sopenharmony_ci#define RT5616_M_OV_L_MM_SFT 12 49962306a36Sopenharmony_ci#define RT5616_M_BST1_MM (0x1 << 11) 50062306a36Sopenharmony_ci#define RT5616_M_BST1_MM_SFT 11 50162306a36Sopenharmony_ci#define RT5616_G_MONOMIX_MASK (0x1 << 10) 50262306a36Sopenharmony_ci#define RT5616_G_MONOMIX_SFT 10 50362306a36Sopenharmony_ci 50462306a36Sopenharmony_ci/* Output Left Mixer Control 1 (0x4d) */ 50562306a36Sopenharmony_ci#define RT5616_G_BST2_OM_L_MASK (0x7 << 10) 50662306a36Sopenharmony_ci#define RT5616_G_BST2_OM_L_SFT 10 50762306a36Sopenharmony_ci#define RT5616_G_BST1_OM_L_MASK (0x7 << 7) 50862306a36Sopenharmony_ci#define RT5616_G_BST1_OM_L_SFT 7 50962306a36Sopenharmony_ci#define RT5616_G_IN1_L_OM_L_MASK (0x7 << 4) 51062306a36Sopenharmony_ci#define RT5616_G_IN1_L_OM_L_SFT 4 51162306a36Sopenharmony_ci#define RT5616_G_RM_L_OM_L_MASK (0x7 << 1) 51262306a36Sopenharmony_ci#define RT5616_G_RM_L_OM_L_SFT 1 51362306a36Sopenharmony_ci 51462306a36Sopenharmony_ci/* Output Left Mixer Control 2 (0x4e) */ 51562306a36Sopenharmony_ci#define RT5616_G_DAC_L1_OM_L_MASK (0x7 << 7) 51662306a36Sopenharmony_ci#define RT5616_G_DAC_L1_OM_L_SFT 7 51762306a36Sopenharmony_ci#define RT5616_G_IN2_L_OM_L_MASK (0x7 << 4) 51862306a36Sopenharmony_ci#define RT5616_G_IN2_L_OM_L_SFT 4 51962306a36Sopenharmony_ci 52062306a36Sopenharmony_ci/* Output Left Mixer Control 3 (0x4f) */ 52162306a36Sopenharmony_ci#define RT5616_M_IN2_L_OM_L (0x1 << 9) 52262306a36Sopenharmony_ci#define RT5616_M_IN2_L_OM_L_SFT 9 52362306a36Sopenharmony_ci#define RT5616_M_BST2_OM_L (0x1 << 6) 52462306a36Sopenharmony_ci#define RT5616_M_BST2_OM_L_SFT 6 52562306a36Sopenharmony_ci#define RT5616_M_BST1_OM_L (0x1 << 5) 52662306a36Sopenharmony_ci#define RT5616_M_BST1_OM_L_SFT 5 52762306a36Sopenharmony_ci#define RT5616_M_IN1_L_OM_L (0x1 << 4) 52862306a36Sopenharmony_ci#define RT5616_M_IN1_L_OM_L_SFT 4 52962306a36Sopenharmony_ci#define RT5616_M_RM_L_OM_L (0x1 << 3) 53062306a36Sopenharmony_ci#define RT5616_M_RM_L_OM_L_SFT 3 53162306a36Sopenharmony_ci#define RT5616_M_DAC_L1_OM_L (0x1) 53262306a36Sopenharmony_ci#define RT5616_M_DAC_L1_OM_L_SFT 0 53362306a36Sopenharmony_ci 53462306a36Sopenharmony_ci/* Output Right Mixer Control 1 (0x50) */ 53562306a36Sopenharmony_ci#define RT5616_G_BST2_OM_R_MASK (0x7 << 10) 53662306a36Sopenharmony_ci#define RT5616_G_BST2_OM_R_SFT 10 53762306a36Sopenharmony_ci#define RT5616_G_BST1_OM_R_MASK (0x7 << 7) 53862306a36Sopenharmony_ci#define RT5616_G_BST1_OM_R_SFT 7 53962306a36Sopenharmony_ci#define RT5616_G_IN1_R_OM_R_MASK (0x7 << 4) 54062306a36Sopenharmony_ci#define RT5616_G_IN1_R_OM_R_SFT 4 54162306a36Sopenharmony_ci#define RT5616_G_RM_R_OM_R_MASK (0x7 << 1) 54262306a36Sopenharmony_ci#define RT5616_G_RM_R_OM_R_SFT 1 54362306a36Sopenharmony_ci 54462306a36Sopenharmony_ci/* Output Right Mixer Control 2 (0x51) */ 54562306a36Sopenharmony_ci#define RT5616_G_DAC_R1_OM_R_MASK (0x7 << 7) 54662306a36Sopenharmony_ci#define RT5616_G_DAC_R1_OM_R_SFT 7 54762306a36Sopenharmony_ci#define RT5616_G_IN2_R_OM_R_MASK (0x7 << 4) 54862306a36Sopenharmony_ci#define RT5616_G_IN2_R_OM_R_SFT 4 54962306a36Sopenharmony_ci 55062306a36Sopenharmony_ci/* Output Right Mixer Control 3 (0x52) */ 55162306a36Sopenharmony_ci#define RT5616_M_IN2_R_OM_R (0x1 << 9) 55262306a36Sopenharmony_ci#define RT5616_M_IN2_R_OM_R_SFT 9 55362306a36Sopenharmony_ci#define RT5616_M_BST2_OM_R (0x1 << 6) 55462306a36Sopenharmony_ci#define RT5616_M_BST2_OM_R_SFT 6 55562306a36Sopenharmony_ci#define RT5616_M_BST1_OM_R (0x1 << 5) 55662306a36Sopenharmony_ci#define RT5616_M_BST1_OM_R_SFT 5 55762306a36Sopenharmony_ci#define RT5616_M_IN1_R_OM_R (0x1 << 4) 55862306a36Sopenharmony_ci#define RT5616_M_IN1_R_OM_R_SFT 4 55962306a36Sopenharmony_ci#define RT5616_M_RM_R_OM_R (0x1 << 3) 56062306a36Sopenharmony_ci#define RT5616_M_RM_R_OM_R_SFT 3 56162306a36Sopenharmony_ci#define RT5616_M_DAC_R1_OM_R (0x1) 56262306a36Sopenharmony_ci#define RT5616_M_DAC_R1_OM_R_SFT 0 56362306a36Sopenharmony_ci 56462306a36Sopenharmony_ci/* LOUT Mixer Control (0x53) */ 56562306a36Sopenharmony_ci#define RT5616_M_DAC_L1_LM (0x1 << 15) 56662306a36Sopenharmony_ci#define RT5616_M_DAC_L1_LM_SFT 15 56762306a36Sopenharmony_ci#define RT5616_M_DAC_R1_LM (0x1 << 14) 56862306a36Sopenharmony_ci#define RT5616_M_DAC_R1_LM_SFT 14 56962306a36Sopenharmony_ci#define RT5616_M_OV_L_LM (0x1 << 13) 57062306a36Sopenharmony_ci#define RT5616_M_OV_L_LM_SFT 13 57162306a36Sopenharmony_ci#define RT5616_M_OV_R_LM (0x1 << 12) 57262306a36Sopenharmony_ci#define RT5616_M_OV_R_LM_SFT 12 57362306a36Sopenharmony_ci#define RT5616_G_LOUTMIX_MASK (0x1 << 11) 57462306a36Sopenharmony_ci#define RT5616_G_LOUTMIX_SFT 11 57562306a36Sopenharmony_ci 57662306a36Sopenharmony_ci/* Power Management for Digital 1 (0x61) */ 57762306a36Sopenharmony_ci#define RT5616_PWR_I2S1 (0x1 << 15) 57862306a36Sopenharmony_ci#define RT5616_PWR_I2S1_BIT 15 57962306a36Sopenharmony_ci#define RT5616_PWR_I2S2 (0x1 << 14) 58062306a36Sopenharmony_ci#define RT5616_PWR_I2S2_BIT 14 58162306a36Sopenharmony_ci#define RT5616_PWR_DAC_L1 (0x1 << 12) 58262306a36Sopenharmony_ci#define RT5616_PWR_DAC_L1_BIT 12 58362306a36Sopenharmony_ci#define RT5616_PWR_DAC_R1 (0x1 << 11) 58462306a36Sopenharmony_ci#define RT5616_PWR_DAC_R1_BIT 11 58562306a36Sopenharmony_ci#define RT5616_PWR_ADC_L (0x1 << 2) 58662306a36Sopenharmony_ci#define RT5616_PWR_ADC_L_BIT 2 58762306a36Sopenharmony_ci#define RT5616_PWR_ADC_R (0x1 << 1) 58862306a36Sopenharmony_ci#define RT5616_PWR_ADC_R_BIT 1 58962306a36Sopenharmony_ci 59062306a36Sopenharmony_ci/* Power Management for Digital 2 (0x62) */ 59162306a36Sopenharmony_ci#define RT5616_PWR_ADC_STO1_F (0x1 << 15) 59262306a36Sopenharmony_ci#define RT5616_PWR_ADC_STO1_F_BIT 15 59362306a36Sopenharmony_ci#define RT5616_PWR_DAC_STO1_F (0x1 << 11) 59462306a36Sopenharmony_ci#define RT5616_PWR_DAC_STO1_F_BIT 11 59562306a36Sopenharmony_ci 59662306a36Sopenharmony_ci/* Power Management for Analog 1 (0x63) */ 59762306a36Sopenharmony_ci#define RT5616_PWR_VREF1 (0x1 << 15) 59862306a36Sopenharmony_ci#define RT5616_PWR_VREF1_BIT 15 59962306a36Sopenharmony_ci#define RT5616_PWR_FV1 (0x1 << 14) 60062306a36Sopenharmony_ci#define RT5616_PWR_FV1_BIT 14 60162306a36Sopenharmony_ci#define RT5616_PWR_MB (0x1 << 13) 60262306a36Sopenharmony_ci#define RT5616_PWR_MB_BIT 13 60362306a36Sopenharmony_ci#define RT5616_PWR_LM (0x1 << 12) 60462306a36Sopenharmony_ci#define RT5616_PWR_LM_BIT 12 60562306a36Sopenharmony_ci#define RT5616_PWR_BG (0x1 << 11) 60662306a36Sopenharmony_ci#define RT5616_PWR_BG_BIT 11 60762306a36Sopenharmony_ci#define RT5616_PWR_HP_L (0x1 << 7) 60862306a36Sopenharmony_ci#define RT5616_PWR_HP_L_BIT 7 60962306a36Sopenharmony_ci#define RT5616_PWR_HP_R (0x1 << 6) 61062306a36Sopenharmony_ci#define RT5616_PWR_HP_R_BIT 6 61162306a36Sopenharmony_ci#define RT5616_PWR_HA (0x1 << 5) 61262306a36Sopenharmony_ci#define RT5616_PWR_HA_BIT 5 61362306a36Sopenharmony_ci#define RT5616_PWR_VREF2 (0x1 << 4) 61462306a36Sopenharmony_ci#define RT5616_PWR_VREF2_BIT 4 61562306a36Sopenharmony_ci#define RT5616_PWR_FV2 (0x1 << 3) 61662306a36Sopenharmony_ci#define RT5616_PWR_FV2_BIT 3 61762306a36Sopenharmony_ci#define RT5616_PWR_LDO (0x1 << 2) 61862306a36Sopenharmony_ci#define RT5616_PWR_LDO_BIT 2 61962306a36Sopenharmony_ci#define RT5616_PWR_LDO_DVO_MASK (0x3) 62062306a36Sopenharmony_ci#define RT5616_PWR_LDO_DVO_1_0V 0 62162306a36Sopenharmony_ci#define RT5616_PWR_LDO_DVO_1_1V 1 62262306a36Sopenharmony_ci#define RT5616_PWR_LDO_DVO_1_2V 2 62362306a36Sopenharmony_ci#define RT5616_PWR_LDO_DVO_1_3V 3 62462306a36Sopenharmony_ci 62562306a36Sopenharmony_ci/* Power Management for Analog 2 (0x64) */ 62662306a36Sopenharmony_ci#define RT5616_PWR_BST1 (0x1 << 15) 62762306a36Sopenharmony_ci#define RT5616_PWR_BST1_BIT 15 62862306a36Sopenharmony_ci#define RT5616_PWR_BST2 (0x1 << 14) 62962306a36Sopenharmony_ci#define RT5616_PWR_BST2_BIT 14 63062306a36Sopenharmony_ci#define RT5616_PWR_MB1 (0x1 << 11) 63162306a36Sopenharmony_ci#define RT5616_PWR_MB1_BIT 11 63262306a36Sopenharmony_ci#define RT5616_PWR_PLL (0x1 << 9) 63362306a36Sopenharmony_ci#define RT5616_PWR_PLL_BIT 9 63462306a36Sopenharmony_ci#define RT5616_PWR_BST1_OP2 (0x1 << 5) 63562306a36Sopenharmony_ci#define RT5616_PWR_BST1_OP2_BIT 5 63662306a36Sopenharmony_ci#define RT5616_PWR_BST2_OP2 (0x1 << 4) 63762306a36Sopenharmony_ci#define RT5616_PWR_BST2_OP2_BIT 4 63862306a36Sopenharmony_ci#define RT5616_PWR_BST3_OP2 (0x1 << 3) 63962306a36Sopenharmony_ci#define RT5616_PWR_BST3_OP2_BIT 3 64062306a36Sopenharmony_ci#define RT5616_PWR_JD_M (0x1 << 2) 64162306a36Sopenharmony_ci#define RT5616_PWM_JD_M_BIT 2 64262306a36Sopenharmony_ci#define RT5616_PWR_JD2 (0x1 << 1) 64362306a36Sopenharmony_ci#define RT5616_PWM_JD2_BIT 1 64462306a36Sopenharmony_ci#define RT5616_PWR_JD3 (0x1) 64562306a36Sopenharmony_ci#define RT5616_PWM_JD3_BIT 0 64662306a36Sopenharmony_ci 64762306a36Sopenharmony_ci/* Power Management for Mixer (0x65) */ 64862306a36Sopenharmony_ci#define RT5616_PWR_OM_L (0x1 << 15) 64962306a36Sopenharmony_ci#define RT5616_PWR_OM_L_BIT 15 65062306a36Sopenharmony_ci#define RT5616_PWR_OM_R (0x1 << 14) 65162306a36Sopenharmony_ci#define RT5616_PWR_OM_R_BIT 14 65262306a36Sopenharmony_ci#define RT5616_PWR_RM_L (0x1 << 11) 65362306a36Sopenharmony_ci#define RT5616_PWR_RM_L_BIT 11 65462306a36Sopenharmony_ci#define RT5616_PWR_RM_R (0x1 << 10) 65562306a36Sopenharmony_ci#define RT5616_PWR_RM_R_BIT 10 65662306a36Sopenharmony_ci 65762306a36Sopenharmony_ci/* Power Management for Volume (0x66) */ 65862306a36Sopenharmony_ci#define RT5616_PWR_OV_L (0x1 << 13) 65962306a36Sopenharmony_ci#define RT5616_PWR_OV_L_BIT 13 66062306a36Sopenharmony_ci#define RT5616_PWR_OV_R (0x1 << 12) 66162306a36Sopenharmony_ci#define RT5616_PWR_OV_R_BIT 12 66262306a36Sopenharmony_ci#define RT5616_PWR_HV_L (0x1 << 11) 66362306a36Sopenharmony_ci#define RT5616_PWR_HV_L_BIT 11 66462306a36Sopenharmony_ci#define RT5616_PWR_HV_R (0x1 << 10) 66562306a36Sopenharmony_ci#define RT5616_PWR_HV_R_BIT 10 66662306a36Sopenharmony_ci#define RT5616_PWR_IN1_L (0x1 << 9) 66762306a36Sopenharmony_ci#define RT5616_PWR_IN1_L_BIT 9 66862306a36Sopenharmony_ci#define RT5616_PWR_IN1_R (0x1 << 8) 66962306a36Sopenharmony_ci#define RT5616_PWR_IN1_R_BIT 8 67062306a36Sopenharmony_ci#define RT5616_PWR_IN2_L (0x1 << 7) 67162306a36Sopenharmony_ci#define RT5616_PWR_IN2_L_BIT 7 67262306a36Sopenharmony_ci#define RT5616_PWR_IN2_R (0x1 << 6) 67362306a36Sopenharmony_ci#define RT5616_PWR_IN2_R_BIT 6 67462306a36Sopenharmony_ci 67562306a36Sopenharmony_ci/* I2S1/2/3 Audio Serial Data Port Control (0x70 0x71) */ 67662306a36Sopenharmony_ci#define RT5616_I2S_MS_MASK (0x1 << 15) 67762306a36Sopenharmony_ci#define RT5616_I2S_MS_SFT 15 67862306a36Sopenharmony_ci#define RT5616_I2S_MS_M (0x0 << 15) 67962306a36Sopenharmony_ci#define RT5616_I2S_MS_S (0x1 << 15) 68062306a36Sopenharmony_ci#define RT5616_I2S_O_CP_MASK (0x3 << 10) 68162306a36Sopenharmony_ci#define RT5616_I2S_O_CP_SFT 10 68262306a36Sopenharmony_ci#define RT5616_I2S_O_CP_OFF (0x0 << 10) 68362306a36Sopenharmony_ci#define RT5616_I2S_O_CP_U_LAW (0x1 << 10) 68462306a36Sopenharmony_ci#define RT5616_I2S_O_CP_A_LAW (0x2 << 10) 68562306a36Sopenharmony_ci#define RT5616_I2S_I_CP_MASK (0x3 << 8) 68662306a36Sopenharmony_ci#define RT5616_I2S_I_CP_SFT 8 68762306a36Sopenharmony_ci#define RT5616_I2S_I_CP_OFF (0x0 << 8) 68862306a36Sopenharmony_ci#define RT5616_I2S_I_CP_U_LAW (0x1 << 8) 68962306a36Sopenharmony_ci#define RT5616_I2S_I_CP_A_LAW (0x2 << 8) 69062306a36Sopenharmony_ci#define RT5616_I2S_BP_MASK (0x1 << 7) 69162306a36Sopenharmony_ci#define RT5616_I2S_BP_SFT 7 69262306a36Sopenharmony_ci#define RT5616_I2S_BP_NOR (0x0 << 7) 69362306a36Sopenharmony_ci#define RT5616_I2S_BP_INV (0x1 << 7) 69462306a36Sopenharmony_ci#define RT5616_I2S_DL_MASK (0x3 << 2) 69562306a36Sopenharmony_ci#define RT5616_I2S_DL_SFT 2 69662306a36Sopenharmony_ci#define RT5616_I2S_DL_16 (0x0 << 2) 69762306a36Sopenharmony_ci#define RT5616_I2S_DL_20 (0x1 << 2) 69862306a36Sopenharmony_ci#define RT5616_I2S_DL_24 (0x2 << 2) 69962306a36Sopenharmony_ci#define RT5616_I2S_DL_8 (0x3 << 2) 70062306a36Sopenharmony_ci#define RT5616_I2S_DF_MASK (0x3) 70162306a36Sopenharmony_ci#define RT5616_I2S_DF_SFT 0 70262306a36Sopenharmony_ci#define RT5616_I2S_DF_I2S (0x0) 70362306a36Sopenharmony_ci#define RT5616_I2S_DF_LEFT (0x1) 70462306a36Sopenharmony_ci#define RT5616_I2S_DF_PCM_A (0x2) 70562306a36Sopenharmony_ci#define RT5616_I2S_DF_PCM_B (0x3) 70662306a36Sopenharmony_ci 70762306a36Sopenharmony_ci/* ADC/DAC Clock Control 1 (0x73) */ 70862306a36Sopenharmony_ci#define RT5616_I2S_PD1_MASK (0x7 << 12) 70962306a36Sopenharmony_ci#define RT5616_I2S_PD1_SFT 12 71062306a36Sopenharmony_ci#define RT5616_I2S_PD1_1 (0x0 << 12) 71162306a36Sopenharmony_ci#define RT5616_I2S_PD1_2 (0x1 << 12) 71262306a36Sopenharmony_ci#define RT5616_I2S_PD1_3 (0x2 << 12) 71362306a36Sopenharmony_ci#define RT5616_I2S_PD1_4 (0x3 << 12) 71462306a36Sopenharmony_ci#define RT5616_I2S_PD1_6 (0x4 << 12) 71562306a36Sopenharmony_ci#define RT5616_I2S_PD1_8 (0x5 << 12) 71662306a36Sopenharmony_ci#define RT5616_I2S_PD1_12 (0x6 << 12) 71762306a36Sopenharmony_ci#define RT5616_I2S_PD1_16 (0x7 << 12) 71862306a36Sopenharmony_ci#define RT5616_I2S_BCLK_MS2_MASK (0x1 << 11) 71962306a36Sopenharmony_ci#define RT5616_DAC_OSR_MASK (0x3 << 2) 72062306a36Sopenharmony_ci#define RT5616_DAC_OSR_SFT 2 72162306a36Sopenharmony_ci#define RT5616_DAC_OSR_128 (0x0 << 2) 72262306a36Sopenharmony_ci#define RT5616_DAC_OSR_64 (0x1 << 2) 72362306a36Sopenharmony_ci#define RT5616_DAC_OSR_32 (0x2 << 2) 72462306a36Sopenharmony_ci#define RT5616_DAC_OSR_128_3 (0x3 << 2) 72562306a36Sopenharmony_ci#define RT5616_ADC_OSR_MASK (0x3) 72662306a36Sopenharmony_ci#define RT5616_ADC_OSR_SFT 0 72762306a36Sopenharmony_ci#define RT5616_ADC_OSR_128 (0x0) 72862306a36Sopenharmony_ci#define RT5616_ADC_OSR_64 (0x1) 72962306a36Sopenharmony_ci#define RT5616_ADC_OSR_32 (0x2) 73062306a36Sopenharmony_ci#define RT5616_ADC_OSR_128_3 (0x3) 73162306a36Sopenharmony_ci 73262306a36Sopenharmony_ci/* ADC/DAC Clock Control 2 (0x74) */ 73362306a36Sopenharmony_ci#define RT5616_DAHPF_EN (0x1 << 11) 73462306a36Sopenharmony_ci#define RT5616_DAHPF_EN_SFT 11 73562306a36Sopenharmony_ci#define RT5616_ADHPF_EN (0x1 << 10) 73662306a36Sopenharmony_ci#define RT5616_ADHPF_EN_SFT 10 73762306a36Sopenharmony_ci 73862306a36Sopenharmony_ci/* TDM Control 1 (0x77) */ 73962306a36Sopenharmony_ci#define RT5616_TDM_INTEL_SEL_MASK (0x1 << 15) 74062306a36Sopenharmony_ci#define RT5616_TDM_INTEL_SEL_SFT 15 74162306a36Sopenharmony_ci#define RT5616_TDM_INTEL_SEL_64 (0x0 << 15) 74262306a36Sopenharmony_ci#define RT5616_TDM_INTEL_SEL_50 (0x1 << 15) 74362306a36Sopenharmony_ci#define RT5616_TDM_MODE_SEL_MASK (0x1 << 14) 74462306a36Sopenharmony_ci#define RT5616_TDM_MODE_SEL_SFT 14 74562306a36Sopenharmony_ci#define RT5616_TDM_MODE_SEL_NOR (0x0 << 14) 74662306a36Sopenharmony_ci#define RT5616_TDM_MODE_SEL_TDM (0x1 << 14) 74762306a36Sopenharmony_ci#define RT5616_TDM_CH_NUM_SEL_MASK (0x3 << 12) 74862306a36Sopenharmony_ci#define RT5616_TDM_CH_NUM_SEL_SFT 12 74962306a36Sopenharmony_ci#define RT5616_TDM_CH_NUM_SEL_2 (0x0 << 12) 75062306a36Sopenharmony_ci#define RT5616_TDM_CH_NUM_SEL_4 (0x1 << 12) 75162306a36Sopenharmony_ci#define RT5616_TDM_CH_NUM_SEL_6 (0x2 << 12) 75262306a36Sopenharmony_ci#define RT5616_TDM_CH_NUM_SEL_8 (0x3 << 12) 75362306a36Sopenharmony_ci#define RT5616_TDM_CH_LEN_SEL_MASK (0x3 << 10) 75462306a36Sopenharmony_ci#define RT5616_TDM_CH_LEN_SEL_SFT 10 75562306a36Sopenharmony_ci#define RT5616_TDM_CH_LEN_SEL_16 (0x0 << 10) 75662306a36Sopenharmony_ci#define RT5616_TDM_CH_LEN_SEL_20 (0x1 << 10) 75762306a36Sopenharmony_ci#define RT5616_TDM_CH_LEN_SEL_24 (0x2 << 10) 75862306a36Sopenharmony_ci#define RT5616_TDM_CH_LEN_SEL_32 (0x3 << 10) 75962306a36Sopenharmony_ci#define RT5616_TDM_ADC_SEL_MASK (0x1 << 9) 76062306a36Sopenharmony_ci#define RT5616_TDM_ADC_SEL_SFT 9 76162306a36Sopenharmony_ci#define RT5616_TDM_ADC_SEL_NOR (0x0 << 9) 76262306a36Sopenharmony_ci#define RT5616_TDM_ADC_SEL_SWAP (0x1 << 9) 76362306a36Sopenharmony_ci#define RT5616_TDM_ADC_START_SEL_MASK (0x1 << 8) 76462306a36Sopenharmony_ci#define RT5616_TDM_ADC_START_SEL_SFT 8 76562306a36Sopenharmony_ci#define RT5616_TDM_ADC_START_SEL_SL0 (0x0 << 8) 76662306a36Sopenharmony_ci#define RT5616_TDM_ADC_START_SEL_SL4 (0x1 << 8) 76762306a36Sopenharmony_ci#define RT5616_TDM_I2S_CH2_SEL_MASK (0x3 << 6) 76862306a36Sopenharmony_ci#define RT5616_TDM_I2S_CH2_SEL_SFT 6 76962306a36Sopenharmony_ci#define RT5616_TDM_I2S_CH2_SEL_LR (0x0 << 6) 77062306a36Sopenharmony_ci#define RT5616_TDM_I2S_CH2_SEL_RL (0x1 << 6) 77162306a36Sopenharmony_ci#define RT5616_TDM_I2S_CH2_SEL_LL (0x2 << 6) 77262306a36Sopenharmony_ci#define RT5616_TDM_I2S_CH2_SEL_RR (0x3 << 6) 77362306a36Sopenharmony_ci#define RT5616_TDM_I2S_CH4_SEL_MASK (0x3 << 4) 77462306a36Sopenharmony_ci#define RT5616_TDM_I2S_CH4_SEL_SFT 4 77562306a36Sopenharmony_ci#define RT5616_TDM_I2S_CH4_SEL_LR (0x0 << 4) 77662306a36Sopenharmony_ci#define RT5616_TDM_I2S_CH4_SEL_RL (0x1 << 4) 77762306a36Sopenharmony_ci#define RT5616_TDM_I2S_CH4_SEL_LL (0x2 << 4) 77862306a36Sopenharmony_ci#define RT5616_TDM_I2S_CH4_SEL_RR (0x3 << 4) 77962306a36Sopenharmony_ci#define RT5616_TDM_I2S_CH6_SEL_MASK (0x3 << 2) 78062306a36Sopenharmony_ci#define RT5616_TDM_I2S_CH6_SEL_SFT 2 78162306a36Sopenharmony_ci#define RT5616_TDM_I2S_CH6_SEL_LR (0x0 << 2) 78262306a36Sopenharmony_ci#define RT5616_TDM_I2S_CH6_SEL_RL (0x1 << 2) 78362306a36Sopenharmony_ci#define RT5616_TDM_I2S_CH6_SEL_LL (0x2 << 2) 78462306a36Sopenharmony_ci#define RT5616_TDM_I2S_CH6_SEL_RR (0x3 << 2) 78562306a36Sopenharmony_ci#define RT5616_TDM_I2S_CH8_SEL_MASK (0x3) 78662306a36Sopenharmony_ci#define RT5616_TDM_I2S_CH8_SEL_SFT 0 78762306a36Sopenharmony_ci#define RT5616_TDM_I2S_CH8_SEL_LR (0x0) 78862306a36Sopenharmony_ci#define RT5616_TDM_I2S_CH8_SEL_RL (0x1) 78962306a36Sopenharmony_ci#define RT5616_TDM_I2S_CH8_SEL_LL (0x2) 79062306a36Sopenharmony_ci#define RT5616_TDM_I2S_CH8_SEL_RR (0x3) 79162306a36Sopenharmony_ci 79262306a36Sopenharmony_ci/* TDM Control 2 (0x78) */ 79362306a36Sopenharmony_ci#define RT5616_TDM_LRCK_POL_SEL_MASK (0x1 << 15) 79462306a36Sopenharmony_ci#define RT5616_TDM_LRCK_POL_SEL_SFT 15 79562306a36Sopenharmony_ci#define RT5616_TDM_LRCK_POL_SEL_NOR (0x0 << 15) 79662306a36Sopenharmony_ci#define RT5616_TDM_LRCK_POL_SEL_INV (0x1 << 15) 79762306a36Sopenharmony_ci#define RT5616_TDM_CH_VAL_SEL_MASK (0x1 << 14) 79862306a36Sopenharmony_ci#define RT5616_TDM_CH_VAL_SEL_SFT 14 79962306a36Sopenharmony_ci#define RT5616_TDM_CH_VAL_SEL_CH01 (0x0 << 14) 80062306a36Sopenharmony_ci#define RT5616_TDM_CH_VAL_SEL_CH0123 (0x1 << 14) 80162306a36Sopenharmony_ci#define RT5616_TDM_CH_VAL_EN (0x1 << 13) 80262306a36Sopenharmony_ci#define RT5616_TDM_CH_VAL_SFT 13 80362306a36Sopenharmony_ci#define RT5616_TDM_LPBK_EN (0x1 << 12) 80462306a36Sopenharmony_ci#define RT5616_TDM_LPBK_SFT 12 80562306a36Sopenharmony_ci#define RT5616_TDM_LRCK_PULSE_SEL_MASK (0x1 << 11) 80662306a36Sopenharmony_ci#define RT5616_TDM_LRCK_PULSE_SEL_SFT 11 80762306a36Sopenharmony_ci#define RT5616_TDM_LRCK_PULSE_SEL_BCLK (0x0 << 11) 80862306a36Sopenharmony_ci#define RT5616_TDM_LRCK_PULSE_SEL_CH (0x1 << 11) 80962306a36Sopenharmony_ci#define RT5616_TDM_END_EDGE_SEL_MASK (0x1 << 10) 81062306a36Sopenharmony_ci#define RT5616_TDM_END_EDGE_SEL_SFT 10 81162306a36Sopenharmony_ci#define RT5616_TDM_END_EDGE_SEL_POS (0x0 << 10) 81262306a36Sopenharmony_ci#define RT5616_TDM_END_EDGE_SEL_NEG (0x1 << 10) 81362306a36Sopenharmony_ci#define RT5616_TDM_END_EDGE_EN (0x1 << 9) 81462306a36Sopenharmony_ci#define RT5616_TDM_END_EDGE_EN_SFT 9 81562306a36Sopenharmony_ci#define RT5616_TDM_TRAN_EDGE_SEL_MASK (0x1 << 8) 81662306a36Sopenharmony_ci#define RT5616_TDM_TRAN_EDGE_SEL_SFT 8 81762306a36Sopenharmony_ci#define RT5616_TDM_TRAN_EDGE_SEL_POS (0x0 << 8) 81862306a36Sopenharmony_ci#define RT5616_TDM_TRAN_EDGE_SEL_NEG (0x1 << 8) 81962306a36Sopenharmony_ci#define RT5616_M_TDM2_L (0x1 << 7) 82062306a36Sopenharmony_ci#define RT5616_M_TDM2_L_SFT 7 82162306a36Sopenharmony_ci#define RT5616_M_TDM2_R (0x1 << 6) 82262306a36Sopenharmony_ci#define RT5616_M_TDM2_R_SFT 6 82362306a36Sopenharmony_ci#define RT5616_M_TDM4_L (0x1 << 5) 82462306a36Sopenharmony_ci#define RT5616_M_TDM4_L_SFT 5 82562306a36Sopenharmony_ci#define RT5616_M_TDM4_R (0x1 << 4) 82662306a36Sopenharmony_ci#define RT5616_M_TDM4_R_SFT 4 82762306a36Sopenharmony_ci 82862306a36Sopenharmony_ci/* Global Clock Control (0x80) */ 82962306a36Sopenharmony_ci#define RT5616_SCLK_SRC_MASK (0x3 << 14) 83062306a36Sopenharmony_ci#define RT5616_SCLK_SRC_SFT 14 83162306a36Sopenharmony_ci#define RT5616_SCLK_SRC_MCLK (0x0 << 14) 83262306a36Sopenharmony_ci#define RT5616_SCLK_SRC_PLL1 (0x1 << 14) 83362306a36Sopenharmony_ci#define RT5616_PLL1_SRC_MASK (0x3 << 12) 83462306a36Sopenharmony_ci#define RT5616_PLL1_SRC_SFT 12 83562306a36Sopenharmony_ci#define RT5616_PLL1_SRC_MCLK (0x0 << 12) 83662306a36Sopenharmony_ci#define RT5616_PLL1_SRC_BCLK1 (0x1 << 12) 83762306a36Sopenharmony_ci#define RT5616_PLL1_SRC_BCLK2 (0x2 << 12) 83862306a36Sopenharmony_ci#define RT5616_PLL1_PD_MASK (0x1 << 3) 83962306a36Sopenharmony_ci#define RT5616_PLL1_PD_SFT 3 84062306a36Sopenharmony_ci#define RT5616_PLL1_PD_1 (0x0 << 3) 84162306a36Sopenharmony_ci#define RT5616_PLL1_PD_2 (0x1 << 3) 84262306a36Sopenharmony_ci 84362306a36Sopenharmony_ci#define RT5616_PLL_INP_MAX 40000000 84462306a36Sopenharmony_ci#define RT5616_PLL_INP_MIN 256000 84562306a36Sopenharmony_ci/* PLL M/N/K Code Control 1 (0x81) */ 84662306a36Sopenharmony_ci#define RT5616_PLL_N_MAX 0x1ff 84762306a36Sopenharmony_ci#define RT5616_PLL_N_MASK (RT5616_PLL_N_MAX << 7) 84862306a36Sopenharmony_ci#define RT5616_PLL_N_SFT 7 84962306a36Sopenharmony_ci#define RT5616_PLL_K_MAX 0x1f 85062306a36Sopenharmony_ci#define RT5616_PLL_K_MASK (RT5616_PLL_K_MAX) 85162306a36Sopenharmony_ci#define RT5616_PLL_K_SFT 0 85262306a36Sopenharmony_ci 85362306a36Sopenharmony_ci/* PLL M/N/K Code Control 2 (0x82) */ 85462306a36Sopenharmony_ci#define RT5616_PLL_M_MAX 0xf 85562306a36Sopenharmony_ci#define RT5616_PLL_M_MASK (RT5616_PLL_M_MAX << 12) 85662306a36Sopenharmony_ci#define RT5616_PLL_M_SFT 12 85762306a36Sopenharmony_ci#define RT5616_PLL_M_BP (0x1 << 11) 85862306a36Sopenharmony_ci#define RT5616_PLL_M_BP_SFT 11 85962306a36Sopenharmony_ci 86062306a36Sopenharmony_ci/* PLL tracking mode 1 (0x83) */ 86162306a36Sopenharmony_ci#define RT5616_STO1_T_MASK (0x1 << 15) 86262306a36Sopenharmony_ci#define RT5616_STO1_T_SFT 15 86362306a36Sopenharmony_ci#define RT5616_STO1_T_SCLK (0x0 << 15) 86462306a36Sopenharmony_ci#define RT5616_STO1_T_LRCK1 (0x1 << 15) 86562306a36Sopenharmony_ci#define RT5616_STO2_T_MASK (0x1 << 12) 86662306a36Sopenharmony_ci#define RT5616_STO2_T_SFT 12 86762306a36Sopenharmony_ci#define RT5616_STO2_T_I2S2 (0x0 << 12) 86862306a36Sopenharmony_ci#define RT5616_STO2_T_LRCK2 (0x1 << 12) 86962306a36Sopenharmony_ci#define RT5616_ASRC2_REF_MASK (0x1 << 11) 87062306a36Sopenharmony_ci#define RT5616_ASRC2_REF_SFT 11 87162306a36Sopenharmony_ci#define RT5616_ASRC2_REF_LRCK2 (0x0 << 11) 87262306a36Sopenharmony_ci#define RT5616_ASRC2_REF_LRCK1 (0x1 << 11) 87362306a36Sopenharmony_ci#define RT5616_DMIC_1_M_MASK (0x1 << 9) 87462306a36Sopenharmony_ci#define RT5616_DMIC_1_M_SFT 9 87562306a36Sopenharmony_ci#define RT5616_DMIC_1_M_NOR (0x0 << 9) 87662306a36Sopenharmony_ci#define RT5616_DMIC_1_M_ASYN (0x1 << 9) 87762306a36Sopenharmony_ci 87862306a36Sopenharmony_ci/* PLL tracking mode 2 (0x84) */ 87962306a36Sopenharmony_ci#define RT5616_STO1_ASRC_EN (0x1 << 15) 88062306a36Sopenharmony_ci#define RT5616_STO1_ASRC_EN_SFT 15 88162306a36Sopenharmony_ci#define RT5616_STO2_ASRC_EN (0x1 << 14) 88262306a36Sopenharmony_ci#define RT5616_STO2_ASRC_EN_SFT 14 88362306a36Sopenharmony_ci#define RT5616_STO1_DAC_M_MASK (0x1 << 13) 88462306a36Sopenharmony_ci#define RT5616_STO1_DAC_M_SFT 13 88562306a36Sopenharmony_ci#define RT5616_STO1_DAC_M_NOR (0x0 << 13) 88662306a36Sopenharmony_ci#define RT5616_STO1_DAC_M_ASRC (0x1 << 13) 88762306a36Sopenharmony_ci#define RT5616_STO2_DAC_M_MASK (0x1 << 12) 88862306a36Sopenharmony_ci#define RT5616_STO2_DAC_M_SFT 12 88962306a36Sopenharmony_ci#define RT5616_STO2_DAC_M_NOR (0x0 << 12) 89062306a36Sopenharmony_ci#define RT5616_STO2_DAC_M_ASRC (0x1 << 12) 89162306a36Sopenharmony_ci#define RT5616_ADC_M_MASK (0x1 << 11) 89262306a36Sopenharmony_ci#define RT5616_ADC_M_SFT 11 89362306a36Sopenharmony_ci#define RT5616_ADC_M_NOR (0x0 << 11) 89462306a36Sopenharmony_ci#define RT5616_ADC_M_ASRC (0x1 << 11) 89562306a36Sopenharmony_ci#define RT5616_I2S1_R_D_MASK (0x1 << 4) 89662306a36Sopenharmony_ci#define RT5616_I2S1_R_D_SFT 4 89762306a36Sopenharmony_ci#define RT5616_I2S1_R_D_DIS (0x0 << 4) 89862306a36Sopenharmony_ci#define RT5616_I2S1_R_D_EN (0x1 << 4) 89962306a36Sopenharmony_ci#define RT5616_I2S2_R_D_MASK (0x1 << 3) 90062306a36Sopenharmony_ci#define RT5616_I2S2_R_D_SFT 3 90162306a36Sopenharmony_ci#define RT5616_I2S2_R_D_DIS (0x0 << 3) 90262306a36Sopenharmony_ci#define RT5616_I2S2_R_D_EN (0x1 << 3) 90362306a36Sopenharmony_ci#define RT5616_PRE_SCLK_MASK (0x3) 90462306a36Sopenharmony_ci#define RT5616_PRE_SCLK_SFT 0 90562306a36Sopenharmony_ci#define RT5616_PRE_SCLK_512 (0x0) 90662306a36Sopenharmony_ci#define RT5616_PRE_SCLK_1024 (0x1) 90762306a36Sopenharmony_ci#define RT5616_PRE_SCLK_2048 (0x2) 90862306a36Sopenharmony_ci 90962306a36Sopenharmony_ci/* PLL tracking mode 3 (0x85) */ 91062306a36Sopenharmony_ci#define RT5616_I2S1_RATE_MASK (0xf << 12) 91162306a36Sopenharmony_ci#define RT5616_I2S1_RATE_SFT 12 91262306a36Sopenharmony_ci#define RT5616_I2S2_RATE_MASK (0xf << 8) 91362306a36Sopenharmony_ci#define RT5616_I2S2_RATE_SFT 8 91462306a36Sopenharmony_ci#define RT5616_G_ASRC_LP_MASK (0x1 << 3) 91562306a36Sopenharmony_ci#define RT5616_G_ASRC_LP_SFT 3 91662306a36Sopenharmony_ci#define RT5616_ASRC_LP_F_M (0x1 << 2) 91762306a36Sopenharmony_ci#define RT5616_ASRC_LP_F_SFT 2 91862306a36Sopenharmony_ci#define RT5616_ASRC_LP_F_NOR (0x0 << 2) 91962306a36Sopenharmony_ci#define RT5616_ASRC_LP_F_SB (0x1 << 2) 92062306a36Sopenharmony_ci#define RT5616_FTK_PH_DET_MASK (0x3) 92162306a36Sopenharmony_ci#define RT5616_FTK_PH_DET_SFT 0 92262306a36Sopenharmony_ci#define RT5616_FTK_PH_DET_DIV1 (0x0) 92362306a36Sopenharmony_ci#define RT5616_FTK_PH_DET_DIV2 (0x1) 92462306a36Sopenharmony_ci#define RT5616_FTK_PH_DET_DIV4 (0x2) 92562306a36Sopenharmony_ci#define RT5616_FTK_PH_DET_DIV8 (0x3) 92662306a36Sopenharmony_ci 92762306a36Sopenharmony_ci/*PLL tracking mode 6 (0x89) */ 92862306a36Sopenharmony_ci#define RT5616_I2S1_PD_MASK (0x7 << 12) 92962306a36Sopenharmony_ci#define RT5616_I2S1_PD_SFT 12 93062306a36Sopenharmony_ci#define RT5616_I2S2_PD_MASK (0x7 << 8) 93162306a36Sopenharmony_ci#define RT5616_I2S2_PD_SFT 8 93262306a36Sopenharmony_ci 93362306a36Sopenharmony_ci/*PLL tracking mode 7 (0x8a) */ 93462306a36Sopenharmony_ci#define RT5616_FSI1_RATE_MASK (0xf << 12) 93562306a36Sopenharmony_ci#define RT5616_FSI1_RATE_SFT 12 93662306a36Sopenharmony_ci#define RT5616_FSI2_RATE_MASK (0xf << 8) 93762306a36Sopenharmony_ci#define RT5616_FSI2_RATE_SFT 8 93862306a36Sopenharmony_ci 93962306a36Sopenharmony_ci/* HPOUT Over Current Detection (0x8b) */ 94062306a36Sopenharmony_ci#define RT5616_HP_OVCD_MASK (0x1 << 10) 94162306a36Sopenharmony_ci#define RT5616_HP_OVCD_SFT 10 94262306a36Sopenharmony_ci#define RT5616_HP_OVCD_DIS (0x0 << 10) 94362306a36Sopenharmony_ci#define RT5616_HP_OVCD_EN (0x1 << 10) 94462306a36Sopenharmony_ci#define RT5616_HP_OC_TH_MASK (0x3 << 8) 94562306a36Sopenharmony_ci#define RT5616_HP_OC_TH_SFT 8 94662306a36Sopenharmony_ci#define RT5616_HP_OC_TH_90 (0x0 << 8) 94762306a36Sopenharmony_ci#define RT5616_HP_OC_TH_105 (0x1 << 8) 94862306a36Sopenharmony_ci#define RT5616_HP_OC_TH_120 (0x2 << 8) 94962306a36Sopenharmony_ci#define RT5616_HP_OC_TH_135 (0x3 << 8) 95062306a36Sopenharmony_ci 95162306a36Sopenharmony_ci/* Depop Mode Control 1 (0x8e) */ 95262306a36Sopenharmony_ci#define RT5616_SMT_TRIG_MASK (0x1 << 15) 95362306a36Sopenharmony_ci#define RT5616_SMT_TRIG_SFT 15 95462306a36Sopenharmony_ci#define RT5616_SMT_TRIG_DIS (0x0 << 15) 95562306a36Sopenharmony_ci#define RT5616_SMT_TRIG_EN (0x1 << 15) 95662306a36Sopenharmony_ci#define RT5616_HP_L_SMT_MASK (0x1 << 9) 95762306a36Sopenharmony_ci#define RT5616_HP_L_SMT_SFT 9 95862306a36Sopenharmony_ci#define RT5616_HP_L_SMT_DIS (0x0 << 9) 95962306a36Sopenharmony_ci#define RT5616_HP_L_SMT_EN (0x1 << 9) 96062306a36Sopenharmony_ci#define RT5616_HP_R_SMT_MASK (0x1 << 8) 96162306a36Sopenharmony_ci#define RT5616_HP_R_SMT_SFT 8 96262306a36Sopenharmony_ci#define RT5616_HP_R_SMT_DIS (0x0 << 8) 96362306a36Sopenharmony_ci#define RT5616_HP_R_SMT_EN (0x1 << 8) 96462306a36Sopenharmony_ci#define RT5616_HP_CD_PD_MASK (0x1 << 7) 96562306a36Sopenharmony_ci#define RT5616_HP_CD_PD_SFT 7 96662306a36Sopenharmony_ci#define RT5616_HP_CD_PD_DIS (0x0 << 7) 96762306a36Sopenharmony_ci#define RT5616_HP_CD_PD_EN (0x1 << 7) 96862306a36Sopenharmony_ci#define RT5616_RSTN_MASK (0x1 << 6) 96962306a36Sopenharmony_ci#define RT5616_RSTN_SFT 6 97062306a36Sopenharmony_ci#define RT5616_RSTN_DIS (0x0 << 6) 97162306a36Sopenharmony_ci#define RT5616_RSTN_EN (0x1 << 6) 97262306a36Sopenharmony_ci#define RT5616_RSTP_MASK (0x1 << 5) 97362306a36Sopenharmony_ci#define RT5616_RSTP_SFT 5 97462306a36Sopenharmony_ci#define RT5616_RSTP_DIS (0x0 << 5) 97562306a36Sopenharmony_ci#define RT5616_RSTP_EN (0x1 << 5) 97662306a36Sopenharmony_ci#define RT5616_HP_CO_MASK (0x1 << 4) 97762306a36Sopenharmony_ci#define RT5616_HP_CO_SFT 4 97862306a36Sopenharmony_ci#define RT5616_HP_CO_DIS (0x0 << 4) 97962306a36Sopenharmony_ci#define RT5616_HP_CO_EN (0x1 << 4) 98062306a36Sopenharmony_ci#define RT5616_HP_CP_MASK (0x1 << 3) 98162306a36Sopenharmony_ci#define RT5616_HP_CP_SFT 3 98262306a36Sopenharmony_ci#define RT5616_HP_CP_PD (0x0 << 3) 98362306a36Sopenharmony_ci#define RT5616_HP_CP_PU (0x1 << 3) 98462306a36Sopenharmony_ci#define RT5616_HP_SG_MASK (0x1 << 2) 98562306a36Sopenharmony_ci#define RT5616_HP_SG_SFT 2 98662306a36Sopenharmony_ci#define RT5616_HP_SG_DIS (0x0 << 2) 98762306a36Sopenharmony_ci#define RT5616_HP_SG_EN (0x1 << 2) 98862306a36Sopenharmony_ci#define RT5616_HP_DP_MASK (0x1 << 1) 98962306a36Sopenharmony_ci#define RT5616_HP_DP_SFT 1 99062306a36Sopenharmony_ci#define RT5616_HP_DP_PD (0x0 << 1) 99162306a36Sopenharmony_ci#define RT5616_HP_DP_PU (0x1 << 1) 99262306a36Sopenharmony_ci#define RT5616_HP_CB_MASK (0x1) 99362306a36Sopenharmony_ci#define RT5616_HP_CB_SFT 0 99462306a36Sopenharmony_ci#define RT5616_HP_CB_PD (0x0) 99562306a36Sopenharmony_ci#define RT5616_HP_CB_PU (0x1) 99662306a36Sopenharmony_ci 99762306a36Sopenharmony_ci/* Depop Mode Control 2 (0x8f) */ 99862306a36Sopenharmony_ci#define RT5616_DEPOP_MASK (0x1 << 13) 99962306a36Sopenharmony_ci#define RT5616_DEPOP_SFT 13 100062306a36Sopenharmony_ci#define RT5616_DEPOP_AUTO (0x0 << 13) 100162306a36Sopenharmony_ci#define RT5616_DEPOP_MAN (0x1 << 13) 100262306a36Sopenharmony_ci#define RT5616_RAMP_MASK (0x1 << 12) 100362306a36Sopenharmony_ci#define RT5616_RAMP_SFT 12 100462306a36Sopenharmony_ci#define RT5616_RAMP_DIS (0x0 << 12) 100562306a36Sopenharmony_ci#define RT5616_RAMP_EN (0x1 << 12) 100662306a36Sopenharmony_ci#define RT5616_BPS_MASK (0x1 << 11) 100762306a36Sopenharmony_ci#define RT5616_BPS_SFT 11 100862306a36Sopenharmony_ci#define RT5616_BPS_DIS (0x0 << 11) 100962306a36Sopenharmony_ci#define RT5616_BPS_EN (0x1 << 11) 101062306a36Sopenharmony_ci#define RT5616_FAST_UPDN_MASK (0x1 << 10) 101162306a36Sopenharmony_ci#define RT5616_FAST_UPDN_SFT 10 101262306a36Sopenharmony_ci#define RT5616_FAST_UPDN_DIS (0x0 << 10) 101362306a36Sopenharmony_ci#define RT5616_FAST_UPDN_EN (0x1 << 10) 101462306a36Sopenharmony_ci#define RT5616_MRES_MASK (0x3 << 8) 101562306a36Sopenharmony_ci#define RT5616_MRES_SFT 8 101662306a36Sopenharmony_ci#define RT5616_MRES_15MO (0x0 << 8) 101762306a36Sopenharmony_ci#define RT5616_MRES_25MO (0x1 << 8) 101862306a36Sopenharmony_ci#define RT5616_MRES_35MO (0x2 << 8) 101962306a36Sopenharmony_ci#define RT5616_MRES_45MO (0x3 << 8) 102062306a36Sopenharmony_ci#define RT5616_VLO_MASK (0x1 << 7) 102162306a36Sopenharmony_ci#define RT5616_VLO_SFT 7 102262306a36Sopenharmony_ci#define RT5616_VLO_3V (0x0 << 7) 102362306a36Sopenharmony_ci#define RT5616_VLO_32V (0x1 << 7) 102462306a36Sopenharmony_ci#define RT5616_DIG_DP_MASK (0x1 << 6) 102562306a36Sopenharmony_ci#define RT5616_DIG_DP_SFT 6 102662306a36Sopenharmony_ci#define RT5616_DIG_DP_DIS (0x0 << 6) 102762306a36Sopenharmony_ci#define RT5616_DIG_DP_EN (0x1 << 6) 102862306a36Sopenharmony_ci#define RT5616_DP_TH_MASK (0x3 << 4) 102962306a36Sopenharmony_ci#define RT5616_DP_TH_SFT 4 103062306a36Sopenharmony_ci 103162306a36Sopenharmony_ci/* Depop Mode Control 3 (0x90) */ 103262306a36Sopenharmony_ci#define RT5616_CP_SYS_MASK (0x7 << 12) 103362306a36Sopenharmony_ci#define RT5616_CP_SYS_SFT 12 103462306a36Sopenharmony_ci#define RT5616_CP_FQ1_MASK (0x7 << 8) 103562306a36Sopenharmony_ci#define RT5616_CP_FQ1_SFT 8 103662306a36Sopenharmony_ci#define RT5616_CP_FQ2_MASK (0x7 << 4) 103762306a36Sopenharmony_ci#define RT5616_CP_FQ2_SFT 4 103862306a36Sopenharmony_ci#define RT5616_CP_FQ3_MASK (0x7) 103962306a36Sopenharmony_ci#define RT5616_CP_FQ3_SFT 0 104062306a36Sopenharmony_ci#define RT5616_CP_FQ_1_5_KHZ 0 104162306a36Sopenharmony_ci#define RT5616_CP_FQ_3_KHZ 1 104262306a36Sopenharmony_ci#define RT5616_CP_FQ_6_KHZ 2 104362306a36Sopenharmony_ci#define RT5616_CP_FQ_12_KHZ 3 104462306a36Sopenharmony_ci#define RT5616_CP_FQ_24_KHZ 4 104562306a36Sopenharmony_ci#define RT5616_CP_FQ_48_KHZ 5 104662306a36Sopenharmony_ci#define RT5616_CP_FQ_96_KHZ 6 104762306a36Sopenharmony_ci#define RT5616_CP_FQ_192_KHZ 7 104862306a36Sopenharmony_ci 104962306a36Sopenharmony_ci/* HPOUT charge pump (0x91) */ 105062306a36Sopenharmony_ci#define RT5616_OSW_L_MASK (0x1 << 11) 105162306a36Sopenharmony_ci#define RT5616_OSW_L_SFT 11 105262306a36Sopenharmony_ci#define RT5616_OSW_L_DIS (0x0 << 11) 105362306a36Sopenharmony_ci#define RT5616_OSW_L_EN (0x1 << 11) 105462306a36Sopenharmony_ci#define RT5616_OSW_R_MASK (0x1 << 10) 105562306a36Sopenharmony_ci#define RT5616_OSW_R_SFT 10 105662306a36Sopenharmony_ci#define RT5616_OSW_R_DIS (0x0 << 10) 105762306a36Sopenharmony_ci#define RT5616_OSW_R_EN (0x1 << 10) 105862306a36Sopenharmony_ci#define RT5616_PM_HP_MASK (0x3 << 8) 105962306a36Sopenharmony_ci#define RT5616_PM_HP_SFT 8 106062306a36Sopenharmony_ci#define RT5616_PM_HP_LV (0x0 << 8) 106162306a36Sopenharmony_ci#define RT5616_PM_HP_MV (0x1 << 8) 106262306a36Sopenharmony_ci#define RT5616_PM_HP_HV (0x2 << 8) 106362306a36Sopenharmony_ci#define RT5616_IB_HP_MASK (0x3 << 6) 106462306a36Sopenharmony_ci#define RT5616_IB_HP_SFT 6 106562306a36Sopenharmony_ci#define RT5616_IB_HP_125IL (0x0 << 6) 106662306a36Sopenharmony_ci#define RT5616_IB_HP_25IL (0x1 << 6) 106762306a36Sopenharmony_ci#define RT5616_IB_HP_5IL (0x2 << 6) 106862306a36Sopenharmony_ci#define RT5616_IB_HP_1IL (0x3 << 6) 106962306a36Sopenharmony_ci 107062306a36Sopenharmony_ci/* Micbias Control (0x93) */ 107162306a36Sopenharmony_ci#define RT5616_MIC1_BS_MASK (0x1 << 15) 107262306a36Sopenharmony_ci#define RT5616_MIC1_BS_SFT 15 107362306a36Sopenharmony_ci#define RT5616_MIC1_BS_9AV (0x0 << 15) 107462306a36Sopenharmony_ci#define RT5616_MIC1_BS_75AV (0x1 << 15) 107562306a36Sopenharmony_ci#define RT5616_MIC1_CLK_MASK (0x1 << 13) 107662306a36Sopenharmony_ci#define RT5616_MIC1_CLK_SFT 13 107762306a36Sopenharmony_ci#define RT5616_MIC1_CLK_DIS (0x0 << 13) 107862306a36Sopenharmony_ci#define RT5616_MIC1_CLK_EN (0x1 << 13) 107962306a36Sopenharmony_ci#define RT5616_MIC1_OVCD_MASK (0x1 << 11) 108062306a36Sopenharmony_ci#define RT5616_MIC1_OVCD_SFT 11 108162306a36Sopenharmony_ci#define RT5616_MIC1_OVCD_DIS (0x0 << 11) 108262306a36Sopenharmony_ci#define RT5616_MIC1_OVCD_EN (0x1 << 11) 108362306a36Sopenharmony_ci#define RT5616_MIC1_OVTH_MASK (0x3 << 9) 108462306a36Sopenharmony_ci#define RT5616_MIC1_OVTH_SFT 9 108562306a36Sopenharmony_ci#define RT5616_MIC1_OVTH_600UA (0x0 << 9) 108662306a36Sopenharmony_ci#define RT5616_MIC1_OVTH_1500UA (0x1 << 9) 108762306a36Sopenharmony_ci#define RT5616_MIC1_OVTH_2000UA (0x2 << 9) 108862306a36Sopenharmony_ci#define RT5616_PWR_MB_MASK (0x1 << 5) 108962306a36Sopenharmony_ci#define RT5616_PWR_MB_SFT 5 109062306a36Sopenharmony_ci#define RT5616_PWR_MB_PD (0x0 << 5) 109162306a36Sopenharmony_ci#define RT5616_PWR_MB_PU (0x1 << 5) 109262306a36Sopenharmony_ci#define RT5616_PWR_CLK12M_MASK (0x1 << 4) 109362306a36Sopenharmony_ci#define RT5616_PWR_CLK12M_SFT 4 109462306a36Sopenharmony_ci#define RT5616_PWR_CLK12M_PD (0x0 << 4) 109562306a36Sopenharmony_ci#define RT5616_PWR_CLK12M_PU (0x1 << 4) 109662306a36Sopenharmony_ci 109762306a36Sopenharmony_ci/* Analog JD Control 1 (0x94) */ 109862306a36Sopenharmony_ci#define RT5616_JD2_CMP_MASK (0x7 << 12) 109962306a36Sopenharmony_ci#define RT5616_JD2_CMP_SFT 12 110062306a36Sopenharmony_ci#define RT5616_JD_PU (0x1 << 11) 110162306a36Sopenharmony_ci#define RT5616_JD_PU_SFT 11 110262306a36Sopenharmony_ci#define RT5616_JD_PD (0x1 << 10) 110362306a36Sopenharmony_ci#define RT5616_JD_PD_SFT 10 110462306a36Sopenharmony_ci#define RT5616_JD_MODE_SEL_MASK (0x3 << 8) 110562306a36Sopenharmony_ci#define RT5616_JD_MODE_SEL_SFT 8 110662306a36Sopenharmony_ci#define RT5616_JD_MODE_SEL_M0 (0x0 << 8) 110762306a36Sopenharmony_ci#define RT5616_JD_MODE_SEL_M1 (0x1 << 8) 110862306a36Sopenharmony_ci#define RT5616_JD_MODE_SEL_M2 (0x2 << 8) 110962306a36Sopenharmony_ci#define RT5616_JD_M_CMP (0x7 << 4) 111062306a36Sopenharmony_ci#define RT5616_JD_M_CMP_SFT 4 111162306a36Sopenharmony_ci#define RT5616_JD_M_PU (0x1 << 3) 111262306a36Sopenharmony_ci#define RT5616_JD_M_PU_SFT 3 111362306a36Sopenharmony_ci#define RT5616_JD_M_PD (0x1 << 2) 111462306a36Sopenharmony_ci#define RT5616_JD_M_PD_SFT 2 111562306a36Sopenharmony_ci#define RT5616_JD_M_MODE_SEL_MASK (0x3) 111662306a36Sopenharmony_ci#define RT5616_JD_M_MODE_SEL_SFT 0 111762306a36Sopenharmony_ci#define RT5616_JD_M_MODE_SEL_M0 (0x0) 111862306a36Sopenharmony_ci#define RT5616_JD_M_MODE_SEL_M1 (0x1) 111962306a36Sopenharmony_ci#define RT5616_JD_M_MODE_SEL_M2 (0x2) 112062306a36Sopenharmony_ci 112162306a36Sopenharmony_ci/* Analog JD Control 2 (0x95) */ 112262306a36Sopenharmony_ci#define RT5616_JD3_CMP_MASK (0x7 << 12) 112362306a36Sopenharmony_ci#define RT5616_JD3_CMP_SFT 12 112462306a36Sopenharmony_ci 112562306a36Sopenharmony_ci/* EQ Control 1 (0xb0) */ 112662306a36Sopenharmony_ci#define RT5616_EQ_SRC_MASK (0x1 << 15) 112762306a36Sopenharmony_ci#define RT5616_EQ_SRC_SFT 15 112862306a36Sopenharmony_ci#define RT5616_EQ_SRC_DAC (0x0 << 15) 112962306a36Sopenharmony_ci#define RT5616_EQ_SRC_ADC (0x1 << 15) 113062306a36Sopenharmony_ci#define RT5616_EQ_UPD (0x1 << 14) 113162306a36Sopenharmony_ci#define RT5616_EQ_UPD_BIT 14 113262306a36Sopenharmony_ci#define RT5616_EQ_CD_MASK (0x1 << 13) 113362306a36Sopenharmony_ci#define RT5616_EQ_CD_SFT 13 113462306a36Sopenharmony_ci#define RT5616_EQ_CD_DIS (0x0 << 13) 113562306a36Sopenharmony_ci#define RT5616_EQ_CD_EN (0x1 << 13) 113662306a36Sopenharmony_ci#define RT5616_EQ_DITH_MASK (0x3 << 8) 113762306a36Sopenharmony_ci#define RT5616_EQ_DITH_SFT 8 113862306a36Sopenharmony_ci#define RT5616_EQ_DITH_NOR (0x0 << 8) 113962306a36Sopenharmony_ci#define RT5616_EQ_DITH_LSB (0x1 << 8) 114062306a36Sopenharmony_ci#define RT5616_EQ_DITH_LSB_1 (0x2 << 8) 114162306a36Sopenharmony_ci#define RT5616_EQ_DITH_LSB_2 (0x3 << 8) 114262306a36Sopenharmony_ci#define RT5616_EQ_CD_F (0x1 << 7) 114362306a36Sopenharmony_ci#define RT5616_EQ_CD_F_BIT 7 114462306a36Sopenharmony_ci#define RT5616_EQ_STA_HP2 (0x1 << 6) 114562306a36Sopenharmony_ci#define RT5616_EQ_STA_HP2_BIT 6 114662306a36Sopenharmony_ci#define RT5616_EQ_STA_HP1 (0x1 << 5) 114762306a36Sopenharmony_ci#define RT5616_EQ_STA_HP1_BIT 5 114862306a36Sopenharmony_ci#define RT5616_EQ_STA_BP4 (0x1 << 4) 114962306a36Sopenharmony_ci#define RT5616_EQ_STA_BP4_BIT 4 115062306a36Sopenharmony_ci#define RT5616_EQ_STA_BP3 (0x1 << 3) 115162306a36Sopenharmony_ci#define RT5616_EQ_STA_BP3_BIT 3 115262306a36Sopenharmony_ci#define RT5616_EQ_STA_BP2 (0x1 << 2) 115362306a36Sopenharmony_ci#define RT5616_EQ_STA_BP2_BIT 2 115462306a36Sopenharmony_ci#define RT5616_EQ_STA_BP1 (0x1 << 1) 115562306a36Sopenharmony_ci#define RT5616_EQ_STA_BP1_BIT 1 115662306a36Sopenharmony_ci#define RT5616_EQ_STA_LP (0x1) 115762306a36Sopenharmony_ci#define RT5616_EQ_STA_LP_BIT 0 115862306a36Sopenharmony_ci 115962306a36Sopenharmony_ci/* EQ Control 2 (0xb1) */ 116062306a36Sopenharmony_ci#define RT5616_EQ_HPF1_M_MASK (0x1 << 8) 116162306a36Sopenharmony_ci#define RT5616_EQ_HPF1_M_SFT 8 116262306a36Sopenharmony_ci#define RT5616_EQ_HPF1_M_HI (0x0 << 8) 116362306a36Sopenharmony_ci#define RT5616_EQ_HPF1_M_1ST (0x1 << 8) 116462306a36Sopenharmony_ci#define RT5616_EQ_LPF1_M_MASK (0x1 << 7) 116562306a36Sopenharmony_ci#define RT5616_EQ_LPF1_M_SFT 7 116662306a36Sopenharmony_ci#define RT5616_EQ_LPF1_M_LO (0x0 << 7) 116762306a36Sopenharmony_ci#define RT5616_EQ_LPF1_M_1ST (0x1 << 7) 116862306a36Sopenharmony_ci#define RT5616_EQ_HPF2_MASK (0x1 << 6) 116962306a36Sopenharmony_ci#define RT5616_EQ_HPF2_SFT 6 117062306a36Sopenharmony_ci#define RT5616_EQ_HPF2_DIS (0x0 << 6) 117162306a36Sopenharmony_ci#define RT5616_EQ_HPF2_EN (0x1 << 6) 117262306a36Sopenharmony_ci#define RT5616_EQ_HPF1_MASK (0x1 << 5) 117362306a36Sopenharmony_ci#define RT5616_EQ_HPF1_SFT 5 117462306a36Sopenharmony_ci#define RT5616_EQ_HPF1_DIS (0x0 << 5) 117562306a36Sopenharmony_ci#define RT5616_EQ_HPF1_EN (0x1 << 5) 117662306a36Sopenharmony_ci#define RT5616_EQ_BPF4_MASK (0x1 << 4) 117762306a36Sopenharmony_ci#define RT5616_EQ_BPF4_SFT 4 117862306a36Sopenharmony_ci#define RT5616_EQ_BPF4_DIS (0x0 << 4) 117962306a36Sopenharmony_ci#define RT5616_EQ_BPF4_EN (0x1 << 4) 118062306a36Sopenharmony_ci#define RT5616_EQ_BPF3_MASK (0x1 << 3) 118162306a36Sopenharmony_ci#define RT5616_EQ_BPF3_SFT 3 118262306a36Sopenharmony_ci#define RT5616_EQ_BPF3_DIS (0x0 << 3) 118362306a36Sopenharmony_ci#define RT5616_EQ_BPF3_EN (0x1 << 3) 118462306a36Sopenharmony_ci#define RT5616_EQ_BPF2_MASK (0x1 << 2) 118562306a36Sopenharmony_ci#define RT5616_EQ_BPF2_SFT 2 118662306a36Sopenharmony_ci#define RT5616_EQ_BPF2_DIS (0x0 << 2) 118762306a36Sopenharmony_ci#define RT5616_EQ_BPF2_EN (0x1 << 2) 118862306a36Sopenharmony_ci#define RT5616_EQ_BPF1_MASK (0x1 << 1) 118962306a36Sopenharmony_ci#define RT5616_EQ_BPF1_SFT 1 119062306a36Sopenharmony_ci#define RT5616_EQ_BPF1_DIS (0x0 << 1) 119162306a36Sopenharmony_ci#define RT5616_EQ_BPF1_EN (0x1 << 1) 119262306a36Sopenharmony_ci#define RT5616_EQ_LPF_MASK (0x1) 119362306a36Sopenharmony_ci#define RT5616_EQ_LPF_SFT 0 119462306a36Sopenharmony_ci#define RT5616_EQ_LPF_DIS (0x0) 119562306a36Sopenharmony_ci#define RT5616_EQ_LPF_EN (0x1) 119662306a36Sopenharmony_ci#define RT5616_EQ_CTRL_MASK (0x7f) 119762306a36Sopenharmony_ci 119862306a36Sopenharmony_ci/* Memory Test (0xb2) */ 119962306a36Sopenharmony_ci#define RT5616_MT_MASK (0x1 << 15) 120062306a36Sopenharmony_ci#define RT5616_MT_SFT 15 120162306a36Sopenharmony_ci#define RT5616_MT_DIS (0x0 << 15) 120262306a36Sopenharmony_ci#define RT5616_MT_EN (0x1 << 15) 120362306a36Sopenharmony_ci 120462306a36Sopenharmony_ci/* DRC/AGC Control 1 (0xb4) */ 120562306a36Sopenharmony_ci#define RT5616_DRC_AGC_P_MASK (0x1 << 15) 120662306a36Sopenharmony_ci#define RT5616_DRC_AGC_P_SFT 15 120762306a36Sopenharmony_ci#define RT5616_DRC_AGC_P_DAC (0x0 << 15) 120862306a36Sopenharmony_ci#define RT5616_DRC_AGC_P_ADC (0x1 << 15) 120962306a36Sopenharmony_ci#define RT5616_DRC_AGC_MASK (0x1 << 14) 121062306a36Sopenharmony_ci#define RT5616_DRC_AGC_SFT 14 121162306a36Sopenharmony_ci#define RT5616_DRC_AGC_DIS (0x0 << 14) 121262306a36Sopenharmony_ci#define RT5616_DRC_AGC_EN (0x1 << 14) 121362306a36Sopenharmony_ci#define RT5616_DRC_AGC_UPD (0x1 << 13) 121462306a36Sopenharmony_ci#define RT5616_DRC_AGC_UPD_BIT 13 121562306a36Sopenharmony_ci#define RT5616_DRC_AGC_AR_MASK (0x1f << 8) 121662306a36Sopenharmony_ci#define RT5616_DRC_AGC_AR_SFT 8 121762306a36Sopenharmony_ci#define RT5616_DRC_AGC_R_MASK (0x7 << 5) 121862306a36Sopenharmony_ci#define RT5616_DRC_AGC_R_SFT 5 121962306a36Sopenharmony_ci#define RT5616_DRC_AGC_R_48K (0x1 << 5) 122062306a36Sopenharmony_ci#define RT5616_DRC_AGC_R_96K (0x2 << 5) 122162306a36Sopenharmony_ci#define RT5616_DRC_AGC_R_192K (0x3 << 5) 122262306a36Sopenharmony_ci#define RT5616_DRC_AGC_R_441K (0x5 << 5) 122362306a36Sopenharmony_ci#define RT5616_DRC_AGC_R_882K (0x6 << 5) 122462306a36Sopenharmony_ci#define RT5616_DRC_AGC_R_1764K (0x7 << 5) 122562306a36Sopenharmony_ci#define RT5616_DRC_AGC_RC_MASK (0x1f) 122662306a36Sopenharmony_ci#define RT5616_DRC_AGC_RC_SFT 0 122762306a36Sopenharmony_ci 122862306a36Sopenharmony_ci/* DRC/AGC Control 2 (0xb5) */ 122962306a36Sopenharmony_ci#define RT5616_DRC_AGC_POB_MASK (0x3f << 8) 123062306a36Sopenharmony_ci#define RT5616_DRC_AGC_POB_SFT 8 123162306a36Sopenharmony_ci#define RT5616_DRC_AGC_CP_MASK (0x1 << 7) 123262306a36Sopenharmony_ci#define RT5616_DRC_AGC_CP_SFT 7 123362306a36Sopenharmony_ci#define RT5616_DRC_AGC_CP_DIS (0x0 << 7) 123462306a36Sopenharmony_ci#define RT5616_DRC_AGC_CP_EN (0x1 << 7) 123562306a36Sopenharmony_ci#define RT5616_DRC_AGC_CPR_MASK (0x3 << 5) 123662306a36Sopenharmony_ci#define RT5616_DRC_AGC_CPR_SFT 5 123762306a36Sopenharmony_ci#define RT5616_DRC_AGC_CPR_1_1 (0x0 << 5) 123862306a36Sopenharmony_ci#define RT5616_DRC_AGC_CPR_1_2 (0x1 << 5) 123962306a36Sopenharmony_ci#define RT5616_DRC_AGC_CPR_1_3 (0x2 << 5) 124062306a36Sopenharmony_ci#define RT5616_DRC_AGC_CPR_1_4 (0x3 << 5) 124162306a36Sopenharmony_ci#define RT5616_DRC_AGC_PRB_MASK (0x1f) 124262306a36Sopenharmony_ci#define RT5616_DRC_AGC_PRB_SFT 0 124362306a36Sopenharmony_ci 124462306a36Sopenharmony_ci/* DRC/AGC Control 3 (0xb6) */ 124562306a36Sopenharmony_ci#define RT5616_DRC_AGC_NGB_MASK (0xf << 12) 124662306a36Sopenharmony_ci#define RT5616_DRC_AGC_NGB_SFT 12 124762306a36Sopenharmony_ci#define RT5616_DRC_AGC_TAR_MASK (0x1f << 7) 124862306a36Sopenharmony_ci#define RT5616_DRC_AGC_TAR_SFT 7 124962306a36Sopenharmony_ci#define RT5616_DRC_AGC_NG_MASK (0x1 << 6) 125062306a36Sopenharmony_ci#define RT5616_DRC_AGC_NG_SFT 6 125162306a36Sopenharmony_ci#define RT5616_DRC_AGC_NG_DIS (0x0 << 6) 125262306a36Sopenharmony_ci#define RT5616_DRC_AGC_NG_EN (0x1 << 6) 125362306a36Sopenharmony_ci#define RT5616_DRC_AGC_NGH_MASK (0x1 << 5) 125462306a36Sopenharmony_ci#define RT5616_DRC_AGC_NGH_SFT 5 125562306a36Sopenharmony_ci#define RT5616_DRC_AGC_NGH_DIS (0x0 << 5) 125662306a36Sopenharmony_ci#define RT5616_DRC_AGC_NGH_EN (0x1 << 5) 125762306a36Sopenharmony_ci#define RT5616_DRC_AGC_NGT_MASK (0x1f) 125862306a36Sopenharmony_ci#define RT5616_DRC_AGC_NGT_SFT 0 125962306a36Sopenharmony_ci 126062306a36Sopenharmony_ci/* Jack Detect Control 1 (0xbb) */ 126162306a36Sopenharmony_ci#define RT5616_JD_MASK (0x7 << 13) 126262306a36Sopenharmony_ci#define RT5616_JD_SFT 13 126362306a36Sopenharmony_ci#define RT5616_JD_DIS (0x0 << 13) 126462306a36Sopenharmony_ci#define RT5616_JD_GPIO1 (0x1 << 13) 126562306a36Sopenharmony_ci#define RT5616_JD_GPIO2 (0x2 << 13) 126662306a36Sopenharmony_ci#define RT5616_JD_GPIO3 (0x3 << 13) 126762306a36Sopenharmony_ci#define RT5616_JD_GPIO4 (0x4 << 13) 126862306a36Sopenharmony_ci#define RT5616_JD_GPIO5 (0x5 << 13) 126962306a36Sopenharmony_ci#define RT5616_JD_GPIO6 (0x6 << 13) 127062306a36Sopenharmony_ci#define RT5616_JD_HP_MASK (0x1 << 11) 127162306a36Sopenharmony_ci#define RT5616_JD_HP_SFT 11 127262306a36Sopenharmony_ci#define RT5616_JD_HP_DIS (0x0 << 11) 127362306a36Sopenharmony_ci#define RT5616_JD_HP_EN (0x1 << 11) 127462306a36Sopenharmony_ci#define RT5616_JD_HP_TRG_MASK (0x1 << 10) 127562306a36Sopenharmony_ci#define RT5616_JD_HP_TRG_SFT 10 127662306a36Sopenharmony_ci#define RT5616_JD_HP_TRG_LO (0x0 << 10) 127762306a36Sopenharmony_ci#define RT5616_JD_HP_TRG_HI (0x1 << 10) 127862306a36Sopenharmony_ci#define RT5616_JD_SPL_MASK (0x1 << 9) 127962306a36Sopenharmony_ci#define RT5616_JD_SPL_SFT 9 128062306a36Sopenharmony_ci#define RT5616_JD_SPL_DIS (0x0 << 9) 128162306a36Sopenharmony_ci#define RT5616_JD_SPL_EN (0x1 << 9) 128262306a36Sopenharmony_ci#define RT5616_JD_SPL_TRG_MASK (0x1 << 8) 128362306a36Sopenharmony_ci#define RT5616_JD_SPL_TRG_SFT 8 128462306a36Sopenharmony_ci#define RT5616_JD_SPL_TRG_LO (0x0 << 8) 128562306a36Sopenharmony_ci#define RT5616_JD_SPL_TRG_HI (0x1 << 8) 128662306a36Sopenharmony_ci#define RT5616_JD_SPR_MASK (0x1 << 7) 128762306a36Sopenharmony_ci#define RT5616_JD_SPR_SFT 7 128862306a36Sopenharmony_ci#define RT5616_JD_SPR_DIS (0x0 << 7) 128962306a36Sopenharmony_ci#define RT5616_JD_SPR_EN (0x1 << 7) 129062306a36Sopenharmony_ci#define RT5616_JD_SPR_TRG_MASK (0x1 << 6) 129162306a36Sopenharmony_ci#define RT5616_JD_SPR_TRG_SFT 6 129262306a36Sopenharmony_ci#define RT5616_JD_SPR_TRG_LO (0x0 << 6) 129362306a36Sopenharmony_ci#define RT5616_JD_SPR_TRG_HI (0x1 << 6) 129462306a36Sopenharmony_ci#define RT5616_JD_LO_MASK (0x1 << 3) 129562306a36Sopenharmony_ci#define RT5616_JD_LO_SFT 3 129662306a36Sopenharmony_ci#define RT5616_JD_LO_DIS (0x0 << 3) 129762306a36Sopenharmony_ci#define RT5616_JD_LO_EN (0x1 << 3) 129862306a36Sopenharmony_ci#define RT5616_JD_LO_TRG_MASK (0x1 << 2) 129962306a36Sopenharmony_ci#define RT5616_JD_LO_TRG_SFT 2 130062306a36Sopenharmony_ci#define RT5616_JD_LO_TRG_LO (0x0 << 2) 130162306a36Sopenharmony_ci#define RT5616_JD_LO_TRG_HI (0x1 << 2) 130262306a36Sopenharmony_ci 130362306a36Sopenharmony_ci/* Jack Detect Control 2 (0xbc) */ 130462306a36Sopenharmony_ci#define RT5616_JD_TRG_SEL_MASK (0x7 << 9) 130562306a36Sopenharmony_ci#define RT5616_JD_TRG_SEL_SFT 9 130662306a36Sopenharmony_ci#define RT5616_JD_TRG_SEL_GPIO (0x0 << 9) 130762306a36Sopenharmony_ci#define RT5616_JD_TRG_SEL_JD1_1 (0x1 << 9) 130862306a36Sopenharmony_ci#define RT5616_JD_TRG_SEL_JD1_2 (0x2 << 9) 130962306a36Sopenharmony_ci#define RT5616_JD_TRG_SEL_JD2 (0x3 << 9) 131062306a36Sopenharmony_ci#define RT5616_JD_TRG_SEL_JD3 (0x4 << 9) 131162306a36Sopenharmony_ci#define RT5616_JD3_IRQ_EN (0x1 << 8) 131262306a36Sopenharmony_ci#define RT5616_JD3_IRQ_EN_SFT 8 131362306a36Sopenharmony_ci#define RT5616_JD3_EN_STKY (0x1 << 7) 131462306a36Sopenharmony_ci#define RT5616_JD3_EN_STKY_SFT 7 131562306a36Sopenharmony_ci#define RT5616_JD3_INV (0x1 << 6) 131662306a36Sopenharmony_ci#define RT5616_JD3_INV_SFT 6 131762306a36Sopenharmony_ci 131862306a36Sopenharmony_ci/* IRQ Control 1 (0xbd) */ 131962306a36Sopenharmony_ci#define RT5616_IRQ_JD_MASK (0x1 << 15) 132062306a36Sopenharmony_ci#define RT5616_IRQ_JD_SFT 15 132162306a36Sopenharmony_ci#define RT5616_IRQ_JD_BP (0x0 << 15) 132262306a36Sopenharmony_ci#define RT5616_IRQ_JD_NOR (0x1 << 15) 132362306a36Sopenharmony_ci#define RT5616_JD_STKY_MASK (0x1 << 13) 132462306a36Sopenharmony_ci#define RT5616_JD_STKY_SFT 13 132562306a36Sopenharmony_ci#define RT5616_JD_STKY_DIS (0x0 << 13) 132662306a36Sopenharmony_ci#define RT5616_JD_STKY_EN (0x1 << 13) 132762306a36Sopenharmony_ci#define RT5616_JD_P_MASK (0x1 << 11) 132862306a36Sopenharmony_ci#define RT5616_JD_P_SFT 11 132962306a36Sopenharmony_ci#define RT5616_JD_P_NOR (0x0 << 11) 133062306a36Sopenharmony_ci#define RT5616_JD_P_INV (0x1 << 11) 133162306a36Sopenharmony_ci#define RT5616_JD1_1_IRQ_EN (0x1 << 9) 133262306a36Sopenharmony_ci#define RT5616_JD1_1_IRQ_EN_SFT 9 133362306a36Sopenharmony_ci#define RT5616_JD1_1_EN_STKY (0x1 << 8) 133462306a36Sopenharmony_ci#define RT5616_JD1_1_EN_STKY_SFT 8 133562306a36Sopenharmony_ci#define RT5616_JD1_1_INV (0x1 << 7) 133662306a36Sopenharmony_ci#define RT5616_JD1_1_INV_SFT 7 133762306a36Sopenharmony_ci#define RT5616_JD1_2_IRQ_EN (0x1 << 6) 133862306a36Sopenharmony_ci#define RT5616_JD1_2_IRQ_EN_SFT 6 133962306a36Sopenharmony_ci#define RT5616_JD1_2_EN_STKY (0x1 << 5) 134062306a36Sopenharmony_ci#define RT5616_JD1_2_EN_STKY_SFT 5 134162306a36Sopenharmony_ci#define RT5616_JD1_2_INV (0x1 << 4) 134262306a36Sopenharmony_ci#define RT5616_JD1_2_INV_SFT 4 134362306a36Sopenharmony_ci#define RT5616_JD2_IRQ_EN (0x1 << 3) 134462306a36Sopenharmony_ci#define RT5616_JD2_IRQ_EN_SFT 3 134562306a36Sopenharmony_ci#define RT5616_JD2_EN_STKY (0x1 << 2) 134662306a36Sopenharmony_ci#define RT5616_JD2_EN_STKY_SFT 2 134762306a36Sopenharmony_ci#define RT5616_JD2_INV (0x1 << 1) 134862306a36Sopenharmony_ci#define RT5616_JD2_INV_SFT 1 134962306a36Sopenharmony_ci 135062306a36Sopenharmony_ci/* IRQ Control 2 (0xbe) */ 135162306a36Sopenharmony_ci#define RT5616_IRQ_MB1_OC_MASK (0x1 << 15) 135262306a36Sopenharmony_ci#define RT5616_IRQ_MB1_OC_SFT 15 135362306a36Sopenharmony_ci#define RT5616_IRQ_MB1_OC_BP (0x0 << 15) 135462306a36Sopenharmony_ci#define RT5616_IRQ_MB1_OC_NOR (0x1 << 15) 135562306a36Sopenharmony_ci#define RT5616_MB1_OC_STKY_MASK (0x1 << 11) 135662306a36Sopenharmony_ci#define RT5616_MB1_OC_STKY_SFT 11 135762306a36Sopenharmony_ci#define RT5616_MB1_OC_STKY_DIS (0x0 << 11) 135862306a36Sopenharmony_ci#define RT5616_MB1_OC_STKY_EN (0x1 << 11) 135962306a36Sopenharmony_ci#define RT5616_MB1_OC_P_MASK (0x1 << 7) 136062306a36Sopenharmony_ci#define RT5616_MB1_OC_P_SFT 7 136162306a36Sopenharmony_ci#define RT5616_MB1_OC_P_NOR (0x0 << 7) 136262306a36Sopenharmony_ci#define RT5616_MB1_OC_P_INV (0x1 << 7) 136362306a36Sopenharmony_ci#define RT5616_MB2_OC_P_MASK (0x1 << 6) 136462306a36Sopenharmony_ci#define RT5616_MB1_OC_CLR (0x1 << 3) 136562306a36Sopenharmony_ci#define RT5616_MB1_OC_CLR_SFT 3 136662306a36Sopenharmony_ci#define RT5616_STA_GPIO8 (0x1) 136762306a36Sopenharmony_ci#define RT5616_STA_GPIO8_BIT 0 136862306a36Sopenharmony_ci 136962306a36Sopenharmony_ci/* Internal Status and GPIO status (0xbf) */ 137062306a36Sopenharmony_ci#define RT5616_STA_JD3 (0x1 << 15) 137162306a36Sopenharmony_ci#define RT5616_STA_JD3_BIT 15 137262306a36Sopenharmony_ci#define RT5616_STA_JD2 (0x1 << 14) 137362306a36Sopenharmony_ci#define RT5616_STA_JD2_BIT 14 137462306a36Sopenharmony_ci#define RT5616_STA_JD1_2 (0x1 << 13) 137562306a36Sopenharmony_ci#define RT5616_STA_JD1_2_BIT 13 137662306a36Sopenharmony_ci#define RT5616_STA_JD1_1 (0x1 << 12) 137762306a36Sopenharmony_ci#define RT5616_STA_JD1_1_BIT 12 137862306a36Sopenharmony_ci#define RT5616_STA_GP7 (0x1 << 11) 137962306a36Sopenharmony_ci#define RT5616_STA_GP7_BIT 11 138062306a36Sopenharmony_ci#define RT5616_STA_GP6 (0x1 << 10) 138162306a36Sopenharmony_ci#define RT5616_STA_GP6_BIT 10 138262306a36Sopenharmony_ci#define RT5616_STA_GP5 (0x1 << 9) 138362306a36Sopenharmony_ci#define RT5616_STA_GP5_BIT 9 138462306a36Sopenharmony_ci#define RT5616_STA_GP1 (0x1 << 8) 138562306a36Sopenharmony_ci#define RT5616_STA_GP1_BIT 8 138662306a36Sopenharmony_ci#define RT5616_STA_GP2 (0x1 << 7) 138762306a36Sopenharmony_ci#define RT5616_STA_GP2_BIT 7 138862306a36Sopenharmony_ci#define RT5616_STA_GP3 (0x1 << 6) 138962306a36Sopenharmony_ci#define RT5616_STA_GP3_BIT 6 139062306a36Sopenharmony_ci#define RT5616_STA_GP4 (0x1 << 5) 139162306a36Sopenharmony_ci#define RT5616_STA_GP4_BIT 5 139262306a36Sopenharmony_ci#define RT5616_STA_GP_JD (0x1 << 4) 139362306a36Sopenharmony_ci#define RT5616_STA_GP_JD_BIT 4 139462306a36Sopenharmony_ci 139562306a36Sopenharmony_ci/* GPIO Control 1 (0xc0) */ 139662306a36Sopenharmony_ci#define RT5616_GP1_PIN_MASK (0x1 << 15) 139762306a36Sopenharmony_ci#define RT5616_GP1_PIN_SFT 15 139862306a36Sopenharmony_ci#define RT5616_GP1_PIN_GPIO1 (0x0 << 15) 139962306a36Sopenharmony_ci#define RT5616_GP1_PIN_IRQ (0x1 << 15) 140062306a36Sopenharmony_ci#define RT5616_GP2_PIN_MASK (0x1 << 14) 140162306a36Sopenharmony_ci#define RT5616_GP2_PIN_SFT 14 140262306a36Sopenharmony_ci#define RT5616_GP2_PIN_GPIO2 (0x0 << 14) 140362306a36Sopenharmony_ci#define RT5616_GP2_PIN_DMIC1_SCL (0x1 << 14) 140462306a36Sopenharmony_ci#define RT5616_GPIO_M_MASK (0x1 << 9) 140562306a36Sopenharmony_ci#define RT5616_GPIO_M_SFT 9 140662306a36Sopenharmony_ci#define RT5616_GPIO_M_FLT (0x0 << 9) 140762306a36Sopenharmony_ci#define RT5616_GPIO_M_PH (0x1 << 9) 140862306a36Sopenharmony_ci#define RT5616_I2S2_SEL_MASK (0x1 << 8) 140962306a36Sopenharmony_ci#define RT5616_I2S2_SEL_SFT 8 141062306a36Sopenharmony_ci#define RT5616_I2S2_SEL_I2S (0x0 << 8) 141162306a36Sopenharmony_ci#define RT5616_I2S2_SEL_GPIO (0x1 << 8) 141262306a36Sopenharmony_ci#define RT5616_GP5_PIN_MASK (0x1 << 7) 141362306a36Sopenharmony_ci#define RT5616_GP5_PIN_SFT 7 141462306a36Sopenharmony_ci#define RT5616_GP5_PIN_GPIO5 (0x0 << 7) 141562306a36Sopenharmony_ci#define RT5616_GP5_PIN_IRQ (0x1 << 7) 141662306a36Sopenharmony_ci#define RT5616_GP6_PIN_MASK (0x1 << 6) 141762306a36Sopenharmony_ci#define RT5616_GP6_PIN_SFT 6 141862306a36Sopenharmony_ci#define RT5616_GP6_PIN_GPIO6 (0x0 << 6) 141962306a36Sopenharmony_ci#define RT5616_GP6_PIN_DMIC_SDA (0x1 << 6) 142062306a36Sopenharmony_ci#define RT5616_GP7_PIN_MASK (0x1 << 5) 142162306a36Sopenharmony_ci#define RT5616_GP7_PIN_SFT 5 142262306a36Sopenharmony_ci#define RT5616_GP7_PIN_GPIO7 (0x0 << 5) 142362306a36Sopenharmony_ci#define RT5616_GP7_PIN_IRQ (0x1 << 5) 142462306a36Sopenharmony_ci#define RT5616_GP8_PIN_MASK (0x1 << 4) 142562306a36Sopenharmony_ci#define RT5616_GP8_PIN_SFT 4 142662306a36Sopenharmony_ci#define RT5616_GP8_PIN_GPIO8 (0x0 << 4) 142762306a36Sopenharmony_ci#define RT5616_GP8_PIN_DMIC_SDA (0x1 << 4) 142862306a36Sopenharmony_ci#define RT5616_GPIO_PDM_SEL_MASK (0x1 << 3) 142962306a36Sopenharmony_ci#define RT5616_GPIO_PDM_SEL_SFT 3 143062306a36Sopenharmony_ci#define RT5616_GPIO_PDM_SEL_GPIO (0x0 << 3) 143162306a36Sopenharmony_ci#define RT5616_GPIO_PDM_SEL_PDM (0x1 << 3) 143262306a36Sopenharmony_ci 143362306a36Sopenharmony_ci/* GPIO Control 2 (0xc1) */ 143462306a36Sopenharmony_ci#define RT5616_GP5_DR_MASK (0x1 << 14) 143562306a36Sopenharmony_ci#define RT5616_GP5_DR_SFT 14 143662306a36Sopenharmony_ci#define RT5616_GP5_DR_IN (0x0 << 14) 143762306a36Sopenharmony_ci#define RT5616_GP5_DR_OUT (0x1 << 14) 143862306a36Sopenharmony_ci#define RT5616_GP5_OUT_MASK (0x1 << 13) 143962306a36Sopenharmony_ci#define RT5616_GP5_OUT_SFT 13 144062306a36Sopenharmony_ci#define RT5616_GP5_OUT_LO (0x0 << 13) 144162306a36Sopenharmony_ci#define RT5616_GP5_OUT_HI (0x1 << 13) 144262306a36Sopenharmony_ci#define RT5616_GP5_P_MASK (0x1 << 12) 144362306a36Sopenharmony_ci#define RT5616_GP5_P_SFT 12 144462306a36Sopenharmony_ci#define RT5616_GP5_P_NOR (0x0 << 12) 144562306a36Sopenharmony_ci#define RT5616_GP5_P_INV (0x1 << 12) 144662306a36Sopenharmony_ci#define RT5616_GP4_DR_MASK (0x1 << 11) 144762306a36Sopenharmony_ci#define RT5616_GP4_DR_SFT 11 144862306a36Sopenharmony_ci#define RT5616_GP4_DR_IN (0x0 << 11) 144962306a36Sopenharmony_ci#define RT5616_GP4_DR_OUT (0x1 << 11) 145062306a36Sopenharmony_ci#define RT5616_GP4_OUT_MASK (0x1 << 10) 145162306a36Sopenharmony_ci#define RT5616_GP4_OUT_SFT 10 145262306a36Sopenharmony_ci#define RT5616_GP4_OUT_LO (0x0 << 10) 145362306a36Sopenharmony_ci#define RT5616_GP4_OUT_HI (0x1 << 10) 145462306a36Sopenharmony_ci#define RT5616_GP4_P_MASK (0x1 << 9) 145562306a36Sopenharmony_ci#define RT5616_GP4_P_SFT 9 145662306a36Sopenharmony_ci#define RT5616_GP4_P_NOR (0x0 << 9) 145762306a36Sopenharmony_ci#define RT5616_GP4_P_INV (0x1 << 9) 145862306a36Sopenharmony_ci#define RT5616_GP3_DR_MASK (0x1 << 8) 145962306a36Sopenharmony_ci#define RT5616_GP3_DR_SFT 8 146062306a36Sopenharmony_ci#define RT5616_GP3_DR_IN (0x0 << 8) 146162306a36Sopenharmony_ci#define RT5616_GP3_DR_OUT (0x1 << 8) 146262306a36Sopenharmony_ci#define RT5616_GP3_OUT_MASK (0x1 << 7) 146362306a36Sopenharmony_ci#define RT5616_GP3_OUT_SFT 7 146462306a36Sopenharmony_ci#define RT5616_GP3_OUT_LO (0x0 << 7) 146562306a36Sopenharmony_ci#define RT5616_GP3_OUT_HI (0x1 << 7) 146662306a36Sopenharmony_ci#define RT5616_GP3_P_MASK (0x1 << 6) 146762306a36Sopenharmony_ci#define RT5616_GP3_P_SFT 6 146862306a36Sopenharmony_ci#define RT5616_GP3_P_NOR (0x0 << 6) 146962306a36Sopenharmony_ci#define RT5616_GP3_P_INV (0x1 << 6) 147062306a36Sopenharmony_ci#define RT5616_GP2_DR_MASK (0x1 << 5) 147162306a36Sopenharmony_ci#define RT5616_GP2_DR_SFT 5 147262306a36Sopenharmony_ci#define RT5616_GP2_DR_IN (0x0 << 5) 147362306a36Sopenharmony_ci#define RT5616_GP2_DR_OUT (0x1 << 5) 147462306a36Sopenharmony_ci#define RT5616_GP2_OUT_MASK (0x1 << 4) 147562306a36Sopenharmony_ci#define RT5616_GP2_OUT_SFT 4 147662306a36Sopenharmony_ci#define RT5616_GP2_OUT_LO (0x0 << 4) 147762306a36Sopenharmony_ci#define RT5616_GP2_OUT_HI (0x1 << 4) 147862306a36Sopenharmony_ci#define RT5616_GP2_P_MASK (0x1 << 3) 147962306a36Sopenharmony_ci#define RT5616_GP2_P_SFT 3 148062306a36Sopenharmony_ci#define RT5616_GP2_P_NOR (0x0 << 3) 148162306a36Sopenharmony_ci#define RT5616_GP2_P_INV (0x1 << 3) 148262306a36Sopenharmony_ci#define RT5616_GP1_DR_MASK (0x1 << 2) 148362306a36Sopenharmony_ci#define RT5616_GP1_DR_SFT 2 148462306a36Sopenharmony_ci#define RT5616_GP1_DR_IN (0x0 << 2) 148562306a36Sopenharmony_ci#define RT5616_GP1_DR_OUT (0x1 << 2) 148662306a36Sopenharmony_ci#define RT5616_GP1_OUT_MASK (0x1 << 1) 148762306a36Sopenharmony_ci#define RT5616_GP1_OUT_SFT 1 148862306a36Sopenharmony_ci#define RT5616_GP1_OUT_LO (0x0 << 1) 148962306a36Sopenharmony_ci#define RT5616_GP1_OUT_HI (0x1 << 1) 149062306a36Sopenharmony_ci#define RT5616_GP1_P_MASK (0x1) 149162306a36Sopenharmony_ci#define RT5616_GP1_P_SFT 0 149262306a36Sopenharmony_ci#define RT5616_GP1_P_NOR (0x0) 149362306a36Sopenharmony_ci#define RT5616_GP1_P_INV (0x1) 149462306a36Sopenharmony_ci 149562306a36Sopenharmony_ci/* GPIO Control 3 (0xc2) */ 149662306a36Sopenharmony_ci#define RT5616_GP8_DR_MASK (0x1 << 8) 149762306a36Sopenharmony_ci#define RT5616_GP8_DR_SFT 8 149862306a36Sopenharmony_ci#define RT5616_GP8_DR_IN (0x0 << 8) 149962306a36Sopenharmony_ci#define RT5616_GP8_DR_OUT (0x1 << 8) 150062306a36Sopenharmony_ci#define RT5616_GP8_OUT_MASK (0x1 << 7) 150162306a36Sopenharmony_ci#define RT5616_GP8_OUT_SFT 7 150262306a36Sopenharmony_ci#define RT5616_GP8_OUT_LO (0x0 << 7) 150362306a36Sopenharmony_ci#define RT5616_GP8_OUT_HI (0x1 << 7) 150462306a36Sopenharmony_ci#define RT5616_GP8_P_MASK (0x1 << 6) 150562306a36Sopenharmony_ci#define RT5616_GP8_P_SFT 6 150662306a36Sopenharmony_ci#define RT5616_GP8_P_NOR (0x0 << 6) 150762306a36Sopenharmony_ci#define RT5616_GP8_P_INV (0x1 << 6) 150862306a36Sopenharmony_ci#define RT5616_GP7_DR_MASK (0x1 << 5) 150962306a36Sopenharmony_ci#define RT5616_GP7_DR_SFT 5 151062306a36Sopenharmony_ci#define RT5616_GP7_DR_IN (0x0 << 5) 151162306a36Sopenharmony_ci#define RT5616_GP7_DR_OUT (0x1 << 5) 151262306a36Sopenharmony_ci#define RT5616_GP7_OUT_MASK (0x1 << 4) 151362306a36Sopenharmony_ci#define RT5616_GP7_OUT_SFT 4 151462306a36Sopenharmony_ci#define RT5616_GP7_OUT_LO (0x0 << 4) 151562306a36Sopenharmony_ci#define RT5616_GP7_OUT_HI (0x1 << 4) 151662306a36Sopenharmony_ci#define RT5616_GP7_P_MASK (0x1 << 3) 151762306a36Sopenharmony_ci#define RT5616_GP7_P_SFT 3 151862306a36Sopenharmony_ci#define RT5616_GP7_P_NOR (0x0 << 3) 151962306a36Sopenharmony_ci#define RT5616_GP7_P_INV (0x1 << 3) 152062306a36Sopenharmony_ci#define RT5616_GP6_DR_MASK (0x1 << 2) 152162306a36Sopenharmony_ci#define RT5616_GP6_DR_SFT 2 152262306a36Sopenharmony_ci#define RT5616_GP6_DR_IN (0x0 << 2) 152362306a36Sopenharmony_ci#define RT5616_GP6_DR_OUT (0x1 << 2) 152462306a36Sopenharmony_ci#define RT5616_GP6_OUT_MASK (0x1 << 1) 152562306a36Sopenharmony_ci#define RT5616_GP6_OUT_SFT 1 152662306a36Sopenharmony_ci#define RT5616_GP6_OUT_LO (0x0 << 1) 152762306a36Sopenharmony_ci#define RT5616_GP6_OUT_HI (0x1 << 1) 152862306a36Sopenharmony_ci#define RT5616_GP6_P_MASK (0x1) 152962306a36Sopenharmony_ci#define RT5616_GP6_P_SFT 0 153062306a36Sopenharmony_ci#define RT5616_GP6_P_NOR (0x0) 153162306a36Sopenharmony_ci#define RT5616_GP6_P_INV (0x1) 153262306a36Sopenharmony_ci 153362306a36Sopenharmony_ci/* Scramble Control (0xce) */ 153462306a36Sopenharmony_ci#define RT5616_SCB_SWAP_MASK (0x1 << 15) 153562306a36Sopenharmony_ci#define RT5616_SCB_SWAP_SFT 15 153662306a36Sopenharmony_ci#define RT5616_SCB_SWAP_DIS (0x0 << 15) 153762306a36Sopenharmony_ci#define RT5616_SCB_SWAP_EN (0x1 << 15) 153862306a36Sopenharmony_ci#define RT5616_SCB_MASK (0x1 << 14) 153962306a36Sopenharmony_ci#define RT5616_SCB_SFT 14 154062306a36Sopenharmony_ci#define RT5616_SCB_DIS (0x0 << 14) 154162306a36Sopenharmony_ci#define RT5616_SCB_EN (0x1 << 14) 154262306a36Sopenharmony_ci 154362306a36Sopenharmony_ci/* Baseback Control (0xcf) */ 154462306a36Sopenharmony_ci#define RT5616_BB_MASK (0x1 << 15) 154562306a36Sopenharmony_ci#define RT5616_BB_SFT 15 154662306a36Sopenharmony_ci#define RT5616_BB_DIS (0x0 << 15) 154762306a36Sopenharmony_ci#define RT5616_BB_EN (0x1 << 15) 154862306a36Sopenharmony_ci#define RT5616_BB_CT_MASK (0x7 << 12) 154962306a36Sopenharmony_ci#define RT5616_BB_CT_SFT 12 155062306a36Sopenharmony_ci#define RT5616_BB_CT_A (0x0 << 12) 155162306a36Sopenharmony_ci#define RT5616_BB_CT_B (0x1 << 12) 155262306a36Sopenharmony_ci#define RT5616_BB_CT_C (0x2 << 12) 155362306a36Sopenharmony_ci#define RT5616_BB_CT_D (0x3 << 12) 155462306a36Sopenharmony_ci#define RT5616_M_BB_L_MASK (0x1 << 9) 155562306a36Sopenharmony_ci#define RT5616_M_BB_L_SFT 9 155662306a36Sopenharmony_ci#define RT5616_M_BB_R_MASK (0x1 << 8) 155762306a36Sopenharmony_ci#define RT5616_M_BB_R_SFT 8 155862306a36Sopenharmony_ci#define RT5616_M_BB_HPF_L_MASK (0x1 << 7) 155962306a36Sopenharmony_ci#define RT5616_M_BB_HPF_L_SFT 7 156062306a36Sopenharmony_ci#define RT5616_M_BB_HPF_R_MASK (0x1 << 6) 156162306a36Sopenharmony_ci#define RT5616_M_BB_HPF_R_SFT 6 156262306a36Sopenharmony_ci#define RT5616_G_BB_BST_MASK (0x3f) 156362306a36Sopenharmony_ci#define RT5616_G_BB_BST_SFT 0 156462306a36Sopenharmony_ci 156562306a36Sopenharmony_ci/* MP3 Plus Control 1 (0xd0) */ 156662306a36Sopenharmony_ci#define RT5616_M_MP3_L_MASK (0x1 << 15) 156762306a36Sopenharmony_ci#define RT5616_M_MP3_L_SFT 15 156862306a36Sopenharmony_ci#define RT5616_M_MP3_R_MASK (0x1 << 14) 156962306a36Sopenharmony_ci#define RT5616_M_MP3_R_SFT 14 157062306a36Sopenharmony_ci#define RT5616_M_MP3_MASK (0x1 << 13) 157162306a36Sopenharmony_ci#define RT5616_M_MP3_SFT 13 157262306a36Sopenharmony_ci#define RT5616_M_MP3_DIS (0x0 << 13) 157362306a36Sopenharmony_ci#define RT5616_M_MP3_EN (0x1 << 13) 157462306a36Sopenharmony_ci#define RT5616_EG_MP3_MASK (0x1f << 8) 157562306a36Sopenharmony_ci#define RT5616_EG_MP3_SFT 8 157662306a36Sopenharmony_ci#define RT5616_MP3_HLP_MASK (0x1 << 7) 157762306a36Sopenharmony_ci#define RT5616_MP3_HLP_SFT 7 157862306a36Sopenharmony_ci#define RT5616_MP3_HLP_DIS (0x0 << 7) 157962306a36Sopenharmony_ci#define RT5616_MP3_HLP_EN (0x1 << 7) 158062306a36Sopenharmony_ci#define RT5616_M_MP3_ORG_L_MASK (0x1 << 6) 158162306a36Sopenharmony_ci#define RT5616_M_MP3_ORG_L_SFT 6 158262306a36Sopenharmony_ci#define RT5616_M_MP3_ORG_R_MASK (0x1 << 5) 158362306a36Sopenharmony_ci#define RT5616_M_MP3_ORG_R_SFT 5 158462306a36Sopenharmony_ci 158562306a36Sopenharmony_ci/* MP3 Plus Control 2 (0xd1) */ 158662306a36Sopenharmony_ci#define RT5616_MP3_WT_MASK (0x1 << 13) 158762306a36Sopenharmony_ci#define RT5616_MP3_WT_SFT 13 158862306a36Sopenharmony_ci#define RT5616_MP3_WT_1_4 (0x0 << 13) 158962306a36Sopenharmony_ci#define RT5616_MP3_WT_1_2 (0x1 << 13) 159062306a36Sopenharmony_ci#define RT5616_OG_MP3_MASK (0x1f << 8) 159162306a36Sopenharmony_ci#define RT5616_OG_MP3_SFT 8 159262306a36Sopenharmony_ci#define RT5616_HG_MP3_MASK (0x3f) 159362306a36Sopenharmony_ci#define RT5616_HG_MP3_SFT 0 159462306a36Sopenharmony_ci 159562306a36Sopenharmony_ci/* 3D HP Control 1 (0xd2) */ 159662306a36Sopenharmony_ci#define RT5616_3D_CF_MASK (0x1 << 15) 159762306a36Sopenharmony_ci#define RT5616_3D_CF_SFT 15 159862306a36Sopenharmony_ci#define RT5616_3D_CF_DIS (0x0 << 15) 159962306a36Sopenharmony_ci#define RT5616_3D_CF_EN (0x1 << 15) 160062306a36Sopenharmony_ci#define RT5616_3D_HP_MASK (0x1 << 14) 160162306a36Sopenharmony_ci#define RT5616_3D_HP_SFT 14 160262306a36Sopenharmony_ci#define RT5616_3D_HP_DIS (0x0 << 14) 160362306a36Sopenharmony_ci#define RT5616_3D_HP_EN (0x1 << 14) 160462306a36Sopenharmony_ci#define RT5616_3D_BT_MASK (0x1 << 13) 160562306a36Sopenharmony_ci#define RT5616_3D_BT_SFT 13 160662306a36Sopenharmony_ci#define RT5616_3D_BT_DIS (0x0 << 13) 160762306a36Sopenharmony_ci#define RT5616_3D_BT_EN (0x1 << 13) 160862306a36Sopenharmony_ci#define RT5616_3D_1F_MIX_MASK (0x3 << 11) 160962306a36Sopenharmony_ci#define RT5616_3D_1F_MIX_SFT 11 161062306a36Sopenharmony_ci#define RT5616_3D_HP_M_MASK (0x1 << 10) 161162306a36Sopenharmony_ci#define RT5616_3D_HP_M_SFT 10 161262306a36Sopenharmony_ci#define RT5616_3D_HP_M_SUR (0x0 << 10) 161362306a36Sopenharmony_ci#define RT5616_3D_HP_M_FRO (0x1 << 10) 161462306a36Sopenharmony_ci#define RT5616_M_3D_HRTF_MASK (0x1 << 9) 161562306a36Sopenharmony_ci#define RT5616_M_3D_HRTF_SFT 9 161662306a36Sopenharmony_ci#define RT5616_M_3D_D2H_MASK (0x1 << 8) 161762306a36Sopenharmony_ci#define RT5616_M_3D_D2H_SFT 8 161862306a36Sopenharmony_ci#define RT5616_M_3D_D2R_MASK (0x1 << 7) 161962306a36Sopenharmony_ci#define RT5616_M_3D_D2R_SFT 7 162062306a36Sopenharmony_ci#define RT5616_M_3D_REVB_MASK (0x1 << 6) 162162306a36Sopenharmony_ci#define RT5616_M_3D_REVB_SFT 6 162262306a36Sopenharmony_ci 162362306a36Sopenharmony_ci/* Adjustable high pass filter control 1 (0xd3) */ 162462306a36Sopenharmony_ci#define RT5616_2ND_HPF_MASK (0x1 << 15) 162562306a36Sopenharmony_ci#define RT5616_2ND_HPF_SFT 15 162662306a36Sopenharmony_ci#define RT5616_2ND_HPF_DIS (0x0 << 15) 162762306a36Sopenharmony_ci#define RT5616_2ND_HPF_EN (0x1 << 15) 162862306a36Sopenharmony_ci#define RT5616_HPF_CF_L_MASK (0x7 << 12) 162962306a36Sopenharmony_ci#define RT5616_HPF_CF_L_SFT 12 163062306a36Sopenharmony_ci#define RT5616_HPF_CF_R_MASK (0x7 << 8) 163162306a36Sopenharmony_ci#define RT5616_HPF_CF_R_SFT 8 163262306a36Sopenharmony_ci#define RT5616_ZD_T_MASK (0x3 << 6) 163362306a36Sopenharmony_ci#define RT5616_ZD_T_SFT 6 163462306a36Sopenharmony_ci#define RT5616_ZD_F_MASK (0x3 << 4) 163562306a36Sopenharmony_ci#define RT5616_ZD_F_SFT 4 163662306a36Sopenharmony_ci#define RT5616_ZD_F_IM (0x0 << 4) 163762306a36Sopenharmony_ci#define RT5616_ZD_F_ZC_IM (0x1 << 4) 163862306a36Sopenharmony_ci#define RT5616_ZD_F_ZC_IOD (0x2 << 4) 163962306a36Sopenharmony_ci#define RT5616_ZD_F_UN (0x3 << 4) 164062306a36Sopenharmony_ci 164162306a36Sopenharmony_ci/* Adjustable high pass filter control 2 (0xd4) */ 164262306a36Sopenharmony_ci#define RT5616_HPF_CF_L_NUM_MASK (0x3f << 8) 164362306a36Sopenharmony_ci#define RT5616_HPF_CF_L_NUM_SFT 8 164462306a36Sopenharmony_ci#define RT5616_HPF_CF_R_NUM_MASK (0x3f) 164562306a36Sopenharmony_ci#define RT5616_HPF_CF_R_NUM_SFT 0 164662306a36Sopenharmony_ci 164762306a36Sopenharmony_ci/* HP calibration control and Amp detection (0xd6) */ 164862306a36Sopenharmony_ci#define RT5616_SI_DAC_MASK (0x1 << 11) 164962306a36Sopenharmony_ci#define RT5616_SI_DAC_SFT 11 165062306a36Sopenharmony_ci#define RT5616_SI_DAC_AUTO (0x0 << 11) 165162306a36Sopenharmony_ci#define RT5616_SI_DAC_TEST (0x1 << 11) 165262306a36Sopenharmony_ci#define RT5616_DC_CAL_M_MASK (0x1 << 10) 165362306a36Sopenharmony_ci#define RT5616_DC_CAL_M_SFT 10 165462306a36Sopenharmony_ci#define RT5616_DC_CAL_M_NOR (0x0 << 10) 165562306a36Sopenharmony_ci#define RT5616_DC_CAL_M_CAL (0x1 << 10) 165662306a36Sopenharmony_ci#define RT5616_DC_CAL_MASK (0x1 << 9) 165762306a36Sopenharmony_ci#define RT5616_DC_CAL_SFT 9 165862306a36Sopenharmony_ci#define RT5616_DC_CAL_DIS (0x0 << 9) 165962306a36Sopenharmony_ci#define RT5616_DC_CAL_EN (0x1 << 9) 166062306a36Sopenharmony_ci#define RT5616_HPD_RCV_MASK (0x7 << 6) 166162306a36Sopenharmony_ci#define RT5616_HPD_RCV_SFT 6 166262306a36Sopenharmony_ci#define RT5616_HPD_PS_MASK (0x1 << 5) 166362306a36Sopenharmony_ci#define RT5616_HPD_PS_SFT 5 166462306a36Sopenharmony_ci#define RT5616_HPD_PS_DIS (0x0 << 5) 166562306a36Sopenharmony_ci#define RT5616_HPD_PS_EN (0x1 << 5) 166662306a36Sopenharmony_ci#define RT5616_CAL_M_MASK (0x1 << 4) 166762306a36Sopenharmony_ci#define RT5616_CAL_M_SFT 4 166862306a36Sopenharmony_ci#define RT5616_CAL_M_DEP (0x0 << 4) 166962306a36Sopenharmony_ci#define RT5616_CAL_M_CAL (0x1 << 4) 167062306a36Sopenharmony_ci#define RT5616_CAL_MASK (0x1 << 3) 167162306a36Sopenharmony_ci#define RT5616_CAL_SFT 3 167262306a36Sopenharmony_ci#define RT5616_CAL_DIS (0x0 << 3) 167362306a36Sopenharmony_ci#define RT5616_CAL_EN (0x1 << 3) 167462306a36Sopenharmony_ci#define RT5616_CAL_TEST_MASK (0x1 << 2) 167562306a36Sopenharmony_ci#define RT5616_CAL_TEST_SFT 2 167662306a36Sopenharmony_ci#define RT5616_CAL_TEST_DIS (0x0 << 2) 167762306a36Sopenharmony_ci#define RT5616_CAL_TEST_EN (0x1 << 2) 167862306a36Sopenharmony_ci#define RT5616_CAL_P_MASK (0x3) 167962306a36Sopenharmony_ci#define RT5616_CAL_P_SFT 0 168062306a36Sopenharmony_ci#define RT5616_CAL_P_NONE (0x0) 168162306a36Sopenharmony_ci#define RT5616_CAL_P_CAL (0x1) 168262306a36Sopenharmony_ci#define RT5616_CAL_P_DAC_CAL (0x2) 168362306a36Sopenharmony_ci 168462306a36Sopenharmony_ci/* Soft volume and zero cross control 1 (0xd9) */ 168562306a36Sopenharmony_ci#define RT5616_SV_MASK (0x1 << 15) 168662306a36Sopenharmony_ci#define RT5616_SV_SFT 15 168762306a36Sopenharmony_ci#define RT5616_SV_DIS (0x0 << 15) 168862306a36Sopenharmony_ci#define RT5616_SV_EN (0x1 << 15) 168962306a36Sopenharmony_ci#define RT5616_OUT_SV_MASK (0x1 << 13) 169062306a36Sopenharmony_ci#define RT5616_OUT_SV_SFT 13 169162306a36Sopenharmony_ci#define RT5616_OUT_SV_DIS (0x0 << 13) 169262306a36Sopenharmony_ci#define RT5616_OUT_SV_EN (0x1 << 13) 169362306a36Sopenharmony_ci#define RT5616_HP_SV_MASK (0x1 << 12) 169462306a36Sopenharmony_ci#define RT5616_HP_SV_SFT 12 169562306a36Sopenharmony_ci#define RT5616_HP_SV_DIS (0x0 << 12) 169662306a36Sopenharmony_ci#define RT5616_HP_SV_EN (0x1 << 12) 169762306a36Sopenharmony_ci#define RT5616_ZCD_DIG_MASK (0x1 << 11) 169862306a36Sopenharmony_ci#define RT5616_ZCD_DIG_SFT 11 169962306a36Sopenharmony_ci#define RT5616_ZCD_DIG_DIS (0x0 << 11) 170062306a36Sopenharmony_ci#define RT5616_ZCD_DIG_EN (0x1 << 11) 170162306a36Sopenharmony_ci#define RT5616_ZCD_MASK (0x1 << 10) 170262306a36Sopenharmony_ci#define RT5616_ZCD_SFT 10 170362306a36Sopenharmony_ci#define RT5616_ZCD_PD (0x0 << 10) 170462306a36Sopenharmony_ci#define RT5616_ZCD_PU (0x1 << 10) 170562306a36Sopenharmony_ci#define RT5616_M_ZCD_MASK (0x3f << 4) 170662306a36Sopenharmony_ci#define RT5616_M_ZCD_SFT 4 170762306a36Sopenharmony_ci#define RT5616_M_ZCD_OM_L (0x1 << 7) 170862306a36Sopenharmony_ci#define RT5616_M_ZCD_OM_R (0x1 << 6) 170962306a36Sopenharmony_ci#define RT5616_M_ZCD_RM_L (0x1 << 5) 171062306a36Sopenharmony_ci#define RT5616_M_ZCD_RM_R (0x1 << 4) 171162306a36Sopenharmony_ci#define RT5616_SV_DLY_MASK (0xf) 171262306a36Sopenharmony_ci#define RT5616_SV_DLY_SFT 0 171362306a36Sopenharmony_ci 171462306a36Sopenharmony_ci/* Soft volume and zero cross control 2 (0xda) */ 171562306a36Sopenharmony_ci#define RT5616_ZCD_HP_MASK (0x1 << 15) 171662306a36Sopenharmony_ci#define RT5616_ZCD_HP_SFT 15 171762306a36Sopenharmony_ci#define RT5616_ZCD_HP_DIS (0x0 << 15) 171862306a36Sopenharmony_ci#define RT5616_ZCD_HP_EN (0x1 << 15) 171962306a36Sopenharmony_ci 172062306a36Sopenharmony_ci/* Digital Misc Control (0xfa) */ 172162306a36Sopenharmony_ci#define RT5616_I2S2_MS_SP_MASK (0x1 << 8) 172262306a36Sopenharmony_ci#define RT5616_I2S2_MS_SP_SEL 8 172362306a36Sopenharmony_ci#define RT5616_I2S2_MS_SP_64 (0x0 << 8) 172462306a36Sopenharmony_ci#define RT5616_I2S2_MS_SP_50 (0x1 << 8) 172562306a36Sopenharmony_ci#define RT5616_CLK_DET_EN (0x1 << 3) 172662306a36Sopenharmony_ci#define RT5616_CLK_DET_EN_SFT 3 172762306a36Sopenharmony_ci#define RT5616_AMP_DET_EN (0x1 << 1) 172862306a36Sopenharmony_ci#define RT5616_AMP_DET_EN_SFT 1 172962306a36Sopenharmony_ci#define RT5616_D_GATE_EN (0x1) 173062306a36Sopenharmony_ci#define RT5616_D_GATE_EN_SFT 0 173162306a36Sopenharmony_ci 173262306a36Sopenharmony_ci/* Codec Private Register definition */ 173362306a36Sopenharmony_ci/* 3D Speaker Control (0x63) */ 173462306a36Sopenharmony_ci#define RT5616_3D_SPK_MASK (0x1 << 15) 173562306a36Sopenharmony_ci#define RT5616_3D_SPK_SFT 15 173662306a36Sopenharmony_ci#define RT5616_3D_SPK_DIS (0x0 << 15) 173762306a36Sopenharmony_ci#define RT5616_3D_SPK_EN (0x1 << 15) 173862306a36Sopenharmony_ci#define RT5616_3D_SPK_M_MASK (0x3 << 13) 173962306a36Sopenharmony_ci#define RT5616_3D_SPK_M_SFT 13 174062306a36Sopenharmony_ci#define RT5616_3D_SPK_CG_MASK (0x1f << 8) 174162306a36Sopenharmony_ci#define RT5616_3D_SPK_CG_SFT 8 174262306a36Sopenharmony_ci#define RT5616_3D_SPK_SG_MASK (0x1f) 174362306a36Sopenharmony_ci#define RT5616_3D_SPK_SG_SFT 0 174462306a36Sopenharmony_ci 174562306a36Sopenharmony_ci/* Wind Noise Detection Control 1 (0x6c) */ 174662306a36Sopenharmony_ci#define RT5616_WND_MASK (0x1 << 15) 174762306a36Sopenharmony_ci#define RT5616_WND_SFT 15 174862306a36Sopenharmony_ci#define RT5616_WND_DIS (0x0 << 15) 174962306a36Sopenharmony_ci#define RT5616_WND_EN (0x1 << 15) 175062306a36Sopenharmony_ci 175162306a36Sopenharmony_ci/* Wind Noise Detection Control 2 (0x6d) */ 175262306a36Sopenharmony_ci#define RT5616_WND_FC_NW_MASK (0x3f << 10) 175362306a36Sopenharmony_ci#define RT5616_WND_FC_NW_SFT 10 175462306a36Sopenharmony_ci#define RT5616_WND_FC_WK_MASK (0x3f << 4) 175562306a36Sopenharmony_ci#define RT5616_WND_FC_WK_SFT 4 175662306a36Sopenharmony_ci 175762306a36Sopenharmony_ci/* Wind Noise Detection Control 3 (0x6e) */ 175862306a36Sopenharmony_ci#define RT5616_HPF_FC_MASK (0x3f << 6) 175962306a36Sopenharmony_ci#define RT5616_HPF_FC_SFT 6 176062306a36Sopenharmony_ci#define RT5616_WND_FC_ST_MASK (0x3f) 176162306a36Sopenharmony_ci#define RT5616_WND_FC_ST_SFT 0 176262306a36Sopenharmony_ci 176362306a36Sopenharmony_ci/* Wind Noise Detection Control 4 (0x6f) */ 176462306a36Sopenharmony_ci#define RT5616_WND_TH_LO_MASK (0x3ff) 176562306a36Sopenharmony_ci#define RT5616_WND_TH_LO_SFT 0 176662306a36Sopenharmony_ci 176762306a36Sopenharmony_ci/* Wind Noise Detection Control 5 (0x70) */ 176862306a36Sopenharmony_ci#define RT5616_WND_TH_HI_MASK (0x3ff) 176962306a36Sopenharmony_ci#define RT5616_WND_TH_HI_SFT 0 177062306a36Sopenharmony_ci 177162306a36Sopenharmony_ci/* Wind Noise Detection Control 8 (0x73) */ 177262306a36Sopenharmony_ci#define RT5616_WND_WIND_MASK (0x1 << 13) /* Read-Only */ 177362306a36Sopenharmony_ci#define RT5616_WND_WIND_SFT 13 177462306a36Sopenharmony_ci#define RT5616_WND_STRONG_MASK (0x1 << 12) /* Read-Only */ 177562306a36Sopenharmony_ci#define RT5616_WND_STRONG_SFT 12 177662306a36Sopenharmony_cienum { 177762306a36Sopenharmony_ci RT5616_NO_WIND, 177862306a36Sopenharmony_ci RT5616_BREEZE, 177962306a36Sopenharmony_ci RT5616_STORM, 178062306a36Sopenharmony_ci}; 178162306a36Sopenharmony_ci 178262306a36Sopenharmony_ci/* Dipole Speaker Interface (0x75) */ 178362306a36Sopenharmony_ci#define RT5616_DP_ATT_MASK (0x3 << 14) 178462306a36Sopenharmony_ci#define RT5616_DP_ATT_SFT 14 178562306a36Sopenharmony_ci#define RT5616_DP_SPK_MASK (0x1 << 10) 178662306a36Sopenharmony_ci#define RT5616_DP_SPK_SFT 10 178762306a36Sopenharmony_ci#define RT5616_DP_SPK_DIS (0x0 << 10) 178862306a36Sopenharmony_ci#define RT5616_DP_SPK_EN (0x1 << 10) 178962306a36Sopenharmony_ci 179062306a36Sopenharmony_ci/* EQ Pre Volume Control (0xb3) */ 179162306a36Sopenharmony_ci#define RT5616_EQ_PRE_VOL_MASK (0xffff) 179262306a36Sopenharmony_ci#define RT5616_EQ_PRE_VOL_SFT 0 179362306a36Sopenharmony_ci 179462306a36Sopenharmony_ci/* EQ Post Volume Control (0xb4) */ 179562306a36Sopenharmony_ci#define RT5616_EQ_PST_VOL_MASK (0xffff) 179662306a36Sopenharmony_ci#define RT5616_EQ_PST_VOL_SFT 0 179762306a36Sopenharmony_ci 179862306a36Sopenharmony_ci/* System Clock Source */ 179962306a36Sopenharmony_cienum { 180062306a36Sopenharmony_ci RT5616_SCLK_S_MCLK, 180162306a36Sopenharmony_ci RT5616_SCLK_S_PLL1, 180262306a36Sopenharmony_ci}; 180362306a36Sopenharmony_ci 180462306a36Sopenharmony_ci/* PLL1 Source */ 180562306a36Sopenharmony_cienum { 180662306a36Sopenharmony_ci RT5616_PLL1_S_MCLK, 180762306a36Sopenharmony_ci RT5616_PLL1_S_BCLK1, 180862306a36Sopenharmony_ci RT5616_PLL1_S_BCLK2, 180962306a36Sopenharmony_ci}; 181062306a36Sopenharmony_ci 181162306a36Sopenharmony_cienum { 181262306a36Sopenharmony_ci RT5616_AIF1, 181362306a36Sopenharmony_ci RT5616_AIFS, 181462306a36Sopenharmony_ci}; 181562306a36Sopenharmony_ci 181662306a36Sopenharmony_ci#endif /* __RT5616_H__ */ 1817