162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */ 262306a36Sopenharmony_ci/* 362306a36Sopenharmony_ci * rt5663.h -- RT5663 ALSA SoC audio driver 462306a36Sopenharmony_ci * 562306a36Sopenharmony_ci * Copyright 2016 Realtek Microelectronics 662306a36Sopenharmony_ci * Author: Jack Yu <jack.yu@realtek.com> 762306a36Sopenharmony_ci */ 862306a36Sopenharmony_ci 962306a36Sopenharmony_ci#ifndef __RT5663_H__ 1062306a36Sopenharmony_ci#define __RT5663_H__ 1162306a36Sopenharmony_ci 1262306a36Sopenharmony_ci#include <sound/rt5663.h> 1362306a36Sopenharmony_ci 1462306a36Sopenharmony_ci/* Info */ 1562306a36Sopenharmony_ci#define RT5663_RESET 0x0000 1662306a36Sopenharmony_ci#define RT5663_VENDOR_ID 0x00fd 1762306a36Sopenharmony_ci#define RT5663_VENDOR_ID_1 0x00fe 1862306a36Sopenharmony_ci#define RT5663_VENDOR_ID_2 0x00ff 1962306a36Sopenharmony_ci 2062306a36Sopenharmony_ci#define RT5663_LOUT_CTRL 0x0001 2162306a36Sopenharmony_ci#define RT5663_HP_AMP_2 0x0003 2262306a36Sopenharmony_ci#define RT5663_MONO_OUT 0x0004 2362306a36Sopenharmony_ci#define RT5663_MONO_GAIN 0x0007 2462306a36Sopenharmony_ci 2562306a36Sopenharmony_ci#define RT5663_AEC_BST 0x000b 2662306a36Sopenharmony_ci#define RT5663_IN1_IN2 0x000c 2762306a36Sopenharmony_ci#define RT5663_IN3_IN4 0x000d 2862306a36Sopenharmony_ci#define RT5663_INL1_INR1 0x000f 2962306a36Sopenharmony_ci#define RT5663_CBJ_TYPE_2 0x0011 3062306a36Sopenharmony_ci#define RT5663_CBJ_TYPE_3 0x0012 3162306a36Sopenharmony_ci#define RT5663_CBJ_TYPE_4 0x0013 3262306a36Sopenharmony_ci#define RT5663_CBJ_TYPE_5 0x0014 3362306a36Sopenharmony_ci#define RT5663_CBJ_TYPE_8 0x0017 3462306a36Sopenharmony_ci 3562306a36Sopenharmony_ci/* I/O - ADC/DAC/DMIC */ 3662306a36Sopenharmony_ci#define RT5663_DAC3_DIG_VOL 0x001a 3762306a36Sopenharmony_ci#define RT5663_DAC3_CTRL 0x001b 3862306a36Sopenharmony_ci#define RT5663_MONO_ADC_DIG_VOL 0x001d 3962306a36Sopenharmony_ci#define RT5663_STO2_ADC_DIG_VOL 0x001e 4062306a36Sopenharmony_ci#define RT5663_MONO_ADC_BST_GAIN 0x0020 4162306a36Sopenharmony_ci#define RT5663_STO2_ADC_BST_GAIN 0x0021 4262306a36Sopenharmony_ci#define RT5663_SIDETONE_CTRL 0x0024 4362306a36Sopenharmony_ci/* Mixer - D-D */ 4462306a36Sopenharmony_ci#define RT5663_MONO1_ADC_MIXER 0x0027 4562306a36Sopenharmony_ci#define RT5663_STO2_ADC_MIXER 0x0028 4662306a36Sopenharmony_ci#define RT5663_MONO_DAC_MIXER 0x002b 4762306a36Sopenharmony_ci#define RT5663_DAC2_SRC_CTRL 0x002e 4862306a36Sopenharmony_ci#define RT5663_IF_3_4_DATA_CTL 0x002f 4962306a36Sopenharmony_ci#define RT5663_IF_5_DATA_CTL 0x0030 5062306a36Sopenharmony_ci#define RT5663_PDM_OUT_CTL 0x0031 5162306a36Sopenharmony_ci#define RT5663_PDM_I2C_DATA_CTL1 0x0032 5262306a36Sopenharmony_ci#define RT5663_PDM_I2C_DATA_CTL2 0x0033 5362306a36Sopenharmony_ci#define RT5663_PDM_I2C_DATA_CTL3 0x0034 5462306a36Sopenharmony_ci#define RT5663_PDM_I2C_DATA_CTL4 0x0035 5562306a36Sopenharmony_ci 5662306a36Sopenharmony_ci/*Mixer - Analog*/ 5762306a36Sopenharmony_ci#define RT5663_RECMIX1_NEW 0x003a 5862306a36Sopenharmony_ci#define RT5663_RECMIX1L_0 0x003b 5962306a36Sopenharmony_ci#define RT5663_RECMIX1L 0x003c 6062306a36Sopenharmony_ci#define RT5663_RECMIX1R_0 0x003d 6162306a36Sopenharmony_ci#define RT5663_RECMIX1R 0x003e 6262306a36Sopenharmony_ci#define RT5663_RECMIX2_NEW 0x003f 6362306a36Sopenharmony_ci#define RT5663_RECMIX2_L_2 0x0041 6462306a36Sopenharmony_ci#define RT5663_RECMIX2_R 0x0042 6562306a36Sopenharmony_ci#define RT5663_RECMIX2_R_2 0x0043 6662306a36Sopenharmony_ci#define RT5663_CALIB_REC_LR 0x0044 6762306a36Sopenharmony_ci#define RT5663_ALC_BK_GAIN 0x0049 6862306a36Sopenharmony_ci#define RT5663_MONOMIX_GAIN 0x004a 6962306a36Sopenharmony_ci#define RT5663_MONOMIX_IN_GAIN 0x004b 7062306a36Sopenharmony_ci#define RT5663_OUT_MIXL_GAIN 0x004d 7162306a36Sopenharmony_ci#define RT5663_OUT_LMIX_IN_GAIN 0x004e 7262306a36Sopenharmony_ci#define RT5663_OUT_RMIX_IN_GAIN 0x004f 7362306a36Sopenharmony_ci#define RT5663_OUT_RMIX_IN_GAIN1 0x0050 7462306a36Sopenharmony_ci#define RT5663_LOUT_MIXER_CTRL 0x0052 7562306a36Sopenharmony_ci/* Power */ 7662306a36Sopenharmony_ci#define RT5663_PWR_VOL 0x0067 7762306a36Sopenharmony_ci 7862306a36Sopenharmony_ci#define RT5663_ADCDAC_RST 0x006d 7962306a36Sopenharmony_ci/* Format - ADC/DAC */ 8062306a36Sopenharmony_ci#define RT5663_I2S34_SDP 0x0071 8162306a36Sopenharmony_ci#define RT5663_I2S5_SDP 0x0072 8262306a36Sopenharmony_ci 8362306a36Sopenharmony_ci/* Function - Analog */ 8462306a36Sopenharmony_ci#define RT5663_ASRC_3 0x0085 8562306a36Sopenharmony_ci#define RT5663_ASRC_6 0x0088 8662306a36Sopenharmony_ci#define RT5663_ASRC_7 0x0089 8762306a36Sopenharmony_ci#define RT5663_PLL_TRK_13 0x0099 8862306a36Sopenharmony_ci#define RT5663_I2S_M_CLK_CTL 0x00a0 8962306a36Sopenharmony_ci#define RT5663_FDIV_I2S34_M_CLK 0x00a1 9062306a36Sopenharmony_ci#define RT5663_FDIV_I2S34_M_CLK2 0x00a2 9162306a36Sopenharmony_ci#define RT5663_FDIV_I2S5_M_CLK 0x00a3 9262306a36Sopenharmony_ci#define RT5663_FDIV_I2S5_M_CLK2 0x00a4 9362306a36Sopenharmony_ci 9462306a36Sopenharmony_ci/* Function - Digital */ 9562306a36Sopenharmony_ci#define RT5663_V2_IRQ_4 0x00b9 9662306a36Sopenharmony_ci#define RT5663_GPIO_3 0x00c2 9762306a36Sopenharmony_ci#define RT5663_GPIO_4 0x00c3 9862306a36Sopenharmony_ci#define RT5663_GPIO_STA2 0x00c4 9962306a36Sopenharmony_ci#define RT5663_HP_AMP_DET1 0x00d0 10062306a36Sopenharmony_ci#define RT5663_HP_AMP_DET2 0x00d1 10162306a36Sopenharmony_ci#define RT5663_HP_AMP_DET3 0x00d2 10262306a36Sopenharmony_ci#define RT5663_MID_BD_HP_AMP 0x00d3 10362306a36Sopenharmony_ci#define RT5663_LOW_BD_HP_AMP 0x00d4 10462306a36Sopenharmony_ci#define RT5663_SOF_VOL_ZC2 0x00da 10562306a36Sopenharmony_ci#define RT5663_ADC_STO2_ADJ1 0x00ee 10662306a36Sopenharmony_ci#define RT5663_ADC_STO2_ADJ2 0x00ef 10762306a36Sopenharmony_ci/* General Control */ 10862306a36Sopenharmony_ci#define RT5663_A_JD_CTRL 0x00f0 10962306a36Sopenharmony_ci#define RT5663_JD1_TRES_CTRL 0x00f1 11062306a36Sopenharmony_ci#define RT5663_JD2_TRES_CTRL 0x00f2 11162306a36Sopenharmony_ci#define RT5663_V2_JD_CTRL2 0x00f7 11262306a36Sopenharmony_ci#define RT5663_DUM_REG_2 0x00fb 11362306a36Sopenharmony_ci#define RT5663_DUM_REG_3 0x00fc 11462306a36Sopenharmony_ci 11562306a36Sopenharmony_ci 11662306a36Sopenharmony_ci#define RT5663_DACADC_DIG_VOL2 0x0101 11762306a36Sopenharmony_ci#define RT5663_DIG_IN_PIN2 0x0133 11862306a36Sopenharmony_ci#define RT5663_PAD_DRV_CTL1 0x0136 11962306a36Sopenharmony_ci#define RT5663_SOF_RAM_DEPOP 0x0138 12062306a36Sopenharmony_ci#define RT5663_VOL_TEST 0x013f 12162306a36Sopenharmony_ci#define RT5663_MONO_DYNA_1 0x0170 12262306a36Sopenharmony_ci#define RT5663_MONO_DYNA_2 0x0171 12362306a36Sopenharmony_ci#define RT5663_MONO_DYNA_3 0x0172 12462306a36Sopenharmony_ci#define RT5663_MONO_DYNA_4 0x0173 12562306a36Sopenharmony_ci#define RT5663_MONO_DYNA_5 0x0174 12662306a36Sopenharmony_ci#define RT5663_MONO_DYNA_6 0x0175 12762306a36Sopenharmony_ci#define RT5663_STO1_SIL_DET 0x0190 12862306a36Sopenharmony_ci#define RT5663_MONOL_SIL_DET 0x0191 12962306a36Sopenharmony_ci#define RT5663_MONOR_SIL_DET 0x0192 13062306a36Sopenharmony_ci#define RT5663_STO2_DAC_SIL 0x0193 13162306a36Sopenharmony_ci#define RT5663_PWR_SAV_CTL1 0x0194 13262306a36Sopenharmony_ci#define RT5663_PWR_SAV_CTL2 0x0195 13362306a36Sopenharmony_ci#define RT5663_PWR_SAV_CTL3 0x0196 13462306a36Sopenharmony_ci#define RT5663_PWR_SAV_CTL4 0x0197 13562306a36Sopenharmony_ci#define RT5663_PWR_SAV_CTL5 0x0198 13662306a36Sopenharmony_ci#define RT5663_PWR_SAV_CTL6 0x0199 13762306a36Sopenharmony_ci#define RT5663_MONO_AMP_CAL1 0x01a0 13862306a36Sopenharmony_ci#define RT5663_MONO_AMP_CAL2 0x01a1 13962306a36Sopenharmony_ci#define RT5663_MONO_AMP_CAL3 0x01a2 14062306a36Sopenharmony_ci#define RT5663_MONO_AMP_CAL4 0x01a3 14162306a36Sopenharmony_ci#define RT5663_MONO_AMP_CAL5 0x01a4 14262306a36Sopenharmony_ci#define RT5663_MONO_AMP_CAL6 0x01a5 14362306a36Sopenharmony_ci#define RT5663_MONO_AMP_CAL7 0x01a6 14462306a36Sopenharmony_ci#define RT5663_MONO_AMP_CAL_ST1 0x01a7 14562306a36Sopenharmony_ci#define RT5663_MONO_AMP_CAL_ST2 0x01a8 14662306a36Sopenharmony_ci#define RT5663_MONO_AMP_CAL_ST3 0x01a9 14762306a36Sopenharmony_ci#define RT5663_MONO_AMP_CAL_ST4 0x01aa 14862306a36Sopenharmony_ci#define RT5663_MONO_AMP_CAL_ST5 0x01ab 14962306a36Sopenharmony_ci#define RT5663_V2_HP_IMP_SEN_13 0x01b9 15062306a36Sopenharmony_ci#define RT5663_V2_HP_IMP_SEN_14 0x01ba 15162306a36Sopenharmony_ci#define RT5663_V2_HP_IMP_SEN_6 0x01bb 15262306a36Sopenharmony_ci#define RT5663_V2_HP_IMP_SEN_7 0x01bc 15362306a36Sopenharmony_ci#define RT5663_V2_HP_IMP_SEN_8 0x01bd 15462306a36Sopenharmony_ci#define RT5663_V2_HP_IMP_SEN_9 0x01be 15562306a36Sopenharmony_ci#define RT5663_V2_HP_IMP_SEN_10 0x01bf 15662306a36Sopenharmony_ci#define RT5663_HP_LOGIC_3 0x01dc 15762306a36Sopenharmony_ci#define RT5663_HP_CALIB_ST10 0x01f3 15862306a36Sopenharmony_ci#define RT5663_HP_CALIB_ST11 0x01f4 15962306a36Sopenharmony_ci#define RT5663_PRO_REG_TBL_4 0x0203 16062306a36Sopenharmony_ci#define RT5663_PRO_REG_TBL_5 0x0204 16162306a36Sopenharmony_ci#define RT5663_PRO_REG_TBL_6 0x0205 16262306a36Sopenharmony_ci#define RT5663_PRO_REG_TBL_7 0x0206 16362306a36Sopenharmony_ci#define RT5663_PRO_REG_TBL_8 0x0207 16462306a36Sopenharmony_ci#define RT5663_PRO_REG_TBL_9 0x0208 16562306a36Sopenharmony_ci#define RT5663_SAR_ADC_INL_1 0x0210 16662306a36Sopenharmony_ci#define RT5663_SAR_ADC_INL_2 0x0211 16762306a36Sopenharmony_ci#define RT5663_SAR_ADC_INL_3 0x0212 16862306a36Sopenharmony_ci#define RT5663_SAR_ADC_INL_4 0x0213 16962306a36Sopenharmony_ci#define RT5663_SAR_ADC_INL_5 0x0214 17062306a36Sopenharmony_ci#define RT5663_SAR_ADC_INL_6 0x0215 17162306a36Sopenharmony_ci#define RT5663_SAR_ADC_INL_7 0x0216 17262306a36Sopenharmony_ci#define RT5663_SAR_ADC_INL_8 0x0217 17362306a36Sopenharmony_ci#define RT5663_SAR_ADC_INL_9 0x0218 17462306a36Sopenharmony_ci#define RT5663_SAR_ADC_INL_10 0x0219 17562306a36Sopenharmony_ci#define RT5663_SAR_ADC_INL_11 0x021a 17662306a36Sopenharmony_ci#define RT5663_SAR_ADC_INL_12 0x021b 17762306a36Sopenharmony_ci#define RT5663_DRC_CTRL_1 0x02ff 17862306a36Sopenharmony_ci#define RT5663_DRC1_CTRL_2 0x0301 17962306a36Sopenharmony_ci#define RT5663_DRC1_CTRL_3 0x0302 18062306a36Sopenharmony_ci#define RT5663_DRC1_CTRL_4 0x0303 18162306a36Sopenharmony_ci#define RT5663_DRC1_CTRL_5 0x0304 18262306a36Sopenharmony_ci#define RT5663_DRC1_CTRL_6 0x0305 18362306a36Sopenharmony_ci#define RT5663_DRC1_HD_CTRL_1 0x0306 18462306a36Sopenharmony_ci#define RT5663_DRC1_HD_CTRL_2 0x0307 18562306a36Sopenharmony_ci#define RT5663_DRC1_PRI_REG_1 0x0310 18662306a36Sopenharmony_ci#define RT5663_DRC1_PRI_REG_2 0x0311 18762306a36Sopenharmony_ci#define RT5663_DRC1_PRI_REG_3 0x0312 18862306a36Sopenharmony_ci#define RT5663_DRC1_PRI_REG_4 0x0313 18962306a36Sopenharmony_ci#define RT5663_DRC1_PRI_REG_5 0x0314 19062306a36Sopenharmony_ci#define RT5663_DRC1_PRI_REG_6 0x0315 19162306a36Sopenharmony_ci#define RT5663_DRC1_PRI_REG_7 0x0316 19262306a36Sopenharmony_ci#define RT5663_DRC1_PRI_REG_8 0x0317 19362306a36Sopenharmony_ci#define RT5663_ALC_PGA_CTL_1 0x0330 19462306a36Sopenharmony_ci#define RT5663_ALC_PGA_CTL_2 0x0331 19562306a36Sopenharmony_ci#define RT5663_ALC_PGA_CTL_3 0x0332 19662306a36Sopenharmony_ci#define RT5663_ALC_PGA_CTL_4 0x0333 19762306a36Sopenharmony_ci#define RT5663_ALC_PGA_CTL_5 0x0334 19862306a36Sopenharmony_ci#define RT5663_ALC_PGA_CTL_6 0x0335 19962306a36Sopenharmony_ci#define RT5663_ALC_PGA_CTL_7 0x0336 20062306a36Sopenharmony_ci#define RT5663_ALC_PGA_CTL_8 0x0337 20162306a36Sopenharmony_ci#define RT5663_ALC_PGA_REG_1 0x0338 20262306a36Sopenharmony_ci#define RT5663_ALC_PGA_REG_2 0x0339 20362306a36Sopenharmony_ci#define RT5663_ALC_PGA_REG_3 0x033a 20462306a36Sopenharmony_ci#define RT5663_ADC_EQ_RECOV_1 0x03c0 20562306a36Sopenharmony_ci#define RT5663_ADC_EQ_RECOV_2 0x03c1 20662306a36Sopenharmony_ci#define RT5663_ADC_EQ_RECOV_3 0x03c2 20762306a36Sopenharmony_ci#define RT5663_ADC_EQ_RECOV_4 0x03c3 20862306a36Sopenharmony_ci#define RT5663_ADC_EQ_RECOV_5 0x03c4 20962306a36Sopenharmony_ci#define RT5663_ADC_EQ_RECOV_6 0x03c5 21062306a36Sopenharmony_ci#define RT5663_ADC_EQ_RECOV_7 0x03c6 21162306a36Sopenharmony_ci#define RT5663_ADC_EQ_RECOV_8 0x03c7 21262306a36Sopenharmony_ci#define RT5663_ADC_EQ_RECOV_9 0x03c8 21362306a36Sopenharmony_ci#define RT5663_ADC_EQ_RECOV_10 0x03c9 21462306a36Sopenharmony_ci#define RT5663_ADC_EQ_RECOV_11 0x03ca 21562306a36Sopenharmony_ci#define RT5663_ADC_EQ_RECOV_12 0x03cb 21662306a36Sopenharmony_ci#define RT5663_ADC_EQ_RECOV_13 0x03cc 21762306a36Sopenharmony_ci#define RT5663_VID_HIDDEN 0x03fe 21862306a36Sopenharmony_ci#define RT5663_VID_CUSTOMER 0x03ff 21962306a36Sopenharmony_ci#define RT5663_SCAN_MODE 0x07f0 22062306a36Sopenharmony_ci#define RT5663_I2C_BYPA 0x07fa 22162306a36Sopenharmony_ci 22262306a36Sopenharmony_ci/* Headphone Amp Control 2 (0x0003) */ 22362306a36Sopenharmony_ci#define RT5663_EN_DAC_HPO_MASK (0x1 << 14) 22462306a36Sopenharmony_ci#define RT5663_EN_DAC_HPO_SHIFT 14 22562306a36Sopenharmony_ci#define RT5663_EN_DAC_HPO_DIS (0x0 << 14) 22662306a36Sopenharmony_ci#define RT5663_EN_DAC_HPO_EN (0x1 << 14) 22762306a36Sopenharmony_ci 22862306a36Sopenharmony_ci/*Headphone Amp L/R Analog Gain and Digital NG2 Gain Control (0x0005 0x0006)*/ 22962306a36Sopenharmony_ci#define RT5663_GAIN_HP (0x1f << 8) 23062306a36Sopenharmony_ci#define RT5663_GAIN_HP_SHIFT 8 23162306a36Sopenharmony_ci 23262306a36Sopenharmony_ci/* AEC BST Control (0x000b) */ 23362306a36Sopenharmony_ci#define RT5663_GAIN_CBJ_MASK (0xf << 8) 23462306a36Sopenharmony_ci#define RT5663_GAIN_CBJ_SHIFT 8 23562306a36Sopenharmony_ci 23662306a36Sopenharmony_ci/* IN1 Control / MIC GND REF (0x000c) */ 23762306a36Sopenharmony_ci#define RT5663_IN1_DF_MASK (0x1 << 15) 23862306a36Sopenharmony_ci#define RT5663_IN1_DF_SHIFT 15 23962306a36Sopenharmony_ci 24062306a36Sopenharmony_ci/* Combo Jack and Type Detection Control 1 (0x0010) */ 24162306a36Sopenharmony_ci#define RT5663_CBJ_DET_MASK (0x1 << 15) 24262306a36Sopenharmony_ci#define RT5663_CBJ_DET_SHIFT 15 24362306a36Sopenharmony_ci#define RT5663_CBJ_DET_DIS (0x0 << 15) 24462306a36Sopenharmony_ci#define RT5663_CBJ_DET_EN (0x1 << 15) 24562306a36Sopenharmony_ci#define RT5663_DET_TYPE_MASK (0x1 << 12) 24662306a36Sopenharmony_ci#define RT5663_DET_TYPE_SHIFT 12 24762306a36Sopenharmony_ci#define RT5663_DET_TYPE_WLCSP (0x0 << 12) 24862306a36Sopenharmony_ci#define RT5663_DET_TYPE_QFN (0x1 << 12) 24962306a36Sopenharmony_ci#define RT5663_VREF_BIAS_MASK (0x1 << 6) 25062306a36Sopenharmony_ci#define RT5663_VREF_BIAS_SHIFT 6 25162306a36Sopenharmony_ci#define RT5663_VREF_BIAS_FSM (0x0 << 6) 25262306a36Sopenharmony_ci#define RT5663_VREF_BIAS_REG (0x1 << 6) 25362306a36Sopenharmony_ci 25462306a36Sopenharmony_ci/* REC Left Mixer Control 2 (0x003c) */ 25562306a36Sopenharmony_ci#define RT5663_RECMIX1L_BST1_CBJ (0x1 << 7) 25662306a36Sopenharmony_ci#define RT5663_RECMIX1L_BST1_CBJ_SHIFT 7 25762306a36Sopenharmony_ci#define RT5663_RECMIX1L_BST2 (0x1 << 4) 25862306a36Sopenharmony_ci#define RT5663_RECMIX1L_BST2_SHIFT 4 25962306a36Sopenharmony_ci 26062306a36Sopenharmony_ci/* REC Right Mixer Control 2 (0x003e) */ 26162306a36Sopenharmony_ci#define RT5663_RECMIX1R_BST2 (0x1 << 4) 26262306a36Sopenharmony_ci#define RT5663_RECMIX1R_BST2_SHIFT 4 26362306a36Sopenharmony_ci 26462306a36Sopenharmony_ci/* DAC1 Digital Volume (0x0019) */ 26562306a36Sopenharmony_ci#define RT5663_DAC_L1_VOL_MASK (0xff << 8) 26662306a36Sopenharmony_ci#define RT5663_DAC_L1_VOL_SHIFT 8 26762306a36Sopenharmony_ci#define RT5663_DAC_R1_VOL_MASK (0xff) 26862306a36Sopenharmony_ci#define RT5663_DAC_R1_VOL_SHIFT 0 26962306a36Sopenharmony_ci 27062306a36Sopenharmony_ci/* ADC Digital Volume Control (0x001c) */ 27162306a36Sopenharmony_ci#define RT5663_ADC_L_MUTE_MASK (0x1 << 15) 27262306a36Sopenharmony_ci#define RT5663_ADC_L_MUTE_SHIFT 15 27362306a36Sopenharmony_ci#define RT5663_ADC_L_VOL_MASK (0x7f << 8) 27462306a36Sopenharmony_ci#define RT5663_ADC_L_VOL_SHIFT 8 27562306a36Sopenharmony_ci#define RT5663_ADC_R_MUTE_MASK (0x1 << 7) 27662306a36Sopenharmony_ci#define RT5663_ADC_R_MUTE_SHIFT 7 27762306a36Sopenharmony_ci#define RT5663_ADC_R_VOL_MASK (0x7f) 27862306a36Sopenharmony_ci#define RT5663_ADC_R_VOL_SHIFT 0 27962306a36Sopenharmony_ci 28062306a36Sopenharmony_ci/* Stereo ADC Mixer Control (0x0026) */ 28162306a36Sopenharmony_ci#define RT5663_M_STO1_ADC_L1 (0x1 << 15) 28262306a36Sopenharmony_ci#define RT5663_M_STO1_ADC_L1_SHIFT 15 28362306a36Sopenharmony_ci#define RT5663_M_STO1_ADC_L2 (0x1 << 14) 28462306a36Sopenharmony_ci#define RT5663_M_STO1_ADC_L2_SHIFT 14 28562306a36Sopenharmony_ci#define RT5663_STO1_ADC_L1_SRC (0x1 << 13) 28662306a36Sopenharmony_ci#define RT5663_STO1_ADC_L1_SRC_SHIFT 13 28762306a36Sopenharmony_ci#define RT5663_STO1_ADC_L2_SRC (0x1 << 12) 28862306a36Sopenharmony_ci#define RT5663_STO1_ADC_L2_SRC_SHIFT 12 28962306a36Sopenharmony_ci#define RT5663_STO1_ADC_L_SRC (0x3 << 10) 29062306a36Sopenharmony_ci#define RT5663_STO1_ADC_L_SRC_SHIFT 10 29162306a36Sopenharmony_ci#define RT5663_M_STO1_ADC_R1 (0x1 << 7) 29262306a36Sopenharmony_ci#define RT5663_M_STO1_ADC_R1_SHIFT 7 29362306a36Sopenharmony_ci#define RT5663_M_STO1_ADC_R2 (0x1 << 6) 29462306a36Sopenharmony_ci#define RT5663_M_STO1_ADC_R2_SHIFT 6 29562306a36Sopenharmony_ci#define RT5663_STO1_ADC_R1_SRC (0x1 << 5) 29662306a36Sopenharmony_ci#define RT5663_STO1_ADC_R1_SRC_SHIFT 5 29762306a36Sopenharmony_ci#define RT5663_STO1_ADC_R2_SRC (0x1 << 4) 29862306a36Sopenharmony_ci#define RT5663_STO1_ADC_R2_SRC_SHIFT 4 29962306a36Sopenharmony_ci#define RT5663_STO1_ADC_R_SRC (0x3 << 2) 30062306a36Sopenharmony_ci#define RT5663_STO1_ADC_R_SRC_SHIFT 2 30162306a36Sopenharmony_ci 30262306a36Sopenharmony_ci/* ADC Mixer to DAC Mixer Control (0x0029) */ 30362306a36Sopenharmony_ci#define RT5663_M_ADCMIX_L (0x1 << 15) 30462306a36Sopenharmony_ci#define RT5663_M_ADCMIX_L_SHIFT 15 30562306a36Sopenharmony_ci#define RT5663_M_DAC1_L (0x1 << 14) 30662306a36Sopenharmony_ci#define RT5663_M_DAC1_L_SHIFT 14 30762306a36Sopenharmony_ci#define RT5663_M_ADCMIX_R (0x1 << 7) 30862306a36Sopenharmony_ci#define RT5663_M_ADCMIX_R_SHIFT 7 30962306a36Sopenharmony_ci#define RT5663_M_DAC1_R (0x1 << 6) 31062306a36Sopenharmony_ci#define RT5663_M_DAC1_R_SHIFT 6 31162306a36Sopenharmony_ci 31262306a36Sopenharmony_ci/* Stereo DAC Mixer Control (0x002a) */ 31362306a36Sopenharmony_ci#define RT5663_M_DAC_L1_STO_L (0x1 << 15) 31462306a36Sopenharmony_ci#define RT5663_M_DAC_L1_STO_L_SHIFT 15 31562306a36Sopenharmony_ci#define RT5663_M_DAC_R1_STO_L (0x1 << 13) 31662306a36Sopenharmony_ci#define RT5663_M_DAC_R1_STO_L_SHIFT 13 31762306a36Sopenharmony_ci#define RT5663_M_DAC_L1_STO_R (0x1 << 7) 31862306a36Sopenharmony_ci#define RT5663_M_DAC_L1_STO_R_SHIFT 7 31962306a36Sopenharmony_ci#define RT5663_M_DAC_R1_STO_R (0x1 << 5) 32062306a36Sopenharmony_ci#define RT5663_M_DAC_R1_STO_R_SHIFT 5 32162306a36Sopenharmony_ci 32262306a36Sopenharmony_ci/* Power Management for Digital 1 (0x0061) */ 32362306a36Sopenharmony_ci#define RT5663_PWR_I2S1 (0x1 << 15) 32462306a36Sopenharmony_ci#define RT5663_PWR_I2S1_SHIFT 15 32562306a36Sopenharmony_ci#define RT5663_PWR_DAC_L1 (0x1 << 11) 32662306a36Sopenharmony_ci#define RT5663_PWR_DAC_L1_SHIFT 11 32762306a36Sopenharmony_ci#define RT5663_PWR_DAC_R1 (0x1 << 10) 32862306a36Sopenharmony_ci#define RT5663_PWR_DAC_R1_SHIFT 10 32962306a36Sopenharmony_ci#define RT5663_PWR_LDO_DACREF_MASK (0x1 << 8) 33062306a36Sopenharmony_ci#define RT5663_PWR_LDO_DACREF_SHIFT 8 33162306a36Sopenharmony_ci#define RT5663_PWR_LDO_DACREF_ON (0x1 << 8) 33262306a36Sopenharmony_ci#define RT5663_PWR_LDO_DACREF_DOWN (0x0 << 8) 33362306a36Sopenharmony_ci#define RT5663_PWR_LDO_SHIFT 8 33462306a36Sopenharmony_ci#define RT5663_PWR_ADC_L1 (0x1 << 4) 33562306a36Sopenharmony_ci#define RT5663_PWR_ADC_L1_SHIFT 4 33662306a36Sopenharmony_ci#define RT5663_PWR_ADC_R1 (0x1 << 3) 33762306a36Sopenharmony_ci#define RT5663_PWR_ADC_R1_SHIFT 3 33862306a36Sopenharmony_ci 33962306a36Sopenharmony_ci/* Power Management for Digital 2 (0x0062) */ 34062306a36Sopenharmony_ci#define RT5663_PWR_ADC_S1F (0x1 << 15) 34162306a36Sopenharmony_ci#define RT5663_PWR_ADC_S1F_SHIFT 15 34262306a36Sopenharmony_ci#define RT5663_PWR_DAC_S1F (0x1 << 10) 34362306a36Sopenharmony_ci#define RT5663_PWR_DAC_S1F_SHIFT 10 34462306a36Sopenharmony_ci 34562306a36Sopenharmony_ci/* Power Management for Analog 1 (0x0063) */ 34662306a36Sopenharmony_ci#define RT5663_PWR_VREF1 (0x1 << 15) 34762306a36Sopenharmony_ci#define RT5663_PWR_VREF1_MASK (0x1 << 15) 34862306a36Sopenharmony_ci#define RT5663_PWR_VREF1_SHIFT 15 34962306a36Sopenharmony_ci#define RT5663_PWR_FV1 (0x1 << 14) 35062306a36Sopenharmony_ci#define RT5663_PWR_FV1_MASK (0x1 << 14) 35162306a36Sopenharmony_ci#define RT5663_PWR_FV1_SHIFT 14 35262306a36Sopenharmony_ci#define RT5663_PWR_VREF2 (0x1 << 13) 35362306a36Sopenharmony_ci#define RT5663_PWR_VREF2_MASK (0x1 << 13) 35462306a36Sopenharmony_ci#define RT5663_PWR_VREF2_SHIFT 13 35562306a36Sopenharmony_ci#define RT5663_PWR_FV2 (0x1 << 12) 35662306a36Sopenharmony_ci#define RT5663_PWR_FV2_MASK (0x1 << 12) 35762306a36Sopenharmony_ci#define RT5663_PWR_FV2_SHIFT 12 35862306a36Sopenharmony_ci#define RT5663_PWR_MB (0x1 << 9) 35962306a36Sopenharmony_ci#define RT5663_PWR_MB_MASK (0x1 << 9) 36062306a36Sopenharmony_ci#define RT5663_PWR_MB_SHIFT 9 36162306a36Sopenharmony_ci#define RT5663_AMP_HP_MASK (0x3 << 2) 36262306a36Sopenharmony_ci#define RT5663_AMP_HP_SHIFT 2 36362306a36Sopenharmony_ci#define RT5663_AMP_HP_1X (0x0 << 2) 36462306a36Sopenharmony_ci#define RT5663_AMP_HP_3X (0x1 << 2) 36562306a36Sopenharmony_ci#define RT5663_AMP_HP_5X (0x3 << 2) 36662306a36Sopenharmony_ci#define RT5663_LDO1_DVO_MASK (0x3) 36762306a36Sopenharmony_ci#define RT5663_LDO1_DVO_SHIFT 0 36862306a36Sopenharmony_ci#define RT5663_LDO1_DVO_0_9V (0x0) 36962306a36Sopenharmony_ci#define RT5663_LDO1_DVO_1_0V (0x1) 37062306a36Sopenharmony_ci#define RT5663_LDO1_DVO_1_2V (0x2) 37162306a36Sopenharmony_ci#define RT5663_LDO1_DVO_1_4V (0x3) 37262306a36Sopenharmony_ci 37362306a36Sopenharmony_ci/* Power Management for Analog 2 (0x0064) */ 37462306a36Sopenharmony_ci#define RT5663_PWR_BST1 (0x1 << 15) 37562306a36Sopenharmony_ci#define RT5663_PWR_BST1_MASK (0x1 << 15) 37662306a36Sopenharmony_ci#define RT5663_PWR_BST1_SHIFT 15 37762306a36Sopenharmony_ci#define RT5663_PWR_BST1_OFF (0x0 << 15) 37862306a36Sopenharmony_ci#define RT5663_PWR_BST1_ON (0x1 << 15) 37962306a36Sopenharmony_ci#define RT5663_PWR_BST2 (0x1 << 14) 38062306a36Sopenharmony_ci#define RT5663_PWR_BST2_MASK (0x1 << 14) 38162306a36Sopenharmony_ci#define RT5663_PWR_BST2_SHIFT 14 38262306a36Sopenharmony_ci#define RT5663_PWR_MB1 (0x1 << 11) 38362306a36Sopenharmony_ci#define RT5663_PWR_MB1_SHIFT 11 38462306a36Sopenharmony_ci#define RT5663_PWR_MB2 (0x1 << 10) 38562306a36Sopenharmony_ci#define RT5663_PWR_MB2_SHIFT 10 38662306a36Sopenharmony_ci#define RT5663_PWR_BST2_OP (0x1 << 6) 38762306a36Sopenharmony_ci#define RT5663_PWR_BST2_OP_MASK (0x1 << 6) 38862306a36Sopenharmony_ci#define RT5663_PWR_BST2_OP_SHIFT 6 38962306a36Sopenharmony_ci#define RT5663_PWR_JD1 (0x1 << 3) 39062306a36Sopenharmony_ci#define RT5663_PWR_JD1_MASK (0x1 << 3) 39162306a36Sopenharmony_ci#define RT5663_PWR_JD1_SHIFT 3 39262306a36Sopenharmony_ci#define RT5663_PWR_JD2 (0x1 << 2) 39362306a36Sopenharmony_ci#define RT5663_PWR_JD2_MASK (0x1 << 2) 39462306a36Sopenharmony_ci#define RT5663_PWR_JD2_SHIFT 2 39562306a36Sopenharmony_ci#define RT5663_PWR_RECMIX1 (0x1 << 1) 39662306a36Sopenharmony_ci#define RT5663_PWR_RECMIX1_SHIFT 1 39762306a36Sopenharmony_ci#define RT5663_PWR_RECMIX2 (0x1) 39862306a36Sopenharmony_ci#define RT5663_PWR_RECMIX2_SHIFT 0 39962306a36Sopenharmony_ci 40062306a36Sopenharmony_ci/* Power Management for Analog 3 (0x0065) */ 40162306a36Sopenharmony_ci#define RT5663_PWR_CBJ_MASK (0x1 << 9) 40262306a36Sopenharmony_ci#define RT5663_PWR_CBJ_SHIFT 9 40362306a36Sopenharmony_ci#define RT5663_PWR_CBJ_OFF (0x0 << 9) 40462306a36Sopenharmony_ci#define RT5663_PWR_CBJ_ON (0x1 << 9) 40562306a36Sopenharmony_ci#define RT5663_PWR_PLL (0x1 << 6) 40662306a36Sopenharmony_ci#define RT5663_PWR_PLL_SHIFT 6 40762306a36Sopenharmony_ci#define RT5663_PWR_LDO2 (0x1 << 2) 40862306a36Sopenharmony_ci#define RT5663_PWR_LDO2_SHIFT 2 40962306a36Sopenharmony_ci 41062306a36Sopenharmony_ci/* Power Management for Volume (0x0067) */ 41162306a36Sopenharmony_ci#define RT5663_V2_PWR_MIC_DET (0x1 << 5) 41262306a36Sopenharmony_ci#define RT5663_V2_PWR_MIC_DET_SHIFT 5 41362306a36Sopenharmony_ci 41462306a36Sopenharmony_ci/* MCLK and System Clock Detection Control (0x006b) */ 41562306a36Sopenharmony_ci#define RT5663_EN_ANA_CLK_DET_MASK (0x1 << 15) 41662306a36Sopenharmony_ci#define RT5663_EN_ANA_CLK_DET_SHIFT 15 41762306a36Sopenharmony_ci#define RT5663_EN_ANA_CLK_DET_DIS (0x0 << 15) 41862306a36Sopenharmony_ci#define RT5663_EN_ANA_CLK_DET_AUTO (0x1 << 15) 41962306a36Sopenharmony_ci#define RT5663_PWR_CLK_DET_MASK (0x1) 42062306a36Sopenharmony_ci#define RT5663_PWR_CLK_DET_SHIFT 0 42162306a36Sopenharmony_ci#define RT5663_PWR_CLK_DET_DIS (0x0) 42262306a36Sopenharmony_ci#define RT5663_PWR_CLK_DET_EN (0x1) 42362306a36Sopenharmony_ci 42462306a36Sopenharmony_ci/* I2S1 Audio Serial Data Port Control (0x0070) */ 42562306a36Sopenharmony_ci#define RT5663_I2S_MS_MASK (0x1 << 15) 42662306a36Sopenharmony_ci#define RT5663_I2S_MS_SHIFT 15 42762306a36Sopenharmony_ci#define RT5663_I2S_MS_M (0x0 << 15) 42862306a36Sopenharmony_ci#define RT5663_I2S_MS_S (0x1 << 15) 42962306a36Sopenharmony_ci#define RT5663_I2S_BP_MASK (0x1 << 8) 43062306a36Sopenharmony_ci#define RT5663_I2S_BP_SHIFT 8 43162306a36Sopenharmony_ci#define RT5663_I2S_BP_NOR (0x0 << 8) 43262306a36Sopenharmony_ci#define RT5663_I2S_BP_INV (0x1 << 8) 43362306a36Sopenharmony_ci#define RT5663_I2S_DL_MASK (0x3 << 4) 43462306a36Sopenharmony_ci#define RT5663_I2S_DL_SHIFT 4 43562306a36Sopenharmony_ci#define RT5663_I2S_DL_16 (0x0 << 4) 43662306a36Sopenharmony_ci#define RT5663_I2S_DL_20 (0x1 << 4) 43762306a36Sopenharmony_ci#define RT5663_I2S_DL_24 (0x2 << 4) 43862306a36Sopenharmony_ci#define RT5663_I2S_DL_8 (0x3 << 4) 43962306a36Sopenharmony_ci#define RT5663_I2S_DF_MASK (0x7) 44062306a36Sopenharmony_ci#define RT5663_I2S_DF_SHIFT 0 44162306a36Sopenharmony_ci#define RT5663_I2S_DF_I2S (0x0) 44262306a36Sopenharmony_ci#define RT5663_I2S_DF_LEFT (0x1) 44362306a36Sopenharmony_ci#define RT5663_I2S_DF_PCM_A (0x2) 44462306a36Sopenharmony_ci#define RT5663_I2S_DF_PCM_B (0x3) 44562306a36Sopenharmony_ci#define RT5663_I2S_DF_PCM_A_N (0x6) 44662306a36Sopenharmony_ci#define RT5663_I2S_DF_PCM_B_N (0x7) 44762306a36Sopenharmony_ci 44862306a36Sopenharmony_ci/* ADC/DAC Clock Control 1 (0x0073) */ 44962306a36Sopenharmony_ci#define RT5663_I2S_PD1_MASK (0x7 << 12) 45062306a36Sopenharmony_ci#define RT5663_I2S_PD1_SHIFT 12 45162306a36Sopenharmony_ci#define RT5663_M_I2S_DIV_MASK (0x7 << 8) 45262306a36Sopenharmony_ci#define RT5663_M_I2S_DIV_SHIFT 8 45362306a36Sopenharmony_ci#define RT5663_CLK_SRC_MASK (0x3 << 4) 45462306a36Sopenharmony_ci#define RT5663_CLK_SRC_MCLK (0x0 << 4) 45562306a36Sopenharmony_ci#define RT5663_CLK_SRC_PLL_OUT (0x1 << 4) 45662306a36Sopenharmony_ci#define RT5663_CLK_SRC_DIV (0x2 << 4) 45762306a36Sopenharmony_ci#define RT5663_CLK_SRC_RC (0x3 << 4) 45862306a36Sopenharmony_ci#define RT5663_DAC_OSR_MASK (0x3 << 2) 45962306a36Sopenharmony_ci#define RT5663_DAC_OSR_SHIFT 2 46062306a36Sopenharmony_ci#define RT5663_DAC_OSR_128 (0x0 << 2) 46162306a36Sopenharmony_ci#define RT5663_DAC_OSR_64 (0x1 << 2) 46262306a36Sopenharmony_ci#define RT5663_DAC_OSR_32 (0x2 << 2) 46362306a36Sopenharmony_ci#define RT5663_ADC_OSR_MASK (0x3) 46462306a36Sopenharmony_ci#define RT5663_ADC_OSR_SHIFT 0 46562306a36Sopenharmony_ci#define RT5663_ADC_OSR_128 (0x0) 46662306a36Sopenharmony_ci#define RT5663_ADC_OSR_64 (0x1) 46762306a36Sopenharmony_ci#define RT5663_ADC_OSR_32 (0x2) 46862306a36Sopenharmony_ci 46962306a36Sopenharmony_ci/* TDM1 control 1 (0x0078) */ 47062306a36Sopenharmony_ci#define RT5663_TDM_MODE_MASK (0x1 << 15) 47162306a36Sopenharmony_ci#define RT5663_TDM_MODE_SHIFT 15 47262306a36Sopenharmony_ci#define RT5663_TDM_MODE_I2S (0x0 << 15) 47362306a36Sopenharmony_ci#define RT5663_TDM_MODE_TDM (0x1 << 15) 47462306a36Sopenharmony_ci#define RT5663_TDM_IN_CH_MASK (0x3 << 10) 47562306a36Sopenharmony_ci#define RT5663_TDM_IN_CH_SHIFT 10 47662306a36Sopenharmony_ci#define RT5663_TDM_IN_CH_2 (0x0 << 10) 47762306a36Sopenharmony_ci#define RT5663_TDM_IN_CH_4 (0x1 << 10) 47862306a36Sopenharmony_ci#define RT5663_TDM_IN_CH_6 (0x2 << 10) 47962306a36Sopenharmony_ci#define RT5663_TDM_IN_CH_8 (0x3 << 10) 48062306a36Sopenharmony_ci#define RT5663_TDM_OUT_CH_MASK (0x3 << 8) 48162306a36Sopenharmony_ci#define RT5663_TDM_OUT_CH_SHIFT 8 48262306a36Sopenharmony_ci#define RT5663_TDM_OUT_CH_2 (0x0 << 8) 48362306a36Sopenharmony_ci#define RT5663_TDM_OUT_CH_4 (0x1 << 8) 48462306a36Sopenharmony_ci#define RT5663_TDM_OUT_CH_6 (0x2 << 8) 48562306a36Sopenharmony_ci#define RT5663_TDM_OUT_CH_8 (0x3 << 8) 48662306a36Sopenharmony_ci#define RT5663_TDM_IN_LEN_MASK (0x3 << 6) 48762306a36Sopenharmony_ci#define RT5663_TDM_IN_LEN_SHIFT 6 48862306a36Sopenharmony_ci#define RT5663_TDM_IN_LEN_16 (0x0 << 6) 48962306a36Sopenharmony_ci#define RT5663_TDM_IN_LEN_20 (0x1 << 6) 49062306a36Sopenharmony_ci#define RT5663_TDM_IN_LEN_24 (0x2 << 6) 49162306a36Sopenharmony_ci#define RT5663_TDM_IN_LEN_32 (0x3 << 6) 49262306a36Sopenharmony_ci#define RT5663_TDM_OUT_LEN_MASK (0x3 << 4) 49362306a36Sopenharmony_ci#define RT5663_TDM_OUT_LEN_SHIFT 4 49462306a36Sopenharmony_ci#define RT5663_TDM_OUT_LEN_16 (0x0 << 4) 49562306a36Sopenharmony_ci#define RT5663_TDM_OUT_LEN_20 (0x1 << 4) 49662306a36Sopenharmony_ci#define RT5663_TDM_OUT_LEN_24 (0x2 << 4) 49762306a36Sopenharmony_ci#define RT5663_TDM_OUT_LEN_32 (0x3 << 4) 49862306a36Sopenharmony_ci 49962306a36Sopenharmony_ci/* Global Clock Control (0x0080) */ 50062306a36Sopenharmony_ci#define RT5663_SCLK_SRC_MASK (0x3 << 14) 50162306a36Sopenharmony_ci#define RT5663_SCLK_SRC_SHIFT 14 50262306a36Sopenharmony_ci#define RT5663_SCLK_SRC_MCLK (0x0 << 14) 50362306a36Sopenharmony_ci#define RT5663_SCLK_SRC_PLL1 (0x1 << 14) 50462306a36Sopenharmony_ci#define RT5663_SCLK_SRC_RCCLK (0x2 << 14) 50562306a36Sopenharmony_ci#define RT5663_PLL1_SRC_MASK (0x7 << 11) 50662306a36Sopenharmony_ci#define RT5663_PLL1_SRC_SHIFT 11 50762306a36Sopenharmony_ci#define RT5663_PLL1_SRC_MCLK (0x0 << 11) 50862306a36Sopenharmony_ci#define RT5663_PLL1_SRC_BCLK1 (0x1 << 11) 50962306a36Sopenharmony_ci#define RT5663_V2_PLL1_SRC_MASK (0x7 << 8) 51062306a36Sopenharmony_ci#define RT5663_V2_PLL1_SRC_SHIFT 8 51162306a36Sopenharmony_ci#define RT5663_V2_PLL1_SRC_MCLK (0x0 << 8) 51262306a36Sopenharmony_ci#define RT5663_V2_PLL1_SRC_BCLK1 (0x1 << 8) 51362306a36Sopenharmony_ci#define RT5663_PLL1_PD_MASK (0x1 << 4) 51462306a36Sopenharmony_ci#define RT5663_PLL1_PD_SHIFT 4 51562306a36Sopenharmony_ci 51662306a36Sopenharmony_ci#define RT5663_PLL_INP_MAX 40000000 51762306a36Sopenharmony_ci#define RT5663_PLL_INP_MIN 256000 51862306a36Sopenharmony_ci/* PLL M/N/K Code Control 1 (0x0081) */ 51962306a36Sopenharmony_ci#define RT5663_PLL_N_MAX 0x001ff 52062306a36Sopenharmony_ci#define RT5663_PLL_N_MASK (RT5663_PLL_N_MAX << 7) 52162306a36Sopenharmony_ci#define RT5663_PLL_N_SHIFT 7 52262306a36Sopenharmony_ci#define RT5663_PLL_K_MAX 0x001f 52362306a36Sopenharmony_ci#define RT5663_PLL_K_MASK (RT5663_PLL_K_MAX) 52462306a36Sopenharmony_ci#define RT5663_PLL_K_SHIFT 0 52562306a36Sopenharmony_ci 52662306a36Sopenharmony_ci/* PLL M/N/K Code Control 2 (0x0082) */ 52762306a36Sopenharmony_ci#define RT5663_PLL_M_MAX 0x00f 52862306a36Sopenharmony_ci#define RT5663_PLL_M_MASK (RT5663_PLL_M_MAX << 12) 52962306a36Sopenharmony_ci#define RT5663_PLL_M_SHIFT 12 53062306a36Sopenharmony_ci#define RT5663_PLL_M_BP (0x1 << 11) 53162306a36Sopenharmony_ci#define RT5663_PLL_M_BP_SHIFT 11 53262306a36Sopenharmony_ci 53362306a36Sopenharmony_ci/* PLL tracking mode 1 (0x0083) */ 53462306a36Sopenharmony_ci#define RT5663_V2_I2S1_ASRC_MASK (0x1 << 13) 53562306a36Sopenharmony_ci#define RT5663_V2_I2S1_ASRC_SHIFT 13 53662306a36Sopenharmony_ci#define RT5663_V2_DAC_STO1_ASRC_MASK (0x1 << 12) 53762306a36Sopenharmony_ci#define RT5663_V2_DAC_STO1_ASRC_SHIFT 12 53862306a36Sopenharmony_ci#define RT5663_V2_ADC_STO1_ASRC_MASK (0x1 << 4) 53962306a36Sopenharmony_ci#define RT5663_V2_ADC_STO1_ASRC_SHIFT 4 54062306a36Sopenharmony_ci 54162306a36Sopenharmony_ci/* PLL tracking mode 2 (0x0084)*/ 54262306a36Sopenharmony_ci#define RT5663_DA_STO1_TRACK_MASK (0x7 << 12) 54362306a36Sopenharmony_ci#define RT5663_DA_STO1_TRACK_SHIFT 12 54462306a36Sopenharmony_ci#define RT5663_DA_STO1_TRACK_SYSCLK (0x0 << 12) 54562306a36Sopenharmony_ci#define RT5663_DA_STO1_TRACK_I2S1 (0x1 << 12) 54662306a36Sopenharmony_ci 54762306a36Sopenharmony_ci/* PLL tracking mode 3 (0x0085)*/ 54862306a36Sopenharmony_ci#define RT5663_V2_AD_STO1_TRACK_MASK (0x7 << 12) 54962306a36Sopenharmony_ci#define RT5663_V2_AD_STO1_TRACK_SHIFT 12 55062306a36Sopenharmony_ci#define RT5663_V2_AD_STO1_TRACK_SYSCLK (0x0 << 12) 55162306a36Sopenharmony_ci#define RT5663_V2_AD_STO1_TRACK_I2S1 (0x1 << 12) 55262306a36Sopenharmony_ci 55362306a36Sopenharmony_ci/* HPOUT Charge pump control 1 (0x0091) */ 55462306a36Sopenharmony_ci#define RT5663_OSW_HP_L_MASK (0x1 << 11) 55562306a36Sopenharmony_ci#define RT5663_OSW_HP_L_SHIFT 11 55662306a36Sopenharmony_ci#define RT5663_OSW_HP_L_EN (0x1 << 11) 55762306a36Sopenharmony_ci#define RT5663_OSW_HP_L_DIS (0x0 << 11) 55862306a36Sopenharmony_ci#define RT5663_OSW_HP_R_MASK (0x1 << 10) 55962306a36Sopenharmony_ci#define RT5663_OSW_HP_R_SHIFT 10 56062306a36Sopenharmony_ci#define RT5663_OSW_HP_R_EN (0x1 << 10) 56162306a36Sopenharmony_ci#define RT5663_OSW_HP_R_DIS (0x0 << 10) 56262306a36Sopenharmony_ci#define RT5663_SEL_PM_HP_MASK (0x3 << 8) 56362306a36Sopenharmony_ci#define RT5663_SEL_PM_HP_SHIFT 8 56462306a36Sopenharmony_ci#define RT5663_SEL_PM_HP_0_6 (0x0 << 8) 56562306a36Sopenharmony_ci#define RT5663_SEL_PM_HP_0_9 (0x1 << 8) 56662306a36Sopenharmony_ci#define RT5663_SEL_PM_HP_1_8 (0x2 << 8) 56762306a36Sopenharmony_ci#define RT5663_SEL_PM_HP_HIGH (0x3 << 8) 56862306a36Sopenharmony_ci#define RT5663_OVCD_HP_MASK (0x1 << 2) 56962306a36Sopenharmony_ci#define RT5663_OVCD_HP_SHIFT 2 57062306a36Sopenharmony_ci#define RT5663_OVCD_HP_EN (0x1 << 2) 57162306a36Sopenharmony_ci#define RT5663_OVCD_HP_DIS (0x0 << 2) 57262306a36Sopenharmony_ci 57362306a36Sopenharmony_ci/* RC Clock Control (0x0094) */ 57462306a36Sopenharmony_ci#define RT5663_DIG_25M_CLK_MASK (0x1 << 9) 57562306a36Sopenharmony_ci#define RT5663_DIG_25M_CLK_SHIFT 9 57662306a36Sopenharmony_ci#define RT5663_DIG_25M_CLK_DIS (0x0 << 9) 57762306a36Sopenharmony_ci#define RT5663_DIG_25M_CLK_EN (0x1 << 9) 57862306a36Sopenharmony_ci#define RT5663_DIG_1M_CLK_MASK (0x1 << 8) 57962306a36Sopenharmony_ci#define RT5663_DIG_1M_CLK_SHIFT 8 58062306a36Sopenharmony_ci#define RT5663_DIG_1M_CLK_DIS (0x0 << 8) 58162306a36Sopenharmony_ci#define RT5663_DIG_1M_CLK_EN (0x1 << 8) 58262306a36Sopenharmony_ci 58362306a36Sopenharmony_ci/* Auto Turn On 1M RC CLK (0x009f) */ 58462306a36Sopenharmony_ci#define RT5663_IRQ_POW_SAV_MASK (0x1 << 15) 58562306a36Sopenharmony_ci#define RT5663_IRQ_POW_SAV_SHIFT 15 58662306a36Sopenharmony_ci#define RT5663_IRQ_POW_SAV_DIS (0x0 << 15) 58762306a36Sopenharmony_ci#define RT5663_IRQ_POW_SAV_EN (0x1 << 15) 58862306a36Sopenharmony_ci#define RT5663_IRQ_POW_SAV_JD1_MASK (0x1 << 14) 58962306a36Sopenharmony_ci#define RT5663_IRQ_POW_SAV_JD1_SHIFT 14 59062306a36Sopenharmony_ci#define RT5663_IRQ_POW_SAV_JD1_DIS (0x0 << 14) 59162306a36Sopenharmony_ci#define RT5663_IRQ_POW_SAV_JD1_EN (0x1 << 14) 59262306a36Sopenharmony_ci#define RT5663_IRQ_MANUAL_MASK (0x1 << 8) 59362306a36Sopenharmony_ci#define RT5663_IRQ_MANUAL_SHIFT 8 59462306a36Sopenharmony_ci#define RT5663_IRQ_MANUAL_DIS (0x0 << 8) 59562306a36Sopenharmony_ci#define RT5663_IRQ_MANUAL_EN (0x1 << 8) 59662306a36Sopenharmony_ci 59762306a36Sopenharmony_ci/* IRQ Control 1 (0x00b6) */ 59862306a36Sopenharmony_ci#define RT5663_EN_CB_JD_MASK (0x1 << 3) 59962306a36Sopenharmony_ci#define RT5663_EN_CB_JD_SHIFT 3 60062306a36Sopenharmony_ci#define RT5663_EN_CB_JD_EN (0x1 << 3) 60162306a36Sopenharmony_ci#define RT5663_EN_CB_JD_DIS (0x0 << 3) 60262306a36Sopenharmony_ci 60362306a36Sopenharmony_ci/* IRQ Control 3 (0x00b8) */ 60462306a36Sopenharmony_ci#define RT5663_V2_EN_IRQ_INLINE_MASK (0x1 << 6) 60562306a36Sopenharmony_ci#define RT5663_V2_EN_IRQ_INLINE_SHIFT 6 60662306a36Sopenharmony_ci#define RT5663_V2_EN_IRQ_INLINE_BYP (0x0 << 6) 60762306a36Sopenharmony_ci#define RT5663_V2_EN_IRQ_INLINE_NOR (0x1 << 6) 60862306a36Sopenharmony_ci 60962306a36Sopenharmony_ci/* GPIO Control 1 (0x00c0) */ 61062306a36Sopenharmony_ci#define RT5663_GP1_PIN_MASK (0x1 << 15) 61162306a36Sopenharmony_ci#define RT5663_GP1_PIN_SHIFT 15 61262306a36Sopenharmony_ci#define RT5663_GP1_PIN_GPIO1 (0x0 << 15) 61362306a36Sopenharmony_ci#define RT5663_GP1_PIN_IRQ (0x1 << 15) 61462306a36Sopenharmony_ci 61562306a36Sopenharmony_ci/* GPIO Control 2 (0x00c1) */ 61662306a36Sopenharmony_ci#define RT5663_GP4_PIN_CONF_MASK (0x1 << 5) 61762306a36Sopenharmony_ci#define RT5663_GP4_PIN_CONF_SHIFT 5 61862306a36Sopenharmony_ci#define RT5663_GP4_PIN_CONF_INPUT (0x0 << 5) 61962306a36Sopenharmony_ci#define RT5663_GP4_PIN_CONF_OUTPUT (0x1 << 5) 62062306a36Sopenharmony_ci 62162306a36Sopenharmony_ci/* GPIO Control 2 (0x00c2) */ 62262306a36Sopenharmony_ci#define RT5663_GP8_PIN_CONF_MASK (0x1 << 13) 62362306a36Sopenharmony_ci#define RT5663_GP8_PIN_CONF_SHIFT 13 62462306a36Sopenharmony_ci#define RT5663_GP8_PIN_CONF_INPUT (0x0 << 13) 62562306a36Sopenharmony_ci#define RT5663_GP8_PIN_CONF_OUTPUT (0x1 << 13) 62662306a36Sopenharmony_ci 62762306a36Sopenharmony_ci/* 4 Buttons Inline Command Function 1 (0x00df) */ 62862306a36Sopenharmony_ci#define RT5663_4BTN_CLK_DEB_MASK (0x3 << 2) 62962306a36Sopenharmony_ci#define RT5663_4BTN_CLK_DEB_SHIFT 2 63062306a36Sopenharmony_ci#define RT5663_4BTN_CLK_DEB_8MS (0x0 << 2) 63162306a36Sopenharmony_ci#define RT5663_4BTN_CLK_DEB_16MS (0x1 << 2) 63262306a36Sopenharmony_ci#define RT5663_4BTN_CLK_DEB_32MS (0x2 << 2) 63362306a36Sopenharmony_ci#define RT5663_4BTN_CLK_DEB_65MS (0x3 << 2) 63462306a36Sopenharmony_ci 63562306a36Sopenharmony_ci/* Inline Command Function 6 (0x00e0) */ 63662306a36Sopenharmony_ci#define RT5663_EN_4BTN_INL_MASK (0x1 << 15) 63762306a36Sopenharmony_ci#define RT5663_EN_4BTN_INL_SHIFT 15 63862306a36Sopenharmony_ci#define RT5663_EN_4BTN_INL_DIS (0x0 << 15) 63962306a36Sopenharmony_ci#define RT5663_EN_4BTN_INL_EN (0x1 << 15) 64062306a36Sopenharmony_ci#define RT5663_RESET_4BTN_INL_MASK (0x1 << 14) 64162306a36Sopenharmony_ci#define RT5663_RESET_4BTN_INL_SHIFT 14 64262306a36Sopenharmony_ci#define RT5663_RESET_4BTN_INL_RESET (0x0 << 14) 64362306a36Sopenharmony_ci#define RT5663_RESET_4BTN_INL_NOR (0x1 << 14) 64462306a36Sopenharmony_ci 64562306a36Sopenharmony_ci/* Digital Misc Control (0x00fa) */ 64662306a36Sopenharmony_ci#define RT5663_DIG_GATE_CTRL_MASK 0x1 64762306a36Sopenharmony_ci#define RT5663_DIG_GATE_CTRL_SHIFT (0) 64862306a36Sopenharmony_ci#define RT5663_DIG_GATE_CTRL_DIS 0x0 64962306a36Sopenharmony_ci#define RT5663_DIG_GATE_CTRL_EN 0x1 65062306a36Sopenharmony_ci 65162306a36Sopenharmony_ci/* Chopper and Clock control for DAC L (0x013a)*/ 65262306a36Sopenharmony_ci#define RT5663_CKXEN_DAC1_MASK (0x1 << 13) 65362306a36Sopenharmony_ci#define RT5663_CKXEN_DAC1_SHIFT 13 65462306a36Sopenharmony_ci#define RT5663_CKGEN_DAC1_MASK (0x1 << 12) 65562306a36Sopenharmony_ci#define RT5663_CKGEN_DAC1_SHIFT 12 65662306a36Sopenharmony_ci 65762306a36Sopenharmony_ci/* Chopper and Clock control for ADC (0x013b)*/ 65862306a36Sopenharmony_ci#define RT5663_CKXEN_ADCC_MASK (0x1 << 13) 65962306a36Sopenharmony_ci#define RT5663_CKXEN_ADCC_SHIFT 13 66062306a36Sopenharmony_ci#define RT5663_CKGEN_ADCC_MASK (0x1 << 12) 66162306a36Sopenharmony_ci#define RT5663_CKGEN_ADCC_SHIFT 12 66262306a36Sopenharmony_ci 66362306a36Sopenharmony_ci/* HP Behavior Logic Control 2 (0x01db) */ 66462306a36Sopenharmony_ci#define RT5663_HP_SIG_SRC1_MASK (0x3) 66562306a36Sopenharmony_ci#define RT5663_HP_SIG_SRC1_SHIFT 0 66662306a36Sopenharmony_ci#define RT5663_HP_SIG_SRC1_HP_DC (0x0) 66762306a36Sopenharmony_ci#define RT5663_HP_SIG_SRC1_HP_CALIB (0x1) 66862306a36Sopenharmony_ci#define RT5663_HP_SIG_SRC1_REG (0x2) 66962306a36Sopenharmony_ci#define RT5663_HP_SIG_SRC1_SILENCE (0x3) 67062306a36Sopenharmony_ci 67162306a36Sopenharmony_ci/* RT5663 specific register */ 67262306a36Sopenharmony_ci#define RT5663_HP_OUT_EN 0x0002 67362306a36Sopenharmony_ci#define RT5663_HP_LCH_DRE 0x0005 67462306a36Sopenharmony_ci#define RT5663_HP_RCH_DRE 0x0006 67562306a36Sopenharmony_ci#define RT5663_CALIB_BST 0x000a 67662306a36Sopenharmony_ci#define RT5663_RECMIX 0x0010 67762306a36Sopenharmony_ci#define RT5663_SIL_DET_CTL 0x0015 67862306a36Sopenharmony_ci#define RT5663_PWR_SAV_SILDET 0x0016 67962306a36Sopenharmony_ci#define RT5663_SIDETONE_CTL 0x0018 68062306a36Sopenharmony_ci#define RT5663_STO1_DAC_DIG_VOL 0x0019 68162306a36Sopenharmony_ci#define RT5663_STO1_ADC_DIG_VOL 0x001c 68262306a36Sopenharmony_ci#define RT5663_STO1_BOOST 0x001f 68362306a36Sopenharmony_ci#define RT5663_HP_IMP_GAIN_1 0x0022 68462306a36Sopenharmony_ci#define RT5663_HP_IMP_GAIN_2 0x0023 68562306a36Sopenharmony_ci#define RT5663_STO1_ADC_MIXER 0x0026 68662306a36Sopenharmony_ci#define RT5663_AD_DA_MIXER 0x0029 68762306a36Sopenharmony_ci#define RT5663_STO_DAC_MIXER 0x002a 68862306a36Sopenharmony_ci#define RT5663_DIG_SIDE_MIXER 0x002c 68962306a36Sopenharmony_ci#define RT5663_BYPASS_STO_DAC 0x002d 69062306a36Sopenharmony_ci#define RT5663_CALIB_REC_MIX 0x0040 69162306a36Sopenharmony_ci#define RT5663_PWR_DIG_1 0x0061 69262306a36Sopenharmony_ci#define RT5663_PWR_DIG_2 0x0062 69362306a36Sopenharmony_ci#define RT5663_PWR_ANLG_1 0x0063 69462306a36Sopenharmony_ci#define RT5663_PWR_ANLG_2 0x0064 69562306a36Sopenharmony_ci#define RT5663_PWR_ANLG_3 0x0065 69662306a36Sopenharmony_ci#define RT5663_PWR_MIXER 0x0066 69762306a36Sopenharmony_ci#define RT5663_SIG_CLK_DET 0x006b 69862306a36Sopenharmony_ci#define RT5663_PRE_DIV_GATING_1 0x006e 69962306a36Sopenharmony_ci#define RT5663_PRE_DIV_GATING_2 0x006f 70062306a36Sopenharmony_ci#define RT5663_I2S1_SDP 0x0070 70162306a36Sopenharmony_ci#define RT5663_ADDA_CLK_1 0x0073 70262306a36Sopenharmony_ci#define RT5663_ADDA_RST 0x0074 70362306a36Sopenharmony_ci#define RT5663_FRAC_DIV_1 0x0075 70462306a36Sopenharmony_ci#define RT5663_FRAC_DIV_2 0x0076 70562306a36Sopenharmony_ci#define RT5663_TDM_1 0x0077 70662306a36Sopenharmony_ci#define RT5663_TDM_2 0x0078 70762306a36Sopenharmony_ci#define RT5663_TDM_3 0x0079 70862306a36Sopenharmony_ci#define RT5663_TDM_4 0x007a 70962306a36Sopenharmony_ci#define RT5663_TDM_5 0x007b 71062306a36Sopenharmony_ci#define RT5663_TDM_6 0x007c 71162306a36Sopenharmony_ci#define RT5663_TDM_7 0x007d 71262306a36Sopenharmony_ci#define RT5663_TDM_8 0x007e 71362306a36Sopenharmony_ci#define RT5663_TDM_9 0x007f 71462306a36Sopenharmony_ci#define RT5663_GLB_CLK 0x0080 71562306a36Sopenharmony_ci#define RT5663_PLL_1 0x0081 71662306a36Sopenharmony_ci#define RT5663_PLL_2 0x0082 71762306a36Sopenharmony_ci#define RT5663_ASRC_1 0x0083 71862306a36Sopenharmony_ci#define RT5663_ASRC_2 0x0084 71962306a36Sopenharmony_ci#define RT5663_ASRC_4 0x0086 72062306a36Sopenharmony_ci#define RT5663_DUMMY_REG 0x0087 72162306a36Sopenharmony_ci#define RT5663_ASRC_8 0x008a 72262306a36Sopenharmony_ci#define RT5663_ASRC_9 0x008b 72362306a36Sopenharmony_ci#define RT5663_ASRC_11 0x008c 72462306a36Sopenharmony_ci#define RT5663_DEPOP_1 0x008e 72562306a36Sopenharmony_ci#define RT5663_DEPOP_2 0x008f 72662306a36Sopenharmony_ci#define RT5663_DEPOP_3 0x0090 72762306a36Sopenharmony_ci#define RT5663_HP_CHARGE_PUMP_1 0x0091 72862306a36Sopenharmony_ci#define RT5663_HP_CHARGE_PUMP_2 0x0092 72962306a36Sopenharmony_ci#define RT5663_MICBIAS_1 0x0093 73062306a36Sopenharmony_ci#define RT5663_RC_CLK 0x0094 73162306a36Sopenharmony_ci#define RT5663_ASRC_11_2 0x0097 73262306a36Sopenharmony_ci#define RT5663_DUMMY_REG_2 0x0098 73362306a36Sopenharmony_ci#define RT5663_REC_PATH_GAIN 0x009a 73462306a36Sopenharmony_ci#define RT5663_AUTO_1MRC_CLK 0x009f 73562306a36Sopenharmony_ci#define RT5663_ADC_EQ_1 0x00ae 73662306a36Sopenharmony_ci#define RT5663_ADC_EQ_2 0x00af 73762306a36Sopenharmony_ci#define RT5663_IRQ_1 0x00b6 73862306a36Sopenharmony_ci#define RT5663_IRQ_2 0x00b7 73962306a36Sopenharmony_ci#define RT5663_IRQ_3 0x00b8 74062306a36Sopenharmony_ci#define RT5663_IRQ_4 0x00ba 74162306a36Sopenharmony_ci#define RT5663_IRQ_5 0x00bb 74262306a36Sopenharmony_ci#define RT5663_INT_ST_1 0x00be 74362306a36Sopenharmony_ci#define RT5663_INT_ST_2 0x00bf 74462306a36Sopenharmony_ci#define RT5663_GPIO_1 0x00c0 74562306a36Sopenharmony_ci#define RT5663_GPIO_2 0x00c1 74662306a36Sopenharmony_ci#define RT5663_GPIO_STA1 0x00c5 74762306a36Sopenharmony_ci#define RT5663_SIN_GEN_1 0x00cb 74862306a36Sopenharmony_ci#define RT5663_SIN_GEN_2 0x00cc 74962306a36Sopenharmony_ci#define RT5663_SIN_GEN_3 0x00cd 75062306a36Sopenharmony_ci#define RT5663_SOF_VOL_ZC1 0x00d9 75162306a36Sopenharmony_ci#define RT5663_IL_CMD_1 0x00db 75262306a36Sopenharmony_ci#define RT5663_IL_CMD_2 0x00dc 75362306a36Sopenharmony_ci#define RT5663_IL_CMD_3 0x00dd 75462306a36Sopenharmony_ci#define RT5663_IL_CMD_4 0x00de 75562306a36Sopenharmony_ci#define RT5663_IL_CMD_5 0x00df 75662306a36Sopenharmony_ci#define RT5663_IL_CMD_6 0x00e0 75762306a36Sopenharmony_ci#define RT5663_IL_CMD_7 0x00e1 75862306a36Sopenharmony_ci#define RT5663_IL_CMD_8 0x00e2 75962306a36Sopenharmony_ci#define RT5663_IL_CMD_PWRSAV1 0x00e4 76062306a36Sopenharmony_ci#define RT5663_IL_CMD_PWRSAV2 0x00e5 76162306a36Sopenharmony_ci#define RT5663_EM_JACK_TYPE_1 0x00e6 76262306a36Sopenharmony_ci#define RT5663_EM_JACK_TYPE_2 0x00e7 76362306a36Sopenharmony_ci#define RT5663_EM_JACK_TYPE_3 0x00e8 76462306a36Sopenharmony_ci#define RT5663_EM_JACK_TYPE_4 0x00e9 76562306a36Sopenharmony_ci#define RT5663_EM_JACK_TYPE_5 0x00ea 76662306a36Sopenharmony_ci#define RT5663_EM_JACK_TYPE_6 0x00eb 76762306a36Sopenharmony_ci#define RT5663_STO1_HPF_ADJ1 0x00ec 76862306a36Sopenharmony_ci#define RT5663_STO1_HPF_ADJ2 0x00ed 76962306a36Sopenharmony_ci#define RT5663_FAST_OFF_MICBIAS 0x00f4 77062306a36Sopenharmony_ci#define RT5663_JD_CTRL1 0x00f6 77162306a36Sopenharmony_ci#define RT5663_JD_CTRL2 0x00f8 77262306a36Sopenharmony_ci#define RT5663_DIG_MISC 0x00fa 77362306a36Sopenharmony_ci#define RT5663_DIG_VOL_ZCD 0x0100 77462306a36Sopenharmony_ci#define RT5663_ANA_BIAS_CUR_1 0x0108 77562306a36Sopenharmony_ci#define RT5663_ANA_BIAS_CUR_2 0x0109 77662306a36Sopenharmony_ci#define RT5663_ANA_BIAS_CUR_3 0x010a 77762306a36Sopenharmony_ci#define RT5663_ANA_BIAS_CUR_4 0x010b 77862306a36Sopenharmony_ci#define RT5663_ANA_BIAS_CUR_5 0x010c 77962306a36Sopenharmony_ci#define RT5663_ANA_BIAS_CUR_6 0x010d 78062306a36Sopenharmony_ci#define RT5663_BIAS_CUR_5 0x010e 78162306a36Sopenharmony_ci#define RT5663_BIAS_CUR_6 0x010f 78262306a36Sopenharmony_ci#define RT5663_BIAS_CUR_7 0x0110 78362306a36Sopenharmony_ci#define RT5663_BIAS_CUR_8 0x0111 78462306a36Sopenharmony_ci#define RT5663_DACREF_LDO 0x0112 78562306a36Sopenharmony_ci#define RT5663_DUMMY_REG_3 0x0113 78662306a36Sopenharmony_ci#define RT5663_BIAS_CUR_9 0x0114 78762306a36Sopenharmony_ci#define RT5663_DUMMY_REG_4 0x0116 78862306a36Sopenharmony_ci#define RT5663_VREFADJ_OP 0x0117 78962306a36Sopenharmony_ci#define RT5663_VREF_RECMIX 0x0118 79062306a36Sopenharmony_ci#define RT5663_CHARGE_PUMP_1 0x0125 79162306a36Sopenharmony_ci#define RT5663_CHARGE_PUMP_1_2 0x0126 79262306a36Sopenharmony_ci#define RT5663_CHARGE_PUMP_1_3 0x0127 79362306a36Sopenharmony_ci#define RT5663_CHARGE_PUMP_2 0x0128 79462306a36Sopenharmony_ci#define RT5663_DIG_IN_PIN1 0x0132 79562306a36Sopenharmony_ci#define RT5663_PAD_DRV_CTL 0x0137 79662306a36Sopenharmony_ci#define RT5663_PLL_INT_REG 0x0139 79762306a36Sopenharmony_ci#define RT5663_CHOP_DAC_L 0x013a 79862306a36Sopenharmony_ci#define RT5663_CHOP_ADC 0x013b 79962306a36Sopenharmony_ci#define RT5663_CALIB_ADC 0x013c 80062306a36Sopenharmony_ci#define RT5663_CHOP_DAC_R 0x013d 80162306a36Sopenharmony_ci#define RT5663_DUMMY_CTL_DACLR 0x013e 80262306a36Sopenharmony_ci#define RT5663_DUMMY_REG_5 0x0140 80362306a36Sopenharmony_ci#define RT5663_SOFT_RAMP 0x0141 80462306a36Sopenharmony_ci#define RT5663_TEST_MODE_1 0x0144 80562306a36Sopenharmony_ci#define RT5663_TEST_MODE_2 0x0145 80662306a36Sopenharmony_ci#define RT5663_TEST_MODE_3 0x0146 80762306a36Sopenharmony_ci#define RT5663_TEST_MODE_4 0x0147 80862306a36Sopenharmony_ci#define RT5663_TEST_MODE_5 0x0148 80962306a36Sopenharmony_ci#define RT5663_STO_DRE_1 0x0160 81062306a36Sopenharmony_ci#define RT5663_STO_DRE_2 0x0161 81162306a36Sopenharmony_ci#define RT5663_STO_DRE_3 0x0162 81262306a36Sopenharmony_ci#define RT5663_STO_DRE_4 0x0163 81362306a36Sopenharmony_ci#define RT5663_STO_DRE_5 0x0164 81462306a36Sopenharmony_ci#define RT5663_STO_DRE_6 0x0165 81562306a36Sopenharmony_ci#define RT5663_STO_DRE_7 0x0166 81662306a36Sopenharmony_ci#define RT5663_STO_DRE_8 0x0167 81762306a36Sopenharmony_ci#define RT5663_STO_DRE_9 0x0168 81862306a36Sopenharmony_ci#define RT5663_STO_DRE_10 0x0169 81962306a36Sopenharmony_ci#define RT5663_MIC_DECRO_1 0x0180 82062306a36Sopenharmony_ci#define RT5663_MIC_DECRO_2 0x0181 82162306a36Sopenharmony_ci#define RT5663_MIC_DECRO_3 0x0182 82262306a36Sopenharmony_ci#define RT5663_MIC_DECRO_4 0x0183 82362306a36Sopenharmony_ci#define RT5663_MIC_DECRO_5 0x0184 82462306a36Sopenharmony_ci#define RT5663_MIC_DECRO_6 0x0185 82562306a36Sopenharmony_ci#define RT5663_HP_DECRO_1 0x01b0 82662306a36Sopenharmony_ci#define RT5663_HP_DECRO_2 0x01b1 82762306a36Sopenharmony_ci#define RT5663_HP_DECRO_3 0x01b2 82862306a36Sopenharmony_ci#define RT5663_HP_DECRO_4 0x01b3 82962306a36Sopenharmony_ci#define RT5663_HP_DECOUP 0x01b4 83062306a36Sopenharmony_ci#define RT5663_HP_IMP_SEN_MAP8 0x01b5 83162306a36Sopenharmony_ci#define RT5663_HP_IMP_SEN_MAP9 0x01b6 83262306a36Sopenharmony_ci#define RT5663_HP_IMP_SEN_MAP10 0x01b7 83362306a36Sopenharmony_ci#define RT5663_HP_IMP_SEN_MAP11 0x01b8 83462306a36Sopenharmony_ci#define RT5663_HP_IMP_SEN_1 0x01c0 83562306a36Sopenharmony_ci#define RT5663_HP_IMP_SEN_2 0x01c1 83662306a36Sopenharmony_ci#define RT5663_HP_IMP_SEN_3 0x01c2 83762306a36Sopenharmony_ci#define RT5663_HP_IMP_SEN_4 0x01c3 83862306a36Sopenharmony_ci#define RT5663_HP_IMP_SEN_5 0x01c4 83962306a36Sopenharmony_ci#define RT5663_HP_IMP_SEN_6 0x01c5 84062306a36Sopenharmony_ci#define RT5663_HP_IMP_SEN_7 0x01c6 84162306a36Sopenharmony_ci#define RT5663_HP_IMP_SEN_8 0x01c7 84262306a36Sopenharmony_ci#define RT5663_HP_IMP_SEN_9 0x01c8 84362306a36Sopenharmony_ci#define RT5663_HP_IMP_SEN_10 0x01c9 84462306a36Sopenharmony_ci#define RT5663_HP_IMP_SEN_11 0x01ca 84562306a36Sopenharmony_ci#define RT5663_HP_IMP_SEN_12 0x01cb 84662306a36Sopenharmony_ci#define RT5663_HP_IMP_SEN_13 0x01cc 84762306a36Sopenharmony_ci#define RT5663_HP_IMP_SEN_14 0x01cd 84862306a36Sopenharmony_ci#define RT5663_HP_IMP_SEN_15 0x01ce 84962306a36Sopenharmony_ci#define RT5663_HP_IMP_SEN_16 0x01cf 85062306a36Sopenharmony_ci#define RT5663_HP_IMP_SEN_17 0x01d0 85162306a36Sopenharmony_ci#define RT5663_HP_IMP_SEN_18 0x01d1 85262306a36Sopenharmony_ci#define RT5663_HP_IMP_SEN_19 0x01d2 85362306a36Sopenharmony_ci#define RT5663_HP_IMPSEN_DIG5 0x01d3 85462306a36Sopenharmony_ci#define RT5663_HP_IMPSEN_MAP1 0x01d4 85562306a36Sopenharmony_ci#define RT5663_HP_IMPSEN_MAP2 0x01d5 85662306a36Sopenharmony_ci#define RT5663_HP_IMPSEN_MAP3 0x01d6 85762306a36Sopenharmony_ci#define RT5663_HP_IMPSEN_MAP4 0x01d7 85862306a36Sopenharmony_ci#define RT5663_HP_IMPSEN_MAP5 0x01d8 85962306a36Sopenharmony_ci#define RT5663_HP_IMPSEN_MAP7 0x01d9 86062306a36Sopenharmony_ci#define RT5663_HP_LOGIC_1 0x01da 86162306a36Sopenharmony_ci#define RT5663_HP_LOGIC_2 0x01db 86262306a36Sopenharmony_ci#define RT5663_HP_CALIB_1 0x01dd 86362306a36Sopenharmony_ci#define RT5663_HP_CALIB_1_1 0x01de 86462306a36Sopenharmony_ci#define RT5663_HP_CALIB_2 0x01df 86562306a36Sopenharmony_ci#define RT5663_HP_CALIB_3 0x01e0 86662306a36Sopenharmony_ci#define RT5663_HP_CALIB_4 0x01e1 86762306a36Sopenharmony_ci#define RT5663_HP_CALIB_5 0x01e2 86862306a36Sopenharmony_ci#define RT5663_HP_CALIB_5_1 0x01e3 86962306a36Sopenharmony_ci#define RT5663_HP_CALIB_6 0x01e4 87062306a36Sopenharmony_ci#define RT5663_HP_CALIB_7 0x01e5 87162306a36Sopenharmony_ci#define RT5663_HP_CALIB_9 0x01e6 87262306a36Sopenharmony_ci#define RT5663_HP_CALIB_10 0x01e7 87362306a36Sopenharmony_ci#define RT5663_HP_CALIB_11 0x01e8 87462306a36Sopenharmony_ci#define RT5663_HP_CALIB_ST1 0x01ea 87562306a36Sopenharmony_ci#define RT5663_HP_CALIB_ST2 0x01eb 87662306a36Sopenharmony_ci#define RT5663_HP_CALIB_ST3 0x01ec 87762306a36Sopenharmony_ci#define RT5663_HP_CALIB_ST4 0x01ed 87862306a36Sopenharmony_ci#define RT5663_HP_CALIB_ST5 0x01ee 87962306a36Sopenharmony_ci#define RT5663_HP_CALIB_ST6 0x01ef 88062306a36Sopenharmony_ci#define RT5663_HP_CALIB_ST7 0x01f0 88162306a36Sopenharmony_ci#define RT5663_HP_CALIB_ST8 0x01f1 88262306a36Sopenharmony_ci#define RT5663_HP_CALIB_ST9 0x01f2 88362306a36Sopenharmony_ci#define RT5663_HP_AMP_DET 0x0200 88462306a36Sopenharmony_ci#define RT5663_DUMMY_REG_6 0x0201 88562306a36Sopenharmony_ci#define RT5663_HP_BIAS 0x0202 88662306a36Sopenharmony_ci#define RT5663_CBJ_1 0x0250 88762306a36Sopenharmony_ci#define RT5663_CBJ_2 0x0251 88862306a36Sopenharmony_ci#define RT5663_CBJ_3 0x0252 88962306a36Sopenharmony_ci#define RT5663_DUMMY_1 0x02fa 89062306a36Sopenharmony_ci#define RT5663_DUMMY_2 0x02fb 89162306a36Sopenharmony_ci#define RT5663_DUMMY_3 0x02fc 89262306a36Sopenharmony_ci#define RT5663_ANA_JD 0x0300 89362306a36Sopenharmony_ci#define RT5663_ADC_LCH_LPF1_A1 0x03d0 89462306a36Sopenharmony_ci#define RT5663_ADC_RCH_LPF1_A1 0x03d1 89562306a36Sopenharmony_ci#define RT5663_ADC_LCH_LPF1_H0 0x03d2 89662306a36Sopenharmony_ci#define RT5663_ADC_RCH_LPF1_H0 0x03d3 89762306a36Sopenharmony_ci#define RT5663_ADC_LCH_BPF1_A1 0x03d4 89862306a36Sopenharmony_ci#define RT5663_ADC_RCH_BPF1_A1 0x03d5 89962306a36Sopenharmony_ci#define RT5663_ADC_LCH_BPF1_A2 0x03d6 90062306a36Sopenharmony_ci#define RT5663_ADC_RCH_BPF1_A2 0x03d7 90162306a36Sopenharmony_ci#define RT5663_ADC_LCH_BPF1_H0 0x03d8 90262306a36Sopenharmony_ci#define RT5663_ADC_RCH_BPF1_H0 0x03d9 90362306a36Sopenharmony_ci#define RT5663_ADC_LCH_BPF2_A1 0x03da 90462306a36Sopenharmony_ci#define RT5663_ADC_RCH_BPF2_A1 0x03db 90562306a36Sopenharmony_ci#define RT5663_ADC_LCH_BPF2_A2 0x03dc 90662306a36Sopenharmony_ci#define RT5663_ADC_RCH_BPF2_A2 0x03dd 90762306a36Sopenharmony_ci#define RT5663_ADC_LCH_BPF2_H0 0x03de 90862306a36Sopenharmony_ci#define RT5663_ADC_RCH_BPF2_H0 0x03df 90962306a36Sopenharmony_ci#define RT5663_ADC_LCH_BPF3_A1 0x03e0 91062306a36Sopenharmony_ci#define RT5663_ADC_RCH_BPF3_A1 0x03e1 91162306a36Sopenharmony_ci#define RT5663_ADC_LCH_BPF3_A2 0x03e2 91262306a36Sopenharmony_ci#define RT5663_ADC_RCH_BPF3_A2 0x03e3 91362306a36Sopenharmony_ci#define RT5663_ADC_LCH_BPF3_H0 0x03e4 91462306a36Sopenharmony_ci#define RT5663_ADC_RCH_BPF3_H0 0x03e5 91562306a36Sopenharmony_ci#define RT5663_ADC_LCH_BPF4_A1 0x03e6 91662306a36Sopenharmony_ci#define RT5663_ADC_RCH_BPF4_A1 0x03e7 91762306a36Sopenharmony_ci#define RT5663_ADC_LCH_BPF4_A2 0x03e8 91862306a36Sopenharmony_ci#define RT5663_ADC_RCH_BPF4_A2 0x03e9 91962306a36Sopenharmony_ci#define RT5663_ADC_LCH_BPF4_H0 0x03ea 92062306a36Sopenharmony_ci#define RT5663_ADC_RCH_BPF4_H0 0x03eb 92162306a36Sopenharmony_ci#define RT5663_ADC_LCH_HPF1_A1 0x03ec 92262306a36Sopenharmony_ci#define RT5663_ADC_RCH_HPF1_A1 0x03ed 92362306a36Sopenharmony_ci#define RT5663_ADC_LCH_HPF1_H0 0x03ee 92462306a36Sopenharmony_ci#define RT5663_ADC_RCH_HPF1_H0 0x03ef 92562306a36Sopenharmony_ci#define RT5663_ADC_EQ_PRE_VOL_L 0x03f0 92662306a36Sopenharmony_ci#define RT5663_ADC_EQ_PRE_VOL_R 0x03f1 92762306a36Sopenharmony_ci#define RT5663_ADC_EQ_POST_VOL_L 0x03f2 92862306a36Sopenharmony_ci#define RT5663_ADC_EQ_POST_VOL_R 0x03f3 92962306a36Sopenharmony_ci 93062306a36Sopenharmony_ci/* RECMIX Control (0x0010) */ 93162306a36Sopenharmony_ci#define RT5663_RECMIX1_BST1_MASK (0x1) 93262306a36Sopenharmony_ci#define RT5663_RECMIX1_BST1_SHIFT 0 93362306a36Sopenharmony_ci#define RT5663_RECMIX1_BST1_ON (0x0) 93462306a36Sopenharmony_ci#define RT5663_RECMIX1_BST1_OFF (0x1) 93562306a36Sopenharmony_ci 93662306a36Sopenharmony_ci/* Bypass Stereo1 DAC Mixer Control (0x002d) */ 93762306a36Sopenharmony_ci#define RT5663_DACL1_SRC_MASK (0x1 << 3) 93862306a36Sopenharmony_ci#define RT5663_DACL1_SRC_SHIFT 3 93962306a36Sopenharmony_ci#define RT5663_DACR1_SRC_MASK (0x1 << 2) 94062306a36Sopenharmony_ci#define RT5663_DACR1_SRC_SHIFT 2 94162306a36Sopenharmony_ci 94262306a36Sopenharmony_ci/* TDM control 2 (0x0078) */ 94362306a36Sopenharmony_ci#define RT5663_DATA_SWAP_ADCDAT1_MASK (0x3 << 14) 94462306a36Sopenharmony_ci#define RT5663_DATA_SWAP_ADCDAT1_SHIFT 14 94562306a36Sopenharmony_ci#define RT5663_DATA_SWAP_ADCDAT1_LR (0x0 << 14) 94662306a36Sopenharmony_ci#define RT5663_DATA_SWAP_ADCDAT1_RL (0x1 << 14) 94762306a36Sopenharmony_ci#define RT5663_DATA_SWAP_ADCDAT1_LL (0x2 << 14) 94862306a36Sopenharmony_ci#define RT5663_DATA_SWAP_ADCDAT1_RR (0x3 << 14) 94962306a36Sopenharmony_ci 95062306a36Sopenharmony_ci/* TDM control 5 (0x007b) */ 95162306a36Sopenharmony_ci#define RT5663_TDM_LENGTN_MASK (0x3) 95262306a36Sopenharmony_ci#define RT5663_TDM_LENGTN_SHIFT 0 95362306a36Sopenharmony_ci#define RT5663_TDM_LENGTN_16 (0x0) 95462306a36Sopenharmony_ci#define RT5663_TDM_LENGTN_20 (0x1) 95562306a36Sopenharmony_ci#define RT5663_TDM_LENGTN_24 (0x2) 95662306a36Sopenharmony_ci#define RT5663_TDM_LENGTN_32 (0x3) 95762306a36Sopenharmony_ci 95862306a36Sopenharmony_ci/* PLL tracking mode 1 (0x0083) */ 95962306a36Sopenharmony_ci#define RT5663_I2S1_ASRC_MASK (0x1 << 11) 96062306a36Sopenharmony_ci#define RT5663_I2S1_ASRC_SHIFT 11 96162306a36Sopenharmony_ci#define RT5663_DAC_STO1_ASRC_MASK (0x1 << 10) 96262306a36Sopenharmony_ci#define RT5663_DAC_STO1_ASRC_SHIFT 10 96362306a36Sopenharmony_ci#define RT5663_ADC_STO1_ASRC_MASK (0x1 << 3) 96462306a36Sopenharmony_ci#define RT5663_ADC_STO1_ASRC_SHIFT 3 96562306a36Sopenharmony_ci 96662306a36Sopenharmony_ci/* PLL tracking mode 2 (0x0084)*/ 96762306a36Sopenharmony_ci#define RT5663_DA_STO1_TRACK_MASK (0x7 << 12) 96862306a36Sopenharmony_ci#define RT5663_DA_STO1_TRACK_SHIFT 12 96962306a36Sopenharmony_ci#define RT5663_DA_STO1_TRACK_SYSCLK (0x0 << 12) 97062306a36Sopenharmony_ci#define RT5663_DA_STO1_TRACK_I2S1 (0x1 << 12) 97162306a36Sopenharmony_ci#define RT5663_AD_STO1_TRACK_MASK (0x7) 97262306a36Sopenharmony_ci#define RT5663_AD_STO1_TRACK_SHIFT 0 97362306a36Sopenharmony_ci#define RT5663_AD_STO1_TRACK_SYSCLK (0x0) 97462306a36Sopenharmony_ci#define RT5663_AD_STO1_TRACK_I2S1 (0x1) 97562306a36Sopenharmony_ci 97662306a36Sopenharmony_ci/* HPOUT Charge pump control 1 (0x0091) */ 97762306a36Sopenharmony_ci#define RT5663_SI_HP_MASK (0x1 << 12) 97862306a36Sopenharmony_ci#define RT5663_SI_HP_SHIFT 12 97962306a36Sopenharmony_ci#define RT5663_SI_HP_EN (0x1 << 12) 98062306a36Sopenharmony_ci#define RT5663_SI_HP_DIS (0x0 << 12) 98162306a36Sopenharmony_ci 98262306a36Sopenharmony_ci/* GPIO Control 2 (0x00b6) */ 98362306a36Sopenharmony_ci#define RT5663_GP1_PIN_CONF_MASK (0x1 << 2) 98462306a36Sopenharmony_ci#define RT5663_GP1_PIN_CONF_SHIFT 2 98562306a36Sopenharmony_ci#define RT5663_GP1_PIN_CONF_OUTPUT (0x1 << 2) 98662306a36Sopenharmony_ci#define RT5663_GP1_PIN_CONF_INPUT (0x0 << 2) 98762306a36Sopenharmony_ci 98862306a36Sopenharmony_ci/* GPIO Control 2 (0x00b7) */ 98962306a36Sopenharmony_ci#define RT5663_EN_IRQ_INLINE_MASK (0x1 << 3) 99062306a36Sopenharmony_ci#define RT5663_EN_IRQ_INLINE_SHIFT 3 99162306a36Sopenharmony_ci#define RT5663_EN_IRQ_INLINE_NOR (0x1 << 3) 99262306a36Sopenharmony_ci#define RT5663_EN_IRQ_INLINE_BYP (0x0 << 3) 99362306a36Sopenharmony_ci 99462306a36Sopenharmony_ci/* GPIO Control 1 (0x00c0) */ 99562306a36Sopenharmony_ci#define RT5663_GPIO1_TYPE_MASK (0x1 << 15) 99662306a36Sopenharmony_ci#define RT5663_GPIO1_TYPE_SHIFT 15 99762306a36Sopenharmony_ci#define RT5663_GPIO1_TYPE_EN (0x1 << 15) 99862306a36Sopenharmony_ci#define RT5663_GPIO1_TYPE_DIS (0x0 << 15) 99962306a36Sopenharmony_ci 100062306a36Sopenharmony_ci/* IRQ Control 1 (0x00c1) */ 100162306a36Sopenharmony_ci#define RT5663_EN_IRQ_JD1_MASK (0x1 << 6) 100262306a36Sopenharmony_ci#define RT5663_EN_IRQ_JD1_SHIFT 6 100362306a36Sopenharmony_ci#define RT5663_EN_IRQ_JD1_EN (0x1 << 6) 100462306a36Sopenharmony_ci#define RT5663_EN_IRQ_JD1_DIS (0x0 << 6) 100562306a36Sopenharmony_ci#define RT5663_SEL_GPIO1_MASK (0x1 << 2) 100662306a36Sopenharmony_ci#define RT5663_SEL_GPIO1_SHIFT 6 100762306a36Sopenharmony_ci#define RT5663_SEL_GPIO1_EN (0x1 << 2) 100862306a36Sopenharmony_ci#define RT5663_SEL_GPIO1_DIS (0x0 << 2) 100962306a36Sopenharmony_ci 101062306a36Sopenharmony_ci/* Inline Command Function 2 (0x00dc) */ 101162306a36Sopenharmony_ci#define RT5663_PWR_MIC_DET_MASK (0x1) 101262306a36Sopenharmony_ci#define RT5663_PWR_MIC_DET_SHIFT 0 101362306a36Sopenharmony_ci#define RT5663_PWR_MIC_DET_ON (0x1) 101462306a36Sopenharmony_ci#define RT5663_PWR_MIC_DET_OFF (0x0) 101562306a36Sopenharmony_ci 101662306a36Sopenharmony_ci/* Embeeded Jack and Type Detection Control 1 (0x00e6)*/ 101762306a36Sopenharmony_ci#define RT5663_CBJ_DET_MASK (0x1 << 15) 101862306a36Sopenharmony_ci#define RT5663_CBJ_DET_SHIFT 15 101962306a36Sopenharmony_ci#define RT5663_CBJ_DET_DIS (0x0 << 15) 102062306a36Sopenharmony_ci#define RT5663_CBJ_DET_EN (0x1 << 15) 102162306a36Sopenharmony_ci#define RT5663_EXT_JD_MASK (0x1 << 11) 102262306a36Sopenharmony_ci#define RT5663_EXT_JD_SHIFT 11 102362306a36Sopenharmony_ci#define RT5663_EXT_JD_EN (0x1 << 11) 102462306a36Sopenharmony_ci#define RT5663_EXT_JD_DIS (0x0 << 11) 102562306a36Sopenharmony_ci#define RT5663_POL_EXT_JD_MASK (0x1 << 10) 102662306a36Sopenharmony_ci#define RT5663_POL_EXT_JD_SHIFT 10 102762306a36Sopenharmony_ci#define RT5663_POL_EXT_JD_EN (0x1 << 10) 102862306a36Sopenharmony_ci#define RT5663_POL_EXT_JD_DIS (0x0 << 10) 102962306a36Sopenharmony_ci#define RT5663_EM_JD_MASK (0x1 << 7) 103062306a36Sopenharmony_ci#define RT5663_EM_JD_SHIFT 7 103162306a36Sopenharmony_ci#define RT5663_EM_JD_NOR (0x1 << 7) 103262306a36Sopenharmony_ci#define RT5663_EM_JD_RST (0x0 << 7) 103362306a36Sopenharmony_ci 103462306a36Sopenharmony_ci/* DACREF LDO Control (0x0112)*/ 103562306a36Sopenharmony_ci#define RT5663_PWR_LDO_DACREFL_MASK (0x1 << 9) 103662306a36Sopenharmony_ci#define RT5663_PWR_LDO_DACREFL_SHIFT 9 103762306a36Sopenharmony_ci#define RT5663_PWR_LDO_DACREFR_MASK (0x1 << 1) 103862306a36Sopenharmony_ci#define RT5663_PWR_LDO_DACREFR_SHIFT 1 103962306a36Sopenharmony_ci 104062306a36Sopenharmony_ci/* Stereo Dynamic Range Enhancement Control 9 (0x0168, 0x0169)*/ 104162306a36Sopenharmony_ci#define RT5663_DRE_GAIN_HP_MASK (0x1f) 104262306a36Sopenharmony_ci#define RT5663_DRE_GAIN_HP_SHIFT 0 104362306a36Sopenharmony_ci 104462306a36Sopenharmony_ci/* Combo Jack Control (0x0250) */ 104562306a36Sopenharmony_ci#define RT5663_INBUF_CBJ_BST1_MASK (0x1 << 11) 104662306a36Sopenharmony_ci#define RT5663_INBUF_CBJ_BST1_SHIFT 11 104762306a36Sopenharmony_ci#define RT5663_INBUF_CBJ_BST1_ON (0x1 << 11) 104862306a36Sopenharmony_ci#define RT5663_INBUF_CBJ_BST1_OFF (0x0 << 11) 104962306a36Sopenharmony_ci#define RT5663_CBJ_SENSE_BST1_MASK (0x1 << 10) 105062306a36Sopenharmony_ci#define RT5663_CBJ_SENSE_BST1_SHIFT 10 105162306a36Sopenharmony_ci#define RT5663_CBJ_SENSE_BST1_L (0x1 << 10) 105262306a36Sopenharmony_ci#define RT5663_CBJ_SENSE_BST1_R (0x0 << 10) 105362306a36Sopenharmony_ci 105462306a36Sopenharmony_ci/* Combo Jack Control (0x0251) */ 105562306a36Sopenharmony_ci#define RT5663_GAIN_BST1_MASK (0xf) 105662306a36Sopenharmony_ci#define RT5663_GAIN_BST1_SHIFT 0 105762306a36Sopenharmony_ci 105862306a36Sopenharmony_ci/* Dummy register 1 (0x02fa) */ 105962306a36Sopenharmony_ci#define RT5663_EMB_CLK_MASK (0x1 << 9) 106062306a36Sopenharmony_ci#define RT5663_EMB_CLK_SHIFT 9 106162306a36Sopenharmony_ci#define RT5663_EMB_CLK_EN (0x1 << 9) 106262306a36Sopenharmony_ci#define RT5663_EMB_CLK_DIS (0x0 << 9) 106362306a36Sopenharmony_ci#define RT5663_HPA_CPL_BIAS_MASK (0x7 << 6) 106462306a36Sopenharmony_ci#define RT5663_HPA_CPL_BIAS_SHIFT 6 106562306a36Sopenharmony_ci#define RT5663_HPA_CPL_BIAS_0_5 (0x0 << 6) 106662306a36Sopenharmony_ci#define RT5663_HPA_CPL_BIAS_1 (0x1 << 6) 106762306a36Sopenharmony_ci#define RT5663_HPA_CPL_BIAS_2 (0x2 << 6) 106862306a36Sopenharmony_ci#define RT5663_HPA_CPL_BIAS_3 (0x3 << 6) 106962306a36Sopenharmony_ci#define RT5663_HPA_CPL_BIAS_4_1 (0x4 << 6) 107062306a36Sopenharmony_ci#define RT5663_HPA_CPL_BIAS_4_2 (0x5 << 6) 107162306a36Sopenharmony_ci#define RT5663_HPA_CPL_BIAS_6 (0x6 << 6) 107262306a36Sopenharmony_ci#define RT5663_HPA_CPL_BIAS_8 (0x7 << 6) 107362306a36Sopenharmony_ci#define RT5663_HPA_CPR_BIAS_MASK (0x7 << 3) 107462306a36Sopenharmony_ci#define RT5663_HPA_CPR_BIAS_SHIFT 3 107562306a36Sopenharmony_ci#define RT5663_HPA_CPR_BIAS_0_5 (0x0 << 3) 107662306a36Sopenharmony_ci#define RT5663_HPA_CPR_BIAS_1 (0x1 << 3) 107762306a36Sopenharmony_ci#define RT5663_HPA_CPR_BIAS_2 (0x2 << 3) 107862306a36Sopenharmony_ci#define RT5663_HPA_CPR_BIAS_3 (0x3 << 3) 107962306a36Sopenharmony_ci#define RT5663_HPA_CPR_BIAS_4_1 (0x4 << 3) 108062306a36Sopenharmony_ci#define RT5663_HPA_CPR_BIAS_4_2 (0x5 << 3) 108162306a36Sopenharmony_ci#define RT5663_HPA_CPR_BIAS_6 (0x6 << 3) 108262306a36Sopenharmony_ci#define RT5663_HPA_CPR_BIAS_8 (0x7 << 3) 108362306a36Sopenharmony_ci#define RT5663_DUMMY_BIAS_MASK (0x7) 108462306a36Sopenharmony_ci#define RT5663_DUMMY_BIAS_SHIFT 0 108562306a36Sopenharmony_ci#define RT5663_DUMMY_BIAS_0_5 (0x0) 108662306a36Sopenharmony_ci#define RT5663_DUMMY_BIAS_1 (0x1) 108762306a36Sopenharmony_ci#define RT5663_DUMMY_BIAS_2 (0x2) 108862306a36Sopenharmony_ci#define RT5663_DUMMY_BIAS_3 (0x3) 108962306a36Sopenharmony_ci#define RT5663_DUMMY_BIAS_4_1 (0x4) 109062306a36Sopenharmony_ci#define RT5663_DUMMY_BIAS_4_2 (0x5) 109162306a36Sopenharmony_ci#define RT5663_DUMMY_BIAS_6 (0x6) 109262306a36Sopenharmony_ci#define RT5663_DUMMY_BIAS_8 (0x7) 109362306a36Sopenharmony_ci 109462306a36Sopenharmony_ci 109562306a36Sopenharmony_ci/* System Clock Source */ 109662306a36Sopenharmony_cienum { 109762306a36Sopenharmony_ci RT5663_SCLK_S_MCLK, 109862306a36Sopenharmony_ci RT5663_SCLK_S_PLL1, 109962306a36Sopenharmony_ci RT5663_SCLK_S_RCCLK, 110062306a36Sopenharmony_ci}; 110162306a36Sopenharmony_ci 110262306a36Sopenharmony_ci/* PLL1 Source */ 110362306a36Sopenharmony_cienum { 110462306a36Sopenharmony_ci RT5663_PLL1_S_MCLK, 110562306a36Sopenharmony_ci RT5663_PLL1_S_BCLK1, 110662306a36Sopenharmony_ci}; 110762306a36Sopenharmony_ci 110862306a36Sopenharmony_cienum { 110962306a36Sopenharmony_ci RT5663_AIF, 111062306a36Sopenharmony_ci RT5663_AIFS, 111162306a36Sopenharmony_ci}; 111262306a36Sopenharmony_ci 111362306a36Sopenharmony_ci/* asrc clock source */ 111462306a36Sopenharmony_cienum { 111562306a36Sopenharmony_ci RT5663_CLK_SEL_SYS = 0x0, 111662306a36Sopenharmony_ci RT5663_CLK_SEL_I2S1_ASRC = 0x1, 111762306a36Sopenharmony_ci}; 111862306a36Sopenharmony_ci 111962306a36Sopenharmony_ci/* filter mask */ 112062306a36Sopenharmony_cienum { 112162306a36Sopenharmony_ci RT5663_DA_STEREO_FILTER = 0x1, 112262306a36Sopenharmony_ci RT5663_AD_STEREO_FILTER = 0x2, 112362306a36Sopenharmony_ci}; 112462306a36Sopenharmony_ci 112562306a36Sopenharmony_ciint rt5663_sel_asrc_clk_src(struct snd_soc_component *component, 112662306a36Sopenharmony_ci unsigned int filter_mask, unsigned int clk_src); 112762306a36Sopenharmony_ci 112862306a36Sopenharmony_ci#endif /* __RT5663_H__ */ 1129