162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */ 262306a36Sopenharmony_ci/* 362306a36Sopenharmony_ci * rt5668.h -- RT5668/RT5658 ALSA SoC audio driver 462306a36Sopenharmony_ci * 562306a36Sopenharmony_ci * Copyright 2018 Realtek Microelectronics 662306a36Sopenharmony_ci * Author: Bard Liao <bardliao@realtek.com> 762306a36Sopenharmony_ci */ 862306a36Sopenharmony_ci 962306a36Sopenharmony_ci#ifndef __RT5668_H__ 1062306a36Sopenharmony_ci#define __RT5668_H__ 1162306a36Sopenharmony_ci 1262306a36Sopenharmony_ci#include <sound/rt5668.h> 1362306a36Sopenharmony_ci 1462306a36Sopenharmony_ci#define DEVICE_ID 0x6530 1562306a36Sopenharmony_ci 1662306a36Sopenharmony_ci/* Info */ 1762306a36Sopenharmony_ci#define RT5668_RESET 0x0000 1862306a36Sopenharmony_ci#define RT5668_VERSION_ID 0x00fd 1962306a36Sopenharmony_ci#define RT5668_VENDOR_ID 0x00fe 2062306a36Sopenharmony_ci#define RT5668_DEVICE_ID 0x00ff 2162306a36Sopenharmony_ci/* I/O - Output */ 2262306a36Sopenharmony_ci#define RT5668_HP_CTRL_1 0x0002 2362306a36Sopenharmony_ci#define RT5668_HP_CTRL_2 0x0003 2462306a36Sopenharmony_ci#define RT5668_HPL_GAIN 0x0005 2562306a36Sopenharmony_ci#define RT5668_HPR_GAIN 0x0006 2662306a36Sopenharmony_ci 2762306a36Sopenharmony_ci#define RT5668_I2C_CTRL 0x0008 2862306a36Sopenharmony_ci 2962306a36Sopenharmony_ci/* I/O - Input */ 3062306a36Sopenharmony_ci#define RT5668_CBJ_BST_CTRL 0x000b 3162306a36Sopenharmony_ci#define RT5668_CBJ_CTRL_1 0x0010 3262306a36Sopenharmony_ci#define RT5668_CBJ_CTRL_2 0x0011 3362306a36Sopenharmony_ci#define RT5668_CBJ_CTRL_3 0x0012 3462306a36Sopenharmony_ci#define RT5668_CBJ_CTRL_4 0x0013 3562306a36Sopenharmony_ci#define RT5668_CBJ_CTRL_5 0x0014 3662306a36Sopenharmony_ci#define RT5668_CBJ_CTRL_6 0x0015 3762306a36Sopenharmony_ci#define RT5668_CBJ_CTRL_7 0x0016 3862306a36Sopenharmony_ci/* I/O - ADC/DAC/DMIC */ 3962306a36Sopenharmony_ci#define RT5668_DAC1_DIG_VOL 0x0019 4062306a36Sopenharmony_ci#define RT5668_STO1_ADC_DIG_VOL 0x001c 4162306a36Sopenharmony_ci#define RT5668_STO1_ADC_BOOST 0x001f 4262306a36Sopenharmony_ci#define RT5668_HP_IMP_GAIN_1 0x0022 4362306a36Sopenharmony_ci#define RT5668_HP_IMP_GAIN_2 0x0023 4462306a36Sopenharmony_ci/* Mixer - D-D */ 4562306a36Sopenharmony_ci#define RT5668_SIDETONE_CTRL 0x0024 4662306a36Sopenharmony_ci#define RT5668_STO1_ADC_MIXER 0x0026 4762306a36Sopenharmony_ci#define RT5668_AD_DA_MIXER 0x0029 4862306a36Sopenharmony_ci#define RT5668_STO1_DAC_MIXER 0x002a 4962306a36Sopenharmony_ci#define RT5668_A_DAC1_MUX 0x002b 5062306a36Sopenharmony_ci#define RT5668_DIG_INF2_DATA 0x0030 5162306a36Sopenharmony_ci/* Mixer - ADC */ 5262306a36Sopenharmony_ci#define RT5668_REC_MIXER 0x003c 5362306a36Sopenharmony_ci#define RT5668_CAL_REC 0x0044 5462306a36Sopenharmony_ci#define RT5668_ALC_BACK_GAIN 0x0049 5562306a36Sopenharmony_ci/* Power */ 5662306a36Sopenharmony_ci#define RT5668_PWR_DIG_1 0x0061 5762306a36Sopenharmony_ci#define RT5668_PWR_DIG_2 0x0062 5862306a36Sopenharmony_ci#define RT5668_PWR_ANLG_1 0x0063 5962306a36Sopenharmony_ci#define RT5668_PWR_ANLG_2 0x0064 6062306a36Sopenharmony_ci#define RT5668_PWR_ANLG_3 0x0065 6162306a36Sopenharmony_ci#define RT5668_PWR_MIXER 0x0066 6262306a36Sopenharmony_ci#define RT5668_PWR_VOL 0x0067 6362306a36Sopenharmony_ci/* Clock Detect */ 6462306a36Sopenharmony_ci#define RT5668_CLK_DET 0x006b 6562306a36Sopenharmony_ci/* Filter Auto Reset */ 6662306a36Sopenharmony_ci#define RT5668_RESET_LPF_CTRL 0x006c 6762306a36Sopenharmony_ci#define RT5668_RESET_HPF_CTRL 0x006d 6862306a36Sopenharmony_ci/* DMIC */ 6962306a36Sopenharmony_ci#define RT5668_DMIC_CTRL_1 0x006e 7062306a36Sopenharmony_ci/* Format - ADC/DAC */ 7162306a36Sopenharmony_ci#define RT5668_I2S1_SDP 0x0070 7262306a36Sopenharmony_ci#define RT5668_I2S2_SDP 0x0071 7362306a36Sopenharmony_ci#define RT5668_ADDA_CLK_1 0x0073 7462306a36Sopenharmony_ci#define RT5668_ADDA_CLK_2 0x0074 7562306a36Sopenharmony_ci#define RT5668_I2S1_F_DIV_CTRL_1 0x0075 7662306a36Sopenharmony_ci#define RT5668_I2S1_F_DIV_CTRL_2 0x0076 7762306a36Sopenharmony_ci/* Format - TDM Control */ 7862306a36Sopenharmony_ci#define RT5668_TDM_CTRL 0x0079 7962306a36Sopenharmony_ci#define RT5668_TDM_ADDA_CTRL_1 0x007a 8062306a36Sopenharmony_ci#define RT5668_TDM_ADDA_CTRL_2 0x007b 8162306a36Sopenharmony_ci#define RT5668_DATA_SEL_CTRL_1 0x007c 8262306a36Sopenharmony_ci#define RT5668_TDM_TCON_CTRL 0x007e 8362306a36Sopenharmony_ci/* Function - Analog */ 8462306a36Sopenharmony_ci#define RT5668_GLB_CLK 0x0080 8562306a36Sopenharmony_ci#define RT5668_PLL_CTRL_1 0x0081 8662306a36Sopenharmony_ci#define RT5668_PLL_CTRL_2 0x0082 8762306a36Sopenharmony_ci#define RT5668_PLL_TRACK_1 0x0083 8862306a36Sopenharmony_ci#define RT5668_PLL_TRACK_2 0x0084 8962306a36Sopenharmony_ci#define RT5668_PLL_TRACK_3 0x0085 9062306a36Sopenharmony_ci#define RT5668_PLL_TRACK_4 0x0086 9162306a36Sopenharmony_ci#define RT5668_PLL_TRACK_5 0x0087 9262306a36Sopenharmony_ci#define RT5668_PLL_TRACK_6 0x0088 9362306a36Sopenharmony_ci#define RT5668_PLL_TRACK_11 0x008c 9462306a36Sopenharmony_ci#define RT5668_SDW_REF_CLK 0x008d 9562306a36Sopenharmony_ci#define RT5668_DEPOP_1 0x008e 9662306a36Sopenharmony_ci#define RT5668_DEPOP_2 0x008f 9762306a36Sopenharmony_ci#define RT5668_HP_CHARGE_PUMP_1 0x0091 9862306a36Sopenharmony_ci#define RT5668_HP_CHARGE_PUMP_2 0x0092 9962306a36Sopenharmony_ci#define RT5668_MICBIAS_1 0x0093 10062306a36Sopenharmony_ci#define RT5668_MICBIAS_2 0x0094 10162306a36Sopenharmony_ci#define RT5668_PLL_TRACK_12 0x0098 10262306a36Sopenharmony_ci#define RT5668_PLL_TRACK_14 0x009a 10362306a36Sopenharmony_ci#define RT5668_PLL2_CTRL_1 0x009b 10462306a36Sopenharmony_ci#define RT5668_PLL2_CTRL_2 0x009c 10562306a36Sopenharmony_ci#define RT5668_PLL2_CTRL_3 0x009d 10662306a36Sopenharmony_ci#define RT5668_PLL2_CTRL_4 0x009e 10762306a36Sopenharmony_ci#define RT5668_RC_CLK_CTRL 0x009f 10862306a36Sopenharmony_ci#define RT5668_I2S_M_CLK_CTRL_1 0x00a0 10962306a36Sopenharmony_ci#define RT5668_I2S2_F_DIV_CTRL_1 0x00a3 11062306a36Sopenharmony_ci#define RT5668_I2S2_F_DIV_CTRL_2 0x00a4 11162306a36Sopenharmony_ci/* Function - Digital */ 11262306a36Sopenharmony_ci#define RT5668_EQ_CTRL_1 0x00ae 11362306a36Sopenharmony_ci#define RT5668_EQ_CTRL_2 0x00af 11462306a36Sopenharmony_ci#define RT5668_IRQ_CTRL_1 0x00b6 11562306a36Sopenharmony_ci#define RT5668_IRQ_CTRL_2 0x00b7 11662306a36Sopenharmony_ci#define RT5668_IRQ_CTRL_3 0x00b8 11762306a36Sopenharmony_ci#define RT5668_IRQ_CTRL_4 0x00b9 11862306a36Sopenharmony_ci#define RT5668_INT_ST_1 0x00be 11962306a36Sopenharmony_ci#define RT5668_GPIO_CTRL_1 0x00c0 12062306a36Sopenharmony_ci#define RT5668_GPIO_CTRL_2 0x00c1 12162306a36Sopenharmony_ci#define RT5668_GPIO_CTRL_3 0x00c2 12262306a36Sopenharmony_ci#define RT5668_HP_AMP_DET_CTRL_1 0x00d0 12362306a36Sopenharmony_ci#define RT5668_HP_AMP_DET_CTRL_2 0x00d1 12462306a36Sopenharmony_ci#define RT5668_MID_HP_AMP_DET 0x00d2 12562306a36Sopenharmony_ci#define RT5668_LOW_HP_AMP_DET 0x00d3 12662306a36Sopenharmony_ci#define RT5668_DELAY_BUF_CTRL 0x00d4 12762306a36Sopenharmony_ci#define RT5668_SV_ZCD_1 0x00d9 12862306a36Sopenharmony_ci#define RT5668_SV_ZCD_2 0x00da 12962306a36Sopenharmony_ci#define RT5668_IL_CMD_1 0x00db 13062306a36Sopenharmony_ci#define RT5668_IL_CMD_2 0x00dc 13162306a36Sopenharmony_ci#define RT5668_IL_CMD_3 0x00dd 13262306a36Sopenharmony_ci#define RT5668_IL_CMD_4 0x00de 13362306a36Sopenharmony_ci#define RT5668_IL_CMD_5 0x00df 13462306a36Sopenharmony_ci#define RT5668_IL_CMD_6 0x00e0 13562306a36Sopenharmony_ci#define RT5668_4BTN_IL_CMD_1 0x00e2 13662306a36Sopenharmony_ci#define RT5668_4BTN_IL_CMD_2 0x00e3 13762306a36Sopenharmony_ci#define RT5668_4BTN_IL_CMD_3 0x00e4 13862306a36Sopenharmony_ci#define RT5668_4BTN_IL_CMD_4 0x00e5 13962306a36Sopenharmony_ci#define RT5668_4BTN_IL_CMD_5 0x00e6 14062306a36Sopenharmony_ci#define RT5668_4BTN_IL_CMD_6 0x00e7 14162306a36Sopenharmony_ci#define RT5668_4BTN_IL_CMD_7 0x00e8 14262306a36Sopenharmony_ci 14362306a36Sopenharmony_ci#define RT5668_ADC_STO1_HP_CTRL_1 0x00ea 14462306a36Sopenharmony_ci#define RT5668_ADC_STO1_HP_CTRL_2 0x00eb 14562306a36Sopenharmony_ci#define RT5668_AJD1_CTRL 0x00f0 14662306a36Sopenharmony_ci#define RT5668_JD1_THD 0x00f1 14762306a36Sopenharmony_ci#define RT5668_JD2_THD 0x00f2 14862306a36Sopenharmony_ci#define RT5668_JD_CTRL_1 0x00f6 14962306a36Sopenharmony_ci/* General Control */ 15062306a36Sopenharmony_ci#define RT5668_DUMMY_1 0x00fa 15162306a36Sopenharmony_ci#define RT5668_DUMMY_2 0x00fb 15262306a36Sopenharmony_ci#define RT5668_DUMMY_3 0x00fc 15362306a36Sopenharmony_ci 15462306a36Sopenharmony_ci#define RT5668_DAC_ADC_DIG_VOL1 0x0100 15562306a36Sopenharmony_ci#define RT5668_BIAS_CUR_CTRL_2 0x010b 15662306a36Sopenharmony_ci#define RT5668_BIAS_CUR_CTRL_3 0x010c 15762306a36Sopenharmony_ci#define RT5668_BIAS_CUR_CTRL_4 0x010d 15862306a36Sopenharmony_ci#define RT5668_BIAS_CUR_CTRL_5 0x010e 15962306a36Sopenharmony_ci#define RT5668_BIAS_CUR_CTRL_6 0x010f 16062306a36Sopenharmony_ci#define RT5668_BIAS_CUR_CTRL_7 0x0110 16162306a36Sopenharmony_ci#define RT5668_BIAS_CUR_CTRL_8 0x0111 16262306a36Sopenharmony_ci#define RT5668_BIAS_CUR_CTRL_9 0x0112 16362306a36Sopenharmony_ci#define RT5668_BIAS_CUR_CTRL_10 0x0113 16462306a36Sopenharmony_ci#define RT5668_VREF_REC_OP_FB_CAP_CTRL 0x0117 16562306a36Sopenharmony_ci#define RT5668_CHARGE_PUMP_1 0x0125 16662306a36Sopenharmony_ci#define RT5668_DIG_IN_CTRL_1 0x0132 16762306a36Sopenharmony_ci#define RT5668_PAD_DRIVING_CTRL 0x0136 16862306a36Sopenharmony_ci#define RT5668_SOFT_RAMP_DEPOP 0x0138 16962306a36Sopenharmony_ci#define RT5668_CHOP_DAC 0x013a 17062306a36Sopenharmony_ci#define RT5668_CHOP_ADC 0x013b 17162306a36Sopenharmony_ci#define RT5668_CALIB_ADC_CTRL 0x013c 17262306a36Sopenharmony_ci#define RT5668_VOL_TEST 0x013f 17362306a36Sopenharmony_ci#define RT5668_SPKVDD_DET_STA 0x0142 17462306a36Sopenharmony_ci#define RT5668_TEST_MODE_CTRL_1 0x0145 17562306a36Sopenharmony_ci#define RT5668_TEST_MODE_CTRL_2 0x0146 17662306a36Sopenharmony_ci#define RT5668_TEST_MODE_CTRL_3 0x0147 17762306a36Sopenharmony_ci#define RT5668_TEST_MODE_CTRL_4 0x0148 17862306a36Sopenharmony_ci#define RT5668_TEST_MODE_CTRL_5 0x0149 17962306a36Sopenharmony_ci#define RT5668_PLL1_INTERNAL 0x0150 18062306a36Sopenharmony_ci#define RT5668_PLL2_INTERNAL 0x0151 18162306a36Sopenharmony_ci#define RT5668_STO_NG2_CTRL_1 0x0160 18262306a36Sopenharmony_ci#define RT5668_STO_NG2_CTRL_2 0x0161 18362306a36Sopenharmony_ci#define RT5668_STO_NG2_CTRL_3 0x0162 18462306a36Sopenharmony_ci#define RT5668_STO_NG2_CTRL_4 0x0163 18562306a36Sopenharmony_ci#define RT5668_STO_NG2_CTRL_5 0x0164 18662306a36Sopenharmony_ci#define RT5668_STO_NG2_CTRL_6 0x0165 18762306a36Sopenharmony_ci#define RT5668_STO_NG2_CTRL_7 0x0166 18862306a36Sopenharmony_ci#define RT5668_STO_NG2_CTRL_8 0x0167 18962306a36Sopenharmony_ci#define RT5668_STO_NG2_CTRL_9 0x0168 19062306a36Sopenharmony_ci#define RT5668_STO_NG2_CTRL_10 0x0169 19162306a36Sopenharmony_ci#define RT5668_STO1_DAC_SIL_DET 0x0190 19262306a36Sopenharmony_ci#define RT5668_SIL_PSV_CTRL1 0x0194 19362306a36Sopenharmony_ci#define RT5668_SIL_PSV_CTRL2 0x0195 19462306a36Sopenharmony_ci#define RT5668_SIL_PSV_CTRL3 0x0197 19562306a36Sopenharmony_ci#define RT5668_SIL_PSV_CTRL4 0x0198 19662306a36Sopenharmony_ci#define RT5668_SIL_PSV_CTRL5 0x0199 19762306a36Sopenharmony_ci#define RT5668_HP_IMP_SENS_CTRL_01 0x01af 19862306a36Sopenharmony_ci#define RT5668_HP_IMP_SENS_CTRL_02 0x01b0 19962306a36Sopenharmony_ci#define RT5668_HP_IMP_SENS_CTRL_03 0x01b1 20062306a36Sopenharmony_ci#define RT5668_HP_IMP_SENS_CTRL_04 0x01b2 20162306a36Sopenharmony_ci#define RT5668_HP_IMP_SENS_CTRL_05 0x01b3 20262306a36Sopenharmony_ci#define RT5668_HP_IMP_SENS_CTRL_06 0x01b4 20362306a36Sopenharmony_ci#define RT5668_HP_IMP_SENS_CTRL_07 0x01b5 20462306a36Sopenharmony_ci#define RT5668_HP_IMP_SENS_CTRL_08 0x01b6 20562306a36Sopenharmony_ci#define RT5668_HP_IMP_SENS_CTRL_09 0x01b7 20662306a36Sopenharmony_ci#define RT5668_HP_IMP_SENS_CTRL_10 0x01b8 20762306a36Sopenharmony_ci#define RT5668_HP_IMP_SENS_CTRL_11 0x01b9 20862306a36Sopenharmony_ci#define RT5668_HP_IMP_SENS_CTRL_12 0x01ba 20962306a36Sopenharmony_ci#define RT5668_HP_IMP_SENS_CTRL_13 0x01bb 21062306a36Sopenharmony_ci#define RT5668_HP_IMP_SENS_CTRL_14 0x01bc 21162306a36Sopenharmony_ci#define RT5668_HP_IMP_SENS_CTRL_15 0x01bd 21262306a36Sopenharmony_ci#define RT5668_HP_IMP_SENS_CTRL_16 0x01be 21362306a36Sopenharmony_ci#define RT5668_HP_IMP_SENS_CTRL_17 0x01bf 21462306a36Sopenharmony_ci#define RT5668_HP_IMP_SENS_CTRL_18 0x01c0 21562306a36Sopenharmony_ci#define RT5668_HP_IMP_SENS_CTRL_19 0x01c1 21662306a36Sopenharmony_ci#define RT5668_HP_IMP_SENS_CTRL_20 0x01c2 21762306a36Sopenharmony_ci#define RT5668_HP_IMP_SENS_CTRL_21 0x01c3 21862306a36Sopenharmony_ci#define RT5668_HP_IMP_SENS_CTRL_22 0x01c4 21962306a36Sopenharmony_ci#define RT5668_HP_IMP_SENS_CTRL_23 0x01c5 22062306a36Sopenharmony_ci#define RT5668_HP_IMP_SENS_CTRL_24 0x01c6 22162306a36Sopenharmony_ci#define RT5668_HP_IMP_SENS_CTRL_25 0x01c7 22262306a36Sopenharmony_ci#define RT5668_HP_IMP_SENS_CTRL_26 0x01c8 22362306a36Sopenharmony_ci#define RT5668_HP_IMP_SENS_CTRL_27 0x01c9 22462306a36Sopenharmony_ci#define RT5668_HP_IMP_SENS_CTRL_28 0x01ca 22562306a36Sopenharmony_ci#define RT5668_HP_IMP_SENS_CTRL_29 0x01cb 22662306a36Sopenharmony_ci#define RT5668_HP_IMP_SENS_CTRL_30 0x01cc 22762306a36Sopenharmony_ci#define RT5668_HP_IMP_SENS_CTRL_31 0x01cd 22862306a36Sopenharmony_ci#define RT5668_HP_IMP_SENS_CTRL_32 0x01ce 22962306a36Sopenharmony_ci#define RT5668_HP_IMP_SENS_CTRL_33 0x01cf 23062306a36Sopenharmony_ci#define RT5668_HP_IMP_SENS_CTRL_34 0x01d0 23162306a36Sopenharmony_ci#define RT5668_HP_IMP_SENS_CTRL_35 0x01d1 23262306a36Sopenharmony_ci#define RT5668_HP_IMP_SENS_CTRL_36 0x01d2 23362306a36Sopenharmony_ci#define RT5668_HP_IMP_SENS_CTRL_37 0x01d3 23462306a36Sopenharmony_ci#define RT5668_HP_IMP_SENS_CTRL_38 0x01d4 23562306a36Sopenharmony_ci#define RT5668_HP_IMP_SENS_CTRL_39 0x01d5 23662306a36Sopenharmony_ci#define RT5668_HP_IMP_SENS_CTRL_40 0x01d6 23762306a36Sopenharmony_ci#define RT5668_HP_IMP_SENS_CTRL_41 0x01d7 23862306a36Sopenharmony_ci#define RT5668_HP_IMP_SENS_CTRL_42 0x01d8 23962306a36Sopenharmony_ci#define RT5668_HP_IMP_SENS_CTRL_43 0x01d9 24062306a36Sopenharmony_ci#define RT5668_HP_LOGIC_CTRL_1 0x01da 24162306a36Sopenharmony_ci#define RT5668_HP_LOGIC_CTRL_2 0x01db 24262306a36Sopenharmony_ci#define RT5668_HP_LOGIC_CTRL_3 0x01dc 24362306a36Sopenharmony_ci#define RT5668_HP_CALIB_CTRL_1 0x01de 24462306a36Sopenharmony_ci#define RT5668_HP_CALIB_CTRL_2 0x01df 24562306a36Sopenharmony_ci#define RT5668_HP_CALIB_CTRL_3 0x01e0 24662306a36Sopenharmony_ci#define RT5668_HP_CALIB_CTRL_4 0x01e1 24762306a36Sopenharmony_ci#define RT5668_HP_CALIB_CTRL_5 0x01e2 24862306a36Sopenharmony_ci#define RT5668_HP_CALIB_CTRL_6 0x01e3 24962306a36Sopenharmony_ci#define RT5668_HP_CALIB_CTRL_7 0x01e4 25062306a36Sopenharmony_ci#define RT5668_HP_CALIB_CTRL_9 0x01e6 25162306a36Sopenharmony_ci#define RT5668_HP_CALIB_CTRL_10 0x01e7 25262306a36Sopenharmony_ci#define RT5668_HP_CALIB_CTRL_11 0x01e8 25362306a36Sopenharmony_ci#define RT5668_HP_CALIB_STA_1 0x01ea 25462306a36Sopenharmony_ci#define RT5668_HP_CALIB_STA_2 0x01eb 25562306a36Sopenharmony_ci#define RT5668_HP_CALIB_STA_3 0x01ec 25662306a36Sopenharmony_ci#define RT5668_HP_CALIB_STA_4 0x01ed 25762306a36Sopenharmony_ci#define RT5668_HP_CALIB_STA_5 0x01ee 25862306a36Sopenharmony_ci#define RT5668_HP_CALIB_STA_6 0x01ef 25962306a36Sopenharmony_ci#define RT5668_HP_CALIB_STA_7 0x01f0 26062306a36Sopenharmony_ci#define RT5668_HP_CALIB_STA_8 0x01f1 26162306a36Sopenharmony_ci#define RT5668_HP_CALIB_STA_9 0x01f2 26262306a36Sopenharmony_ci#define RT5668_HP_CALIB_STA_10 0x01f3 26362306a36Sopenharmony_ci#define RT5668_HP_CALIB_STA_11 0x01f4 26462306a36Sopenharmony_ci#define RT5668_SAR_IL_CMD_1 0x0210 26562306a36Sopenharmony_ci#define RT5668_SAR_IL_CMD_2 0x0211 26662306a36Sopenharmony_ci#define RT5668_SAR_IL_CMD_3 0x0212 26762306a36Sopenharmony_ci#define RT5668_SAR_IL_CMD_4 0x0213 26862306a36Sopenharmony_ci#define RT5668_SAR_IL_CMD_5 0x0214 26962306a36Sopenharmony_ci#define RT5668_SAR_IL_CMD_6 0x0215 27062306a36Sopenharmony_ci#define RT5668_SAR_IL_CMD_7 0x0216 27162306a36Sopenharmony_ci#define RT5668_SAR_IL_CMD_8 0x0217 27262306a36Sopenharmony_ci#define RT5668_SAR_IL_CMD_9 0x0218 27362306a36Sopenharmony_ci#define RT5668_SAR_IL_CMD_10 0x0219 27462306a36Sopenharmony_ci#define RT5668_SAR_IL_CMD_11 0x021a 27562306a36Sopenharmony_ci#define RT5668_SAR_IL_CMD_12 0x021b 27662306a36Sopenharmony_ci#define RT5668_SAR_IL_CMD_13 0x021c 27762306a36Sopenharmony_ci#define RT5668_EFUSE_CTRL_1 0x0250 27862306a36Sopenharmony_ci#define RT5668_EFUSE_CTRL_2 0x0251 27962306a36Sopenharmony_ci#define RT5668_EFUSE_CTRL_3 0x0252 28062306a36Sopenharmony_ci#define RT5668_EFUSE_CTRL_4 0x0253 28162306a36Sopenharmony_ci#define RT5668_EFUSE_CTRL_5 0x0254 28262306a36Sopenharmony_ci#define RT5668_EFUSE_CTRL_6 0x0255 28362306a36Sopenharmony_ci#define RT5668_EFUSE_CTRL_7 0x0256 28462306a36Sopenharmony_ci#define RT5668_EFUSE_CTRL_8 0x0257 28562306a36Sopenharmony_ci#define RT5668_EFUSE_CTRL_9 0x0258 28662306a36Sopenharmony_ci#define RT5668_EFUSE_CTRL_10 0x0259 28762306a36Sopenharmony_ci#define RT5668_EFUSE_CTRL_11 0x025a 28862306a36Sopenharmony_ci#define RT5668_JD_TOP_VC_VTRL 0x0270 28962306a36Sopenharmony_ci#define RT5668_DRC1_CTRL_0 0x02ff 29062306a36Sopenharmony_ci#define RT5668_DRC1_CTRL_1 0x0300 29162306a36Sopenharmony_ci#define RT5668_DRC1_CTRL_2 0x0301 29262306a36Sopenharmony_ci#define RT5668_DRC1_CTRL_3 0x0302 29362306a36Sopenharmony_ci#define RT5668_DRC1_CTRL_4 0x0303 29462306a36Sopenharmony_ci#define RT5668_DRC1_CTRL_5 0x0304 29562306a36Sopenharmony_ci#define RT5668_DRC1_CTRL_6 0x0305 29662306a36Sopenharmony_ci#define RT5668_DRC1_HARD_LMT_CTRL_1 0x0306 29762306a36Sopenharmony_ci#define RT5668_DRC1_HARD_LMT_CTRL_2 0x0307 29862306a36Sopenharmony_ci#define RT5668_DRC1_PRIV_1 0x0310 29962306a36Sopenharmony_ci#define RT5668_DRC1_PRIV_2 0x0311 30062306a36Sopenharmony_ci#define RT5668_DRC1_PRIV_3 0x0312 30162306a36Sopenharmony_ci#define RT5668_DRC1_PRIV_4 0x0313 30262306a36Sopenharmony_ci#define RT5668_DRC1_PRIV_5 0x0314 30362306a36Sopenharmony_ci#define RT5668_DRC1_PRIV_6 0x0315 30462306a36Sopenharmony_ci#define RT5668_DRC1_PRIV_7 0x0316 30562306a36Sopenharmony_ci#define RT5668_DRC1_PRIV_8 0x0317 30662306a36Sopenharmony_ci#define RT5668_EQ_AUTO_RCV_CTRL1 0x03c0 30762306a36Sopenharmony_ci#define RT5668_EQ_AUTO_RCV_CTRL2 0x03c1 30862306a36Sopenharmony_ci#define RT5668_EQ_AUTO_RCV_CTRL3 0x03c2 30962306a36Sopenharmony_ci#define RT5668_EQ_AUTO_RCV_CTRL4 0x03c3 31062306a36Sopenharmony_ci#define RT5668_EQ_AUTO_RCV_CTRL5 0x03c4 31162306a36Sopenharmony_ci#define RT5668_EQ_AUTO_RCV_CTRL6 0x03c5 31262306a36Sopenharmony_ci#define RT5668_EQ_AUTO_RCV_CTRL7 0x03c6 31362306a36Sopenharmony_ci#define RT5668_EQ_AUTO_RCV_CTRL8 0x03c7 31462306a36Sopenharmony_ci#define RT5668_EQ_AUTO_RCV_CTRL9 0x03c8 31562306a36Sopenharmony_ci#define RT5668_EQ_AUTO_RCV_CTRL10 0x03c9 31662306a36Sopenharmony_ci#define RT5668_EQ_AUTO_RCV_CTRL11 0x03ca 31762306a36Sopenharmony_ci#define RT5668_EQ_AUTO_RCV_CTRL12 0x03cb 31862306a36Sopenharmony_ci#define RT5668_EQ_AUTO_RCV_CTRL13 0x03cc 31962306a36Sopenharmony_ci#define RT5668_ADC_L_EQ_LPF1_A1 0x03d0 32062306a36Sopenharmony_ci#define RT5668_R_EQ_LPF1_A1 0x03d1 32162306a36Sopenharmony_ci#define RT5668_L_EQ_LPF1_H0 0x03d2 32262306a36Sopenharmony_ci#define RT5668_R_EQ_LPF1_H0 0x03d3 32362306a36Sopenharmony_ci#define RT5668_L_EQ_BPF1_A1 0x03d4 32462306a36Sopenharmony_ci#define RT5668_R_EQ_BPF1_A1 0x03d5 32562306a36Sopenharmony_ci#define RT5668_L_EQ_BPF1_A2 0x03d6 32662306a36Sopenharmony_ci#define RT5668_R_EQ_BPF1_A2 0x03d7 32762306a36Sopenharmony_ci#define RT5668_L_EQ_BPF1_H0 0x03d8 32862306a36Sopenharmony_ci#define RT5668_R_EQ_BPF1_H0 0x03d9 32962306a36Sopenharmony_ci#define RT5668_L_EQ_BPF2_A1 0x03da 33062306a36Sopenharmony_ci#define RT5668_R_EQ_BPF2_A1 0x03db 33162306a36Sopenharmony_ci#define RT5668_L_EQ_BPF2_A2 0x03dc 33262306a36Sopenharmony_ci#define RT5668_R_EQ_BPF2_A2 0x03dd 33362306a36Sopenharmony_ci#define RT5668_L_EQ_BPF2_H0 0x03de 33462306a36Sopenharmony_ci#define RT5668_R_EQ_BPF2_H0 0x03df 33562306a36Sopenharmony_ci#define RT5668_L_EQ_BPF3_A1 0x03e0 33662306a36Sopenharmony_ci#define RT5668_R_EQ_BPF3_A1 0x03e1 33762306a36Sopenharmony_ci#define RT5668_L_EQ_BPF3_A2 0x03e2 33862306a36Sopenharmony_ci#define RT5668_R_EQ_BPF3_A2 0x03e3 33962306a36Sopenharmony_ci#define RT5668_L_EQ_BPF3_H0 0x03e4 34062306a36Sopenharmony_ci#define RT5668_R_EQ_BPF3_H0 0x03e5 34162306a36Sopenharmony_ci#define RT5668_L_EQ_BPF4_A1 0x03e6 34262306a36Sopenharmony_ci#define RT5668_R_EQ_BPF4_A1 0x03e7 34362306a36Sopenharmony_ci#define RT5668_L_EQ_BPF4_A2 0x03e8 34462306a36Sopenharmony_ci#define RT5668_R_EQ_BPF4_A2 0x03e9 34562306a36Sopenharmony_ci#define RT5668_L_EQ_BPF4_H0 0x03ea 34662306a36Sopenharmony_ci#define RT5668_R_EQ_BPF4_H0 0x03eb 34762306a36Sopenharmony_ci#define RT5668_L_EQ_HPF1_A1 0x03ec 34862306a36Sopenharmony_ci#define RT5668_R_EQ_HPF1_A1 0x03ed 34962306a36Sopenharmony_ci#define RT5668_L_EQ_HPF1_H0 0x03ee 35062306a36Sopenharmony_ci#define RT5668_R_EQ_HPF1_H0 0x03ef 35162306a36Sopenharmony_ci#define RT5668_L_EQ_PRE_VOL 0x03f0 35262306a36Sopenharmony_ci#define RT5668_R_EQ_PRE_VOL 0x03f1 35362306a36Sopenharmony_ci#define RT5668_L_EQ_POST_VOL 0x03f2 35462306a36Sopenharmony_ci#define RT5668_R_EQ_POST_VOL 0x03f3 35562306a36Sopenharmony_ci#define RT5668_I2C_MODE 0xffff 35662306a36Sopenharmony_ci 35762306a36Sopenharmony_ci 35862306a36Sopenharmony_ci/* global definition */ 35962306a36Sopenharmony_ci#define RT5668_L_MUTE (0x1 << 15) 36062306a36Sopenharmony_ci#define RT5668_L_MUTE_SFT 15 36162306a36Sopenharmony_ci#define RT5668_VOL_L_MUTE (0x1 << 14) 36262306a36Sopenharmony_ci#define RT5668_VOL_L_SFT 14 36362306a36Sopenharmony_ci#define RT5668_R_MUTE (0x1 << 7) 36462306a36Sopenharmony_ci#define RT5668_R_MUTE_SFT 7 36562306a36Sopenharmony_ci#define RT5668_VOL_R_MUTE (0x1 << 6) 36662306a36Sopenharmony_ci#define RT5668_VOL_R_SFT 6 36762306a36Sopenharmony_ci#define RT5668_L_VOL_MASK (0x3f << 8) 36862306a36Sopenharmony_ci#define RT5668_L_VOL_SFT 8 36962306a36Sopenharmony_ci#define RT5668_R_VOL_MASK (0x3f) 37062306a36Sopenharmony_ci#define RT5668_R_VOL_SFT 0 37162306a36Sopenharmony_ci 37262306a36Sopenharmony_ci/*Headphone Amp L/R Analog Gain and Digital NG2 Gain Control (0x0005 0x0006)*/ 37362306a36Sopenharmony_ci#define RT5668_G_HP (0xf << 8) 37462306a36Sopenharmony_ci#define RT5668_G_HP_SFT 8 37562306a36Sopenharmony_ci#define RT5668_G_STO_DA_DMIX (0xf) 37662306a36Sopenharmony_ci#define RT5668_G_STO_DA_SFT 0 37762306a36Sopenharmony_ci 37862306a36Sopenharmony_ci/* CBJ Control (0x000b) */ 37962306a36Sopenharmony_ci#define RT5668_BST_CBJ_MASK (0xf << 8) 38062306a36Sopenharmony_ci#define RT5668_BST_CBJ_SFT 8 38162306a36Sopenharmony_ci 38262306a36Sopenharmony_ci/* Embeeded Jack and Type Detection Control 1 (0x0010) */ 38362306a36Sopenharmony_ci#define RT5668_EMB_JD_EN (0x1 << 15) 38462306a36Sopenharmony_ci#define RT5668_EMB_JD_EN_SFT 15 38562306a36Sopenharmony_ci#define RT5668_EMB_JD_RST (0x1 << 14) 38662306a36Sopenharmony_ci#define RT5668_JD_MODE (0x1 << 13) 38762306a36Sopenharmony_ci#define RT5668_JD_MODE_SFT 13 38862306a36Sopenharmony_ci#define RT5668_DET_TYPE (0x1 << 12) 38962306a36Sopenharmony_ci#define RT5668_DET_TYPE_SFT 12 39062306a36Sopenharmony_ci#define RT5668_POLA_EXT_JD_MASK (0x1 << 11) 39162306a36Sopenharmony_ci#define RT5668_POLA_EXT_JD_LOW (0x1 << 11) 39262306a36Sopenharmony_ci#define RT5668_POLA_EXT_JD_HIGH (0x0 << 11) 39362306a36Sopenharmony_ci#define RT5668_EXT_JD_DIG (0x1 << 9) 39462306a36Sopenharmony_ci#define RT5668_POL_FAST_OFF_MASK (0x1 << 8) 39562306a36Sopenharmony_ci#define RT5668_POL_FAST_OFF_HIGH (0x1 << 8) 39662306a36Sopenharmony_ci#define RT5668_POL_FAST_OFF_LOW (0x0 << 8) 39762306a36Sopenharmony_ci#define RT5668_FAST_OFF_MASK (0x1 << 7) 39862306a36Sopenharmony_ci#define RT5668_FAST_OFF_EN (0x1 << 7) 39962306a36Sopenharmony_ci#define RT5668_FAST_OFF_DIS (0x0 << 7) 40062306a36Sopenharmony_ci#define RT5668_VREF_POW_MASK (0x1 << 6) 40162306a36Sopenharmony_ci#define RT5668_VREF_POW_FSM (0x0 << 6) 40262306a36Sopenharmony_ci#define RT5668_VREF_POW_REG (0x1 << 6) 40362306a36Sopenharmony_ci#define RT5668_MB1_PATH_MASK (0x1 << 5) 40462306a36Sopenharmony_ci#define RT5668_CTRL_MB1_REG (0x1 << 5) 40562306a36Sopenharmony_ci#define RT5668_CTRL_MB1_FSM (0x0 << 5) 40662306a36Sopenharmony_ci#define RT5668_MB2_PATH_MASK (0x1 << 4) 40762306a36Sopenharmony_ci#define RT5668_CTRL_MB2_REG (0x1 << 4) 40862306a36Sopenharmony_ci#define RT5668_CTRL_MB2_FSM (0x0 << 4) 40962306a36Sopenharmony_ci#define RT5668_TRIG_JD_MASK (0x1 << 3) 41062306a36Sopenharmony_ci#define RT5668_TRIG_JD_HIGH (0x1 << 3) 41162306a36Sopenharmony_ci#define RT5668_TRIG_JD_LOW (0x0 << 3) 41262306a36Sopenharmony_ci#define RT5668_MIC_CAP_MASK (0x1 << 1) 41362306a36Sopenharmony_ci#define RT5668_MIC_CAP_HS (0x1 << 1) 41462306a36Sopenharmony_ci#define RT5668_MIC_CAP_HP (0x0 << 1) 41562306a36Sopenharmony_ci#define RT5668_MIC_CAP_SRC_MASK (0x1) 41662306a36Sopenharmony_ci#define RT5668_MIC_CAP_SRC_REG (0x1) 41762306a36Sopenharmony_ci#define RT5668_MIC_CAP_SRC_ANA (0x0) 41862306a36Sopenharmony_ci 41962306a36Sopenharmony_ci/* Embeeded Jack and Type Detection Control 2 (0x0011) */ 42062306a36Sopenharmony_ci#define RT5668_EXT_JD_SRC (0x7 << 4) 42162306a36Sopenharmony_ci#define RT5668_EXT_JD_SRC_SFT 4 42262306a36Sopenharmony_ci#define RT5668_EXT_JD_SRC_GPIO_JD1 (0x0 << 4) 42362306a36Sopenharmony_ci#define RT5668_EXT_JD_SRC_GPIO_JD2 (0x1 << 4) 42462306a36Sopenharmony_ci#define RT5668_EXT_JD_SRC_JDH (0x2 << 4) 42562306a36Sopenharmony_ci#define RT5668_EXT_JD_SRC_JDL (0x3 << 4) 42662306a36Sopenharmony_ci#define RT5668_EXT_JD_SRC_MANUAL (0x4 << 4) 42762306a36Sopenharmony_ci#define RT5668_JACK_TYPE_MASK (0x3) 42862306a36Sopenharmony_ci 42962306a36Sopenharmony_ci/* Combo Jack and Type Detection Control 3 (0x0012) */ 43062306a36Sopenharmony_ci#define RT5668_CBJ_IN_BUF_EN (0x1 << 7) 43162306a36Sopenharmony_ci 43262306a36Sopenharmony_ci/* Combo Jack and Type Detection Control 4 (0x0013) */ 43362306a36Sopenharmony_ci#define RT5668_SEL_SHT_MID_TON_MASK (0x3 << 12) 43462306a36Sopenharmony_ci#define RT5668_SEL_SHT_MID_TON_2 (0x0 << 12) 43562306a36Sopenharmony_ci#define RT5668_SEL_SHT_MID_TON_3 (0x1 << 12) 43662306a36Sopenharmony_ci#define RT5668_CBJ_JD_TEST_MASK (0x1 << 6) 43762306a36Sopenharmony_ci#define RT5668_CBJ_JD_TEST_NORM (0x0 << 6) 43862306a36Sopenharmony_ci#define RT5668_CBJ_JD_TEST_MODE (0x1 << 6) 43962306a36Sopenharmony_ci 44062306a36Sopenharmony_ci/* DAC1 Digital Volume (0x0019) */ 44162306a36Sopenharmony_ci#define RT5668_DAC_L1_VOL_MASK (0xff << 8) 44262306a36Sopenharmony_ci#define RT5668_DAC_L1_VOL_SFT 8 44362306a36Sopenharmony_ci#define RT5668_DAC_R1_VOL_MASK (0xff) 44462306a36Sopenharmony_ci#define RT5668_DAC_R1_VOL_SFT 0 44562306a36Sopenharmony_ci 44662306a36Sopenharmony_ci/* ADC Digital Volume Control (0x001c) */ 44762306a36Sopenharmony_ci#define RT5668_ADC_L_VOL_MASK (0x7f << 8) 44862306a36Sopenharmony_ci#define RT5668_ADC_L_VOL_SFT 8 44962306a36Sopenharmony_ci#define RT5668_ADC_R_VOL_MASK (0x7f) 45062306a36Sopenharmony_ci#define RT5668_ADC_R_VOL_SFT 0 45162306a36Sopenharmony_ci 45262306a36Sopenharmony_ci/* Stereo1 ADC Boost Gain Control (0x001f) */ 45362306a36Sopenharmony_ci#define RT5668_STO1_ADC_L_BST_MASK (0x3 << 14) 45462306a36Sopenharmony_ci#define RT5668_STO1_ADC_L_BST_SFT 14 45562306a36Sopenharmony_ci#define RT5668_STO1_ADC_R_BST_MASK (0x3 << 12) 45662306a36Sopenharmony_ci#define RT5668_STO1_ADC_R_BST_SFT 12 45762306a36Sopenharmony_ci 45862306a36Sopenharmony_ci/* Sidetone Control (0x0024) */ 45962306a36Sopenharmony_ci#define RT5668_ST_SRC_SEL (0x1 << 8) 46062306a36Sopenharmony_ci#define RT5668_ST_SRC_SFT 8 46162306a36Sopenharmony_ci#define RT5668_ST_EN_MASK (0x1 << 6) 46262306a36Sopenharmony_ci#define RT5668_ST_DIS (0x0 << 6) 46362306a36Sopenharmony_ci#define RT5668_ST_EN (0x1 << 6) 46462306a36Sopenharmony_ci#define RT5668_ST_EN_SFT 6 46562306a36Sopenharmony_ci 46662306a36Sopenharmony_ci/* Stereo1 ADC Mixer Control (0x0026) */ 46762306a36Sopenharmony_ci#define RT5668_M_STO1_ADC_L1 (0x1 << 15) 46862306a36Sopenharmony_ci#define RT5668_M_STO1_ADC_L1_SFT 15 46962306a36Sopenharmony_ci#define RT5668_M_STO1_ADC_L2 (0x1 << 14) 47062306a36Sopenharmony_ci#define RT5668_M_STO1_ADC_L2_SFT 14 47162306a36Sopenharmony_ci#define RT5668_STO1_ADC1L_SRC_MASK (0x1 << 13) 47262306a36Sopenharmony_ci#define RT5668_STO1_ADC1L_SRC_SFT 13 47362306a36Sopenharmony_ci#define RT5668_STO1_ADC1_SRC_ADC (0x1 << 13) 47462306a36Sopenharmony_ci#define RT5668_STO1_ADC1_SRC_DACMIX (0x0 << 13) 47562306a36Sopenharmony_ci#define RT5668_STO1_ADC2L_SRC_MASK (0x1 << 12) 47662306a36Sopenharmony_ci#define RT5668_STO1_ADC2L_SRC_SFT 12 47762306a36Sopenharmony_ci#define RT5668_STO1_ADCL_SRC_MASK (0x3 << 10) 47862306a36Sopenharmony_ci#define RT5668_STO1_ADCL_SRC_SFT 10 47962306a36Sopenharmony_ci#define RT5668_STO1_DD_L_SRC_MASK (0x1 << 9) 48062306a36Sopenharmony_ci#define RT5668_STO1_DD_L_SRC_SFT 9 48162306a36Sopenharmony_ci#define RT5668_STO1_DMIC_SRC_MASK (0x1 << 8) 48262306a36Sopenharmony_ci#define RT5668_STO1_DMIC_SRC_SFT 8 48362306a36Sopenharmony_ci#define RT5668_STO1_DMIC_SRC_DMIC2 (0x1 << 8) 48462306a36Sopenharmony_ci#define RT5668_STO1_DMIC_SRC_DMIC1 (0x0 << 8) 48562306a36Sopenharmony_ci#define RT5668_M_STO1_ADC_R1 (0x1 << 7) 48662306a36Sopenharmony_ci#define RT5668_M_STO1_ADC_R1_SFT 7 48762306a36Sopenharmony_ci#define RT5668_M_STO1_ADC_R2 (0x1 << 6) 48862306a36Sopenharmony_ci#define RT5668_M_STO1_ADC_R2_SFT 6 48962306a36Sopenharmony_ci#define RT5668_STO1_ADC1R_SRC_MASK (0x1 << 5) 49062306a36Sopenharmony_ci#define RT5668_STO1_ADC1R_SRC_SFT 5 49162306a36Sopenharmony_ci#define RT5668_STO1_ADC2R_SRC_MASK (0x1 << 4) 49262306a36Sopenharmony_ci#define RT5668_STO1_ADC2R_SRC_SFT 4 49362306a36Sopenharmony_ci#define RT5668_STO1_ADCR_SRC_MASK (0x3 << 2) 49462306a36Sopenharmony_ci#define RT5668_STO1_ADCR_SRC_SFT 2 49562306a36Sopenharmony_ci 49662306a36Sopenharmony_ci/* ADC Mixer to DAC Mixer Control (0x0029) */ 49762306a36Sopenharmony_ci#define RT5668_M_ADCMIX_L (0x1 << 15) 49862306a36Sopenharmony_ci#define RT5668_M_ADCMIX_L_SFT 15 49962306a36Sopenharmony_ci#define RT5668_M_DAC1_L (0x1 << 14) 50062306a36Sopenharmony_ci#define RT5668_M_DAC1_L_SFT 14 50162306a36Sopenharmony_ci#define RT5668_DAC1_R_SEL_MASK (0x1 << 10) 50262306a36Sopenharmony_ci#define RT5668_DAC1_R_SEL_SFT 10 50362306a36Sopenharmony_ci#define RT5668_DAC1_L_SEL_MASK (0x1 << 8) 50462306a36Sopenharmony_ci#define RT5668_DAC1_L_SEL_SFT 8 50562306a36Sopenharmony_ci#define RT5668_M_ADCMIX_R (0x1 << 7) 50662306a36Sopenharmony_ci#define RT5668_M_ADCMIX_R_SFT 7 50762306a36Sopenharmony_ci#define RT5668_M_DAC1_R (0x1 << 6) 50862306a36Sopenharmony_ci#define RT5668_M_DAC1_R_SFT 6 50962306a36Sopenharmony_ci 51062306a36Sopenharmony_ci/* Stereo1 DAC Mixer Control (0x002a) */ 51162306a36Sopenharmony_ci#define RT5668_M_DAC_L1_STO_L (0x1 << 15) 51262306a36Sopenharmony_ci#define RT5668_M_DAC_L1_STO_L_SFT 15 51362306a36Sopenharmony_ci#define RT5668_G_DAC_L1_STO_L_MASK (0x1 << 14) 51462306a36Sopenharmony_ci#define RT5668_G_DAC_L1_STO_L_SFT 14 51562306a36Sopenharmony_ci#define RT5668_M_DAC_R1_STO_L (0x1 << 13) 51662306a36Sopenharmony_ci#define RT5668_M_DAC_R1_STO_L_SFT 13 51762306a36Sopenharmony_ci#define RT5668_G_DAC_R1_STO_L_MASK (0x1 << 12) 51862306a36Sopenharmony_ci#define RT5668_G_DAC_R1_STO_L_SFT 12 51962306a36Sopenharmony_ci#define RT5668_M_DAC_L1_STO_R (0x1 << 7) 52062306a36Sopenharmony_ci#define RT5668_M_DAC_L1_STO_R_SFT 7 52162306a36Sopenharmony_ci#define RT5668_G_DAC_L1_STO_R_MASK (0x1 << 6) 52262306a36Sopenharmony_ci#define RT5668_G_DAC_L1_STO_R_SFT 6 52362306a36Sopenharmony_ci#define RT5668_M_DAC_R1_STO_R (0x1 << 5) 52462306a36Sopenharmony_ci#define RT5668_M_DAC_R1_STO_R_SFT 5 52562306a36Sopenharmony_ci#define RT5668_G_DAC_R1_STO_R_MASK (0x1 << 4) 52662306a36Sopenharmony_ci#define RT5668_G_DAC_R1_STO_R_SFT 4 52762306a36Sopenharmony_ci 52862306a36Sopenharmony_ci/* Analog DAC1 Input Source Control (0x002b) */ 52962306a36Sopenharmony_ci#define RT5668_M_ST_STO_L (0x1 << 9) 53062306a36Sopenharmony_ci#define RT5668_M_ST_STO_L_SFT 9 53162306a36Sopenharmony_ci#define RT5668_M_ST_STO_R (0x1 << 8) 53262306a36Sopenharmony_ci#define RT5668_M_ST_STO_R_SFT 8 53362306a36Sopenharmony_ci#define RT5668_DAC_L1_SRC_MASK (0x3 << 4) 53462306a36Sopenharmony_ci#define RT5668_A_DACL1_SFT 4 53562306a36Sopenharmony_ci#define RT5668_DAC_R1_SRC_MASK (0x3) 53662306a36Sopenharmony_ci#define RT5668_A_DACR1_SFT 0 53762306a36Sopenharmony_ci 53862306a36Sopenharmony_ci/* Digital Interface Data Control (0x0030) */ 53962306a36Sopenharmony_ci#define RT5668_IF2_ADC_SEL_MASK (0x3 << 0) 54062306a36Sopenharmony_ci#define RT5668_IF2_ADC_SEL_SFT 0 54162306a36Sopenharmony_ci 54262306a36Sopenharmony_ci/* REC Left Mixer Control 2 (0x003c) */ 54362306a36Sopenharmony_ci#define RT5668_G_CBJ_RM1_L (0x7 << 10) 54462306a36Sopenharmony_ci#define RT5668_G_CBJ_RM1_L_SFT 10 54562306a36Sopenharmony_ci#define RT5668_M_CBJ_RM1_L (0x1 << 7) 54662306a36Sopenharmony_ci#define RT5668_M_CBJ_RM1_L_SFT 7 54762306a36Sopenharmony_ci 54862306a36Sopenharmony_ci/* Power Management for Digital 1 (0x0061) */ 54962306a36Sopenharmony_ci#define RT5668_PWR_I2S1 (0x1 << 15) 55062306a36Sopenharmony_ci#define RT5668_PWR_I2S1_BIT 15 55162306a36Sopenharmony_ci#define RT5668_PWR_I2S2 (0x1 << 14) 55262306a36Sopenharmony_ci#define RT5668_PWR_I2S2_BIT 14 55362306a36Sopenharmony_ci#define RT5668_PWR_DAC_L1 (0x1 << 11) 55462306a36Sopenharmony_ci#define RT5668_PWR_DAC_L1_BIT 11 55562306a36Sopenharmony_ci#define RT5668_PWR_DAC_R1 (0x1 << 10) 55662306a36Sopenharmony_ci#define RT5668_PWR_DAC_R1_BIT 10 55762306a36Sopenharmony_ci#define RT5668_PWR_LDO (0x1 << 8) 55862306a36Sopenharmony_ci#define RT5668_PWR_LDO_BIT 8 55962306a36Sopenharmony_ci#define RT5668_PWR_ADC_L1 (0x1 << 4) 56062306a36Sopenharmony_ci#define RT5668_PWR_ADC_L1_BIT 4 56162306a36Sopenharmony_ci#define RT5668_PWR_ADC_R1 (0x1 << 3) 56262306a36Sopenharmony_ci#define RT5668_PWR_ADC_R1_BIT 3 56362306a36Sopenharmony_ci#define RT5668_DIG_GATE_CTRL (0x1 << 0) 56462306a36Sopenharmony_ci#define RT5668_DIG_GATE_CTRL_SFT 0 56562306a36Sopenharmony_ci 56662306a36Sopenharmony_ci 56762306a36Sopenharmony_ci/* Power Management for Digital 2 (0x0062) */ 56862306a36Sopenharmony_ci#define RT5668_PWR_ADC_S1F (0x1 << 15) 56962306a36Sopenharmony_ci#define RT5668_PWR_ADC_S1F_BIT 15 57062306a36Sopenharmony_ci#define RT5668_PWR_DAC_S1F (0x1 << 10) 57162306a36Sopenharmony_ci#define RT5668_PWR_DAC_S1F_BIT 10 57262306a36Sopenharmony_ci 57362306a36Sopenharmony_ci/* Power Management for Analog 1 (0x0063) */ 57462306a36Sopenharmony_ci#define RT5668_PWR_VREF1 (0x1 << 15) 57562306a36Sopenharmony_ci#define RT5668_PWR_VREF1_BIT 15 57662306a36Sopenharmony_ci#define RT5668_PWR_FV1 (0x1 << 14) 57762306a36Sopenharmony_ci#define RT5668_PWR_FV1_BIT 14 57862306a36Sopenharmony_ci#define RT5668_PWR_VREF2 (0x1 << 13) 57962306a36Sopenharmony_ci#define RT5668_PWR_VREF2_BIT 13 58062306a36Sopenharmony_ci#define RT5668_PWR_FV2 (0x1 << 12) 58162306a36Sopenharmony_ci#define RT5668_PWR_FV2_BIT 12 58262306a36Sopenharmony_ci#define RT5668_LDO1_DBG_MASK (0x3 << 10) 58362306a36Sopenharmony_ci#define RT5668_PWR_MB (0x1 << 9) 58462306a36Sopenharmony_ci#define RT5668_PWR_MB_BIT 9 58562306a36Sopenharmony_ci#define RT5668_PWR_BG (0x1 << 7) 58662306a36Sopenharmony_ci#define RT5668_PWR_BG_BIT 7 58762306a36Sopenharmony_ci#define RT5668_LDO1_BYPASS_MASK (0x1 << 6) 58862306a36Sopenharmony_ci#define RT5668_LDO1_BYPASS (0x1 << 6) 58962306a36Sopenharmony_ci#define RT5668_LDO1_NOT_BYPASS (0x0 << 6) 59062306a36Sopenharmony_ci#define RT5668_PWR_MA_BIT 6 59162306a36Sopenharmony_ci#define RT5668_LDO1_DVO_MASK (0x3 << 4) 59262306a36Sopenharmony_ci#define RT5668_LDO1_DVO_09 (0x0 << 4) 59362306a36Sopenharmony_ci#define RT5668_LDO1_DVO_10 (0x1 << 4) 59462306a36Sopenharmony_ci#define RT5668_LDO1_DVO_12 (0x2 << 4) 59562306a36Sopenharmony_ci#define RT5668_LDO1_DVO_14 (0x3 << 4) 59662306a36Sopenharmony_ci#define RT5668_HP_DRIVER_MASK (0x3 << 2) 59762306a36Sopenharmony_ci#define RT5668_HP_DRIVER_1X (0x0 << 2) 59862306a36Sopenharmony_ci#define RT5668_HP_DRIVER_3X (0x1 << 2) 59962306a36Sopenharmony_ci#define RT5668_HP_DRIVER_5X (0x3 << 2) 60062306a36Sopenharmony_ci#define RT5668_PWR_HA_L (0x1 << 1) 60162306a36Sopenharmony_ci#define RT5668_PWR_HA_L_BIT 1 60262306a36Sopenharmony_ci#define RT5668_PWR_HA_R (0x1 << 0) 60362306a36Sopenharmony_ci#define RT5668_PWR_HA_R_BIT 0 60462306a36Sopenharmony_ci 60562306a36Sopenharmony_ci/* Power Management for Analog 2 (0x0064) */ 60662306a36Sopenharmony_ci#define RT5668_PWR_MB1 (0x1 << 11) 60762306a36Sopenharmony_ci#define RT5668_PWR_MB1_PWR_DOWN (0x0 << 11) 60862306a36Sopenharmony_ci#define RT5668_PWR_MB1_BIT 11 60962306a36Sopenharmony_ci#define RT5668_PWR_MB2 (0x1 << 10) 61062306a36Sopenharmony_ci#define RT5668_PWR_MB2_PWR_DOWN (0x0 << 10) 61162306a36Sopenharmony_ci#define RT5668_PWR_MB2_BIT 10 61262306a36Sopenharmony_ci#define RT5668_PWR_JDH (0x1 << 3) 61362306a36Sopenharmony_ci#define RT5668_PWR_JDH_BIT 3 61462306a36Sopenharmony_ci#define RT5668_PWR_JDL (0x1 << 2) 61562306a36Sopenharmony_ci#define RT5668_PWR_JDL_BIT 2 61662306a36Sopenharmony_ci#define RT5668_PWR_RM1_L (0x1 << 1) 61762306a36Sopenharmony_ci#define RT5668_PWR_RM1_L_BIT 1 61862306a36Sopenharmony_ci 61962306a36Sopenharmony_ci/* Power Management for Analog 3 (0x0065) */ 62062306a36Sopenharmony_ci#define RT5668_PWR_CBJ (0x1 << 9) 62162306a36Sopenharmony_ci#define RT5668_PWR_CBJ_BIT 9 62262306a36Sopenharmony_ci#define RT5668_PWR_PLL (0x1 << 6) 62362306a36Sopenharmony_ci#define RT5668_PWR_PLL_BIT 6 62462306a36Sopenharmony_ci#define RT5668_PWR_PLL2B (0x1 << 5) 62562306a36Sopenharmony_ci#define RT5668_PWR_PLL2B_BIT 5 62662306a36Sopenharmony_ci#define RT5668_PWR_PLL2F (0x1 << 4) 62762306a36Sopenharmony_ci#define RT5668_PWR_PLL2F_BIT 4 62862306a36Sopenharmony_ci#define RT5668_PWR_LDO2 (0x1 << 2) 62962306a36Sopenharmony_ci#define RT5668_PWR_LDO2_BIT 2 63062306a36Sopenharmony_ci#define RT5668_PWR_DET_SPKVDD (0x1 << 1) 63162306a36Sopenharmony_ci#define RT5668_PWR_DET_SPKVDD_BIT 1 63262306a36Sopenharmony_ci 63362306a36Sopenharmony_ci/* Power Management for Mixer (0x0066) */ 63462306a36Sopenharmony_ci#define RT5668_PWR_STO1_DAC_L (0x1 << 5) 63562306a36Sopenharmony_ci#define RT5668_PWR_STO1_DAC_L_BIT 5 63662306a36Sopenharmony_ci#define RT5668_PWR_STO1_DAC_R (0x1 << 4) 63762306a36Sopenharmony_ci#define RT5668_PWR_STO1_DAC_R_BIT 4 63862306a36Sopenharmony_ci 63962306a36Sopenharmony_ci/* MCLK and System Clock Detection Control (0x006b) */ 64062306a36Sopenharmony_ci#define RT5668_SYS_CLK_DET (0x1 << 15) 64162306a36Sopenharmony_ci#define RT5668_SYS_CLK_DET_SFT 15 64262306a36Sopenharmony_ci#define RT5668_PLL1_CLK_DET (0x1 << 14) 64362306a36Sopenharmony_ci#define RT5668_PLL1_CLK_DET_SFT 14 64462306a36Sopenharmony_ci#define RT5668_PLL2_CLK_DET (0x1 << 13) 64562306a36Sopenharmony_ci#define RT5668_PLL2_CLK_DET_SFT 13 64662306a36Sopenharmony_ci#define RT5668_POW_CLK_DET2_SFT 8 64762306a36Sopenharmony_ci#define RT5668_POW_CLK_DET_SFT 0 64862306a36Sopenharmony_ci 64962306a36Sopenharmony_ci/* Digital Microphone Control 1 (0x006e) */ 65062306a36Sopenharmony_ci#define RT5668_DMIC_1_EN_MASK (0x1 << 15) 65162306a36Sopenharmony_ci#define RT5668_DMIC_1_EN_SFT 15 65262306a36Sopenharmony_ci#define RT5668_DMIC_1_DIS (0x0 << 15) 65362306a36Sopenharmony_ci#define RT5668_DMIC_1_EN (0x1 << 15) 65462306a36Sopenharmony_ci#define RT5668_DMIC_1_DP_MASK (0x3 << 4) 65562306a36Sopenharmony_ci#define RT5668_DMIC_1_DP_SFT 4 65662306a36Sopenharmony_ci#define RT5668_DMIC_1_DP_GPIO2 (0x0 << 4) 65762306a36Sopenharmony_ci#define RT5668_DMIC_1_DP_GPIO5 (0x1 << 4) 65862306a36Sopenharmony_ci#define RT5668_DMIC_CLK_MASK (0xf << 0) 65962306a36Sopenharmony_ci#define RT5668_DMIC_CLK_SFT 0 66062306a36Sopenharmony_ci 66162306a36Sopenharmony_ci/* I2S1 Audio Serial Data Port Control (0x0070) */ 66262306a36Sopenharmony_ci#define RT5668_SEL_ADCDAT_MASK (0x1 << 15) 66362306a36Sopenharmony_ci#define RT5668_SEL_ADCDAT_OUT (0x0 << 15) 66462306a36Sopenharmony_ci#define RT5668_SEL_ADCDAT_IN (0x1 << 15) 66562306a36Sopenharmony_ci#define RT5668_SEL_ADCDAT_SFT 15 66662306a36Sopenharmony_ci#define RT5668_I2S1_TX_CHL_MASK (0x7 << 12) 66762306a36Sopenharmony_ci#define RT5668_I2S1_TX_CHL_SFT 12 66862306a36Sopenharmony_ci#define RT5668_I2S1_TX_CHL_16 (0x0 << 12) 66962306a36Sopenharmony_ci#define RT5668_I2S1_TX_CHL_20 (0x1 << 12) 67062306a36Sopenharmony_ci#define RT5668_I2S1_TX_CHL_24 (0x2 << 12) 67162306a36Sopenharmony_ci#define RT5668_I2S1_TX_CHL_32 (0x3 << 12) 67262306a36Sopenharmony_ci#define RT5668_I2S1_TX_CHL_8 (0x4 << 12) 67362306a36Sopenharmony_ci#define RT5668_I2S1_RX_CHL_MASK (0x7 << 8) 67462306a36Sopenharmony_ci#define RT5668_I2S1_RX_CHL_SFT 8 67562306a36Sopenharmony_ci#define RT5668_I2S1_RX_CHL_16 (0x0 << 8) 67662306a36Sopenharmony_ci#define RT5668_I2S1_RX_CHL_20 (0x1 << 8) 67762306a36Sopenharmony_ci#define RT5668_I2S1_RX_CHL_24 (0x2 << 8) 67862306a36Sopenharmony_ci#define RT5668_I2S1_RX_CHL_32 (0x3 << 8) 67962306a36Sopenharmony_ci#define RT5668_I2S1_RX_CHL_8 (0x4 << 8) 68062306a36Sopenharmony_ci#define RT5668_I2S1_MONO_MASK (0x1 << 7) 68162306a36Sopenharmony_ci#define RT5668_I2S1_MONO_EN (0x1 << 7) 68262306a36Sopenharmony_ci#define RT5668_I2S1_MONO_DIS (0x0 << 7) 68362306a36Sopenharmony_ci#define RT5668_I2S2_MONO_MASK (0x1 << 6) 68462306a36Sopenharmony_ci#define RT5668_I2S2_MONO_EN (0x1 << 6) 68562306a36Sopenharmony_ci#define RT5668_I2S2_MONO_DIS (0x0 << 6) 68662306a36Sopenharmony_ci#define RT5668_I2S1_DL_MASK (0x7 << 4) 68762306a36Sopenharmony_ci#define RT5668_I2S1_DL_SFT 4 68862306a36Sopenharmony_ci#define RT5668_I2S1_DL_16 (0x0 << 4) 68962306a36Sopenharmony_ci#define RT5668_I2S1_DL_20 (0x1 << 4) 69062306a36Sopenharmony_ci#define RT5668_I2S1_DL_24 (0x2 << 4) 69162306a36Sopenharmony_ci#define RT5668_I2S1_DL_32 (0x3 << 4) 69262306a36Sopenharmony_ci#define RT5668_I2S1_DL_8 (0x4 << 4) 69362306a36Sopenharmony_ci 69462306a36Sopenharmony_ci/* I2S1/2 Audio Serial Data Port Control (0x0070)(0x0071) */ 69562306a36Sopenharmony_ci#define RT5668_I2S2_MS_MASK (0x1 << 15) 69662306a36Sopenharmony_ci#define RT5668_I2S2_MS_SFT 15 69762306a36Sopenharmony_ci#define RT5668_I2S2_MS_M (0x0 << 15) 69862306a36Sopenharmony_ci#define RT5668_I2S2_MS_S (0x1 << 15) 69962306a36Sopenharmony_ci#define RT5668_I2S2_PIN_CFG_MASK (0x1 << 14) 70062306a36Sopenharmony_ci#define RT5668_I2S2_PIN_CFG_SFT 14 70162306a36Sopenharmony_ci#define RT5668_I2S2_CLK_SEL_MASK (0x1 << 11) 70262306a36Sopenharmony_ci#define RT5668_I2S2_CLK_SEL_SFT 11 70362306a36Sopenharmony_ci#define RT5668_I2S2_OUT_MASK (0x1 << 9) 70462306a36Sopenharmony_ci#define RT5668_I2S2_OUT_SFT 9 70562306a36Sopenharmony_ci#define RT5668_I2S2_OUT_UM (0x0 << 9) 70662306a36Sopenharmony_ci#define RT5668_I2S2_OUT_M (0x1 << 9) 70762306a36Sopenharmony_ci#define RT5668_I2S_BP_MASK (0x1 << 8) 70862306a36Sopenharmony_ci#define RT5668_I2S_BP_SFT 8 70962306a36Sopenharmony_ci#define RT5668_I2S_BP_NOR (0x0 << 8) 71062306a36Sopenharmony_ci#define RT5668_I2S_BP_INV (0x1 << 8) 71162306a36Sopenharmony_ci#define RT5668_I2S2_MONO_EN (0x1 << 6) 71262306a36Sopenharmony_ci#define RT5668_I2S2_MONO_DIS (0x0 << 6) 71362306a36Sopenharmony_ci#define RT5668_I2S2_DL_MASK (0x3 << 4) 71462306a36Sopenharmony_ci#define RT5668_I2S2_DL_SFT 4 71562306a36Sopenharmony_ci#define RT5668_I2S2_DL_16 (0x0 << 4) 71662306a36Sopenharmony_ci#define RT5668_I2S2_DL_20 (0x1 << 4) 71762306a36Sopenharmony_ci#define RT5668_I2S2_DL_24 (0x2 << 4) 71862306a36Sopenharmony_ci#define RT5668_I2S2_DL_8 (0x3 << 4) 71962306a36Sopenharmony_ci#define RT5668_I2S_DF_MASK (0x7) 72062306a36Sopenharmony_ci#define RT5668_I2S_DF_SFT 0 72162306a36Sopenharmony_ci#define RT5668_I2S_DF_I2S (0x0) 72262306a36Sopenharmony_ci#define RT5668_I2S_DF_LEFT (0x1) 72362306a36Sopenharmony_ci#define RT5668_I2S_DF_PCM_A (0x2) 72462306a36Sopenharmony_ci#define RT5668_I2S_DF_PCM_B (0x3) 72562306a36Sopenharmony_ci#define RT5668_I2S_DF_PCM_A_N (0x6) 72662306a36Sopenharmony_ci#define RT5668_I2S_DF_PCM_B_N (0x7) 72762306a36Sopenharmony_ci 72862306a36Sopenharmony_ci/* ADC/DAC Clock Control 1 (0x0073) */ 72962306a36Sopenharmony_ci#define RT5668_ADC_OSR_MASK (0xf << 12) 73062306a36Sopenharmony_ci#define RT5668_ADC_OSR_SFT 12 73162306a36Sopenharmony_ci#define RT5668_ADC_OSR_D_1 (0x0 << 12) 73262306a36Sopenharmony_ci#define RT5668_ADC_OSR_D_2 (0x1 << 12) 73362306a36Sopenharmony_ci#define RT5668_ADC_OSR_D_4 (0x2 << 12) 73462306a36Sopenharmony_ci#define RT5668_ADC_OSR_D_6 (0x3 << 12) 73562306a36Sopenharmony_ci#define RT5668_ADC_OSR_D_8 (0x4 << 12) 73662306a36Sopenharmony_ci#define RT5668_ADC_OSR_D_12 (0x5 << 12) 73762306a36Sopenharmony_ci#define RT5668_ADC_OSR_D_16 (0x6 << 12) 73862306a36Sopenharmony_ci#define RT5668_ADC_OSR_D_24 (0x7 << 12) 73962306a36Sopenharmony_ci#define RT5668_ADC_OSR_D_32 (0x8 << 12) 74062306a36Sopenharmony_ci#define RT5668_ADC_OSR_D_48 (0x9 << 12) 74162306a36Sopenharmony_ci#define RT5668_I2S_M_DIV_MASK (0xf << 12) 74262306a36Sopenharmony_ci#define RT5668_I2S_M_DIV_SFT 8 74362306a36Sopenharmony_ci#define RT5668_I2S_M_D_1 (0x0 << 8) 74462306a36Sopenharmony_ci#define RT5668_I2S_M_D_2 (0x1 << 8) 74562306a36Sopenharmony_ci#define RT5668_I2S_M_D_3 (0x2 << 8) 74662306a36Sopenharmony_ci#define RT5668_I2S_M_D_4 (0x3 << 8) 74762306a36Sopenharmony_ci#define RT5668_I2S_M_D_6 (0x4 << 8) 74862306a36Sopenharmony_ci#define RT5668_I2S_M_D_8 (0x5 << 8) 74962306a36Sopenharmony_ci#define RT5668_I2S_M_D_12 (0x6 << 8) 75062306a36Sopenharmony_ci#define RT5668_I2S_M_D_16 (0x7 << 8) 75162306a36Sopenharmony_ci#define RT5668_I2S_M_D_24 (0x8 << 8) 75262306a36Sopenharmony_ci#define RT5668_I2S_M_D_32 (0x9 << 8) 75362306a36Sopenharmony_ci#define RT5668_I2S_M_D_48 (0x10 << 8) 75462306a36Sopenharmony_ci#define RT5668_I2S_CLK_SRC_MASK (0x7 << 4) 75562306a36Sopenharmony_ci#define RT5668_I2S_CLK_SRC_SFT 4 75662306a36Sopenharmony_ci#define RT5668_I2S_CLK_SRC_MCLK (0x0 << 4) 75762306a36Sopenharmony_ci#define RT5668_I2S_CLK_SRC_PLL1 (0x1 << 4) 75862306a36Sopenharmony_ci#define RT5668_I2S_CLK_SRC_PLL2 (0x2 << 4) 75962306a36Sopenharmony_ci#define RT5668_I2S_CLK_SRC_SDW (0x3 << 4) 76062306a36Sopenharmony_ci#define RT5668_I2S_CLK_SRC_RCCLK (0x4 << 4) /* 25M */ 76162306a36Sopenharmony_ci#define RT5668_DAC_OSR_MASK (0xf << 0) 76262306a36Sopenharmony_ci#define RT5668_DAC_OSR_SFT 0 76362306a36Sopenharmony_ci#define RT5668_DAC_OSR_D_1 (0x0 << 0) 76462306a36Sopenharmony_ci#define RT5668_DAC_OSR_D_2 (0x1 << 0) 76562306a36Sopenharmony_ci#define RT5668_DAC_OSR_D_4 (0x2 << 0) 76662306a36Sopenharmony_ci#define RT5668_DAC_OSR_D_6 (0x3 << 0) 76762306a36Sopenharmony_ci#define RT5668_DAC_OSR_D_8 (0x4 << 0) 76862306a36Sopenharmony_ci#define RT5668_DAC_OSR_D_12 (0x5 << 0) 76962306a36Sopenharmony_ci#define RT5668_DAC_OSR_D_16 (0x6 << 0) 77062306a36Sopenharmony_ci#define RT5668_DAC_OSR_D_24 (0x7 << 0) 77162306a36Sopenharmony_ci#define RT5668_DAC_OSR_D_32 (0x8 << 0) 77262306a36Sopenharmony_ci#define RT5668_DAC_OSR_D_48 (0x9 << 0) 77362306a36Sopenharmony_ci 77462306a36Sopenharmony_ci/* ADC/DAC Clock Control 2 (0x0074) */ 77562306a36Sopenharmony_ci#define RT5668_I2S2_BCLK_MS2_MASK (0x1 << 11) 77662306a36Sopenharmony_ci#define RT5668_I2S2_BCLK_MS2_SFT 11 77762306a36Sopenharmony_ci#define RT5668_I2S2_BCLK_MS2_32 (0x0 << 11) 77862306a36Sopenharmony_ci#define RT5668_I2S2_BCLK_MS2_64 (0x1 << 11) 77962306a36Sopenharmony_ci 78062306a36Sopenharmony_ci 78162306a36Sopenharmony_ci/* TDM control 1 (0x0079) */ 78262306a36Sopenharmony_ci#define RT5668_TDM_TX_CH_MASK (0x3 << 12) 78362306a36Sopenharmony_ci#define RT5668_TDM_TX_CH_2 (0x0 << 12) 78462306a36Sopenharmony_ci#define RT5668_TDM_TX_CH_4 (0x1 << 12) 78562306a36Sopenharmony_ci#define RT5668_TDM_TX_CH_6 (0x2 << 12) 78662306a36Sopenharmony_ci#define RT5668_TDM_TX_CH_8 (0x3 << 12) 78762306a36Sopenharmony_ci#define RT5668_TDM_RX_CH_MASK (0x3 << 8) 78862306a36Sopenharmony_ci#define RT5668_TDM_RX_CH_2 (0x0 << 8) 78962306a36Sopenharmony_ci#define RT5668_TDM_RX_CH_4 (0x1 << 8) 79062306a36Sopenharmony_ci#define RT5668_TDM_RX_CH_6 (0x2 << 8) 79162306a36Sopenharmony_ci#define RT5668_TDM_RX_CH_8 (0x3 << 8) 79262306a36Sopenharmony_ci#define RT5668_TDM_ADC_LCA_MASK (0xf << 4) 79362306a36Sopenharmony_ci#define RT5668_TDM_ADC_LCA_SFT 4 79462306a36Sopenharmony_ci#define RT5668_TDM_ADC_DL_SFT 0 79562306a36Sopenharmony_ci 79662306a36Sopenharmony_ci/* TDM control 3 (0x007a) */ 79762306a36Sopenharmony_ci#define RT5668_IF1_ADC1_SEL_SFT 14 79862306a36Sopenharmony_ci#define RT5668_IF1_ADC2_SEL_SFT 12 79962306a36Sopenharmony_ci#define RT5668_IF1_ADC3_SEL_SFT 10 80062306a36Sopenharmony_ci#define RT5668_IF1_ADC4_SEL_SFT 8 80162306a36Sopenharmony_ci#define RT5668_TDM_ADC_SEL_SFT 4 80262306a36Sopenharmony_ci 80362306a36Sopenharmony_ci/* TDM/I2S control (0x007e) */ 80462306a36Sopenharmony_ci#define RT5668_TDM_S_BP_MASK (0x1 << 15) 80562306a36Sopenharmony_ci#define RT5668_TDM_S_BP_SFT 15 80662306a36Sopenharmony_ci#define RT5668_TDM_S_BP_NOR (0x0 << 15) 80762306a36Sopenharmony_ci#define RT5668_TDM_S_BP_INV (0x1 << 15) 80862306a36Sopenharmony_ci#define RT5668_TDM_S_LP_MASK (0x1 << 14) 80962306a36Sopenharmony_ci#define RT5668_TDM_S_LP_SFT 14 81062306a36Sopenharmony_ci#define RT5668_TDM_S_LP_NOR (0x0 << 14) 81162306a36Sopenharmony_ci#define RT5668_TDM_S_LP_INV (0x1 << 14) 81262306a36Sopenharmony_ci#define RT5668_TDM_DF_MASK (0x7 << 11) 81362306a36Sopenharmony_ci#define RT5668_TDM_DF_SFT 11 81462306a36Sopenharmony_ci#define RT5668_TDM_DF_I2S (0x0 << 11) 81562306a36Sopenharmony_ci#define RT5668_TDM_DF_LEFT (0x1 << 11) 81662306a36Sopenharmony_ci#define RT5668_TDM_DF_PCM_A (0x2 << 11) 81762306a36Sopenharmony_ci#define RT5668_TDM_DF_PCM_B (0x3 << 11) 81862306a36Sopenharmony_ci#define RT5668_TDM_DF_PCM_A_N (0x6 << 11) 81962306a36Sopenharmony_ci#define RT5668_TDM_DF_PCM_B_N (0x7 << 11) 82062306a36Sopenharmony_ci#define RT5668_TDM_CL_MASK (0x3 << 4) 82162306a36Sopenharmony_ci#define RT5668_TDM_CL_16 (0x0 << 4) 82262306a36Sopenharmony_ci#define RT5668_TDM_CL_20 (0x1 << 4) 82362306a36Sopenharmony_ci#define RT5668_TDM_CL_24 (0x2 << 4) 82462306a36Sopenharmony_ci#define RT5668_TDM_CL_32 (0x3 << 4) 82562306a36Sopenharmony_ci#define RT5668_TDM_M_BP_MASK (0x1 << 2) 82662306a36Sopenharmony_ci#define RT5668_TDM_M_BP_SFT 2 82762306a36Sopenharmony_ci#define RT5668_TDM_M_BP_NOR (0x0 << 2) 82862306a36Sopenharmony_ci#define RT5668_TDM_M_BP_INV (0x1 << 2) 82962306a36Sopenharmony_ci#define RT5668_TDM_M_LP_MASK (0x1 << 1) 83062306a36Sopenharmony_ci#define RT5668_TDM_M_LP_SFT 1 83162306a36Sopenharmony_ci#define RT5668_TDM_M_LP_NOR (0x0 << 1) 83262306a36Sopenharmony_ci#define RT5668_TDM_M_LP_INV (0x1 << 1) 83362306a36Sopenharmony_ci#define RT5668_TDM_MS_MASK (0x1 << 0) 83462306a36Sopenharmony_ci#define RT5668_TDM_MS_SFT 0 83562306a36Sopenharmony_ci#define RT5668_TDM_MS_M (0x0 << 0) 83662306a36Sopenharmony_ci#define RT5668_TDM_MS_S (0x1 << 0) 83762306a36Sopenharmony_ci 83862306a36Sopenharmony_ci/* Global Clock Control (0x0080) */ 83962306a36Sopenharmony_ci#define RT5668_SCLK_SRC_MASK (0x7 << 13) 84062306a36Sopenharmony_ci#define RT5668_SCLK_SRC_SFT 13 84162306a36Sopenharmony_ci#define RT5668_SCLK_SRC_MCLK (0x0 << 13) 84262306a36Sopenharmony_ci#define RT5668_SCLK_SRC_PLL1 (0x1 << 13) 84362306a36Sopenharmony_ci#define RT5668_SCLK_SRC_PLL2 (0x2 << 13) 84462306a36Sopenharmony_ci#define RT5668_SCLK_SRC_SDW (0x3 << 13) 84562306a36Sopenharmony_ci#define RT5668_SCLK_SRC_RCCLK (0x4 << 13) 84662306a36Sopenharmony_ci#define RT5668_PLL1_SRC_MASK (0x3 << 10) 84762306a36Sopenharmony_ci#define RT5668_PLL1_SRC_SFT 10 84862306a36Sopenharmony_ci#define RT5668_PLL1_SRC_MCLK (0x0 << 10) 84962306a36Sopenharmony_ci#define RT5668_PLL1_SRC_BCLK1 (0x1 << 10) 85062306a36Sopenharmony_ci#define RT5668_PLL1_SRC_SDW (0x2 << 10) 85162306a36Sopenharmony_ci#define RT5668_PLL1_SRC_RC (0x3 << 10) 85262306a36Sopenharmony_ci#define RT5668_PLL2_SRC_MASK (0x3 << 8) 85362306a36Sopenharmony_ci#define RT5668_PLL2_SRC_SFT 8 85462306a36Sopenharmony_ci#define RT5668_PLL2_SRC_MCLK (0x0 << 8) 85562306a36Sopenharmony_ci#define RT5668_PLL2_SRC_BCLK1 (0x1 << 8) 85662306a36Sopenharmony_ci#define RT5668_PLL2_SRC_SDW (0x2 << 8) 85762306a36Sopenharmony_ci#define RT5668_PLL2_SRC_RC (0x3 << 8) 85862306a36Sopenharmony_ci 85962306a36Sopenharmony_ci 86062306a36Sopenharmony_ci 86162306a36Sopenharmony_ci#define RT5668_PLL_INP_MAX 40000000 86262306a36Sopenharmony_ci#define RT5668_PLL_INP_MIN 256000 86362306a36Sopenharmony_ci/* PLL M/N/K Code Control 1 (0x0081) */ 86462306a36Sopenharmony_ci#define RT5668_PLL_N_MAX 0x001ff 86562306a36Sopenharmony_ci#define RT5668_PLL_N_MASK (RT5668_PLL_N_MAX << 7) 86662306a36Sopenharmony_ci#define RT5668_PLL_N_SFT 7 86762306a36Sopenharmony_ci#define RT5668_PLL_K_MAX 0x001f 86862306a36Sopenharmony_ci#define RT5668_PLL_K_MASK (RT5668_PLL_K_MAX) 86962306a36Sopenharmony_ci#define RT5668_PLL_K_SFT 0 87062306a36Sopenharmony_ci 87162306a36Sopenharmony_ci/* PLL M/N/K Code Control 2 (0x0082) */ 87262306a36Sopenharmony_ci#define RT5668_PLL_M_MAX 0x00f 87362306a36Sopenharmony_ci#define RT5668_PLL_M_MASK (RT5668_PLL_M_MAX << 12) 87462306a36Sopenharmony_ci#define RT5668_PLL_M_SFT 12 87562306a36Sopenharmony_ci#define RT5668_PLL_M_BP (0x1 << 11) 87662306a36Sopenharmony_ci#define RT5668_PLL_M_BP_SFT 11 87762306a36Sopenharmony_ci#define RT5668_PLL_K_BP (0x1 << 10) 87862306a36Sopenharmony_ci#define RT5668_PLL_K_BP_SFT 10 87962306a36Sopenharmony_ci 88062306a36Sopenharmony_ci/* PLL tracking mode 1 (0x0083) */ 88162306a36Sopenharmony_ci#define RT5668_DA_ASRC_MASK (0x1 << 13) 88262306a36Sopenharmony_ci#define RT5668_DA_ASRC_SFT 13 88362306a36Sopenharmony_ci#define RT5668_DAC_STO1_ASRC_MASK (0x1 << 12) 88462306a36Sopenharmony_ci#define RT5668_DAC_STO1_ASRC_SFT 12 88562306a36Sopenharmony_ci#define RT5668_AD_ASRC_MASK (0x1 << 8) 88662306a36Sopenharmony_ci#define RT5668_AD_ASRC_SFT 8 88762306a36Sopenharmony_ci#define RT5668_AD_ASRC_SEL_MASK (0x1 << 4) 88862306a36Sopenharmony_ci#define RT5668_AD_ASRC_SEL_SFT 4 88962306a36Sopenharmony_ci#define RT5668_DMIC_ASRC_MASK (0x1 << 3) 89062306a36Sopenharmony_ci#define RT5668_DMIC_ASRC_SFT 3 89162306a36Sopenharmony_ci#define RT5668_ADC_STO1_ASRC_MASK (0x1 << 2) 89262306a36Sopenharmony_ci#define RT5668_ADC_STO1_ASRC_SFT 2 89362306a36Sopenharmony_ci#define RT5668_DA_ASRC_SEL_MASK (0x1 << 0) 89462306a36Sopenharmony_ci#define RT5668_DA_ASRC_SEL_SFT 0 89562306a36Sopenharmony_ci 89662306a36Sopenharmony_ci/* PLL tracking mode 2 3 (0x0084)(0x0085)*/ 89762306a36Sopenharmony_ci#define RT5668_FILTER_CLK_SEL_MASK (0x7 << 12) 89862306a36Sopenharmony_ci#define RT5668_FILTER_CLK_SEL_SFT 12 89962306a36Sopenharmony_ci 90062306a36Sopenharmony_ci/* ASRC Control 4 (0x0086) */ 90162306a36Sopenharmony_ci#define RT5668_ASRCIN_FTK_N1_MASK (0x3 << 14) 90262306a36Sopenharmony_ci#define RT5668_ASRCIN_FTK_N1_SFT 14 90362306a36Sopenharmony_ci#define RT5668_ASRCIN_FTK_N2_MASK (0x3 << 12) 90462306a36Sopenharmony_ci#define RT5668_ASRCIN_FTK_N2_SFT 12 90562306a36Sopenharmony_ci#define RT5668_ASRCIN_FTK_M1_MASK (0x7 << 8) 90662306a36Sopenharmony_ci#define RT5668_ASRCIN_FTK_M1_SFT 8 90762306a36Sopenharmony_ci#define RT5668_ASRCIN_FTK_M2_MASK (0x7 << 4) 90862306a36Sopenharmony_ci#define RT5668_ASRCIN_FTK_M2_SFT 4 90962306a36Sopenharmony_ci 91062306a36Sopenharmony_ci/* SoundWire reference clk (0x008d) */ 91162306a36Sopenharmony_ci#define RT5668_PLL2_OUT_MASK (0x1 << 8) 91262306a36Sopenharmony_ci#define RT5668_PLL2_OUT_98M (0x0 << 8) 91362306a36Sopenharmony_ci#define RT5668_PLL2_OUT_49M (0x1 << 8) 91462306a36Sopenharmony_ci#define RT5668_SDW_REF_2_MASK (0xf << 4) 91562306a36Sopenharmony_ci#define RT5668_SDW_REF_2_SFT 4 91662306a36Sopenharmony_ci#define RT5668_SDW_REF_2_48K (0x0 << 4) 91762306a36Sopenharmony_ci#define RT5668_SDW_REF_2_96K (0x1 << 4) 91862306a36Sopenharmony_ci#define RT5668_SDW_REF_2_192K (0x2 << 4) 91962306a36Sopenharmony_ci#define RT5668_SDW_REF_2_32K (0x3 << 4) 92062306a36Sopenharmony_ci#define RT5668_SDW_REF_2_24K (0x4 << 4) 92162306a36Sopenharmony_ci#define RT5668_SDW_REF_2_16K (0x5 << 4) 92262306a36Sopenharmony_ci#define RT5668_SDW_REF_2_12K (0x6 << 4) 92362306a36Sopenharmony_ci#define RT5668_SDW_REF_2_8K (0x7 << 4) 92462306a36Sopenharmony_ci#define RT5668_SDW_REF_2_44K (0x8 << 4) 92562306a36Sopenharmony_ci#define RT5668_SDW_REF_2_88K (0x9 << 4) 92662306a36Sopenharmony_ci#define RT5668_SDW_REF_2_176K (0xa << 4) 92762306a36Sopenharmony_ci#define RT5668_SDW_REF_2_353K (0xb << 4) 92862306a36Sopenharmony_ci#define RT5668_SDW_REF_2_22K (0xc << 4) 92962306a36Sopenharmony_ci#define RT5668_SDW_REF_2_384K (0xd << 4) 93062306a36Sopenharmony_ci#define RT5668_SDW_REF_2_11K (0xe << 4) 93162306a36Sopenharmony_ci#define RT5668_SDW_REF_1_MASK (0xf << 0) 93262306a36Sopenharmony_ci#define RT5668_SDW_REF_1_SFT 0 93362306a36Sopenharmony_ci#define RT5668_SDW_REF_1_48K (0x0 << 0) 93462306a36Sopenharmony_ci#define RT5668_SDW_REF_1_96K (0x1 << 0) 93562306a36Sopenharmony_ci#define RT5668_SDW_REF_1_192K (0x2 << 0) 93662306a36Sopenharmony_ci#define RT5668_SDW_REF_1_32K (0x3 << 0) 93762306a36Sopenharmony_ci#define RT5668_SDW_REF_1_24K (0x4 << 0) 93862306a36Sopenharmony_ci#define RT5668_SDW_REF_1_16K (0x5 << 0) 93962306a36Sopenharmony_ci#define RT5668_SDW_REF_1_12K (0x6 << 0) 94062306a36Sopenharmony_ci#define RT5668_SDW_REF_1_8K (0x7 << 0) 94162306a36Sopenharmony_ci#define RT5668_SDW_REF_1_44K (0x8 << 0) 94262306a36Sopenharmony_ci#define RT5668_SDW_REF_1_88K (0x9 << 0) 94362306a36Sopenharmony_ci#define RT5668_SDW_REF_1_176K (0xa << 0) 94462306a36Sopenharmony_ci#define RT5668_SDW_REF_1_353K (0xb << 0) 94562306a36Sopenharmony_ci#define RT5668_SDW_REF_1_22K (0xc << 0) 94662306a36Sopenharmony_ci#define RT5668_SDW_REF_1_384K (0xd << 0) 94762306a36Sopenharmony_ci#define RT5668_SDW_REF_1_11K (0xe << 0) 94862306a36Sopenharmony_ci 94962306a36Sopenharmony_ci/* Depop Mode Control 1 (0x008e) */ 95062306a36Sopenharmony_ci#define RT5668_PUMP_EN (0x1 << 3) 95162306a36Sopenharmony_ci#define RT5668_PUMP_EN_SFT 3 95262306a36Sopenharmony_ci#define RT5668_CAPLESS_EN (0x1 << 0) 95362306a36Sopenharmony_ci#define RT5668_CAPLESS_EN_SFT 0 95462306a36Sopenharmony_ci 95562306a36Sopenharmony_ci/* Depop Mode Control 2 (0x8f) */ 95662306a36Sopenharmony_ci#define RT5668_RAMP_MASK (0x1 << 12) 95762306a36Sopenharmony_ci#define RT5668_RAMP_SFT 12 95862306a36Sopenharmony_ci#define RT5668_RAMP_DIS (0x0 << 12) 95962306a36Sopenharmony_ci#define RT5668_RAMP_EN (0x1 << 12) 96062306a36Sopenharmony_ci#define RT5668_BPS_MASK (0x1 << 11) 96162306a36Sopenharmony_ci#define RT5668_BPS_SFT 11 96262306a36Sopenharmony_ci#define RT5668_BPS_DIS (0x0 << 11) 96362306a36Sopenharmony_ci#define RT5668_BPS_EN (0x1 << 11) 96462306a36Sopenharmony_ci#define RT5668_FAST_UPDN_MASK (0x1 << 10) 96562306a36Sopenharmony_ci#define RT5668_FAST_UPDN_SFT 10 96662306a36Sopenharmony_ci#define RT5668_FAST_UPDN_DIS (0x0 << 10) 96762306a36Sopenharmony_ci#define RT5668_FAST_UPDN_EN (0x1 << 10) 96862306a36Sopenharmony_ci#define RT5668_VLO_MASK (0x1 << 7) 96962306a36Sopenharmony_ci#define RT5668_VLO_SFT 7 97062306a36Sopenharmony_ci#define RT5668_VLO_3V (0x0 << 7) 97162306a36Sopenharmony_ci#define RT5668_VLO_33V (0x1 << 7) 97262306a36Sopenharmony_ci 97362306a36Sopenharmony_ci/* HPOUT charge pump 1 (0x0091) */ 97462306a36Sopenharmony_ci#define RT5668_OSW_L_MASK (0x1 << 11) 97562306a36Sopenharmony_ci#define RT5668_OSW_L_SFT 11 97662306a36Sopenharmony_ci#define RT5668_OSW_L_DIS (0x0 << 11) 97762306a36Sopenharmony_ci#define RT5668_OSW_L_EN (0x1 << 11) 97862306a36Sopenharmony_ci#define RT5668_OSW_R_MASK (0x1 << 10) 97962306a36Sopenharmony_ci#define RT5668_OSW_R_SFT 10 98062306a36Sopenharmony_ci#define RT5668_OSW_R_DIS (0x0 << 10) 98162306a36Sopenharmony_ci#define RT5668_OSW_R_EN (0x1 << 10) 98262306a36Sopenharmony_ci#define RT5668_PM_HP_MASK (0x3 << 8) 98362306a36Sopenharmony_ci#define RT5668_PM_HP_SFT 8 98462306a36Sopenharmony_ci#define RT5668_PM_HP_LV (0x0 << 8) 98562306a36Sopenharmony_ci#define RT5668_PM_HP_MV (0x1 << 8) 98662306a36Sopenharmony_ci#define RT5668_PM_HP_HV (0x2 << 8) 98762306a36Sopenharmony_ci#define RT5668_IB_HP_MASK (0x3 << 6) 98862306a36Sopenharmony_ci#define RT5668_IB_HP_SFT 6 98962306a36Sopenharmony_ci#define RT5668_IB_HP_125IL (0x0 << 6) 99062306a36Sopenharmony_ci#define RT5668_IB_HP_25IL (0x1 << 6) 99162306a36Sopenharmony_ci#define RT5668_IB_HP_5IL (0x2 << 6) 99262306a36Sopenharmony_ci#define RT5668_IB_HP_1IL (0x3 << 6) 99362306a36Sopenharmony_ci 99462306a36Sopenharmony_ci/* Micbias Control1 (0x93) */ 99562306a36Sopenharmony_ci#define RT5668_MIC1_OV_MASK (0x3 << 14) 99662306a36Sopenharmony_ci#define RT5668_MIC1_OV_SFT 14 99762306a36Sopenharmony_ci#define RT5668_MIC1_OV_2V7 (0x0 << 14) 99862306a36Sopenharmony_ci#define RT5668_MIC1_OV_2V4 (0x1 << 14) 99962306a36Sopenharmony_ci#define RT5668_MIC1_OV_2V25 (0x3 << 14) 100062306a36Sopenharmony_ci#define RT5668_MIC1_OV_1V8 (0x4 << 14) 100162306a36Sopenharmony_ci#define RT5668_MIC1_CLK_MASK (0x1 << 13) 100262306a36Sopenharmony_ci#define RT5668_MIC1_CLK_SFT 13 100362306a36Sopenharmony_ci#define RT5668_MIC1_CLK_DIS (0x0 << 13) 100462306a36Sopenharmony_ci#define RT5668_MIC1_CLK_EN (0x1 << 13) 100562306a36Sopenharmony_ci#define RT5668_MIC1_OVCD_MASK (0x1 << 12) 100662306a36Sopenharmony_ci#define RT5668_MIC1_OVCD_SFT 12 100762306a36Sopenharmony_ci#define RT5668_MIC1_OVCD_DIS (0x0 << 12) 100862306a36Sopenharmony_ci#define RT5668_MIC1_OVCD_EN (0x1 << 12) 100962306a36Sopenharmony_ci#define RT5668_MIC1_OVTH_MASK (0x3 << 10) 101062306a36Sopenharmony_ci#define RT5668_MIC1_OVTH_SFT 10 101162306a36Sopenharmony_ci#define RT5668_MIC1_OVTH_768UA (0x0 << 10) 101262306a36Sopenharmony_ci#define RT5668_MIC1_OVTH_960UA (0x1 << 10) 101362306a36Sopenharmony_ci#define RT5668_MIC1_OVTH_1152UA (0x2 << 10) 101462306a36Sopenharmony_ci#define RT5668_MIC1_OVTH_1960UA (0x3 << 10) 101562306a36Sopenharmony_ci#define RT5668_MIC2_OV_MASK (0x3 << 8) 101662306a36Sopenharmony_ci#define RT5668_MIC2_OV_SFT 8 101762306a36Sopenharmony_ci#define RT5668_MIC2_OV_2V7 (0x0 << 8) 101862306a36Sopenharmony_ci#define RT5668_MIC2_OV_2V4 (0x1 << 8) 101962306a36Sopenharmony_ci#define RT5668_MIC2_OV_2V25 (0x3 << 8) 102062306a36Sopenharmony_ci#define RT5668_MIC2_OV_1V8 (0x4 << 8) 102162306a36Sopenharmony_ci#define RT5668_MIC2_CLK_MASK (0x1 << 7) 102262306a36Sopenharmony_ci#define RT5668_MIC2_CLK_SFT 7 102362306a36Sopenharmony_ci#define RT5668_MIC2_CLK_DIS (0x0 << 7) 102462306a36Sopenharmony_ci#define RT5668_MIC2_CLK_EN (0x1 << 7) 102562306a36Sopenharmony_ci#define RT5668_MIC2_OVTH_MASK (0x3 << 4) 102662306a36Sopenharmony_ci#define RT5668_MIC2_OVTH_SFT 4 102762306a36Sopenharmony_ci#define RT5668_MIC2_OVTH_768UA (0x0 << 4) 102862306a36Sopenharmony_ci#define RT5668_MIC2_OVTH_960UA (0x1 << 4) 102962306a36Sopenharmony_ci#define RT5668_MIC2_OVTH_1152UA (0x2 << 4) 103062306a36Sopenharmony_ci#define RT5668_MIC2_OVTH_1960UA (0x3 << 4) 103162306a36Sopenharmony_ci#define RT5668_PWR_MB_MASK (0x1 << 3) 103262306a36Sopenharmony_ci#define RT5668_PWR_MB_SFT 3 103362306a36Sopenharmony_ci#define RT5668_PWR_MB_PD (0x0 << 3) 103462306a36Sopenharmony_ci#define RT5668_PWR_MB_PU (0x1 << 3) 103562306a36Sopenharmony_ci 103662306a36Sopenharmony_ci/* Micbias Control2 (0x0094) */ 103762306a36Sopenharmony_ci#define RT5668_PWR_CLK25M_MASK (0x1 << 9) 103862306a36Sopenharmony_ci#define RT5668_PWR_CLK25M_SFT 9 103962306a36Sopenharmony_ci#define RT5668_PWR_CLK25M_PD (0x0 << 9) 104062306a36Sopenharmony_ci#define RT5668_PWR_CLK25M_PU (0x1 << 9) 104162306a36Sopenharmony_ci#define RT5668_PWR_CLK1M_MASK (0x1 << 8) 104262306a36Sopenharmony_ci#define RT5668_PWR_CLK1M_SFT 8 104362306a36Sopenharmony_ci#define RT5668_PWR_CLK1M_PD (0x0 << 8) 104462306a36Sopenharmony_ci#define RT5668_PWR_CLK1M_PU (0x1 << 8) 104562306a36Sopenharmony_ci 104662306a36Sopenharmony_ci/* RC Clock Control (0x009f) */ 104762306a36Sopenharmony_ci#define RT5668_POW_IRQ (0x1 << 15) 104862306a36Sopenharmony_ci#define RT5668_POW_JDH (0x1 << 14) 104962306a36Sopenharmony_ci#define RT5668_POW_JDL (0x1 << 13) 105062306a36Sopenharmony_ci#define RT5668_POW_ANA (0x1 << 12) 105162306a36Sopenharmony_ci 105262306a36Sopenharmony_ci/* I2S Master Mode Clock Control 1 (0x00a0) */ 105362306a36Sopenharmony_ci#define RT5668_CLK_SRC_MCLK (0x0) 105462306a36Sopenharmony_ci#define RT5668_CLK_SRC_PLL1 (0x1) 105562306a36Sopenharmony_ci#define RT5668_CLK_SRC_PLL2 (0x2) 105662306a36Sopenharmony_ci#define RT5668_CLK_SRC_SDW (0x3) 105762306a36Sopenharmony_ci#define RT5668_CLK_SRC_RCCLK (0x4) 105862306a36Sopenharmony_ci#define RT5668_I2S_PD_1 (0x0) 105962306a36Sopenharmony_ci#define RT5668_I2S_PD_2 (0x1) 106062306a36Sopenharmony_ci#define RT5668_I2S_PD_3 (0x2) 106162306a36Sopenharmony_ci#define RT5668_I2S_PD_4 (0x3) 106262306a36Sopenharmony_ci#define RT5668_I2S_PD_6 (0x4) 106362306a36Sopenharmony_ci#define RT5668_I2S_PD_8 (0x5) 106462306a36Sopenharmony_ci#define RT5668_I2S_PD_12 (0x6) 106562306a36Sopenharmony_ci#define RT5668_I2S_PD_16 (0x7) 106662306a36Sopenharmony_ci#define RT5668_I2S_PD_24 (0x8) 106762306a36Sopenharmony_ci#define RT5668_I2S_PD_32 (0x9) 106862306a36Sopenharmony_ci#define RT5668_I2S_PD_48 (0xa) 106962306a36Sopenharmony_ci#define RT5668_I2S2_SRC_MASK (0x3 << 4) 107062306a36Sopenharmony_ci#define RT5668_I2S2_SRC_SFT 4 107162306a36Sopenharmony_ci#define RT5668_I2S2_M_PD_MASK (0xf << 0) 107262306a36Sopenharmony_ci#define RT5668_I2S2_M_PD_SFT 0 107362306a36Sopenharmony_ci 107462306a36Sopenharmony_ci/* IRQ Control 1 (0x00b6) */ 107562306a36Sopenharmony_ci#define RT5668_JD1_PULSE_EN_MASK (0x1 << 10) 107662306a36Sopenharmony_ci#define RT5668_JD1_PULSE_EN_SFT 10 107762306a36Sopenharmony_ci#define RT5668_JD1_PULSE_DIS (0x0 << 10) 107862306a36Sopenharmony_ci#define RT5668_JD1_PULSE_EN (0x1 << 10) 107962306a36Sopenharmony_ci 108062306a36Sopenharmony_ci/* IRQ Control 2 (0x00b7) */ 108162306a36Sopenharmony_ci#define RT5668_JD1_EN_MASK (0x1 << 15) 108262306a36Sopenharmony_ci#define RT5668_JD1_EN_SFT 15 108362306a36Sopenharmony_ci#define RT5668_JD1_DIS (0x0 << 15) 108462306a36Sopenharmony_ci#define RT5668_JD1_EN (0x1 << 15) 108562306a36Sopenharmony_ci#define RT5668_JD1_POL_MASK (0x1 << 13) 108662306a36Sopenharmony_ci#define RT5668_JD1_POL_NOR (0x0 << 13) 108762306a36Sopenharmony_ci#define RT5668_JD1_POL_INV (0x1 << 13) 108862306a36Sopenharmony_ci 108962306a36Sopenharmony_ci/* IRQ Control 3 (0x00b8) */ 109062306a36Sopenharmony_ci#define RT5668_IL_IRQ_MASK (0x1 << 7) 109162306a36Sopenharmony_ci#define RT5668_IL_IRQ_DIS (0x0 << 7) 109262306a36Sopenharmony_ci#define RT5668_IL_IRQ_EN (0x1 << 7) 109362306a36Sopenharmony_ci 109462306a36Sopenharmony_ci/* GPIO Control 1 (0x00c0) */ 109562306a36Sopenharmony_ci#define RT5668_GP1_PIN_MASK (0x3 << 14) 109662306a36Sopenharmony_ci#define RT5668_GP1_PIN_SFT 14 109762306a36Sopenharmony_ci#define RT5668_GP1_PIN_GPIO1 (0x0 << 14) 109862306a36Sopenharmony_ci#define RT5668_GP1_PIN_IRQ (0x1 << 14) 109962306a36Sopenharmony_ci#define RT5668_GP1_PIN_DMIC_CLK (0x2 << 14) 110062306a36Sopenharmony_ci#define RT5668_GP2_PIN_MASK (0x3 << 12) 110162306a36Sopenharmony_ci#define RT5668_GP2_PIN_SFT 12 110262306a36Sopenharmony_ci#define RT5668_GP2_PIN_GPIO2 (0x0 << 12) 110362306a36Sopenharmony_ci#define RT5668_GP2_PIN_LRCK2 (0x1 << 12) 110462306a36Sopenharmony_ci#define RT5668_GP2_PIN_DMIC_SDA (0x2 << 12) 110562306a36Sopenharmony_ci#define RT5668_GP3_PIN_MASK (0x3 << 10) 110662306a36Sopenharmony_ci#define RT5668_GP3_PIN_SFT 10 110762306a36Sopenharmony_ci#define RT5668_GP3_PIN_GPIO3 (0x0 << 10) 110862306a36Sopenharmony_ci#define RT5668_GP3_PIN_BCLK2 (0x1 << 10) 110962306a36Sopenharmony_ci#define RT5668_GP3_PIN_DMIC_CLK (0x2 << 10) 111062306a36Sopenharmony_ci#define RT5668_GP4_PIN_MASK (0x3 << 8) 111162306a36Sopenharmony_ci#define RT5668_GP4_PIN_SFT 8 111262306a36Sopenharmony_ci#define RT5668_GP4_PIN_GPIO4 (0x0 << 8) 111362306a36Sopenharmony_ci#define RT5668_GP4_PIN_ADCDAT1 (0x1 << 8) 111462306a36Sopenharmony_ci#define RT5668_GP4_PIN_DMIC_CLK (0x2 << 8) 111562306a36Sopenharmony_ci#define RT5668_GP4_PIN_ADCDAT2 (0x3 << 8) 111662306a36Sopenharmony_ci#define RT5668_GP5_PIN_MASK (0x3 << 6) 111762306a36Sopenharmony_ci#define RT5668_GP5_PIN_SFT 6 111862306a36Sopenharmony_ci#define RT5668_GP5_PIN_GPIO5 (0x0 << 6) 111962306a36Sopenharmony_ci#define RT5668_GP5_PIN_DACDAT1 (0x1 << 6) 112062306a36Sopenharmony_ci#define RT5668_GP5_PIN_DMIC_SDA (0x2 << 6) 112162306a36Sopenharmony_ci#define RT5668_GP6_PIN_MASK (0x1 << 5) 112262306a36Sopenharmony_ci#define RT5668_GP6_PIN_SFT 5 112362306a36Sopenharmony_ci#define RT5668_GP6_PIN_GPIO6 (0x0 << 5) 112462306a36Sopenharmony_ci#define RT5668_GP6_PIN_LRCK1 (0x1 << 5) 112562306a36Sopenharmony_ci 112662306a36Sopenharmony_ci/* GPIO Control 2 (0x00c1)*/ 112762306a36Sopenharmony_ci#define RT5668_GP1_PF_MASK (0x1 << 15) 112862306a36Sopenharmony_ci#define RT5668_GP1_PF_IN (0x0 << 15) 112962306a36Sopenharmony_ci#define RT5668_GP1_PF_OUT (0x1 << 15) 113062306a36Sopenharmony_ci#define RT5668_GP1_OUT_MASK (0x1 << 14) 113162306a36Sopenharmony_ci#define RT5668_GP1_OUT_L (0x0 << 14) 113262306a36Sopenharmony_ci#define RT5668_GP1_OUT_H (0x1 << 14) 113362306a36Sopenharmony_ci#define RT5668_GP2_PF_MASK (0x1 << 13) 113462306a36Sopenharmony_ci#define RT5668_GP2_PF_IN (0x0 << 13) 113562306a36Sopenharmony_ci#define RT5668_GP2_PF_OUT (0x1 << 13) 113662306a36Sopenharmony_ci#define RT5668_GP2_OUT_MASK (0x1 << 12) 113762306a36Sopenharmony_ci#define RT5668_GP2_OUT_L (0x0 << 12) 113862306a36Sopenharmony_ci#define RT5668_GP2_OUT_H (0x1 << 12) 113962306a36Sopenharmony_ci#define RT5668_GP3_PF_MASK (0x1 << 11) 114062306a36Sopenharmony_ci#define RT5668_GP3_PF_IN (0x0 << 11) 114162306a36Sopenharmony_ci#define RT5668_GP3_PF_OUT (0x1 << 11) 114262306a36Sopenharmony_ci#define RT5668_GP3_OUT_MASK (0x1 << 10) 114362306a36Sopenharmony_ci#define RT5668_GP3_OUT_L (0x0 << 10) 114462306a36Sopenharmony_ci#define RT5668_GP3_OUT_H (0x1 << 10) 114562306a36Sopenharmony_ci#define RT5668_GP4_PF_MASK (0x1 << 9) 114662306a36Sopenharmony_ci#define RT5668_GP4_PF_IN (0x0 << 9) 114762306a36Sopenharmony_ci#define RT5668_GP4_PF_OUT (0x1 << 9) 114862306a36Sopenharmony_ci#define RT5668_GP4_OUT_MASK (0x1 << 8) 114962306a36Sopenharmony_ci#define RT5668_GP4_OUT_L (0x0 << 8) 115062306a36Sopenharmony_ci#define RT5668_GP4_OUT_H (0x1 << 8) 115162306a36Sopenharmony_ci#define RT5668_GP5_PF_MASK (0x1 << 7) 115262306a36Sopenharmony_ci#define RT5668_GP5_PF_IN (0x0 << 7) 115362306a36Sopenharmony_ci#define RT5668_GP5_PF_OUT (0x1 << 7) 115462306a36Sopenharmony_ci#define RT5668_GP5_OUT_MASK (0x1 << 6) 115562306a36Sopenharmony_ci#define RT5668_GP5_OUT_L (0x0 << 6) 115662306a36Sopenharmony_ci#define RT5668_GP5_OUT_H (0x1 << 6) 115762306a36Sopenharmony_ci#define RT5668_GP6_PF_MASK (0x1 << 5) 115862306a36Sopenharmony_ci#define RT5668_GP6_PF_IN (0x0 << 5) 115962306a36Sopenharmony_ci#define RT5668_GP6_PF_OUT (0x1 << 5) 116062306a36Sopenharmony_ci#define RT5668_GP6_OUT_MASK (0x1 << 4) 116162306a36Sopenharmony_ci#define RT5668_GP6_OUT_L (0x0 << 4) 116262306a36Sopenharmony_ci#define RT5668_GP6_OUT_H (0x1 << 4) 116362306a36Sopenharmony_ci 116462306a36Sopenharmony_ci 116562306a36Sopenharmony_ci/* GPIO Status (0x00c2) */ 116662306a36Sopenharmony_ci#define RT5668_GP6_STA (0x1 << 6) 116762306a36Sopenharmony_ci#define RT5668_GP5_STA (0x1 << 5) 116862306a36Sopenharmony_ci#define RT5668_GP4_STA (0x1 << 4) 116962306a36Sopenharmony_ci#define RT5668_GP3_STA (0x1 << 3) 117062306a36Sopenharmony_ci#define RT5668_GP2_STA (0x1 << 2) 117162306a36Sopenharmony_ci#define RT5668_GP1_STA (0x1 << 1) 117262306a36Sopenharmony_ci 117362306a36Sopenharmony_ci/* Soft volume and zero cross control 1 (0x00d9) */ 117462306a36Sopenharmony_ci#define RT5668_SV_MASK (0x1 << 15) 117562306a36Sopenharmony_ci#define RT5668_SV_SFT 15 117662306a36Sopenharmony_ci#define RT5668_SV_DIS (0x0 << 15) 117762306a36Sopenharmony_ci#define RT5668_SV_EN (0x1 << 15) 117862306a36Sopenharmony_ci#define RT5668_ZCD_MASK (0x1 << 10) 117962306a36Sopenharmony_ci#define RT5668_ZCD_SFT 10 118062306a36Sopenharmony_ci#define RT5668_ZCD_PD (0x0 << 10) 118162306a36Sopenharmony_ci#define RT5668_ZCD_PU (0x1 << 10) 118262306a36Sopenharmony_ci#define RT5668_SV_DLY_MASK (0xf) 118362306a36Sopenharmony_ci#define RT5668_SV_DLY_SFT 0 118462306a36Sopenharmony_ci 118562306a36Sopenharmony_ci/* Soft volume and zero cross control 2 (0x00da) */ 118662306a36Sopenharmony_ci#define RT5668_ZCD_BST1_CBJ_MASK (0x1 << 7) 118762306a36Sopenharmony_ci#define RT5668_ZCD_BST1_CBJ_SFT 7 118862306a36Sopenharmony_ci#define RT5668_ZCD_BST1_CBJ_DIS (0x0 << 7) 118962306a36Sopenharmony_ci#define RT5668_ZCD_BST1_CBJ_EN (0x1 << 7) 119062306a36Sopenharmony_ci#define RT5668_ZCD_RECMIX_MASK (0x1) 119162306a36Sopenharmony_ci#define RT5668_ZCD_RECMIX_SFT 0 119262306a36Sopenharmony_ci#define RT5668_ZCD_RECMIX_DIS (0x0) 119362306a36Sopenharmony_ci#define RT5668_ZCD_RECMIX_EN (0x1) 119462306a36Sopenharmony_ci 119562306a36Sopenharmony_ci/* 4 Button Inline Command Control 2 (0x00e3) */ 119662306a36Sopenharmony_ci#define RT5668_4BTN_IL_MASK (0x1 << 15) 119762306a36Sopenharmony_ci#define RT5668_4BTN_IL_EN (0x1 << 15) 119862306a36Sopenharmony_ci#define RT5668_4BTN_IL_DIS (0x0 << 15) 119962306a36Sopenharmony_ci#define RT5668_4BTN_IL_RST_MASK (0x1 << 14) 120062306a36Sopenharmony_ci#define RT5668_4BTN_IL_NOR (0x1 << 14) 120162306a36Sopenharmony_ci#define RT5668_4BTN_IL_RST (0x0 << 14) 120262306a36Sopenharmony_ci 120362306a36Sopenharmony_ci/* Analog JD Control (0x00f0) */ 120462306a36Sopenharmony_ci#define RT5668_JDH_RS_MASK (0x1 << 4) 120562306a36Sopenharmony_ci#define RT5668_JDH_NO_PLUG (0x1 << 4) 120662306a36Sopenharmony_ci#define RT5668_JDH_PLUG (0x0 << 4) 120762306a36Sopenharmony_ci 120862306a36Sopenharmony_ci/* Chopper and Clock control for DAC (0x013a)*/ 120962306a36Sopenharmony_ci#define RT5668_CKXEN_DAC1_MASK (0x1 << 13) 121062306a36Sopenharmony_ci#define RT5668_CKXEN_DAC1_SFT 13 121162306a36Sopenharmony_ci#define RT5668_CKGEN_DAC1_MASK (0x1 << 12) 121262306a36Sopenharmony_ci#define RT5668_CKGEN_DAC1_SFT 12 121362306a36Sopenharmony_ci 121462306a36Sopenharmony_ci/* Chopper and Clock control for ADC (0x013b)*/ 121562306a36Sopenharmony_ci#define RT5668_CKXEN_ADC1_MASK (0x1 << 13) 121662306a36Sopenharmony_ci#define RT5668_CKXEN_ADC1_SFT 13 121762306a36Sopenharmony_ci#define RT5668_CKGEN_ADC1_MASK (0x1 << 12) 121862306a36Sopenharmony_ci#define RT5668_CKGEN_ADC1_SFT 12 121962306a36Sopenharmony_ci 122062306a36Sopenharmony_ci/* Volume test (0x013f)*/ 122162306a36Sopenharmony_ci#define RT5668_SEL_CLK_VOL_MASK (0x1 << 15) 122262306a36Sopenharmony_ci#define RT5668_SEL_CLK_VOL_EN (0x1 << 15) 122362306a36Sopenharmony_ci#define RT5668_SEL_CLK_VOL_DIS (0x0 << 15) 122462306a36Sopenharmony_ci 122562306a36Sopenharmony_ci/* Test Mode Control 1 (0x0145) */ 122662306a36Sopenharmony_ci#define RT5668_AD2DA_LB_MASK (0x1 << 10) 122762306a36Sopenharmony_ci#define RT5668_AD2DA_LB_SFT 10 122862306a36Sopenharmony_ci 122962306a36Sopenharmony_ci/* Stereo Noise Gate Control 1 (0x0160) */ 123062306a36Sopenharmony_ci#define RT5668_NG2_EN_MASK (0x1 << 15) 123162306a36Sopenharmony_ci#define RT5668_NG2_EN (0x1 << 15) 123262306a36Sopenharmony_ci#define RT5668_NG2_DIS (0x0 << 15) 123362306a36Sopenharmony_ci 123462306a36Sopenharmony_ci/* Stereo1 DAC Silence Detection Control (0x0190) */ 123562306a36Sopenharmony_ci#define RT5668_DEB_STO_DAC_MASK (0x7 << 4) 123662306a36Sopenharmony_ci#define RT5668_DEB_80_MS (0x0 << 4) 123762306a36Sopenharmony_ci 123862306a36Sopenharmony_ci/* SAR ADC Inline Command Control 1 (0x0210) */ 123962306a36Sopenharmony_ci#define RT5668_SAR_BUTT_DET_MASK (0x1 << 15) 124062306a36Sopenharmony_ci#define RT5668_SAR_BUTT_DET_EN (0x1 << 15) 124162306a36Sopenharmony_ci#define RT5668_SAR_BUTT_DET_DIS (0x0 << 15) 124262306a36Sopenharmony_ci#define RT5668_SAR_BUTDET_MODE_MASK (0x1 << 14) 124362306a36Sopenharmony_ci#define RT5668_SAR_BUTDET_POW_SAV (0x1 << 14) 124462306a36Sopenharmony_ci#define RT5668_SAR_BUTDET_POW_NORM (0x0 << 14) 124562306a36Sopenharmony_ci#define RT5668_SAR_BUTDET_RST_MASK (0x1 << 13) 124662306a36Sopenharmony_ci#define RT5668_SAR_BUTDET_RST_NORMAL (0x1 << 13) 124762306a36Sopenharmony_ci#define RT5668_SAR_BUTDET_RST (0x0 << 13) 124862306a36Sopenharmony_ci#define RT5668_SAR_POW_MASK (0x1 << 12) 124962306a36Sopenharmony_ci#define RT5668_SAR_POW_EN (0x1 << 12) 125062306a36Sopenharmony_ci#define RT5668_SAR_POW_DIS (0x0 << 12) 125162306a36Sopenharmony_ci#define RT5668_SAR_RST_MASK (0x1 << 11) 125262306a36Sopenharmony_ci#define RT5668_SAR_RST_NORMAL (0x1 << 11) 125362306a36Sopenharmony_ci#define RT5668_SAR_RST (0x0 << 11) 125462306a36Sopenharmony_ci#define RT5668_SAR_BYPASS_MASK (0x1 << 10) 125562306a36Sopenharmony_ci#define RT5668_SAR_BYPASS_EN (0x1 << 10) 125662306a36Sopenharmony_ci#define RT5668_SAR_BYPASS_DIS (0x0 << 10) 125762306a36Sopenharmony_ci#define RT5668_SAR_SEL_MB1_MASK (0x1 << 9) 125862306a36Sopenharmony_ci#define RT5668_SAR_SEL_MB1_SEL (0x1 << 9) 125962306a36Sopenharmony_ci#define RT5668_SAR_SEL_MB1_NOSEL (0x0 << 9) 126062306a36Sopenharmony_ci#define RT5668_SAR_SEL_MB2_MASK (0x1 << 8) 126162306a36Sopenharmony_ci#define RT5668_SAR_SEL_MB2_SEL (0x1 << 8) 126262306a36Sopenharmony_ci#define RT5668_SAR_SEL_MB2_NOSEL (0x0 << 8) 126362306a36Sopenharmony_ci#define RT5668_SAR_SEL_MODE_MASK (0x1 << 7) 126462306a36Sopenharmony_ci#define RT5668_SAR_SEL_MODE_CMP (0x1 << 7) 126562306a36Sopenharmony_ci#define RT5668_SAR_SEL_MODE_ADC (0x0 << 7) 126662306a36Sopenharmony_ci#define RT5668_SAR_SEL_MB1_MB2_MASK (0x1 << 5) 126762306a36Sopenharmony_ci#define RT5668_SAR_SEL_MB1_MB2_AUTO (0x1 << 5) 126862306a36Sopenharmony_ci#define RT5668_SAR_SEL_MB1_MB2_MANU (0x0 << 5) 126962306a36Sopenharmony_ci#define RT5668_SAR_SEL_SIGNAL_MASK (0x1 << 4) 127062306a36Sopenharmony_ci#define RT5668_SAR_SEL_SIGNAL_AUTO (0x1 << 4) 127162306a36Sopenharmony_ci#define RT5668_SAR_SEL_SIGNAL_MANU (0x0 << 4) 127262306a36Sopenharmony_ci 127362306a36Sopenharmony_ci/* SAR ADC Inline Command Control 13 (0x021c) */ 127462306a36Sopenharmony_ci#define RT5668_SAR_SOUR_MASK (0x3f) 127562306a36Sopenharmony_ci#define RT5668_SAR_SOUR_BTN (0x3f) 127662306a36Sopenharmony_ci#define RT5668_SAR_SOUR_TYPE (0x0) 127762306a36Sopenharmony_ci 127862306a36Sopenharmony_ci 127962306a36Sopenharmony_ci/* System Clock Source */ 128062306a36Sopenharmony_cienum { 128162306a36Sopenharmony_ci RT5668_SCLK_S_MCLK, 128262306a36Sopenharmony_ci RT5668_SCLK_S_PLL1, 128362306a36Sopenharmony_ci RT5668_SCLK_S_PLL2, 128462306a36Sopenharmony_ci RT5668_SCLK_S_RCCLK, 128562306a36Sopenharmony_ci}; 128662306a36Sopenharmony_ci 128762306a36Sopenharmony_ci/* PLL Source */ 128862306a36Sopenharmony_cienum { 128962306a36Sopenharmony_ci RT5668_PLL1_S_MCLK, 129062306a36Sopenharmony_ci RT5668_PLL1_S_BCLK1, 129162306a36Sopenharmony_ci RT5668_PLL1_S_RCCLK, 129262306a36Sopenharmony_ci}; 129362306a36Sopenharmony_ci 129462306a36Sopenharmony_cienum { 129562306a36Sopenharmony_ci RT5668_AIF1, 129662306a36Sopenharmony_ci RT5668_AIF2, 129762306a36Sopenharmony_ci RT5668_AIFS 129862306a36Sopenharmony_ci}; 129962306a36Sopenharmony_ci 130062306a36Sopenharmony_ci/* filter mask */ 130162306a36Sopenharmony_cienum { 130262306a36Sopenharmony_ci RT5668_DA_STEREO1_FILTER = 0x1, 130362306a36Sopenharmony_ci RT5668_AD_STEREO1_FILTER = (0x1 << 1), 130462306a36Sopenharmony_ci}; 130562306a36Sopenharmony_ci 130662306a36Sopenharmony_cienum { 130762306a36Sopenharmony_ci RT5668_CLK_SEL_SYS, 130862306a36Sopenharmony_ci RT5668_CLK_SEL_I2S1_ASRC, 130962306a36Sopenharmony_ci RT5668_CLK_SEL_I2S2_ASRC, 131062306a36Sopenharmony_ci}; 131162306a36Sopenharmony_ci 131262306a36Sopenharmony_ciint rt5668_sel_asrc_clk_src(struct snd_soc_component *component, 131362306a36Sopenharmony_ci unsigned int filter_mask, unsigned int clk_src); 131462306a36Sopenharmony_ci 131562306a36Sopenharmony_ci#endif /* __RT5668_H__ */ 1316