18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */ 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * rt5645.h -- RT5645 ALSA SoC audio driver 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * Copyright 2013 Realtek Microelectronics 68c2ecf20Sopenharmony_ci * Author: Bard Liao <bardliao@realtek.com> 78c2ecf20Sopenharmony_ci */ 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_ci#ifndef __RT5645_H__ 108c2ecf20Sopenharmony_ci#define __RT5645_H__ 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_ci#include <sound/rt5645.h> 138c2ecf20Sopenharmony_ci 148c2ecf20Sopenharmony_ci/* Info */ 158c2ecf20Sopenharmony_ci#define RT5645_RESET 0x00 168c2ecf20Sopenharmony_ci#define RT5645_VENDOR_ID 0xfd 178c2ecf20Sopenharmony_ci#define RT5645_VENDOR_ID1 0xfe 188c2ecf20Sopenharmony_ci#define RT5645_VENDOR_ID2 0xff 198c2ecf20Sopenharmony_ci/* I/O - Output */ 208c2ecf20Sopenharmony_ci#define RT5645_SPK_VOL 0x01 218c2ecf20Sopenharmony_ci#define RT5645_HP_VOL 0x02 228c2ecf20Sopenharmony_ci#define RT5645_LOUT1 0x03 238c2ecf20Sopenharmony_ci#define RT5645_LOUT_CTRL 0x05 248c2ecf20Sopenharmony_ci/* I/O - Input */ 258c2ecf20Sopenharmony_ci#define RT5645_IN1_CTRL1 0x0a 268c2ecf20Sopenharmony_ci#define RT5645_IN1_CTRL2 0x0b 278c2ecf20Sopenharmony_ci#define RT5645_IN1_CTRL3 0x0c 288c2ecf20Sopenharmony_ci#define RT5645_IN2_CTRL 0x0d 298c2ecf20Sopenharmony_ci#define RT5645_INL1_INR1_VOL 0x0f 308c2ecf20Sopenharmony_ci#define RT5645_SPK_FUNC_LIM 0x14 318c2ecf20Sopenharmony_ci#define RT5645_ADJ_HPF_CTRL 0x16 328c2ecf20Sopenharmony_ci/* I/O - ADC/DAC/DMIC */ 338c2ecf20Sopenharmony_ci#define RT5645_DAC1_DIG_VOL 0x19 348c2ecf20Sopenharmony_ci#define RT5645_DAC2_DIG_VOL 0x1a 358c2ecf20Sopenharmony_ci#define RT5645_DAC_CTRL 0x1b 368c2ecf20Sopenharmony_ci#define RT5645_STO1_ADC_DIG_VOL 0x1c 378c2ecf20Sopenharmony_ci#define RT5645_MONO_ADC_DIG_VOL 0x1d 388c2ecf20Sopenharmony_ci#define RT5645_ADC_BST_VOL1 0x1e 398c2ecf20Sopenharmony_ci#define RT5645_ADC_BST_VOL2 0x20 408c2ecf20Sopenharmony_ci/* Mixer - D-D */ 418c2ecf20Sopenharmony_ci#define RT5645_STO1_ADC_MIXER 0x27 428c2ecf20Sopenharmony_ci#define RT5645_MONO_ADC_MIXER 0x28 438c2ecf20Sopenharmony_ci#define RT5645_AD_DA_MIXER 0x29 448c2ecf20Sopenharmony_ci#define RT5645_STO_DAC_MIXER 0x2a 458c2ecf20Sopenharmony_ci#define RT5645_MONO_DAC_MIXER 0x2b 468c2ecf20Sopenharmony_ci#define RT5645_DIG_MIXER 0x2c 478c2ecf20Sopenharmony_ci#define RT5650_A_DAC_SOUR 0x2d 488c2ecf20Sopenharmony_ci#define RT5645_DIG_INF1_DATA 0x2f 498c2ecf20Sopenharmony_ci/* Mixer - PDM */ 508c2ecf20Sopenharmony_ci#define RT5645_PDM_OUT_CTRL 0x31 518c2ecf20Sopenharmony_ci/* Mixer - ADC */ 528c2ecf20Sopenharmony_ci#define RT5645_REC_L1_MIXER 0x3b 538c2ecf20Sopenharmony_ci#define RT5645_REC_L2_MIXER 0x3c 548c2ecf20Sopenharmony_ci#define RT5645_REC_R1_MIXER 0x3d 558c2ecf20Sopenharmony_ci#define RT5645_REC_R2_MIXER 0x3e 568c2ecf20Sopenharmony_ci/* Mixer - DAC */ 578c2ecf20Sopenharmony_ci#define RT5645_HPMIXL_CTRL 0x3f 588c2ecf20Sopenharmony_ci#define RT5645_HPOMIXL_CTRL 0x40 598c2ecf20Sopenharmony_ci#define RT5645_HPMIXR_CTRL 0x41 608c2ecf20Sopenharmony_ci#define RT5645_HPOMIXR_CTRL 0x42 618c2ecf20Sopenharmony_ci#define RT5645_HPO_MIXER 0x45 628c2ecf20Sopenharmony_ci#define RT5645_SPK_L_MIXER 0x46 638c2ecf20Sopenharmony_ci#define RT5645_SPK_R_MIXER 0x47 648c2ecf20Sopenharmony_ci#define RT5645_SPO_MIXER 0x48 658c2ecf20Sopenharmony_ci#define RT5645_SPO_CLSD_RATIO 0x4a 668c2ecf20Sopenharmony_ci#define RT5645_OUT_L_GAIN1 0x4d 678c2ecf20Sopenharmony_ci#define RT5645_OUT_L_GAIN2 0x4e 688c2ecf20Sopenharmony_ci#define RT5645_OUT_L1_MIXER 0x4f 698c2ecf20Sopenharmony_ci#define RT5645_OUT_R_GAIN1 0x50 708c2ecf20Sopenharmony_ci#define RT5645_OUT_R_GAIN2 0x51 718c2ecf20Sopenharmony_ci#define RT5645_OUT_R1_MIXER 0x52 728c2ecf20Sopenharmony_ci#define RT5645_LOUT_MIXER 0x53 738c2ecf20Sopenharmony_ci/* Haptic */ 748c2ecf20Sopenharmony_ci#define RT5645_HAPTIC_CTRL1 0x56 758c2ecf20Sopenharmony_ci#define RT5645_HAPTIC_CTRL2 0x57 768c2ecf20Sopenharmony_ci#define RT5645_HAPTIC_CTRL3 0x58 778c2ecf20Sopenharmony_ci#define RT5645_HAPTIC_CTRL4 0x59 788c2ecf20Sopenharmony_ci#define RT5645_HAPTIC_CTRL5 0x5a 798c2ecf20Sopenharmony_ci#define RT5645_HAPTIC_CTRL6 0x5b 808c2ecf20Sopenharmony_ci#define RT5645_HAPTIC_CTRL7 0x5c 818c2ecf20Sopenharmony_ci#define RT5645_HAPTIC_CTRL8 0x5d 828c2ecf20Sopenharmony_ci#define RT5645_HAPTIC_CTRL9 0x5e 838c2ecf20Sopenharmony_ci#define RT5645_HAPTIC_CTRL10 0x5f 848c2ecf20Sopenharmony_ci/* Power */ 858c2ecf20Sopenharmony_ci#define RT5645_PWR_DIG1 0x61 868c2ecf20Sopenharmony_ci#define RT5645_PWR_DIG2 0x62 878c2ecf20Sopenharmony_ci#define RT5645_PWR_ANLG1 0x63 888c2ecf20Sopenharmony_ci#define RT5645_PWR_ANLG2 0x64 898c2ecf20Sopenharmony_ci#define RT5645_PWR_MIXER 0x65 908c2ecf20Sopenharmony_ci#define RT5645_PWR_VOL 0x66 918c2ecf20Sopenharmony_ci/* Private Register Control */ 928c2ecf20Sopenharmony_ci#define RT5645_PRIV_INDEX 0x6a 938c2ecf20Sopenharmony_ci#define RT5645_PRIV_DATA 0x6c 948c2ecf20Sopenharmony_ci/* Format - ADC/DAC */ 958c2ecf20Sopenharmony_ci#define RT5645_I2S1_SDP 0x70 968c2ecf20Sopenharmony_ci#define RT5645_I2S2_SDP 0x71 978c2ecf20Sopenharmony_ci#define RT5645_ADDA_CLK1 0x73 988c2ecf20Sopenharmony_ci#define RT5645_ADDA_CLK2 0x74 998c2ecf20Sopenharmony_ci#define RT5645_DMIC_CTRL1 0x75 1008c2ecf20Sopenharmony_ci#define RT5645_DMIC_CTRL2 0x76 1018c2ecf20Sopenharmony_ci/* Format - TDM Control */ 1028c2ecf20Sopenharmony_ci#define RT5645_TDM_CTRL_1 0x77 1038c2ecf20Sopenharmony_ci#define RT5645_TDM_CTRL_2 0x78 1048c2ecf20Sopenharmony_ci#define RT5645_TDM_CTRL_3 0x79 1058c2ecf20Sopenharmony_ci#define RT5650_TDM_CTRL_4 0x7a 1068c2ecf20Sopenharmony_ci 1078c2ecf20Sopenharmony_ci/* Function - Analog */ 1088c2ecf20Sopenharmony_ci#define RT5645_GLB_CLK 0x80 1098c2ecf20Sopenharmony_ci#define RT5645_PLL_CTRL1 0x81 1108c2ecf20Sopenharmony_ci#define RT5645_PLL_CTRL2 0x82 1118c2ecf20Sopenharmony_ci#define RT5645_ASRC_1 0x83 1128c2ecf20Sopenharmony_ci#define RT5645_ASRC_2 0x84 1138c2ecf20Sopenharmony_ci#define RT5645_ASRC_3 0x85 1148c2ecf20Sopenharmony_ci#define RT5645_ASRC_4 0x8a 1158c2ecf20Sopenharmony_ci#define RT5645_DEPOP_M1 0x8e 1168c2ecf20Sopenharmony_ci#define RT5645_DEPOP_M2 0x8f 1178c2ecf20Sopenharmony_ci#define RT5645_DEPOP_M3 0x90 1188c2ecf20Sopenharmony_ci#define RT5645_CHARGE_PUMP 0x91 1198c2ecf20Sopenharmony_ci#define RT5645_MICBIAS 0x93 1208c2ecf20Sopenharmony_ci#define RT5645_A_JD_CTRL1 0x94 1218c2ecf20Sopenharmony_ci#define RT5645_VAD_CTRL4 0x9d 1228c2ecf20Sopenharmony_ci#define RT5645_CLSD_OUT_CTRL 0xa0 1238c2ecf20Sopenharmony_ci/* Function - Digital */ 1248c2ecf20Sopenharmony_ci#define RT5645_ADC_EQ_CTRL1 0xae 1258c2ecf20Sopenharmony_ci#define RT5645_ADC_EQ_CTRL2 0xaf 1268c2ecf20Sopenharmony_ci#define RT5645_EQ_CTRL1 0xb0 1278c2ecf20Sopenharmony_ci#define RT5645_EQ_CTRL2 0xb1 1288c2ecf20Sopenharmony_ci#define RT5645_ALC_CTRL_1 0xb3 1298c2ecf20Sopenharmony_ci#define RT5645_ALC_CTRL_2 0xb4 1308c2ecf20Sopenharmony_ci#define RT5645_ALC_CTRL_3 0xb5 1318c2ecf20Sopenharmony_ci#define RT5645_ALC_CTRL_4 0xb6 1328c2ecf20Sopenharmony_ci#define RT5645_ALC_CTRL_5 0xb7 1338c2ecf20Sopenharmony_ci#define RT5645_JD_CTRL 0xbb 1348c2ecf20Sopenharmony_ci#define RT5645_IRQ_CTRL1 0xbc 1358c2ecf20Sopenharmony_ci#define RT5645_IRQ_CTRL2 0xbd 1368c2ecf20Sopenharmony_ci#define RT5645_IRQ_CTRL3 0xbe 1378c2ecf20Sopenharmony_ci#define RT5645_INT_IRQ_ST 0xbf 1388c2ecf20Sopenharmony_ci#define RT5645_GPIO_CTRL1 0xc0 1398c2ecf20Sopenharmony_ci#define RT5645_GPIO_CTRL2 0xc1 1408c2ecf20Sopenharmony_ci#define RT5645_GPIO_CTRL3 0xc2 1418c2ecf20Sopenharmony_ci#define RT5645_BASS_BACK 0xcf 1428c2ecf20Sopenharmony_ci#define RT5645_MP3_PLUS1 0xd0 1438c2ecf20Sopenharmony_ci#define RT5645_MP3_PLUS2 0xd1 1448c2ecf20Sopenharmony_ci#define RT5645_ADJ_HPF1 0xd3 1458c2ecf20Sopenharmony_ci#define RT5645_ADJ_HPF2 0xd4 1468c2ecf20Sopenharmony_ci#define RT5645_HP_CALIB_AMP_DET 0xd6 1478c2ecf20Sopenharmony_ci#define RT5645_SV_ZCD1 0xd9 1488c2ecf20Sopenharmony_ci#define RT5645_SV_ZCD2 0xda 1498c2ecf20Sopenharmony_ci#define RT5645_IL_CMD 0xdb 1508c2ecf20Sopenharmony_ci#define RT5645_IL_CMD2 0xdc 1518c2ecf20Sopenharmony_ci#define RT5645_IL_CMD3 0xdd 1528c2ecf20Sopenharmony_ci#define RT5650_4BTN_IL_CMD1 0xdf 1538c2ecf20Sopenharmony_ci#define RT5650_4BTN_IL_CMD2 0xe0 1548c2ecf20Sopenharmony_ci#define RT5645_DRC1_HL_CTRL1 0xe7 1558c2ecf20Sopenharmony_ci#define RT5645_DRC2_HL_CTRL1 0xe9 1568c2ecf20Sopenharmony_ci#define RT5645_MUTI_DRC_CTRL1 0xea 1578c2ecf20Sopenharmony_ci#define RT5645_ADC_MONO_HP_CTRL1 0xec 1588c2ecf20Sopenharmony_ci#define RT5645_ADC_MONO_HP_CTRL2 0xed 1598c2ecf20Sopenharmony_ci#define RT5645_DRC2_CTRL1 0xf0 1608c2ecf20Sopenharmony_ci#define RT5645_DRC2_CTRL2 0xf1 1618c2ecf20Sopenharmony_ci#define RT5645_DRC2_CTRL3 0xf2 1628c2ecf20Sopenharmony_ci#define RT5645_DRC2_CTRL4 0xf3 1638c2ecf20Sopenharmony_ci#define RT5645_DRC2_CTRL5 0xf4 1648c2ecf20Sopenharmony_ci#define RT5645_JD_CTRL3 0xf8 1658c2ecf20Sopenharmony_ci#define RT5645_JD_CTRL4 0xf9 1668c2ecf20Sopenharmony_ci/* General Control */ 1678c2ecf20Sopenharmony_ci#define RT5645_GEN_CTRL1 0xfa 1688c2ecf20Sopenharmony_ci#define RT5645_GEN_CTRL2 0xfb 1698c2ecf20Sopenharmony_ci#define RT5645_GEN_CTRL3 0xfc 1708c2ecf20Sopenharmony_ci 1718c2ecf20Sopenharmony_ci 1728c2ecf20Sopenharmony_ci/* Index of Codec Private Register definition */ 1738c2ecf20Sopenharmony_ci#define RT5645_DIG_VOL 0x00 1748c2ecf20Sopenharmony_ci#define RT5645_PR_ALC_CTRL_1 0x01 1758c2ecf20Sopenharmony_ci#define RT5645_PR_ALC_CTRL_2 0x02 1768c2ecf20Sopenharmony_ci#define RT5645_PR_ALC_CTRL_3 0x03 1778c2ecf20Sopenharmony_ci#define RT5645_PR_ALC_CTRL_4 0x04 1788c2ecf20Sopenharmony_ci#define RT5645_PR_ALC_CTRL_5 0x05 1798c2ecf20Sopenharmony_ci#define RT5645_PR_ALC_CTRL_6 0x06 1808c2ecf20Sopenharmony_ci#define RT5645_BIAS_CUR1 0x12 1818c2ecf20Sopenharmony_ci#define RT5645_BIAS_CUR3 0x14 1828c2ecf20Sopenharmony_ci#define RT5645_CLSD_INT_REG1 0x1c 1838c2ecf20Sopenharmony_ci#define RT5645_MAMP_INT_REG2 0x37 1848c2ecf20Sopenharmony_ci#define RT5645_CHOP_DAC_ADC 0x3d 1858c2ecf20Sopenharmony_ci#define RT5645_MIXER_INT_REG 0x3f 1868c2ecf20Sopenharmony_ci#define RT5645_3D_SPK 0x63 1878c2ecf20Sopenharmony_ci#define RT5645_WND_1 0x6c 1888c2ecf20Sopenharmony_ci#define RT5645_WND_2 0x6d 1898c2ecf20Sopenharmony_ci#define RT5645_WND_3 0x6e 1908c2ecf20Sopenharmony_ci#define RT5645_WND_4 0x6f 1918c2ecf20Sopenharmony_ci#define RT5645_WND_5 0x70 1928c2ecf20Sopenharmony_ci#define RT5645_WND_8 0x73 1938c2ecf20Sopenharmony_ci#define RT5645_DIP_SPK_INF 0x75 1948c2ecf20Sopenharmony_ci#define RT5645_HP_DCC_INT1 0x77 1958c2ecf20Sopenharmony_ci#define RT5645_EQ_BW_LOP 0xa0 1968c2ecf20Sopenharmony_ci#define RT5645_EQ_GN_LOP 0xa1 1978c2ecf20Sopenharmony_ci#define RT5645_EQ_FC_BP1 0xa2 1988c2ecf20Sopenharmony_ci#define RT5645_EQ_BW_BP1 0xa3 1998c2ecf20Sopenharmony_ci#define RT5645_EQ_GN_BP1 0xa4 2008c2ecf20Sopenharmony_ci#define RT5645_EQ_FC_BP2 0xa5 2018c2ecf20Sopenharmony_ci#define RT5645_EQ_BW_BP2 0xa6 2028c2ecf20Sopenharmony_ci#define RT5645_EQ_GN_BP2 0xa7 2038c2ecf20Sopenharmony_ci#define RT5645_EQ_FC_BP3 0xa8 2048c2ecf20Sopenharmony_ci#define RT5645_EQ_BW_BP3 0xa9 2058c2ecf20Sopenharmony_ci#define RT5645_EQ_GN_BP3 0xaa 2068c2ecf20Sopenharmony_ci#define RT5645_EQ_FC_BP4 0xab 2078c2ecf20Sopenharmony_ci#define RT5645_EQ_BW_BP4 0xac 2088c2ecf20Sopenharmony_ci#define RT5645_EQ_GN_BP4 0xad 2098c2ecf20Sopenharmony_ci#define RT5645_EQ_FC_HIP1 0xae 2108c2ecf20Sopenharmony_ci#define RT5645_EQ_GN_HIP1 0xaf 2118c2ecf20Sopenharmony_ci#define RT5645_EQ_FC_HIP2 0xb0 2128c2ecf20Sopenharmony_ci#define RT5645_EQ_BW_HIP2 0xb1 2138c2ecf20Sopenharmony_ci#define RT5645_EQ_GN_HIP2 0xb2 2148c2ecf20Sopenharmony_ci#define RT5645_EQ_PRE_VOL 0xb3 2158c2ecf20Sopenharmony_ci#define RT5645_EQ_PST_VOL 0xb4 2168c2ecf20Sopenharmony_ci 2178c2ecf20Sopenharmony_ci 2188c2ecf20Sopenharmony_ci/* global definition */ 2198c2ecf20Sopenharmony_ci#define RT5645_L_MUTE (0x1 << 15) 2208c2ecf20Sopenharmony_ci#define RT5645_L_MUTE_SFT 15 2218c2ecf20Sopenharmony_ci#define RT5645_VOL_L_MUTE (0x1 << 14) 2228c2ecf20Sopenharmony_ci#define RT5645_VOL_L_SFT 14 2238c2ecf20Sopenharmony_ci#define RT5645_R_MUTE (0x1 << 7) 2248c2ecf20Sopenharmony_ci#define RT5645_R_MUTE_SFT 7 2258c2ecf20Sopenharmony_ci#define RT5645_VOL_R_MUTE (0x1 << 6) 2268c2ecf20Sopenharmony_ci#define RT5645_VOL_R_SFT 6 2278c2ecf20Sopenharmony_ci#define RT5645_L_VOL_MASK (0x3f << 8) 2288c2ecf20Sopenharmony_ci#define RT5645_L_VOL_SFT 8 2298c2ecf20Sopenharmony_ci#define RT5645_R_VOL_MASK (0x3f) 2308c2ecf20Sopenharmony_ci#define RT5645_R_VOL_SFT 0 2318c2ecf20Sopenharmony_ci 2328c2ecf20Sopenharmony_ci/* IN1 Control 1 (0x0a) */ 2338c2ecf20Sopenharmony_ci#define RT5645_CBJ_BST1_MASK (0xf << 12) 2348c2ecf20Sopenharmony_ci#define RT5645_CBJ_BST1_SFT (12) 2358c2ecf20Sopenharmony_ci#define RT5645_CBJ_JD_HP_EN (0x1 << 9) 2368c2ecf20Sopenharmony_ci#define RT5645_CBJ_JD_MIC_EN (0x1 << 8) 2378c2ecf20Sopenharmony_ci#define RT5645_CBJ_JD_MIC_SW_EN (0x1 << 7) 2388c2ecf20Sopenharmony_ci#define RT5645_CBJ_MIC_SEL_R (0x1 << 6) 2398c2ecf20Sopenharmony_ci#define RT5645_CBJ_MIC_SEL_L (0x1 << 5) 2408c2ecf20Sopenharmony_ci#define RT5645_CBJ_MIC_SW (0x1 << 4) 2418c2ecf20Sopenharmony_ci#define RT5645_CBJ_BST1_EN (0x1 << 2) 2428c2ecf20Sopenharmony_ci 2438c2ecf20Sopenharmony_ci/* IN1 Control 2 (0x0b) */ 2448c2ecf20Sopenharmony_ci#define RT5645_CBJ_MN_JD (0x1 << 12) 2458c2ecf20Sopenharmony_ci#define RT5645_CAPLESS_EN (0x1 << 11) 2468c2ecf20Sopenharmony_ci#define RT5645_CBJ_DET_MODE (0x1 << 7) 2478c2ecf20Sopenharmony_ci 2488c2ecf20Sopenharmony_ci/* IN1 Control 3 (0x0c) */ 2498c2ecf20Sopenharmony_ci#define RT5645_CBJ_TIE_G_L (0x1 << 15) 2508c2ecf20Sopenharmony_ci#define RT5645_CBJ_TIE_G_R (0x1 << 14) 2518c2ecf20Sopenharmony_ci 2528c2ecf20Sopenharmony_ci/* IN2 Control (0x0d) */ 2538c2ecf20Sopenharmony_ci#define RT5645_BST_MASK1 (0xf<<12) 2548c2ecf20Sopenharmony_ci#define RT5645_BST_SFT1 12 2558c2ecf20Sopenharmony_ci#define RT5645_BST_MASK2 (0xf<<8) 2568c2ecf20Sopenharmony_ci#define RT5645_BST_SFT2 8 2578c2ecf20Sopenharmony_ci#define RT5645_IN_DF2 (0x1 << 6) 2588c2ecf20Sopenharmony_ci#define RT5645_IN_SFT2 6 2598c2ecf20Sopenharmony_ci 2608c2ecf20Sopenharmony_ci/* INL and INR Volume Control (0x0f) */ 2618c2ecf20Sopenharmony_ci#define RT5645_INL_SEL_MASK (0x1 << 15) 2628c2ecf20Sopenharmony_ci#define RT5645_INL_SEL_SFT 15 2638c2ecf20Sopenharmony_ci#define RT5645_INL_SEL_IN4P (0x0 << 15) 2648c2ecf20Sopenharmony_ci#define RT5645_INL_SEL_MONOP (0x1 << 15) 2658c2ecf20Sopenharmony_ci#define RT5645_INL_VOL_MASK (0x1f << 8) 2668c2ecf20Sopenharmony_ci#define RT5645_INL_VOL_SFT 8 2678c2ecf20Sopenharmony_ci#define RT5645_INR_SEL_MASK (0x1 << 7) 2688c2ecf20Sopenharmony_ci#define RT5645_INR_SEL_SFT 7 2698c2ecf20Sopenharmony_ci#define RT5645_INR_SEL_IN4N (0x0 << 7) 2708c2ecf20Sopenharmony_ci#define RT5645_INR_SEL_MONON (0x1 << 7) 2718c2ecf20Sopenharmony_ci#define RT5645_INR_VOL_MASK (0x1f) 2728c2ecf20Sopenharmony_ci#define RT5645_INR_VOL_SFT 0 2738c2ecf20Sopenharmony_ci 2748c2ecf20Sopenharmony_ci/* DAC1 Digital Volume (0x19) */ 2758c2ecf20Sopenharmony_ci#define RT5645_DAC_L1_VOL_MASK (0xff << 8) 2768c2ecf20Sopenharmony_ci#define RT5645_DAC_L1_VOL_SFT 8 2778c2ecf20Sopenharmony_ci#define RT5645_DAC_R1_VOL_MASK (0xff) 2788c2ecf20Sopenharmony_ci#define RT5645_DAC_R1_VOL_SFT 0 2798c2ecf20Sopenharmony_ci 2808c2ecf20Sopenharmony_ci/* DAC2 Digital Volume (0x1a) */ 2818c2ecf20Sopenharmony_ci#define RT5645_DAC_L2_VOL_MASK (0xff << 8) 2828c2ecf20Sopenharmony_ci#define RT5645_DAC_L2_VOL_SFT 8 2838c2ecf20Sopenharmony_ci#define RT5645_DAC_R2_VOL_MASK (0xff) 2848c2ecf20Sopenharmony_ci#define RT5645_DAC_R2_VOL_SFT 0 2858c2ecf20Sopenharmony_ci 2868c2ecf20Sopenharmony_ci/* DAC2 Control (0x1b) */ 2878c2ecf20Sopenharmony_ci#define RT5645_M_DAC_L2_VOL (0x1 << 13) 2888c2ecf20Sopenharmony_ci#define RT5645_M_DAC_L2_VOL_SFT 13 2898c2ecf20Sopenharmony_ci#define RT5645_M_DAC_R2_VOL (0x1 << 12) 2908c2ecf20Sopenharmony_ci#define RT5645_M_DAC_R2_VOL_SFT 12 2918c2ecf20Sopenharmony_ci#define RT5645_DAC2_L_SEL_MASK (0x7 << 4) 2928c2ecf20Sopenharmony_ci#define RT5645_DAC2_L_SEL_SFT 4 2938c2ecf20Sopenharmony_ci#define RT5645_DAC2_R_SEL_MASK (0x7 << 0) 2948c2ecf20Sopenharmony_ci#define RT5645_DAC2_R_SEL_SFT 0 2958c2ecf20Sopenharmony_ci 2968c2ecf20Sopenharmony_ci/* ADC Digital Volume Control (0x1c) */ 2978c2ecf20Sopenharmony_ci#define RT5645_ADC_L_VOL_MASK (0x7f << 8) 2988c2ecf20Sopenharmony_ci#define RT5645_ADC_L_VOL_SFT 8 2998c2ecf20Sopenharmony_ci#define RT5645_ADC_R_VOL_MASK (0x7f) 3008c2ecf20Sopenharmony_ci#define RT5645_ADC_R_VOL_SFT 0 3018c2ecf20Sopenharmony_ci 3028c2ecf20Sopenharmony_ci/* Mono ADC Digital Volume Control (0x1d) */ 3038c2ecf20Sopenharmony_ci#define RT5645_MONO_ADC_L_VOL_MASK (0x7f << 8) 3048c2ecf20Sopenharmony_ci#define RT5645_MONO_ADC_L_VOL_SFT 8 3058c2ecf20Sopenharmony_ci#define RT5645_MONO_ADC_R_VOL_MASK (0x7f) 3068c2ecf20Sopenharmony_ci#define RT5645_MONO_ADC_R_VOL_SFT 0 3078c2ecf20Sopenharmony_ci 3088c2ecf20Sopenharmony_ci/* ADC Boost Volume Control (0x1e) */ 3098c2ecf20Sopenharmony_ci#define RT5645_STO1_ADC_L_BST_MASK (0x3 << 14) 3108c2ecf20Sopenharmony_ci#define RT5645_STO1_ADC_L_BST_SFT 14 3118c2ecf20Sopenharmony_ci#define RT5645_STO1_ADC_R_BST_MASK (0x3 << 12) 3128c2ecf20Sopenharmony_ci#define RT5645_STO1_ADC_R_BST_SFT 12 3138c2ecf20Sopenharmony_ci#define RT5645_STO1_ADC_COMP_MASK (0x3 << 10) 3148c2ecf20Sopenharmony_ci#define RT5645_STO1_ADC_COMP_SFT 10 3158c2ecf20Sopenharmony_ci 3168c2ecf20Sopenharmony_ci/* ADC Boost Volume Control (0x20) */ 3178c2ecf20Sopenharmony_ci#define RT5645_MONO_ADC_L_BST_MASK (0x3 << 14) 3188c2ecf20Sopenharmony_ci#define RT5645_MONO_ADC_L_BST_SFT 14 3198c2ecf20Sopenharmony_ci#define RT5645_MONO_ADC_R_BST_MASK (0x3 << 12) 3208c2ecf20Sopenharmony_ci#define RT5645_MONO_ADC_R_BST_SFT 12 3218c2ecf20Sopenharmony_ci#define RT5645_MONO_ADC_COMP_MASK (0x3 << 10) 3228c2ecf20Sopenharmony_ci#define RT5645_MONO_ADC_COMP_SFT 10 3238c2ecf20Sopenharmony_ci 3248c2ecf20Sopenharmony_ci/* Stereo2 ADC Mixer Control (0x26) */ 3258c2ecf20Sopenharmony_ci#define RT5645_STO2_ADC_SRC_MASK (0x1 << 15) 3268c2ecf20Sopenharmony_ci#define RT5645_STO2_ADC_SRC_SFT 15 3278c2ecf20Sopenharmony_ci 3288c2ecf20Sopenharmony_ci/* Stereo ADC Mixer Control (0x27) */ 3298c2ecf20Sopenharmony_ci#define RT5645_M_ADC_L1 (0x1 << 14) 3308c2ecf20Sopenharmony_ci#define RT5645_M_ADC_L1_SFT 14 3318c2ecf20Sopenharmony_ci#define RT5645_M_ADC_L2 (0x1 << 13) 3328c2ecf20Sopenharmony_ci#define RT5645_M_ADC_L2_SFT 13 3338c2ecf20Sopenharmony_ci#define RT5645_ADC_1_SRC_MASK (0x1 << 12) 3348c2ecf20Sopenharmony_ci#define RT5645_ADC_1_SRC_SFT 12 3358c2ecf20Sopenharmony_ci#define RT5645_ADC_1_SRC_ADC (0x1 << 12) 3368c2ecf20Sopenharmony_ci#define RT5645_ADC_1_SRC_DACMIX (0x0 << 12) 3378c2ecf20Sopenharmony_ci#define RT5645_ADC_2_SRC_MASK (0x1 << 11) 3388c2ecf20Sopenharmony_ci#define RT5645_ADC_2_SRC_SFT 11 3398c2ecf20Sopenharmony_ci#define RT5645_DMIC_SRC_MASK (0x1 << 8) 3408c2ecf20Sopenharmony_ci#define RT5645_DMIC_SRC_SFT 8 3418c2ecf20Sopenharmony_ci#define RT5645_M_ADC_R1 (0x1 << 6) 3428c2ecf20Sopenharmony_ci#define RT5645_M_ADC_R1_SFT 6 3438c2ecf20Sopenharmony_ci#define RT5645_M_ADC_R2 (0x1 << 5) 3448c2ecf20Sopenharmony_ci#define RT5645_M_ADC_R2_SFT 5 3458c2ecf20Sopenharmony_ci#define RT5645_DMIC3_SRC_MASK (0x1 << 1) 3468c2ecf20Sopenharmony_ci#define RT5645_DMIC3_SRC_SFT 0 3478c2ecf20Sopenharmony_ci 3488c2ecf20Sopenharmony_ci/* Mono ADC Mixer Control (0x28) */ 3498c2ecf20Sopenharmony_ci#define RT5645_M_MONO_ADC_L1 (0x1 << 14) 3508c2ecf20Sopenharmony_ci#define RT5645_M_MONO_ADC_L1_SFT 14 3518c2ecf20Sopenharmony_ci#define RT5645_M_MONO_ADC_L2 (0x1 << 13) 3528c2ecf20Sopenharmony_ci#define RT5645_M_MONO_ADC_L2_SFT 13 3538c2ecf20Sopenharmony_ci#define RT5645_MONO_ADC_L1_SRC_MASK (0x1 << 12) 3548c2ecf20Sopenharmony_ci#define RT5645_MONO_ADC_L1_SRC_SFT 12 3558c2ecf20Sopenharmony_ci#define RT5645_MONO_ADC_L1_SRC_DACMIXL (0x0 << 12) 3568c2ecf20Sopenharmony_ci#define RT5645_MONO_ADC_L1_SRC_ADCL (0x1 << 12) 3578c2ecf20Sopenharmony_ci#define RT5645_MONO_ADC_L2_SRC_MASK (0x1 << 11) 3588c2ecf20Sopenharmony_ci#define RT5645_MONO_ADC_L2_SRC_SFT 11 3598c2ecf20Sopenharmony_ci#define RT5645_MONO_DMIC_L_SRC_MASK (0x1 << 8) 3608c2ecf20Sopenharmony_ci#define RT5645_MONO_DMIC_L_SRC_SFT 8 3618c2ecf20Sopenharmony_ci#define RT5645_M_MONO_ADC_R1 (0x1 << 6) 3628c2ecf20Sopenharmony_ci#define RT5645_M_MONO_ADC_R1_SFT 6 3638c2ecf20Sopenharmony_ci#define RT5645_M_MONO_ADC_R2 (0x1 << 5) 3648c2ecf20Sopenharmony_ci#define RT5645_M_MONO_ADC_R2_SFT 5 3658c2ecf20Sopenharmony_ci#define RT5645_MONO_ADC_R1_SRC_MASK (0x1 << 4) 3668c2ecf20Sopenharmony_ci#define RT5645_MONO_ADC_R1_SRC_SFT 4 3678c2ecf20Sopenharmony_ci#define RT5645_MONO_ADC_R1_SRC_ADCR (0x1 << 4) 3688c2ecf20Sopenharmony_ci#define RT5645_MONO_ADC_R1_SRC_DACMIXR (0x0 << 4) 3698c2ecf20Sopenharmony_ci#define RT5645_MONO_ADC_R2_SRC_MASK (0x1 << 3) 3708c2ecf20Sopenharmony_ci#define RT5645_MONO_ADC_R2_SRC_SFT 3 3718c2ecf20Sopenharmony_ci#define RT5645_MONO_DMIC_R_SRC_MASK (0x3) 3728c2ecf20Sopenharmony_ci#define RT5645_MONO_DMIC_R_SRC_SFT 0 3738c2ecf20Sopenharmony_ci 3748c2ecf20Sopenharmony_ci/* ADC Mixer to DAC Mixer Control (0x29) */ 3758c2ecf20Sopenharmony_ci#define RT5645_M_ADCMIX_L (0x1 << 15) 3768c2ecf20Sopenharmony_ci#define RT5645_M_ADCMIX_L_SFT 15 3778c2ecf20Sopenharmony_ci#define RT5645_M_DAC1_L (0x1 << 14) 3788c2ecf20Sopenharmony_ci#define RT5645_M_DAC1_L_SFT 14 3798c2ecf20Sopenharmony_ci#define RT5645_DAC1_R_SEL_MASK (0x3 << 10) 3808c2ecf20Sopenharmony_ci#define RT5645_DAC1_R_SEL_SFT 10 3818c2ecf20Sopenharmony_ci#define RT5645_DAC1_R_SEL_IF1 (0x0 << 10) 3828c2ecf20Sopenharmony_ci#define RT5645_DAC1_R_SEL_IF2 (0x1 << 10) 3838c2ecf20Sopenharmony_ci#define RT5645_DAC1_R_SEL_IF3 (0x2 << 10) 3848c2ecf20Sopenharmony_ci#define RT5645_DAC1_R_SEL_IF4 (0x3 << 10) 3858c2ecf20Sopenharmony_ci#define RT5645_DAC1_L_SEL_MASK (0x3 << 8) 3868c2ecf20Sopenharmony_ci#define RT5645_DAC1_L_SEL_SFT 8 3878c2ecf20Sopenharmony_ci#define RT5645_DAC1_L_SEL_IF1 (0x0 << 8) 3888c2ecf20Sopenharmony_ci#define RT5645_DAC1_L_SEL_IF2 (0x1 << 8) 3898c2ecf20Sopenharmony_ci#define RT5645_DAC1_L_SEL_IF3 (0x2 << 8) 3908c2ecf20Sopenharmony_ci#define RT5645_DAC1_L_SEL_IF4 (0x3 << 8) 3918c2ecf20Sopenharmony_ci#define RT5645_M_ADCMIX_R (0x1 << 7) 3928c2ecf20Sopenharmony_ci#define RT5645_M_ADCMIX_R_SFT 7 3938c2ecf20Sopenharmony_ci#define RT5645_M_DAC1_R (0x1 << 6) 3948c2ecf20Sopenharmony_ci#define RT5645_M_DAC1_R_SFT 6 3958c2ecf20Sopenharmony_ci 3968c2ecf20Sopenharmony_ci/* Stereo DAC Mixer Control (0x2a) */ 3978c2ecf20Sopenharmony_ci#define RT5645_M_DAC_L1 (0x1 << 14) 3988c2ecf20Sopenharmony_ci#define RT5645_M_DAC_L1_SFT 14 3998c2ecf20Sopenharmony_ci#define RT5645_DAC_L1_STO_L_VOL_MASK (0x1 << 13) 4008c2ecf20Sopenharmony_ci#define RT5645_DAC_L1_STO_L_VOL_SFT 13 4018c2ecf20Sopenharmony_ci#define RT5645_M_DAC_L2 (0x1 << 12) 4028c2ecf20Sopenharmony_ci#define RT5645_M_DAC_L2_SFT 12 4038c2ecf20Sopenharmony_ci#define RT5645_DAC_L2_STO_L_VOL_MASK (0x1 << 11) 4048c2ecf20Sopenharmony_ci#define RT5645_DAC_L2_STO_L_VOL_SFT 11 4058c2ecf20Sopenharmony_ci#define RT5645_M_ANC_DAC_L (0x1 << 10) 4068c2ecf20Sopenharmony_ci#define RT5645_M_ANC_DAC_L_SFT 10 4078c2ecf20Sopenharmony_ci#define RT5645_M_DAC_R1_STO_L (0x1 << 9) 4088c2ecf20Sopenharmony_ci#define RT5645_M_DAC_R1_STO_L_SFT 9 4098c2ecf20Sopenharmony_ci#define RT5645_DAC_R1_STO_L_VOL_MASK (0x1 << 8) 4108c2ecf20Sopenharmony_ci#define RT5645_DAC_R1_STO_L_VOL_SFT 8 4118c2ecf20Sopenharmony_ci#define RT5645_M_DAC_R1 (0x1 << 6) 4128c2ecf20Sopenharmony_ci#define RT5645_M_DAC_R1_SFT 6 4138c2ecf20Sopenharmony_ci#define RT5645_DAC_R1_STO_R_VOL_MASK (0x1 << 5) 4148c2ecf20Sopenharmony_ci#define RT5645_DAC_R1_STO_R_VOL_SFT 5 4158c2ecf20Sopenharmony_ci#define RT5645_M_DAC_R2 (0x1 << 4) 4168c2ecf20Sopenharmony_ci#define RT5645_M_DAC_R2_SFT 4 4178c2ecf20Sopenharmony_ci#define RT5645_DAC_R2_STO_R_VOL_MASK (0x1 << 3) 4188c2ecf20Sopenharmony_ci#define RT5645_DAC_R2_STO_R_VOL_SFT 3 4198c2ecf20Sopenharmony_ci#define RT5645_M_ANC_DAC_R (0x1 << 2) 4208c2ecf20Sopenharmony_ci#define RT5645_M_ANC_DAC_R_SFT 2 4218c2ecf20Sopenharmony_ci#define RT5645_M_DAC_L1_STO_R (0x1 << 1) 4228c2ecf20Sopenharmony_ci#define RT5645_M_DAC_L1_STO_R_SFT 1 4238c2ecf20Sopenharmony_ci#define RT5645_DAC_L1_STO_R_VOL_MASK (0x1) 4248c2ecf20Sopenharmony_ci#define RT5645_DAC_L1_STO_R_VOL_SFT 0 4258c2ecf20Sopenharmony_ci 4268c2ecf20Sopenharmony_ci/* Mono DAC Mixer Control (0x2b) */ 4278c2ecf20Sopenharmony_ci#define RT5645_M_DAC_L1_MONO_L (0x1 << 14) 4288c2ecf20Sopenharmony_ci#define RT5645_M_DAC_L1_MONO_L_SFT 14 4298c2ecf20Sopenharmony_ci#define RT5645_DAC_L1_MONO_L_VOL_MASK (0x1 << 13) 4308c2ecf20Sopenharmony_ci#define RT5645_DAC_L1_MONO_L_VOL_SFT 13 4318c2ecf20Sopenharmony_ci#define RT5645_M_DAC_L2_MONO_L (0x1 << 12) 4328c2ecf20Sopenharmony_ci#define RT5645_M_DAC_L2_MONO_L_SFT 12 4338c2ecf20Sopenharmony_ci#define RT5645_DAC_L2_MONO_L_VOL_MASK (0x1 << 11) 4348c2ecf20Sopenharmony_ci#define RT5645_DAC_L2_MONO_L_VOL_SFT 11 4358c2ecf20Sopenharmony_ci#define RT5645_M_DAC_R2_MONO_L (0x1 << 10) 4368c2ecf20Sopenharmony_ci#define RT5645_M_DAC_R2_MONO_L_SFT 10 4378c2ecf20Sopenharmony_ci#define RT5645_DAC_R2_MONO_L_VOL_MASK (0x1 << 9) 4388c2ecf20Sopenharmony_ci#define RT5645_DAC_R2_MONO_L_VOL_SFT 9 4398c2ecf20Sopenharmony_ci#define RT5645_M_DAC_R1_MONO_R (0x1 << 6) 4408c2ecf20Sopenharmony_ci#define RT5645_M_DAC_R1_MONO_R_SFT 6 4418c2ecf20Sopenharmony_ci#define RT5645_DAC_R1_MONO_R_VOL_MASK (0x1 << 5) 4428c2ecf20Sopenharmony_ci#define RT5645_DAC_R1_MONO_R_VOL_SFT 5 4438c2ecf20Sopenharmony_ci#define RT5645_M_DAC_R2_MONO_R (0x1 << 4) 4448c2ecf20Sopenharmony_ci#define RT5645_M_DAC_R2_MONO_R_SFT 4 4458c2ecf20Sopenharmony_ci#define RT5645_DAC_R2_MONO_R_VOL_MASK (0x1 << 3) 4468c2ecf20Sopenharmony_ci#define RT5645_DAC_R2_MONO_R_VOL_SFT 3 4478c2ecf20Sopenharmony_ci#define RT5645_M_DAC_L2_MONO_R (0x1 << 2) 4488c2ecf20Sopenharmony_ci#define RT5645_M_DAC_L2_MONO_R_SFT 2 4498c2ecf20Sopenharmony_ci#define RT5645_DAC_L2_MONO_R_VOL_MASK (0x1 << 1) 4508c2ecf20Sopenharmony_ci#define RT5645_DAC_L2_MONO_R_VOL_SFT 1 4518c2ecf20Sopenharmony_ci 4528c2ecf20Sopenharmony_ci/* Digital Mixer Control (0x2c) */ 4538c2ecf20Sopenharmony_ci#define RT5645_M_STO_L_DAC_L (0x1 << 15) 4548c2ecf20Sopenharmony_ci#define RT5645_M_STO_L_DAC_L_SFT 15 4558c2ecf20Sopenharmony_ci#define RT5645_STO_L_DAC_L_VOL_MASK (0x1 << 14) 4568c2ecf20Sopenharmony_ci#define RT5645_STO_L_DAC_L_VOL_SFT 14 4578c2ecf20Sopenharmony_ci#define RT5645_M_DAC_L2_DAC_L (0x1 << 13) 4588c2ecf20Sopenharmony_ci#define RT5645_M_DAC_L2_DAC_L_SFT 13 4598c2ecf20Sopenharmony_ci#define RT5645_DAC_L2_DAC_L_VOL_MASK (0x1 << 12) 4608c2ecf20Sopenharmony_ci#define RT5645_DAC_L2_DAC_L_VOL_SFT 12 4618c2ecf20Sopenharmony_ci#define RT5645_M_STO_R_DAC_R (0x1 << 11) 4628c2ecf20Sopenharmony_ci#define RT5645_M_STO_R_DAC_R_SFT 11 4638c2ecf20Sopenharmony_ci#define RT5645_STO_R_DAC_R_VOL_MASK (0x1 << 10) 4648c2ecf20Sopenharmony_ci#define RT5645_STO_R_DAC_R_VOL_SFT 10 4658c2ecf20Sopenharmony_ci#define RT5645_M_DAC_R2_DAC_R (0x1 << 9) 4668c2ecf20Sopenharmony_ci#define RT5645_M_DAC_R2_DAC_R_SFT 9 4678c2ecf20Sopenharmony_ci#define RT5645_DAC_R2_DAC_R_VOL_MASK (0x1 << 8) 4688c2ecf20Sopenharmony_ci#define RT5645_DAC_R2_DAC_R_VOL_SFT 8 4698c2ecf20Sopenharmony_ci#define RT5645_M_DAC_R2_DAC_L (0x1 << 7) 4708c2ecf20Sopenharmony_ci#define RT5645_M_DAC_R2_DAC_L_SFT 7 4718c2ecf20Sopenharmony_ci#define RT5645_DAC_R2_DAC_L_VOL_MASK (0x1 << 6) 4728c2ecf20Sopenharmony_ci#define RT5645_DAC_R2_DAC_L_VOL_SFT 6 4738c2ecf20Sopenharmony_ci#define RT5645_M_DAC_L2_DAC_R (0x1 << 5) 4748c2ecf20Sopenharmony_ci#define RT5645_M_DAC_L2_DAC_R_SFT 5 4758c2ecf20Sopenharmony_ci#define RT5645_DAC_L2_DAC_R_VOL_MASK (0x1 << 4) 4768c2ecf20Sopenharmony_ci#define RT5645_DAC_L2_DAC_R_VOL_SFT 4 4778c2ecf20Sopenharmony_ci 4788c2ecf20Sopenharmony_ci/* Analog DAC1/2 Input Source Control (0x2d) */ 4798c2ecf20Sopenharmony_ci#define RT5650_A_DAC1_L_IN_SFT 3 4808c2ecf20Sopenharmony_ci#define RT5650_A_DAC1_R_IN_SFT 2 4818c2ecf20Sopenharmony_ci#define RT5650_A_DAC2_L_IN_SFT 1 4828c2ecf20Sopenharmony_ci#define RT5650_A_DAC2_R_IN_SFT 0 4838c2ecf20Sopenharmony_ci 4848c2ecf20Sopenharmony_ci/* Digital Interface Data Control (0x2f) */ 4858c2ecf20Sopenharmony_ci#define RT5645_IF1_ADC2_IN_SEL (0x1 << 15) 4868c2ecf20Sopenharmony_ci#define RT5645_IF1_ADC2_IN_SFT 15 4878c2ecf20Sopenharmony_ci#define RT5645_IF2_ADC_IN_MASK (0x7 << 12) 4888c2ecf20Sopenharmony_ci#define RT5645_IF2_ADC_IN_SFT 12 4898c2ecf20Sopenharmony_ci#define RT5645_IF2_DAC_SEL_MASK (0x3 << 10) 4908c2ecf20Sopenharmony_ci#define RT5645_IF2_DAC_SEL_SFT 10 4918c2ecf20Sopenharmony_ci#define RT5645_IF2_ADC_SEL_MASK (0x3 << 8) 4928c2ecf20Sopenharmony_ci#define RT5645_IF2_ADC_SEL_SFT 8 4938c2ecf20Sopenharmony_ci#define RT5645_IF3_DAC_SEL_MASK (0x3 << 6) 4948c2ecf20Sopenharmony_ci#define RT5645_IF3_DAC_SEL_SFT 6 4958c2ecf20Sopenharmony_ci#define RT5645_IF3_ADC_SEL_MASK (0x3 << 4) 4968c2ecf20Sopenharmony_ci#define RT5645_IF3_ADC_SEL_SFT 4 4978c2ecf20Sopenharmony_ci#define RT5645_IF3_ADC_IN_MASK (0x7) 4988c2ecf20Sopenharmony_ci#define RT5645_IF3_ADC_IN_SFT 0 4998c2ecf20Sopenharmony_ci 5008c2ecf20Sopenharmony_ci/* PDM Output Control (0x31) */ 5018c2ecf20Sopenharmony_ci#define RT5645_PDM1_L_MASK (0x1 << 15) 5028c2ecf20Sopenharmony_ci#define RT5645_PDM1_L_SFT 15 5038c2ecf20Sopenharmony_ci#define RT5645_M_PDM1_L (0x1 << 14) 5048c2ecf20Sopenharmony_ci#define RT5645_M_PDM1_L_SFT 14 5058c2ecf20Sopenharmony_ci#define RT5645_PDM1_R_MASK (0x1 << 13) 5068c2ecf20Sopenharmony_ci#define RT5645_PDM1_R_SFT 13 5078c2ecf20Sopenharmony_ci#define RT5645_M_PDM1_R (0x1 << 12) 5088c2ecf20Sopenharmony_ci#define RT5645_M_PDM1_R_SFT 12 5098c2ecf20Sopenharmony_ci#define RT5645_PDM2_L_MASK (0x1 << 11) 5108c2ecf20Sopenharmony_ci#define RT5645_PDM2_L_SFT 11 5118c2ecf20Sopenharmony_ci#define RT5645_M_PDM2_L (0x1 << 10) 5128c2ecf20Sopenharmony_ci#define RT5645_M_PDM2_L_SFT 10 5138c2ecf20Sopenharmony_ci#define RT5645_PDM2_R_MASK (0x1 << 9) 5148c2ecf20Sopenharmony_ci#define RT5645_PDM2_R_SFT 9 5158c2ecf20Sopenharmony_ci#define RT5645_M_PDM2_R (0x1 << 8) 5168c2ecf20Sopenharmony_ci#define RT5645_M_PDM2_R_SFT 8 5178c2ecf20Sopenharmony_ci#define RT5645_PDM2_BUSY (0x1 << 7) 5188c2ecf20Sopenharmony_ci#define RT5645_PDM1_BUSY (0x1 << 6) 5198c2ecf20Sopenharmony_ci#define RT5645_PDM_PATTERN (0x1 << 5) 5208c2ecf20Sopenharmony_ci#define RT5645_PDM_GAIN (0x1 << 4) 5218c2ecf20Sopenharmony_ci#define RT5645_PDM_DIV_MASK (0x3) 5228c2ecf20Sopenharmony_ci 5238c2ecf20Sopenharmony_ci/* REC Left Mixer Control 1 (0x3b) */ 5248c2ecf20Sopenharmony_ci#define RT5645_G_HP_L_RM_L_MASK (0x7 << 13) 5258c2ecf20Sopenharmony_ci#define RT5645_G_HP_L_RM_L_SFT 13 5268c2ecf20Sopenharmony_ci#define RT5645_G_IN_L_RM_L_MASK (0x7 << 10) 5278c2ecf20Sopenharmony_ci#define RT5645_G_IN_L_RM_L_SFT 10 5288c2ecf20Sopenharmony_ci#define RT5645_G_BST4_RM_L_MASK (0x7 << 7) 5298c2ecf20Sopenharmony_ci#define RT5645_G_BST4_RM_L_SFT 7 5308c2ecf20Sopenharmony_ci#define RT5645_G_BST3_RM_L_MASK (0x7 << 4) 5318c2ecf20Sopenharmony_ci#define RT5645_G_BST3_RM_L_SFT 4 5328c2ecf20Sopenharmony_ci#define RT5645_G_BST2_RM_L_MASK (0x7 << 1) 5338c2ecf20Sopenharmony_ci#define RT5645_G_BST2_RM_L_SFT 1 5348c2ecf20Sopenharmony_ci 5358c2ecf20Sopenharmony_ci/* REC Left Mixer Control 2 (0x3c) */ 5368c2ecf20Sopenharmony_ci#define RT5645_G_BST1_RM_L_MASK (0x7 << 13) 5378c2ecf20Sopenharmony_ci#define RT5645_G_BST1_RM_L_SFT 13 5388c2ecf20Sopenharmony_ci#define RT5645_G_OM_L_RM_L_MASK (0x7 << 10) 5398c2ecf20Sopenharmony_ci#define RT5645_G_OM_L_RM_L_SFT 10 5408c2ecf20Sopenharmony_ci#define RT5645_M_MM_L_RM_L (0x1 << 6) 5418c2ecf20Sopenharmony_ci#define RT5645_M_MM_L_RM_L_SFT 6 5428c2ecf20Sopenharmony_ci#define RT5645_M_IN_L_RM_L (0x1 << 5) 5438c2ecf20Sopenharmony_ci#define RT5645_M_IN_L_RM_L_SFT 5 5448c2ecf20Sopenharmony_ci#define RT5645_M_HP_L_RM_L (0x1 << 4) 5458c2ecf20Sopenharmony_ci#define RT5645_M_HP_L_RM_L_SFT 4 5468c2ecf20Sopenharmony_ci#define RT5645_M_BST3_RM_L (0x1 << 3) 5478c2ecf20Sopenharmony_ci#define RT5645_M_BST3_RM_L_SFT 3 5488c2ecf20Sopenharmony_ci#define RT5645_M_BST2_RM_L (0x1 << 2) 5498c2ecf20Sopenharmony_ci#define RT5645_M_BST2_RM_L_SFT 2 5508c2ecf20Sopenharmony_ci#define RT5645_M_BST1_RM_L (0x1 << 1) 5518c2ecf20Sopenharmony_ci#define RT5645_M_BST1_RM_L_SFT 1 5528c2ecf20Sopenharmony_ci#define RT5645_M_OM_L_RM_L (0x1) 5538c2ecf20Sopenharmony_ci#define RT5645_M_OM_L_RM_L_SFT 0 5548c2ecf20Sopenharmony_ci 5558c2ecf20Sopenharmony_ci/* REC Right Mixer Control 1 (0x3d) */ 5568c2ecf20Sopenharmony_ci#define RT5645_G_HP_R_RM_R_MASK (0x7 << 13) 5578c2ecf20Sopenharmony_ci#define RT5645_G_HP_R_RM_R_SFT 13 5588c2ecf20Sopenharmony_ci#define RT5645_G_IN_R_RM_R_MASK (0x7 << 10) 5598c2ecf20Sopenharmony_ci#define RT5645_G_IN_R_RM_R_SFT 10 5608c2ecf20Sopenharmony_ci#define RT5645_G_BST4_RM_R_MASK (0x7 << 7) 5618c2ecf20Sopenharmony_ci#define RT5645_G_BST4_RM_R_SFT 7 5628c2ecf20Sopenharmony_ci#define RT5645_G_BST3_RM_R_MASK (0x7 << 4) 5638c2ecf20Sopenharmony_ci#define RT5645_G_BST3_RM_R_SFT 4 5648c2ecf20Sopenharmony_ci#define RT5645_G_BST2_RM_R_MASK (0x7 << 1) 5658c2ecf20Sopenharmony_ci#define RT5645_G_BST2_RM_R_SFT 1 5668c2ecf20Sopenharmony_ci 5678c2ecf20Sopenharmony_ci/* REC Right Mixer Control 2 (0x3e) */ 5688c2ecf20Sopenharmony_ci#define RT5645_G_BST1_RM_R_MASK (0x7 << 13) 5698c2ecf20Sopenharmony_ci#define RT5645_G_BST1_RM_R_SFT 13 5708c2ecf20Sopenharmony_ci#define RT5645_G_OM_R_RM_R_MASK (0x7 << 10) 5718c2ecf20Sopenharmony_ci#define RT5645_G_OM_R_RM_R_SFT 10 5728c2ecf20Sopenharmony_ci#define RT5645_M_MM_R_RM_R (0x1 << 6) 5738c2ecf20Sopenharmony_ci#define RT5645_M_MM_R_RM_R_SFT 6 5748c2ecf20Sopenharmony_ci#define RT5645_M_IN_R_RM_R (0x1 << 5) 5758c2ecf20Sopenharmony_ci#define RT5645_M_IN_R_RM_R_SFT 5 5768c2ecf20Sopenharmony_ci#define RT5645_M_HP_R_RM_R (0x1 << 4) 5778c2ecf20Sopenharmony_ci#define RT5645_M_HP_R_RM_R_SFT 4 5788c2ecf20Sopenharmony_ci#define RT5645_M_BST3_RM_R (0x1 << 3) 5798c2ecf20Sopenharmony_ci#define RT5645_M_BST3_RM_R_SFT 3 5808c2ecf20Sopenharmony_ci#define RT5645_M_BST2_RM_R (0x1 << 2) 5818c2ecf20Sopenharmony_ci#define RT5645_M_BST2_RM_R_SFT 2 5828c2ecf20Sopenharmony_ci#define RT5645_M_BST1_RM_R (0x1 << 1) 5838c2ecf20Sopenharmony_ci#define RT5645_M_BST1_RM_R_SFT 1 5848c2ecf20Sopenharmony_ci#define RT5645_M_OM_R_RM_R (0x1) 5858c2ecf20Sopenharmony_ci#define RT5645_M_OM_R_RM_R_SFT 0 5868c2ecf20Sopenharmony_ci 5878c2ecf20Sopenharmony_ci/* HPOMIX Control (0x40) (0x42) */ 5888c2ecf20Sopenharmony_ci#define RT5645_M_BST1_HV (0x1 << 4) 5898c2ecf20Sopenharmony_ci#define RT5645_M_BST1_HV_SFT 4 5908c2ecf20Sopenharmony_ci#define RT5645_M_BST2_HV (0x1 << 4) 5918c2ecf20Sopenharmony_ci#define RT5645_M_BST2_HV_SFT 4 5928c2ecf20Sopenharmony_ci#define RT5645_M_BST3_HV (0x1 << 3) 5938c2ecf20Sopenharmony_ci#define RT5645_M_BST3_HV_SFT 3 5948c2ecf20Sopenharmony_ci#define RT5645_M_IN_HV (0x1 << 2) 5958c2ecf20Sopenharmony_ci#define RT5645_M_IN_HV_SFT 2 5968c2ecf20Sopenharmony_ci#define RT5645_M_DAC2_HV (0x1 << 1) 5978c2ecf20Sopenharmony_ci#define RT5645_M_DAC2_HV_SFT 1 5988c2ecf20Sopenharmony_ci#define RT5645_M_DAC1_HV (0x1 << 0) 5998c2ecf20Sopenharmony_ci#define RT5645_M_DAC1_HV_SFT 0 6008c2ecf20Sopenharmony_ci 6018c2ecf20Sopenharmony_ci/* HPMIX Control (0x45) */ 6028c2ecf20Sopenharmony_ci#define RT5645_M_DAC1_HM (0x1 << 14) 6038c2ecf20Sopenharmony_ci#define RT5645_M_DAC1_HM_SFT 14 6048c2ecf20Sopenharmony_ci#define RT5645_M_HPVOL_HM (0x1 << 13) 6058c2ecf20Sopenharmony_ci#define RT5645_M_HPVOL_HM_SFT 13 6068c2ecf20Sopenharmony_ci#define RT5645_IRQ_PSV_MODE (0x1 << 12) 6078c2ecf20Sopenharmony_ci 6088c2ecf20Sopenharmony_ci/* SPK Left Mixer Control (0x46) */ 6098c2ecf20Sopenharmony_ci#define RT5645_G_RM_L_SM_L_MASK (0x3 << 14) 6108c2ecf20Sopenharmony_ci#define RT5645_G_RM_L_SM_L_SFT 14 6118c2ecf20Sopenharmony_ci#define RT5645_G_IN_L_SM_L_MASK (0x3 << 12) 6128c2ecf20Sopenharmony_ci#define RT5645_G_IN_L_SM_L_SFT 12 6138c2ecf20Sopenharmony_ci#define RT5645_G_DAC_L1_SM_L_MASK (0x3 << 10) 6148c2ecf20Sopenharmony_ci#define RT5645_G_DAC_L1_SM_L_SFT 10 6158c2ecf20Sopenharmony_ci#define RT5645_G_DAC_L2_SM_L_MASK (0x3 << 8) 6168c2ecf20Sopenharmony_ci#define RT5645_G_DAC_L2_SM_L_SFT 8 6178c2ecf20Sopenharmony_ci#define RT5645_G_OM_L_SM_L_MASK (0x3 << 6) 6188c2ecf20Sopenharmony_ci#define RT5645_G_OM_L_SM_L_SFT 6 6198c2ecf20Sopenharmony_ci#define RT5645_M_BST1_L_SM_L (0x1 << 5) 6208c2ecf20Sopenharmony_ci#define RT5645_M_BST1_L_SM_L_SFT 5 6218c2ecf20Sopenharmony_ci#define RT5645_M_BST3_L_SM_L (0x1 << 4) 6228c2ecf20Sopenharmony_ci#define RT5645_M_BST3_L_SM_L_SFT 4 6238c2ecf20Sopenharmony_ci#define RT5645_M_IN_L_SM_L (0x1 << 3) 6248c2ecf20Sopenharmony_ci#define RT5645_M_IN_L_SM_L_SFT 3 6258c2ecf20Sopenharmony_ci#define RT5645_M_DAC_L2_SM_L (0x1 << 2) 6268c2ecf20Sopenharmony_ci#define RT5645_M_DAC_L2_SM_L_SFT 2 6278c2ecf20Sopenharmony_ci#define RT5645_M_DAC_L1_SM_L (0x1 << 1) 6288c2ecf20Sopenharmony_ci#define RT5645_M_DAC_L1_SM_L_SFT 1 6298c2ecf20Sopenharmony_ci 6308c2ecf20Sopenharmony_ci/* SPK Right Mixer Control (0x47) */ 6318c2ecf20Sopenharmony_ci#define RT5645_G_RM_R_SM_R_MASK (0x3 << 14) 6328c2ecf20Sopenharmony_ci#define RT5645_G_RM_R_SM_R_SFT 14 6338c2ecf20Sopenharmony_ci#define RT5645_G_IN_R_SM_R_MASK (0x3 << 12) 6348c2ecf20Sopenharmony_ci#define RT5645_G_IN_R_SM_R_SFT 12 6358c2ecf20Sopenharmony_ci#define RT5645_G_DAC_R1_SM_R_MASK (0x3 << 10) 6368c2ecf20Sopenharmony_ci#define RT5645_G_DAC_R1_SM_R_SFT 10 6378c2ecf20Sopenharmony_ci#define RT5645_G_DAC_R2_SM_R_MASK (0x3 << 8) 6388c2ecf20Sopenharmony_ci#define RT5645_G_DAC_R2_SM_R_SFT 8 6398c2ecf20Sopenharmony_ci#define RT5645_G_OM_R_SM_R_MASK (0x3 << 6) 6408c2ecf20Sopenharmony_ci#define RT5645_G_OM_R_SM_R_SFT 6 6418c2ecf20Sopenharmony_ci#define RT5645_M_BST2_R_SM_R (0x1 << 5) 6428c2ecf20Sopenharmony_ci#define RT5645_M_BST2_R_SM_R_SFT 5 6438c2ecf20Sopenharmony_ci#define RT5645_M_BST3_R_SM_R (0x1 << 4) 6448c2ecf20Sopenharmony_ci#define RT5645_M_BST3_R_SM_R_SFT 4 6458c2ecf20Sopenharmony_ci#define RT5645_M_IN_R_SM_R (0x1 << 3) 6468c2ecf20Sopenharmony_ci#define RT5645_M_IN_R_SM_R_SFT 3 6478c2ecf20Sopenharmony_ci#define RT5645_M_DAC_R2_SM_R (0x1 << 2) 6488c2ecf20Sopenharmony_ci#define RT5645_M_DAC_R2_SM_R_SFT 2 6498c2ecf20Sopenharmony_ci#define RT5645_M_DAC_R1_SM_R (0x1 << 1) 6508c2ecf20Sopenharmony_ci#define RT5645_M_DAC_R1_SM_R_SFT 1 6518c2ecf20Sopenharmony_ci 6528c2ecf20Sopenharmony_ci/* SPOLMIX Control (0x48) */ 6538c2ecf20Sopenharmony_ci#define RT5645_M_DAC_L1_SPM_L (0x1 << 15) 6548c2ecf20Sopenharmony_ci#define RT5645_M_DAC_L1_SPM_L_SFT 15 6558c2ecf20Sopenharmony_ci#define RT5645_M_DAC_R1_SPM_L (0x1 << 14) 6568c2ecf20Sopenharmony_ci#define RT5645_M_DAC_R1_SPM_L_SFT 14 6578c2ecf20Sopenharmony_ci#define RT5645_M_SV_L_SPM_L (0x1 << 13) 6588c2ecf20Sopenharmony_ci#define RT5645_M_SV_L_SPM_L_SFT 13 6598c2ecf20Sopenharmony_ci#define RT5645_M_SV_R_SPM_L (0x1 << 12) 6608c2ecf20Sopenharmony_ci#define RT5645_M_SV_R_SPM_L_SFT 12 6618c2ecf20Sopenharmony_ci#define RT5645_M_BST3_SPM_L (0x1 << 11) 6628c2ecf20Sopenharmony_ci#define RT5645_M_BST3_SPM_L_SFT 11 6638c2ecf20Sopenharmony_ci#define RT5645_M_DAC_R1_SPM_R (0x1 << 2) 6648c2ecf20Sopenharmony_ci#define RT5645_M_DAC_R1_SPM_R_SFT 2 6658c2ecf20Sopenharmony_ci#define RT5645_M_BST3_SPM_R (0x1 << 1) 6668c2ecf20Sopenharmony_ci#define RT5645_M_BST3_SPM_R_SFT 1 6678c2ecf20Sopenharmony_ci#define RT5645_M_SV_R_SPM_R (0x1 << 0) 6688c2ecf20Sopenharmony_ci#define RT5645_M_SV_R_SPM_R_SFT 0 6698c2ecf20Sopenharmony_ci 6708c2ecf20Sopenharmony_ci/* SPOMIX Ratio Control (0x4a) */ 6718c2ecf20Sopenharmony_ci#define RT5645_SPK_G_CLSD_MASK (0x7 << 0) 6728c2ecf20Sopenharmony_ci#define RT5645_SPK_G_CLSD_SFT 0 6738c2ecf20Sopenharmony_ci 6748c2ecf20Sopenharmony_ci/* Mono Output Mixer Control (0x4c) */ 6758c2ecf20Sopenharmony_ci#define RT5645_G_MONOMIX_MASK (0x1 << 10) 6768c2ecf20Sopenharmony_ci#define RT5645_G_MONOMIX_SFT 10 6778c2ecf20Sopenharmony_ci#define RT5645_M_OV_L_MM (0x1 << 9) 6788c2ecf20Sopenharmony_ci#define RT5645_M_OV_L_MM_SFT 9 6798c2ecf20Sopenharmony_ci#define RT5645_M_DAC_L2_MA (0x1 << 8) 6808c2ecf20Sopenharmony_ci#define RT5645_M_DAC_L2_MA_SFT 8 6818c2ecf20Sopenharmony_ci#define RT5645_M_BST2_MM (0x1 << 4) 6828c2ecf20Sopenharmony_ci#define RT5645_M_BST2_MM_SFT 4 6838c2ecf20Sopenharmony_ci#define RT5645_M_DAC_R1_MM (0x1 << 3) 6848c2ecf20Sopenharmony_ci#define RT5645_M_DAC_R1_MM_SFT 3 6858c2ecf20Sopenharmony_ci#define RT5645_M_DAC_R2_MM (0x1 << 2) 6868c2ecf20Sopenharmony_ci#define RT5645_M_DAC_R2_MM_SFT 2 6878c2ecf20Sopenharmony_ci#define RT5645_M_DAC_L2_MM (0x1 << 1) 6888c2ecf20Sopenharmony_ci#define RT5645_M_DAC_L2_MM_SFT 1 6898c2ecf20Sopenharmony_ci#define RT5645_M_BST3_MM (0x1 << 0) 6908c2ecf20Sopenharmony_ci#define RT5645_M_BST3_MM_SFT 0 6918c2ecf20Sopenharmony_ci 6928c2ecf20Sopenharmony_ci/* Output Left Mixer Control 1 (0x4d) */ 6938c2ecf20Sopenharmony_ci#define RT5645_G_BST3_OM_L_MASK (0x7 << 13) 6948c2ecf20Sopenharmony_ci#define RT5645_G_BST3_OM_L_SFT 13 6958c2ecf20Sopenharmony_ci#define RT5645_G_BST2_OM_L_MASK (0x7 << 10) 6968c2ecf20Sopenharmony_ci#define RT5645_G_BST2_OM_L_SFT 10 6978c2ecf20Sopenharmony_ci#define RT5645_G_BST1_OM_L_MASK (0x7 << 7) 6988c2ecf20Sopenharmony_ci#define RT5645_G_BST1_OM_L_SFT 7 6998c2ecf20Sopenharmony_ci#define RT5645_G_IN_L_OM_L_MASK (0x7 << 4) 7008c2ecf20Sopenharmony_ci#define RT5645_G_IN_L_OM_L_SFT 4 7018c2ecf20Sopenharmony_ci#define RT5645_G_RM_L_OM_L_MASK (0x7 << 1) 7028c2ecf20Sopenharmony_ci#define RT5645_G_RM_L_OM_L_SFT 1 7038c2ecf20Sopenharmony_ci 7048c2ecf20Sopenharmony_ci/* Output Left Mixer Control 2 (0x4e) */ 7058c2ecf20Sopenharmony_ci#define RT5645_G_DAC_R2_OM_L_MASK (0x7 << 13) 7068c2ecf20Sopenharmony_ci#define RT5645_G_DAC_R2_OM_L_SFT 13 7078c2ecf20Sopenharmony_ci#define RT5645_G_DAC_L2_OM_L_MASK (0x7 << 10) 7088c2ecf20Sopenharmony_ci#define RT5645_G_DAC_L2_OM_L_SFT 10 7098c2ecf20Sopenharmony_ci#define RT5645_G_DAC_L1_OM_L_MASK (0x7 << 7) 7108c2ecf20Sopenharmony_ci#define RT5645_G_DAC_L1_OM_L_SFT 7 7118c2ecf20Sopenharmony_ci 7128c2ecf20Sopenharmony_ci/* Output Left Mixer Control 3 (0x4f) */ 7138c2ecf20Sopenharmony_ci#define RT5645_M_BST3_OM_L (0x1 << 4) 7148c2ecf20Sopenharmony_ci#define RT5645_M_BST3_OM_L_SFT 4 7158c2ecf20Sopenharmony_ci#define RT5645_M_BST1_OM_L (0x1 << 3) 7168c2ecf20Sopenharmony_ci#define RT5645_M_BST1_OM_L_SFT 3 7178c2ecf20Sopenharmony_ci#define RT5645_M_IN_L_OM_L (0x1 << 2) 7188c2ecf20Sopenharmony_ci#define RT5645_M_IN_L_OM_L_SFT 2 7198c2ecf20Sopenharmony_ci#define RT5645_M_DAC_L2_OM_L (0x1 << 1) 7208c2ecf20Sopenharmony_ci#define RT5645_M_DAC_L2_OM_L_SFT 1 7218c2ecf20Sopenharmony_ci#define RT5645_M_DAC_L1_OM_L (0x1) 7228c2ecf20Sopenharmony_ci#define RT5645_M_DAC_L1_OM_L_SFT 0 7238c2ecf20Sopenharmony_ci 7248c2ecf20Sopenharmony_ci/* Output Right Mixer Control 1 (0x50) */ 7258c2ecf20Sopenharmony_ci#define RT5645_G_BST4_OM_R_MASK (0x7 << 13) 7268c2ecf20Sopenharmony_ci#define RT5645_G_BST4_OM_R_SFT 13 7278c2ecf20Sopenharmony_ci#define RT5645_G_BST2_OM_R_MASK (0x7 << 10) 7288c2ecf20Sopenharmony_ci#define RT5645_G_BST2_OM_R_SFT 10 7298c2ecf20Sopenharmony_ci#define RT5645_G_BST1_OM_R_MASK (0x7 << 7) 7308c2ecf20Sopenharmony_ci#define RT5645_G_BST1_OM_R_SFT 7 7318c2ecf20Sopenharmony_ci#define RT5645_G_IN_R_OM_R_MASK (0x7 << 4) 7328c2ecf20Sopenharmony_ci#define RT5645_G_IN_R_OM_R_SFT 4 7338c2ecf20Sopenharmony_ci#define RT5645_G_RM_R_OM_R_MASK (0x7 << 1) 7348c2ecf20Sopenharmony_ci#define RT5645_G_RM_R_OM_R_SFT 1 7358c2ecf20Sopenharmony_ci 7368c2ecf20Sopenharmony_ci/* Output Right Mixer Control 2 (0x51) */ 7378c2ecf20Sopenharmony_ci#define RT5645_G_DAC_L2_OM_R_MASK (0x7 << 13) 7388c2ecf20Sopenharmony_ci#define RT5645_G_DAC_L2_OM_R_SFT 13 7398c2ecf20Sopenharmony_ci#define RT5645_G_DAC_R2_OM_R_MASK (0x7 << 10) 7408c2ecf20Sopenharmony_ci#define RT5645_G_DAC_R2_OM_R_SFT 10 7418c2ecf20Sopenharmony_ci#define RT5645_G_DAC_R1_OM_R_MASK (0x7 << 7) 7428c2ecf20Sopenharmony_ci#define RT5645_G_DAC_R1_OM_R_SFT 7 7438c2ecf20Sopenharmony_ci 7448c2ecf20Sopenharmony_ci/* Output Right Mixer Control 3 (0x52) */ 7458c2ecf20Sopenharmony_ci#define RT5645_M_BST3_OM_R (0x1 << 4) 7468c2ecf20Sopenharmony_ci#define RT5645_M_BST3_OM_R_SFT 4 7478c2ecf20Sopenharmony_ci#define RT5645_M_BST2_OM_R (0x1 << 3) 7488c2ecf20Sopenharmony_ci#define RT5645_M_BST2_OM_R_SFT 3 7498c2ecf20Sopenharmony_ci#define RT5645_M_IN_R_OM_R (0x1 << 2) 7508c2ecf20Sopenharmony_ci#define RT5645_M_IN_R_OM_R_SFT 2 7518c2ecf20Sopenharmony_ci#define RT5645_M_DAC_R2_OM_R (0x1 << 1) 7528c2ecf20Sopenharmony_ci#define RT5645_M_DAC_R2_OM_R_SFT 1 7538c2ecf20Sopenharmony_ci#define RT5645_M_DAC_R1_OM_R (0x1) 7548c2ecf20Sopenharmony_ci#define RT5645_M_DAC_R1_OM_R_SFT 0 7558c2ecf20Sopenharmony_ci 7568c2ecf20Sopenharmony_ci/* LOUT Mixer Control (0x53) */ 7578c2ecf20Sopenharmony_ci#define RT5645_M_DAC_L1_LM (0x1 << 15) 7588c2ecf20Sopenharmony_ci#define RT5645_M_DAC_L1_LM_SFT 15 7598c2ecf20Sopenharmony_ci#define RT5645_M_DAC_R1_LM (0x1 << 14) 7608c2ecf20Sopenharmony_ci#define RT5645_M_DAC_R1_LM_SFT 14 7618c2ecf20Sopenharmony_ci#define RT5645_M_OV_L_LM (0x1 << 13) 7628c2ecf20Sopenharmony_ci#define RT5645_M_OV_L_LM_SFT 13 7638c2ecf20Sopenharmony_ci#define RT5645_M_OV_R_LM (0x1 << 12) 7648c2ecf20Sopenharmony_ci#define RT5645_M_OV_R_LM_SFT 12 7658c2ecf20Sopenharmony_ci#define RT5645_G_LOUTMIX_MASK (0x1 << 11) 7668c2ecf20Sopenharmony_ci#define RT5645_G_LOUTMIX_SFT 11 7678c2ecf20Sopenharmony_ci 7688c2ecf20Sopenharmony_ci/* Power Management for Digital 1 (0x61) */ 7698c2ecf20Sopenharmony_ci#define RT5645_PWR_I2S1 (0x1 << 15) 7708c2ecf20Sopenharmony_ci#define RT5645_PWR_I2S1_BIT 15 7718c2ecf20Sopenharmony_ci#define RT5645_PWR_I2S2 (0x1 << 14) 7728c2ecf20Sopenharmony_ci#define RT5645_PWR_I2S2_BIT 14 7738c2ecf20Sopenharmony_ci#define RT5645_PWR_I2S3 (0x1 << 13) 7748c2ecf20Sopenharmony_ci#define RT5645_PWR_I2S3_BIT 13 7758c2ecf20Sopenharmony_ci#define RT5645_PWR_DAC_L1 (0x1 << 12) 7768c2ecf20Sopenharmony_ci#define RT5645_PWR_DAC_L1_BIT 12 7778c2ecf20Sopenharmony_ci#define RT5645_PWR_DAC_R1 (0x1 << 11) 7788c2ecf20Sopenharmony_ci#define RT5645_PWR_DAC_R1_BIT 11 7798c2ecf20Sopenharmony_ci#define RT5645_PWR_CLS_D_R (0x1 << 9) 7808c2ecf20Sopenharmony_ci#define RT5645_PWR_CLS_D_R_BIT 9 7818c2ecf20Sopenharmony_ci#define RT5645_PWR_CLS_D_L (0x1 << 8) 7828c2ecf20Sopenharmony_ci#define RT5645_PWR_CLS_D_L_BIT 8 7838c2ecf20Sopenharmony_ci#define RT5645_PWR_DAC_L2 (0x1 << 7) 7848c2ecf20Sopenharmony_ci#define RT5645_PWR_DAC_L2_BIT 7 7858c2ecf20Sopenharmony_ci#define RT5645_PWR_DAC_R2 (0x1 << 6) 7868c2ecf20Sopenharmony_ci#define RT5645_PWR_DAC_R2_BIT 6 7878c2ecf20Sopenharmony_ci#define RT5645_PWR_ADC_L (0x1 << 2) 7888c2ecf20Sopenharmony_ci#define RT5645_PWR_ADC_L_BIT 2 7898c2ecf20Sopenharmony_ci#define RT5645_PWR_ADC_R (0x1 << 1) 7908c2ecf20Sopenharmony_ci#define RT5645_PWR_ADC_R_BIT 1 7918c2ecf20Sopenharmony_ci#define RT5645_PWR_CLS_D (0x1) 7928c2ecf20Sopenharmony_ci#define RT5645_PWR_CLS_D_BIT 0 7938c2ecf20Sopenharmony_ci 7948c2ecf20Sopenharmony_ci/* Power Management for Digital 2 (0x62) */ 7958c2ecf20Sopenharmony_ci#define RT5645_PWR_ADC_S1F (0x1 << 15) 7968c2ecf20Sopenharmony_ci#define RT5645_PWR_ADC_S1F_BIT 15 7978c2ecf20Sopenharmony_ci#define RT5645_PWR_ADC_MF_L (0x1 << 14) 7988c2ecf20Sopenharmony_ci#define RT5645_PWR_ADC_MF_L_BIT 14 7998c2ecf20Sopenharmony_ci#define RT5645_PWR_ADC_MF_R (0x1 << 13) 8008c2ecf20Sopenharmony_ci#define RT5645_PWR_ADC_MF_R_BIT 13 8018c2ecf20Sopenharmony_ci#define RT5645_PWR_I2S_DSP (0x1 << 12) 8028c2ecf20Sopenharmony_ci#define RT5645_PWR_I2S_DSP_BIT 12 8038c2ecf20Sopenharmony_ci#define RT5645_PWR_DAC_S1F (0x1 << 11) 8048c2ecf20Sopenharmony_ci#define RT5645_PWR_DAC_S1F_BIT 11 8058c2ecf20Sopenharmony_ci#define RT5645_PWR_DAC_MF_L (0x1 << 10) 8068c2ecf20Sopenharmony_ci#define RT5645_PWR_DAC_MF_L_BIT 10 8078c2ecf20Sopenharmony_ci#define RT5645_PWR_DAC_MF_R (0x1 << 9) 8088c2ecf20Sopenharmony_ci#define RT5645_PWR_DAC_MF_R_BIT 9 8098c2ecf20Sopenharmony_ci#define RT5645_PWR_PDM1 (0x1 << 7) 8108c2ecf20Sopenharmony_ci#define RT5645_PWR_PDM1_BIT 7 8118c2ecf20Sopenharmony_ci#define RT5645_PWR_PDM2 (0x1 << 6) 8128c2ecf20Sopenharmony_ci#define RT5645_PWR_PDM2_BIT 6 8138c2ecf20Sopenharmony_ci#define RT5645_PWR_IPTV (0x1 << 1) 8148c2ecf20Sopenharmony_ci#define RT5645_PWR_IPTV_BIT 1 8158c2ecf20Sopenharmony_ci#define RT5645_PWR_PAD (0x1) 8168c2ecf20Sopenharmony_ci#define RT5645_PWR_PAD_BIT 0 8178c2ecf20Sopenharmony_ci 8188c2ecf20Sopenharmony_ci/* Power Management for Analog 1 (0x63) */ 8198c2ecf20Sopenharmony_ci#define RT5645_PWR_VREF1 (0x1 << 15) 8208c2ecf20Sopenharmony_ci#define RT5645_PWR_VREF1_BIT 15 8218c2ecf20Sopenharmony_ci#define RT5645_PWR_FV1 (0x1 << 14) 8228c2ecf20Sopenharmony_ci#define RT5645_PWR_FV1_BIT 14 8238c2ecf20Sopenharmony_ci#define RT5645_PWR_MB (0x1 << 13) 8248c2ecf20Sopenharmony_ci#define RT5645_PWR_MB_BIT 13 8258c2ecf20Sopenharmony_ci#define RT5645_PWR_LM (0x1 << 12) 8268c2ecf20Sopenharmony_ci#define RT5645_PWR_LM_BIT 12 8278c2ecf20Sopenharmony_ci#define RT5645_PWR_BG (0x1 << 11) 8288c2ecf20Sopenharmony_ci#define RT5645_PWR_BG_BIT 11 8298c2ecf20Sopenharmony_ci#define RT5645_PWR_MA (0x1 << 10) 8308c2ecf20Sopenharmony_ci#define RT5645_PWR_MA_BIT 10 8318c2ecf20Sopenharmony_ci#define RT5645_PWR_HP_L (0x1 << 7) 8328c2ecf20Sopenharmony_ci#define RT5645_PWR_HP_L_BIT 7 8338c2ecf20Sopenharmony_ci#define RT5645_PWR_HP_R (0x1 << 6) 8348c2ecf20Sopenharmony_ci#define RT5645_PWR_HP_R_BIT 6 8358c2ecf20Sopenharmony_ci#define RT5645_PWR_HA (0x1 << 5) 8368c2ecf20Sopenharmony_ci#define RT5645_PWR_HA_BIT 5 8378c2ecf20Sopenharmony_ci#define RT5645_PWR_VREF2 (0x1 << 4) 8388c2ecf20Sopenharmony_ci#define RT5645_PWR_VREF2_BIT 4 8398c2ecf20Sopenharmony_ci#define RT5645_PWR_FV2 (0x1 << 3) 8408c2ecf20Sopenharmony_ci#define RT5645_PWR_FV2_BIT 3 8418c2ecf20Sopenharmony_ci#define RT5645_LDO_SEL_MASK (0x3) 8428c2ecf20Sopenharmony_ci#define RT5645_LDO_SEL_SFT 0 8438c2ecf20Sopenharmony_ci 8448c2ecf20Sopenharmony_ci/* Power Management for Analog 2 (0x64) */ 8458c2ecf20Sopenharmony_ci#define RT5645_PWR_BST1 (0x1 << 15) 8468c2ecf20Sopenharmony_ci#define RT5645_PWR_BST1_BIT 15 8478c2ecf20Sopenharmony_ci#define RT5645_PWR_BST2 (0x1 << 14) 8488c2ecf20Sopenharmony_ci#define RT5645_PWR_BST2_BIT 14 8498c2ecf20Sopenharmony_ci#define RT5645_PWR_BST3 (0x1 << 13) 8508c2ecf20Sopenharmony_ci#define RT5645_PWR_BST3_BIT 13 8518c2ecf20Sopenharmony_ci#define RT5645_PWR_BST4 (0x1 << 12) 8528c2ecf20Sopenharmony_ci#define RT5645_PWR_BST4_BIT 12 8538c2ecf20Sopenharmony_ci#define RT5645_PWR_MB1 (0x1 << 11) 8548c2ecf20Sopenharmony_ci#define RT5645_PWR_MB1_BIT 11 8558c2ecf20Sopenharmony_ci#define RT5645_PWR_MB2 (0x1 << 10) 8568c2ecf20Sopenharmony_ci#define RT5645_PWR_MB2_BIT 10 8578c2ecf20Sopenharmony_ci#define RT5645_PWR_PLL (0x1 << 9) 8588c2ecf20Sopenharmony_ci#define RT5645_PWR_PLL_BIT 9 8598c2ecf20Sopenharmony_ci#define RT5645_PWR_BST2_P (0x1 << 5) 8608c2ecf20Sopenharmony_ci#define RT5645_PWR_BST2_P_BIT 5 8618c2ecf20Sopenharmony_ci#define RT5645_PWR_BST3_P (0x1 << 4) 8628c2ecf20Sopenharmony_ci#define RT5645_PWR_BST3_P_BIT 4 8638c2ecf20Sopenharmony_ci#define RT5645_PWR_BST4_P (0x1 << 3) 8648c2ecf20Sopenharmony_ci#define RT5645_PWR_BST4_P_BIT 3 8658c2ecf20Sopenharmony_ci#define RT5645_PWR_JD1 (0x1 << 2) 8668c2ecf20Sopenharmony_ci#define RT5645_PWR_JD1_BIT 2 8678c2ecf20Sopenharmony_ci#define RT5645_PWR_JD (0x1 << 1) 8688c2ecf20Sopenharmony_ci#define RT5645_PWR_JD_BIT 1 8698c2ecf20Sopenharmony_ci 8708c2ecf20Sopenharmony_ci/* Power Management for Mixer (0x65) */ 8718c2ecf20Sopenharmony_ci#define RT5645_PWR_OM_L (0x1 << 15) 8728c2ecf20Sopenharmony_ci#define RT5645_PWR_OM_L_BIT 15 8738c2ecf20Sopenharmony_ci#define RT5645_PWR_OM_R (0x1 << 14) 8748c2ecf20Sopenharmony_ci#define RT5645_PWR_OM_R_BIT 14 8758c2ecf20Sopenharmony_ci#define RT5645_PWR_SM_L (0x1 << 13) 8768c2ecf20Sopenharmony_ci#define RT5645_PWR_SM_L_BIT 13 8778c2ecf20Sopenharmony_ci#define RT5645_PWR_SM_R (0x1 << 12) 8788c2ecf20Sopenharmony_ci#define RT5645_PWR_SM_R_BIT 12 8798c2ecf20Sopenharmony_ci#define RT5645_PWR_RM_L (0x1 << 11) 8808c2ecf20Sopenharmony_ci#define RT5645_PWR_RM_L_BIT 11 8818c2ecf20Sopenharmony_ci#define RT5645_PWR_RM_R (0x1 << 10) 8828c2ecf20Sopenharmony_ci#define RT5645_PWR_RM_R_BIT 10 8838c2ecf20Sopenharmony_ci#define RT5645_PWR_MM (0x1 << 8) 8848c2ecf20Sopenharmony_ci#define RT5645_PWR_MM_BIT 8 8858c2ecf20Sopenharmony_ci#define RT5645_PWR_HM_L (0x1 << 7) 8868c2ecf20Sopenharmony_ci#define RT5645_PWR_HM_L_BIT 7 8878c2ecf20Sopenharmony_ci#define RT5645_PWR_HM_R (0x1 << 6) 8888c2ecf20Sopenharmony_ci#define RT5645_PWR_HM_R_BIT 6 8898c2ecf20Sopenharmony_ci#define RT5645_PWR_LDO2 (0x1 << 1) 8908c2ecf20Sopenharmony_ci#define RT5645_PWR_LDO2_BIT 1 8918c2ecf20Sopenharmony_ci 8928c2ecf20Sopenharmony_ci/* Power Management for Volume (0x66) */ 8938c2ecf20Sopenharmony_ci#define RT5645_PWR_SV_L (0x1 << 15) 8948c2ecf20Sopenharmony_ci#define RT5645_PWR_SV_L_BIT 15 8958c2ecf20Sopenharmony_ci#define RT5645_PWR_SV_R (0x1 << 14) 8968c2ecf20Sopenharmony_ci#define RT5645_PWR_SV_R_BIT 14 8978c2ecf20Sopenharmony_ci#define RT5645_PWR_HV_L (0x1 << 11) 8988c2ecf20Sopenharmony_ci#define RT5645_PWR_HV_L_BIT 11 8998c2ecf20Sopenharmony_ci#define RT5645_PWR_HV_R (0x1 << 10) 9008c2ecf20Sopenharmony_ci#define RT5645_PWR_HV_R_BIT 10 9018c2ecf20Sopenharmony_ci#define RT5645_PWR_IN_L (0x1 << 9) 9028c2ecf20Sopenharmony_ci#define RT5645_PWR_IN_L_BIT 9 9038c2ecf20Sopenharmony_ci#define RT5645_PWR_IN_R (0x1 << 8) 9048c2ecf20Sopenharmony_ci#define RT5645_PWR_IN_R_BIT 8 9058c2ecf20Sopenharmony_ci#define RT5645_PWR_MIC_DET (0x1 << 5) 9068c2ecf20Sopenharmony_ci#define RT5645_PWR_MIC_DET_BIT 5 9078c2ecf20Sopenharmony_ci 9088c2ecf20Sopenharmony_ci/* I2S1/2 Audio Serial Data Port Control (0x70 0x71) */ 9098c2ecf20Sopenharmony_ci#define RT5645_I2S_MS_MASK (0x1 << 15) 9108c2ecf20Sopenharmony_ci#define RT5645_I2S_MS_SFT 15 9118c2ecf20Sopenharmony_ci#define RT5645_I2S_MS_M (0x0 << 15) 9128c2ecf20Sopenharmony_ci#define RT5645_I2S_MS_S (0x1 << 15) 9138c2ecf20Sopenharmony_ci#define RT5645_I2S_O_CP_MASK (0x3 << 10) 9148c2ecf20Sopenharmony_ci#define RT5645_I2S_O_CP_SFT 10 9158c2ecf20Sopenharmony_ci#define RT5645_I2S_O_CP_OFF (0x0 << 10) 9168c2ecf20Sopenharmony_ci#define RT5645_I2S_O_CP_U_LAW (0x1 << 10) 9178c2ecf20Sopenharmony_ci#define RT5645_I2S_O_CP_A_LAW (0x2 << 10) 9188c2ecf20Sopenharmony_ci#define RT5645_I2S_I_CP_MASK (0x3 << 8) 9198c2ecf20Sopenharmony_ci#define RT5645_I2S_I_CP_SFT 8 9208c2ecf20Sopenharmony_ci#define RT5645_I2S_I_CP_OFF (0x0 << 8) 9218c2ecf20Sopenharmony_ci#define RT5645_I2S_I_CP_U_LAW (0x1 << 8) 9228c2ecf20Sopenharmony_ci#define RT5645_I2S_I_CP_A_LAW (0x2 << 8) 9238c2ecf20Sopenharmony_ci#define RT5645_I2S_BP_MASK (0x1 << 7) 9248c2ecf20Sopenharmony_ci#define RT5645_I2S_BP_SFT 7 9258c2ecf20Sopenharmony_ci#define RT5645_I2S_BP_NOR (0x0 << 7) 9268c2ecf20Sopenharmony_ci#define RT5645_I2S_BP_INV (0x1 << 7) 9278c2ecf20Sopenharmony_ci#define RT5645_I2S_DL_MASK (0x3 << 2) 9288c2ecf20Sopenharmony_ci#define RT5645_I2S_DL_SFT 2 9298c2ecf20Sopenharmony_ci#define RT5645_I2S_DL_16 (0x0 << 2) 9308c2ecf20Sopenharmony_ci#define RT5645_I2S_DL_20 (0x1 << 2) 9318c2ecf20Sopenharmony_ci#define RT5645_I2S_DL_24 (0x2 << 2) 9328c2ecf20Sopenharmony_ci#define RT5645_I2S_DL_8 (0x3 << 2) 9338c2ecf20Sopenharmony_ci#define RT5645_I2S_DF_MASK (0x3) 9348c2ecf20Sopenharmony_ci#define RT5645_I2S_DF_SFT 0 9358c2ecf20Sopenharmony_ci#define RT5645_I2S_DF_I2S (0x0) 9368c2ecf20Sopenharmony_ci#define RT5645_I2S_DF_LEFT (0x1) 9378c2ecf20Sopenharmony_ci#define RT5645_I2S_DF_PCM_A (0x2) 9388c2ecf20Sopenharmony_ci#define RT5645_I2S_DF_PCM_B (0x3) 9398c2ecf20Sopenharmony_ci 9408c2ecf20Sopenharmony_ci/* I2S2 Audio Serial Data Port Control (0x71) */ 9418c2ecf20Sopenharmony_ci#define RT5645_I2S2_SDI_MASK (0x1 << 6) 9428c2ecf20Sopenharmony_ci#define RT5645_I2S2_SDI_SFT 6 9438c2ecf20Sopenharmony_ci#define RT5645_I2S2_SDI_I2S1 (0x0 << 6) 9448c2ecf20Sopenharmony_ci#define RT5645_I2S2_SDI_I2S2 (0x1 << 6) 9458c2ecf20Sopenharmony_ci 9468c2ecf20Sopenharmony_ci/* ADC/DAC Clock Control 1 (0x73) */ 9478c2ecf20Sopenharmony_ci#define RT5645_I2S_PD1_MASK (0x7 << 12) 9488c2ecf20Sopenharmony_ci#define RT5645_I2S_PD1_SFT 12 9498c2ecf20Sopenharmony_ci#define RT5645_I2S_PD1_1 (0x0 << 12) 9508c2ecf20Sopenharmony_ci#define RT5645_I2S_PD1_2 (0x1 << 12) 9518c2ecf20Sopenharmony_ci#define RT5645_I2S_PD1_3 (0x2 << 12) 9528c2ecf20Sopenharmony_ci#define RT5645_I2S_PD1_4 (0x3 << 12) 9538c2ecf20Sopenharmony_ci#define RT5645_I2S_PD1_6 (0x4 << 12) 9548c2ecf20Sopenharmony_ci#define RT5645_I2S_PD1_8 (0x5 << 12) 9558c2ecf20Sopenharmony_ci#define RT5645_I2S_PD1_12 (0x6 << 12) 9568c2ecf20Sopenharmony_ci#define RT5645_I2S_PD1_16 (0x7 << 12) 9578c2ecf20Sopenharmony_ci#define RT5645_I2S_BCLK_MS2_MASK (0x1 << 11) 9588c2ecf20Sopenharmony_ci#define RT5645_I2S_BCLK_MS2_SFT 11 9598c2ecf20Sopenharmony_ci#define RT5645_I2S_BCLK_MS2_32 (0x0 << 11) 9608c2ecf20Sopenharmony_ci#define RT5645_I2S_BCLK_MS2_64 (0x1 << 11) 9618c2ecf20Sopenharmony_ci#define RT5645_I2S_PD2_MASK (0x7 << 8) 9628c2ecf20Sopenharmony_ci#define RT5645_I2S_PD2_SFT 8 9638c2ecf20Sopenharmony_ci#define RT5645_I2S_PD2_1 (0x0 << 8) 9648c2ecf20Sopenharmony_ci#define RT5645_I2S_PD2_2 (0x1 << 8) 9658c2ecf20Sopenharmony_ci#define RT5645_I2S_PD2_3 (0x2 << 8) 9668c2ecf20Sopenharmony_ci#define RT5645_I2S_PD2_4 (0x3 << 8) 9678c2ecf20Sopenharmony_ci#define RT5645_I2S_PD2_6 (0x4 << 8) 9688c2ecf20Sopenharmony_ci#define RT5645_I2S_PD2_8 (0x5 << 8) 9698c2ecf20Sopenharmony_ci#define RT5645_I2S_PD2_12 (0x6 << 8) 9708c2ecf20Sopenharmony_ci#define RT5645_I2S_PD2_16 (0x7 << 8) 9718c2ecf20Sopenharmony_ci#define RT5645_I2S_BCLK_MS3_MASK (0x1 << 7) 9728c2ecf20Sopenharmony_ci#define RT5645_I2S_BCLK_MS3_SFT 7 9738c2ecf20Sopenharmony_ci#define RT5645_I2S_BCLK_MS3_32 (0x0 << 7) 9748c2ecf20Sopenharmony_ci#define RT5645_I2S_BCLK_MS3_64 (0x1 << 7) 9758c2ecf20Sopenharmony_ci#define RT5645_I2S_PD3_MASK (0x7 << 4) 9768c2ecf20Sopenharmony_ci#define RT5645_I2S_PD3_SFT 4 9778c2ecf20Sopenharmony_ci#define RT5645_I2S_PD3_1 (0x0 << 4) 9788c2ecf20Sopenharmony_ci#define RT5645_I2S_PD3_2 (0x1 << 4) 9798c2ecf20Sopenharmony_ci#define RT5645_I2S_PD3_3 (0x2 << 4) 9808c2ecf20Sopenharmony_ci#define RT5645_I2S_PD3_4 (0x3 << 4) 9818c2ecf20Sopenharmony_ci#define RT5645_I2S_PD3_6 (0x4 << 4) 9828c2ecf20Sopenharmony_ci#define RT5645_I2S_PD3_8 (0x5 << 4) 9838c2ecf20Sopenharmony_ci#define RT5645_I2S_PD3_12 (0x6 << 4) 9848c2ecf20Sopenharmony_ci#define RT5645_I2S_PD3_16 (0x7 << 4) 9858c2ecf20Sopenharmony_ci#define RT5645_DAC_OSR_MASK (0x3 << 2) 9868c2ecf20Sopenharmony_ci#define RT5645_DAC_OSR_SFT 2 9878c2ecf20Sopenharmony_ci#define RT5645_DAC_OSR_128 (0x0 << 2) 9888c2ecf20Sopenharmony_ci#define RT5645_DAC_OSR_64 (0x1 << 2) 9898c2ecf20Sopenharmony_ci#define RT5645_DAC_OSR_32 (0x2 << 2) 9908c2ecf20Sopenharmony_ci#define RT5645_DAC_OSR_16 (0x3 << 2) 9918c2ecf20Sopenharmony_ci#define RT5645_ADC_OSR_MASK (0x3) 9928c2ecf20Sopenharmony_ci#define RT5645_ADC_OSR_SFT 0 9938c2ecf20Sopenharmony_ci#define RT5645_ADC_OSR_128 (0x0) 9948c2ecf20Sopenharmony_ci#define RT5645_ADC_OSR_64 (0x1) 9958c2ecf20Sopenharmony_ci#define RT5645_ADC_OSR_32 (0x2) 9968c2ecf20Sopenharmony_ci#define RT5645_ADC_OSR_16 (0x3) 9978c2ecf20Sopenharmony_ci 9988c2ecf20Sopenharmony_ci/* ADC/DAC Clock Control 2 (0x74) */ 9998c2ecf20Sopenharmony_ci#define RT5645_DAC_L_OSR_MASK (0x3 << 14) 10008c2ecf20Sopenharmony_ci#define RT5645_DAC_L_OSR_SFT 14 10018c2ecf20Sopenharmony_ci#define RT5645_DAC_L_OSR_128 (0x0 << 14) 10028c2ecf20Sopenharmony_ci#define RT5645_DAC_L_OSR_64 (0x1 << 14) 10038c2ecf20Sopenharmony_ci#define RT5645_DAC_L_OSR_32 (0x2 << 14) 10048c2ecf20Sopenharmony_ci#define RT5645_DAC_L_OSR_16 (0x3 << 14) 10058c2ecf20Sopenharmony_ci#define RT5645_ADC_R_OSR_MASK (0x3 << 12) 10068c2ecf20Sopenharmony_ci#define RT5645_ADC_R_OSR_SFT 12 10078c2ecf20Sopenharmony_ci#define RT5645_ADC_R_OSR_128 (0x0 << 12) 10088c2ecf20Sopenharmony_ci#define RT5645_ADC_R_OSR_64 (0x1 << 12) 10098c2ecf20Sopenharmony_ci#define RT5645_ADC_R_OSR_32 (0x2 << 12) 10108c2ecf20Sopenharmony_ci#define RT5645_ADC_R_OSR_16 (0x3 << 12) 10118c2ecf20Sopenharmony_ci#define RT5645_DAHPF_EN (0x1 << 11) 10128c2ecf20Sopenharmony_ci#define RT5645_DAHPF_EN_SFT 11 10138c2ecf20Sopenharmony_ci#define RT5645_ADHPF_EN (0x1 << 10) 10148c2ecf20Sopenharmony_ci#define RT5645_ADHPF_EN_SFT 10 10158c2ecf20Sopenharmony_ci 10168c2ecf20Sopenharmony_ci/* Digital Microphone Control (0x75) */ 10178c2ecf20Sopenharmony_ci#define RT5645_DMIC_1_EN_MASK (0x1 << 15) 10188c2ecf20Sopenharmony_ci#define RT5645_DMIC_1_EN_SFT 15 10198c2ecf20Sopenharmony_ci#define RT5645_DMIC_1_DIS (0x0 << 15) 10208c2ecf20Sopenharmony_ci#define RT5645_DMIC_1_EN (0x1 << 15) 10218c2ecf20Sopenharmony_ci#define RT5645_DMIC_2_EN_MASK (0x1 << 14) 10228c2ecf20Sopenharmony_ci#define RT5645_DMIC_2_EN_SFT 14 10238c2ecf20Sopenharmony_ci#define RT5645_DMIC_2_DIS (0x0 << 14) 10248c2ecf20Sopenharmony_ci#define RT5645_DMIC_2_EN (0x1 << 14) 10258c2ecf20Sopenharmony_ci#define RT5645_DMIC_1L_LH_MASK (0x1 << 13) 10268c2ecf20Sopenharmony_ci#define RT5645_DMIC_1L_LH_SFT 13 10278c2ecf20Sopenharmony_ci#define RT5645_DMIC_1L_LH_FALLING (0x0 << 13) 10288c2ecf20Sopenharmony_ci#define RT5645_DMIC_1L_LH_RISING (0x1 << 13) 10298c2ecf20Sopenharmony_ci#define RT5645_DMIC_1R_LH_MASK (0x1 << 12) 10308c2ecf20Sopenharmony_ci#define RT5645_DMIC_1R_LH_SFT 12 10318c2ecf20Sopenharmony_ci#define RT5645_DMIC_1R_LH_FALLING (0x0 << 12) 10328c2ecf20Sopenharmony_ci#define RT5645_DMIC_1R_LH_RISING (0x1 << 12) 10338c2ecf20Sopenharmony_ci#define RT5645_DMIC_2_DP_MASK (0x3 << 10) 10348c2ecf20Sopenharmony_ci#define RT5645_DMIC_2_DP_SFT 10 10358c2ecf20Sopenharmony_ci#define RT5645_DMIC_2_DP_GPIO6 (0x0 << 10) 10368c2ecf20Sopenharmony_ci#define RT5645_DMIC_2_DP_GPIO10 (0x1 << 10) 10378c2ecf20Sopenharmony_ci#define RT5645_DMIC_2_DP_GPIO12 (0x2 << 10) 10388c2ecf20Sopenharmony_ci#define RT5645_DMIC_2_DP_IN2P (0x3 << 10) 10398c2ecf20Sopenharmony_ci#define RT5645_DMIC_2L_LH_MASK (0x1 << 9) 10408c2ecf20Sopenharmony_ci#define RT5645_DMIC_2L_LH_SFT 9 10418c2ecf20Sopenharmony_ci#define RT5645_DMIC_2L_LH_FALLING (0x0 << 9) 10428c2ecf20Sopenharmony_ci#define RT5645_DMIC_2L_LH_RISING (0x1 << 9) 10438c2ecf20Sopenharmony_ci#define RT5645_DMIC_2R_LH_MASK (0x1 << 8) 10448c2ecf20Sopenharmony_ci#define RT5645_DMIC_2R_LH_SFT 8 10458c2ecf20Sopenharmony_ci#define RT5645_DMIC_2R_LH_FALLING (0x0 << 8) 10468c2ecf20Sopenharmony_ci#define RT5645_DMIC_2R_LH_RISING (0x1 << 8) 10478c2ecf20Sopenharmony_ci#define RT5645_DMIC_CLK_MASK (0x7 << 5) 10488c2ecf20Sopenharmony_ci#define RT5645_DMIC_CLK_SFT 5 10498c2ecf20Sopenharmony_ci#define RT5645_DMIC_3_EN_MASK (0x1 << 4) 10508c2ecf20Sopenharmony_ci#define RT5645_DMIC_3_EN_SFT 4 10518c2ecf20Sopenharmony_ci#define RT5645_DMIC_3_DIS (0x0 << 4) 10528c2ecf20Sopenharmony_ci#define RT5645_DMIC_3_EN (0x1 << 4) 10538c2ecf20Sopenharmony_ci#define RT5645_DMIC_1_DP_MASK (0x3 << 0) 10548c2ecf20Sopenharmony_ci#define RT5645_DMIC_1_DP_SFT 0 10558c2ecf20Sopenharmony_ci#define RT5645_DMIC_1_DP_GPIO5 (0x0 << 0) 10568c2ecf20Sopenharmony_ci#define RT5645_DMIC_1_DP_IN2N (0x1 << 0) 10578c2ecf20Sopenharmony_ci#define RT5645_DMIC_1_DP_GPIO11 (0x2 << 0) 10588c2ecf20Sopenharmony_ci 10598c2ecf20Sopenharmony_ci/* TDM Control 1 (0x77) */ 10608c2ecf20Sopenharmony_ci#define RT5645_IF1_ADC_IN_MASK (0x3 << 8) 10618c2ecf20Sopenharmony_ci#define RT5645_IF1_ADC_IN_SFT 8 10628c2ecf20Sopenharmony_ci 10638c2ecf20Sopenharmony_ci/* Global Clock Control (0x80) */ 10648c2ecf20Sopenharmony_ci#define RT5645_SCLK_SRC_MASK (0x3 << 14) 10658c2ecf20Sopenharmony_ci#define RT5645_SCLK_SRC_SFT 14 10668c2ecf20Sopenharmony_ci#define RT5645_SCLK_SRC_MCLK (0x0 << 14) 10678c2ecf20Sopenharmony_ci#define RT5645_SCLK_SRC_PLL1 (0x1 << 14) 10688c2ecf20Sopenharmony_ci#define RT5645_SCLK_SRC_RCCLK (0x2 << 14) 10698c2ecf20Sopenharmony_ci#define RT5645_PLL1_SRC_MASK (0x7 << 11) 10708c2ecf20Sopenharmony_ci#define RT5645_PLL1_SRC_SFT 11 10718c2ecf20Sopenharmony_ci#define RT5645_PLL1_SRC_MCLK (0x0 << 11) 10728c2ecf20Sopenharmony_ci#define RT5645_PLL1_SRC_BCLK1 (0x1 << 11) 10738c2ecf20Sopenharmony_ci#define RT5645_PLL1_SRC_BCLK2 (0x2 << 11) 10748c2ecf20Sopenharmony_ci#define RT5645_PLL1_SRC_BCLK3 (0x3 << 11) 10758c2ecf20Sopenharmony_ci#define RT5645_PLL1_SRC_RCCLK (0x4 << 11) 10768c2ecf20Sopenharmony_ci#define RT5645_PLL1_PD_MASK (0x1 << 3) 10778c2ecf20Sopenharmony_ci#define RT5645_PLL1_PD_SFT 3 10788c2ecf20Sopenharmony_ci#define RT5645_PLL1_PD_1 (0x0 << 3) 10798c2ecf20Sopenharmony_ci#define RT5645_PLL1_PD_2 (0x1 << 3) 10808c2ecf20Sopenharmony_ci 10818c2ecf20Sopenharmony_ci#define RT5645_PLL_INP_MAX 40000000 10828c2ecf20Sopenharmony_ci#define RT5645_PLL_INP_MIN 256000 10838c2ecf20Sopenharmony_ci/* PLL M/N/K Code Control 1 (0x81) */ 10848c2ecf20Sopenharmony_ci#define RT5645_PLL_N_MAX 0x1ff 10858c2ecf20Sopenharmony_ci#define RT5645_PLL_N_MASK (RT5645_PLL_N_MAX << 7) 10868c2ecf20Sopenharmony_ci#define RT5645_PLL_N_SFT 7 10878c2ecf20Sopenharmony_ci#define RT5645_PLL_K_MAX 0x1f 10888c2ecf20Sopenharmony_ci#define RT5645_PLL_K_MASK (RT5645_PLL_K_MAX) 10898c2ecf20Sopenharmony_ci#define RT5645_PLL_K_SFT 0 10908c2ecf20Sopenharmony_ci 10918c2ecf20Sopenharmony_ci/* PLL M/N/K Code Control 2 (0x82) */ 10928c2ecf20Sopenharmony_ci#define RT5645_PLL_M_MAX 0xf 10938c2ecf20Sopenharmony_ci#define RT5645_PLL_M_MASK (RT5645_PLL_M_MAX << 12) 10948c2ecf20Sopenharmony_ci#define RT5645_PLL_M_SFT 12 10958c2ecf20Sopenharmony_ci#define RT5645_PLL_M_BP (0x1 << 11) 10968c2ecf20Sopenharmony_ci#define RT5645_PLL_M_BP_SFT 11 10978c2ecf20Sopenharmony_ci 10988c2ecf20Sopenharmony_ci/* ASRC Control 1 (0x83) */ 10998c2ecf20Sopenharmony_ci#define RT5645_STO_T_MASK (0x1 << 15) 11008c2ecf20Sopenharmony_ci#define RT5645_STO_T_SFT 15 11018c2ecf20Sopenharmony_ci#define RT5645_STO_T_SCLK (0x0 << 15) 11028c2ecf20Sopenharmony_ci#define RT5645_STO_T_LRCK1 (0x1 << 15) 11038c2ecf20Sopenharmony_ci#define RT5645_M1_T_MASK (0x1 << 14) 11048c2ecf20Sopenharmony_ci#define RT5645_M1_T_SFT 14 11058c2ecf20Sopenharmony_ci#define RT5645_M1_T_I2S2 (0x0 << 14) 11068c2ecf20Sopenharmony_ci#define RT5645_M1_T_I2S2_D3 (0x1 << 14) 11078c2ecf20Sopenharmony_ci#define RT5645_I2S2_F_MASK (0x1 << 12) 11088c2ecf20Sopenharmony_ci#define RT5645_I2S2_F_SFT 12 11098c2ecf20Sopenharmony_ci#define RT5645_I2S2_F_I2S2_D2 (0x0 << 12) 11108c2ecf20Sopenharmony_ci#define RT5645_I2S2_F_I2S1_TCLK (0x1 << 12) 11118c2ecf20Sopenharmony_ci#define RT5645_DMIC_1_M_MASK (0x1 << 9) 11128c2ecf20Sopenharmony_ci#define RT5645_DMIC_1_M_SFT 9 11138c2ecf20Sopenharmony_ci#define RT5645_DMIC_1_M_NOR (0x0 << 9) 11148c2ecf20Sopenharmony_ci#define RT5645_DMIC_1_M_ASYN (0x1 << 9) 11158c2ecf20Sopenharmony_ci#define RT5645_DMIC_2_M_MASK (0x1 << 8) 11168c2ecf20Sopenharmony_ci#define RT5645_DMIC_2_M_SFT 8 11178c2ecf20Sopenharmony_ci#define RT5645_DMIC_2_M_NOR (0x0 << 8) 11188c2ecf20Sopenharmony_ci#define RT5645_DMIC_2_M_ASYN (0x1 << 8) 11198c2ecf20Sopenharmony_ci 11208c2ecf20Sopenharmony_ci/* ASRC clock source selection (0x84, 0x85) */ 11218c2ecf20Sopenharmony_ci#define RT5645_CLK_SEL_SYS (0x0) 11228c2ecf20Sopenharmony_ci#define RT5645_CLK_SEL_I2S1_ASRC (0x1) 11238c2ecf20Sopenharmony_ci#define RT5645_CLK_SEL_I2S2_ASRC (0x2) 11248c2ecf20Sopenharmony_ci#define RT5645_CLK_SEL_SYS2 (0x5) 11258c2ecf20Sopenharmony_ci 11268c2ecf20Sopenharmony_ci/* ASRC Control 2 (0x84) */ 11278c2ecf20Sopenharmony_ci#define RT5645_DA_STO_CLK_SEL_MASK (0xf << 12) 11288c2ecf20Sopenharmony_ci#define RT5645_DA_STO_CLK_SEL_SFT 12 11298c2ecf20Sopenharmony_ci#define RT5645_DA_MONOL_CLK_SEL_MASK (0xf << 8) 11308c2ecf20Sopenharmony_ci#define RT5645_DA_MONOL_CLK_SEL_SFT 8 11318c2ecf20Sopenharmony_ci#define RT5645_DA_MONOR_CLK_SEL_MASK (0xf << 4) 11328c2ecf20Sopenharmony_ci#define RT5645_DA_MONOR_CLK_SEL_SFT 4 11338c2ecf20Sopenharmony_ci#define RT5645_AD_STO1_CLK_SEL_MASK (0xf << 0) 11348c2ecf20Sopenharmony_ci#define RT5645_AD_STO1_CLK_SEL_SFT 0 11358c2ecf20Sopenharmony_ci 11368c2ecf20Sopenharmony_ci/* ASRC Control 3 (0x85) */ 11378c2ecf20Sopenharmony_ci#define RT5645_AD_MONOL_CLK_SEL_MASK (0xf << 4) 11388c2ecf20Sopenharmony_ci#define RT5645_AD_MONOL_CLK_SEL_SFT 4 11398c2ecf20Sopenharmony_ci#define RT5645_AD_MONOR_CLK_SEL_MASK (0xf << 0) 11408c2ecf20Sopenharmony_ci#define RT5645_AD_MONOR_CLK_SEL_SFT 0 11418c2ecf20Sopenharmony_ci 11428c2ecf20Sopenharmony_ci/* ASRC Control 4 (0x89) */ 11438c2ecf20Sopenharmony_ci#define RT5645_I2S1_PD_MASK (0x7 << 12) 11448c2ecf20Sopenharmony_ci#define RT5645_I2S1_PD_SFT 12 11458c2ecf20Sopenharmony_ci#define RT5645_I2S2_PD_MASK (0x7 << 8) 11468c2ecf20Sopenharmony_ci#define RT5645_I2S2_PD_SFT 8 11478c2ecf20Sopenharmony_ci 11488c2ecf20Sopenharmony_ci/* HPOUT Over Current Detection (0x8b) */ 11498c2ecf20Sopenharmony_ci#define RT5645_HP_OVCD_MASK (0x1 << 10) 11508c2ecf20Sopenharmony_ci#define RT5645_HP_OVCD_SFT 10 11518c2ecf20Sopenharmony_ci#define RT5645_HP_OVCD_DIS (0x0 << 10) 11528c2ecf20Sopenharmony_ci#define RT5645_HP_OVCD_EN (0x1 << 10) 11538c2ecf20Sopenharmony_ci#define RT5645_HP_OC_TH_MASK (0x3 << 8) 11548c2ecf20Sopenharmony_ci#define RT5645_HP_OC_TH_SFT 8 11558c2ecf20Sopenharmony_ci#define RT5645_HP_OC_TH_90 (0x0 << 8) 11568c2ecf20Sopenharmony_ci#define RT5645_HP_OC_TH_105 (0x1 << 8) 11578c2ecf20Sopenharmony_ci#define RT5645_HP_OC_TH_120 (0x2 << 8) 11588c2ecf20Sopenharmony_ci#define RT5645_HP_OC_TH_135 (0x3 << 8) 11598c2ecf20Sopenharmony_ci 11608c2ecf20Sopenharmony_ci/* Class D Over Current Control (0x8c) */ 11618c2ecf20Sopenharmony_ci#define RT5645_CLSD_OC_MASK (0x1 << 9) 11628c2ecf20Sopenharmony_ci#define RT5645_CLSD_OC_SFT 9 11638c2ecf20Sopenharmony_ci#define RT5645_CLSD_OC_PU (0x0 << 9) 11648c2ecf20Sopenharmony_ci#define RT5645_CLSD_OC_PD (0x1 << 9) 11658c2ecf20Sopenharmony_ci#define RT5645_AUTO_PD_MASK (0x1 << 8) 11668c2ecf20Sopenharmony_ci#define RT5645_AUTO_PD_SFT 8 11678c2ecf20Sopenharmony_ci#define RT5645_AUTO_PD_DIS (0x0 << 8) 11688c2ecf20Sopenharmony_ci#define RT5645_AUTO_PD_EN (0x1 << 8) 11698c2ecf20Sopenharmony_ci#define RT5645_CLSD_OC_TH_MASK (0x3f) 11708c2ecf20Sopenharmony_ci#define RT5645_CLSD_OC_TH_SFT 0 11718c2ecf20Sopenharmony_ci 11728c2ecf20Sopenharmony_ci/* Class D Output Control (0x8d) */ 11738c2ecf20Sopenharmony_ci#define RT5645_CLSD_RATIO_MASK (0xf << 12) 11748c2ecf20Sopenharmony_ci#define RT5645_CLSD_RATIO_SFT 12 11758c2ecf20Sopenharmony_ci#define RT5645_CLSD_OM_MASK (0x1 << 11) 11768c2ecf20Sopenharmony_ci#define RT5645_CLSD_OM_SFT 11 11778c2ecf20Sopenharmony_ci#define RT5645_CLSD_OM_MONO (0x0 << 11) 11788c2ecf20Sopenharmony_ci#define RT5645_CLSD_OM_STO (0x1 << 11) 11798c2ecf20Sopenharmony_ci#define RT5645_CLSD_SCH_MASK (0x1 << 10) 11808c2ecf20Sopenharmony_ci#define RT5645_CLSD_SCH_SFT 10 11818c2ecf20Sopenharmony_ci#define RT5645_CLSD_SCH_L (0x0 << 10) 11828c2ecf20Sopenharmony_ci#define RT5645_CLSD_SCH_S (0x1 << 10) 11838c2ecf20Sopenharmony_ci 11848c2ecf20Sopenharmony_ci/* Depop Mode Control 1 (0x8e) */ 11858c2ecf20Sopenharmony_ci#define RT5645_SMT_TRIG_MASK (0x1 << 15) 11868c2ecf20Sopenharmony_ci#define RT5645_SMT_TRIG_SFT 15 11878c2ecf20Sopenharmony_ci#define RT5645_SMT_TRIG_DIS (0x0 << 15) 11888c2ecf20Sopenharmony_ci#define RT5645_SMT_TRIG_EN (0x1 << 15) 11898c2ecf20Sopenharmony_ci#define RT5645_HP_L_SMT_MASK (0x1 << 9) 11908c2ecf20Sopenharmony_ci#define RT5645_HP_L_SMT_SFT 9 11918c2ecf20Sopenharmony_ci#define RT5645_HP_L_SMT_DIS (0x0 << 9) 11928c2ecf20Sopenharmony_ci#define RT5645_HP_L_SMT_EN (0x1 << 9) 11938c2ecf20Sopenharmony_ci#define RT5645_HP_R_SMT_MASK (0x1 << 8) 11948c2ecf20Sopenharmony_ci#define RT5645_HP_R_SMT_SFT 8 11958c2ecf20Sopenharmony_ci#define RT5645_HP_R_SMT_DIS (0x0 << 8) 11968c2ecf20Sopenharmony_ci#define RT5645_HP_R_SMT_EN (0x1 << 8) 11978c2ecf20Sopenharmony_ci#define RT5645_HP_CD_PD_MASK (0x1 << 7) 11988c2ecf20Sopenharmony_ci#define RT5645_HP_CD_PD_SFT 7 11998c2ecf20Sopenharmony_ci#define RT5645_HP_CD_PD_DIS (0x0 << 7) 12008c2ecf20Sopenharmony_ci#define RT5645_HP_CD_PD_EN (0x1 << 7) 12018c2ecf20Sopenharmony_ci#define RT5645_RSTN_MASK (0x1 << 6) 12028c2ecf20Sopenharmony_ci#define RT5645_RSTN_SFT 6 12038c2ecf20Sopenharmony_ci#define RT5645_RSTN_DIS (0x0 << 6) 12048c2ecf20Sopenharmony_ci#define RT5645_RSTN_EN (0x1 << 6) 12058c2ecf20Sopenharmony_ci#define RT5645_RSTP_MASK (0x1 << 5) 12068c2ecf20Sopenharmony_ci#define RT5645_RSTP_SFT 5 12078c2ecf20Sopenharmony_ci#define RT5645_RSTP_DIS (0x0 << 5) 12088c2ecf20Sopenharmony_ci#define RT5645_RSTP_EN (0x1 << 5) 12098c2ecf20Sopenharmony_ci#define RT5645_HP_CO_MASK (0x1 << 4) 12108c2ecf20Sopenharmony_ci#define RT5645_HP_CO_SFT 4 12118c2ecf20Sopenharmony_ci#define RT5645_HP_CO_DIS (0x0 << 4) 12128c2ecf20Sopenharmony_ci#define RT5645_HP_CO_EN (0x1 << 4) 12138c2ecf20Sopenharmony_ci#define RT5645_HP_CP_MASK (0x1 << 3) 12148c2ecf20Sopenharmony_ci#define RT5645_HP_CP_SFT 3 12158c2ecf20Sopenharmony_ci#define RT5645_HP_CP_PD (0x0 << 3) 12168c2ecf20Sopenharmony_ci#define RT5645_HP_CP_PU (0x1 << 3) 12178c2ecf20Sopenharmony_ci#define RT5645_HP_SG_MASK (0x1 << 2) 12188c2ecf20Sopenharmony_ci#define RT5645_HP_SG_SFT 2 12198c2ecf20Sopenharmony_ci#define RT5645_HP_SG_DIS (0x0 << 2) 12208c2ecf20Sopenharmony_ci#define RT5645_HP_SG_EN (0x1 << 2) 12218c2ecf20Sopenharmony_ci#define RT5645_HP_DP_MASK (0x1 << 1) 12228c2ecf20Sopenharmony_ci#define RT5645_HP_DP_SFT 1 12238c2ecf20Sopenharmony_ci#define RT5645_HP_DP_PD (0x0 << 1) 12248c2ecf20Sopenharmony_ci#define RT5645_HP_DP_PU (0x1 << 1) 12258c2ecf20Sopenharmony_ci#define RT5645_HP_CB_MASK (0x1) 12268c2ecf20Sopenharmony_ci#define RT5645_HP_CB_SFT 0 12278c2ecf20Sopenharmony_ci#define RT5645_HP_CB_PD (0x0) 12288c2ecf20Sopenharmony_ci#define RT5645_HP_CB_PU (0x1) 12298c2ecf20Sopenharmony_ci 12308c2ecf20Sopenharmony_ci/* Depop Mode Control 2 (0x8f) */ 12318c2ecf20Sopenharmony_ci#define RT5645_DEPOP_MASK (0x1 << 13) 12328c2ecf20Sopenharmony_ci#define RT5645_DEPOP_SFT 13 12338c2ecf20Sopenharmony_ci#define RT5645_DEPOP_AUTO (0x0 << 13) 12348c2ecf20Sopenharmony_ci#define RT5645_DEPOP_MAN (0x1 << 13) 12358c2ecf20Sopenharmony_ci#define RT5645_RAMP_MASK (0x1 << 12) 12368c2ecf20Sopenharmony_ci#define RT5645_RAMP_SFT 12 12378c2ecf20Sopenharmony_ci#define RT5645_RAMP_DIS (0x0 << 12) 12388c2ecf20Sopenharmony_ci#define RT5645_RAMP_EN (0x1 << 12) 12398c2ecf20Sopenharmony_ci#define RT5645_BPS_MASK (0x1 << 11) 12408c2ecf20Sopenharmony_ci#define RT5645_BPS_SFT 11 12418c2ecf20Sopenharmony_ci#define RT5645_BPS_DIS (0x0 << 11) 12428c2ecf20Sopenharmony_ci#define RT5645_BPS_EN (0x1 << 11) 12438c2ecf20Sopenharmony_ci#define RT5645_FAST_UPDN_MASK (0x1 << 10) 12448c2ecf20Sopenharmony_ci#define RT5645_FAST_UPDN_SFT 10 12458c2ecf20Sopenharmony_ci#define RT5645_FAST_UPDN_DIS (0x0 << 10) 12468c2ecf20Sopenharmony_ci#define RT5645_FAST_UPDN_EN (0x1 << 10) 12478c2ecf20Sopenharmony_ci#define RT5645_MRES_MASK (0x3 << 8) 12488c2ecf20Sopenharmony_ci#define RT5645_MRES_SFT 8 12498c2ecf20Sopenharmony_ci#define RT5645_MRES_15MO (0x0 << 8) 12508c2ecf20Sopenharmony_ci#define RT5645_MRES_25MO (0x1 << 8) 12518c2ecf20Sopenharmony_ci#define RT5645_MRES_35MO (0x2 << 8) 12528c2ecf20Sopenharmony_ci#define RT5645_MRES_45MO (0x3 << 8) 12538c2ecf20Sopenharmony_ci#define RT5645_VLO_MASK (0x1 << 7) 12548c2ecf20Sopenharmony_ci#define RT5645_VLO_SFT 7 12558c2ecf20Sopenharmony_ci#define RT5645_VLO_3V (0x0 << 7) 12568c2ecf20Sopenharmony_ci#define RT5645_VLO_32V (0x1 << 7) 12578c2ecf20Sopenharmony_ci#define RT5645_DIG_DP_MASK (0x1 << 6) 12588c2ecf20Sopenharmony_ci#define RT5645_DIG_DP_SFT 6 12598c2ecf20Sopenharmony_ci#define RT5645_DIG_DP_DIS (0x0 << 6) 12608c2ecf20Sopenharmony_ci#define RT5645_DIG_DP_EN (0x1 << 6) 12618c2ecf20Sopenharmony_ci#define RT5645_DP_TH_MASK (0x3 << 4) 12628c2ecf20Sopenharmony_ci#define RT5645_DP_TH_SFT 4 12638c2ecf20Sopenharmony_ci 12648c2ecf20Sopenharmony_ci/* Depop Mode Control 3 (0x90) */ 12658c2ecf20Sopenharmony_ci#define RT5645_CP_SYS_MASK (0x7 << 12) 12668c2ecf20Sopenharmony_ci#define RT5645_CP_SYS_SFT 12 12678c2ecf20Sopenharmony_ci#define RT5645_CP_FQ1_MASK (0x7 << 8) 12688c2ecf20Sopenharmony_ci#define RT5645_CP_FQ1_SFT 8 12698c2ecf20Sopenharmony_ci#define RT5645_CP_FQ2_MASK (0x7 << 4) 12708c2ecf20Sopenharmony_ci#define RT5645_CP_FQ2_SFT 4 12718c2ecf20Sopenharmony_ci#define RT5645_CP_FQ3_MASK (0x7) 12728c2ecf20Sopenharmony_ci#define RT5645_CP_FQ3_SFT 0 12738c2ecf20Sopenharmony_ci#define RT5645_CP_FQ_1_5_KHZ 0 12748c2ecf20Sopenharmony_ci#define RT5645_CP_FQ_3_KHZ 1 12758c2ecf20Sopenharmony_ci#define RT5645_CP_FQ_6_KHZ 2 12768c2ecf20Sopenharmony_ci#define RT5645_CP_FQ_12_KHZ 3 12778c2ecf20Sopenharmony_ci#define RT5645_CP_FQ_24_KHZ 4 12788c2ecf20Sopenharmony_ci#define RT5645_CP_FQ_48_KHZ 5 12798c2ecf20Sopenharmony_ci#define RT5645_CP_FQ_96_KHZ 6 12808c2ecf20Sopenharmony_ci#define RT5645_CP_FQ_192_KHZ 7 12818c2ecf20Sopenharmony_ci 12828c2ecf20Sopenharmony_ci/* PV detection and SPK gain control (0x92) */ 12838c2ecf20Sopenharmony_ci#define RT5645_PVDD_DET_MASK (0x1 << 15) 12848c2ecf20Sopenharmony_ci#define RT5645_PVDD_DET_SFT 15 12858c2ecf20Sopenharmony_ci#define RT5645_PVDD_DET_DIS (0x0 << 15) 12868c2ecf20Sopenharmony_ci#define RT5645_PVDD_DET_EN (0x1 << 15) 12878c2ecf20Sopenharmony_ci#define RT5645_SPK_AG_MASK (0x1 << 14) 12888c2ecf20Sopenharmony_ci#define RT5645_SPK_AG_SFT 14 12898c2ecf20Sopenharmony_ci#define RT5645_SPK_AG_DIS (0x0 << 14) 12908c2ecf20Sopenharmony_ci#define RT5645_SPK_AG_EN (0x1 << 14) 12918c2ecf20Sopenharmony_ci 12928c2ecf20Sopenharmony_ci/* Micbias Control (0x93) */ 12938c2ecf20Sopenharmony_ci#define RT5645_MIC1_BS_MASK (0x1 << 15) 12948c2ecf20Sopenharmony_ci#define RT5645_MIC1_BS_SFT 15 12958c2ecf20Sopenharmony_ci#define RT5645_MIC1_BS_9AV (0x0 << 15) 12968c2ecf20Sopenharmony_ci#define RT5645_MIC1_BS_75AV (0x1 << 15) 12978c2ecf20Sopenharmony_ci#define RT5645_MIC2_BS_MASK (0x1 << 14) 12988c2ecf20Sopenharmony_ci#define RT5645_MIC2_BS_SFT 14 12998c2ecf20Sopenharmony_ci#define RT5645_MIC2_BS_9AV (0x0 << 14) 13008c2ecf20Sopenharmony_ci#define RT5645_MIC2_BS_75AV (0x1 << 14) 13018c2ecf20Sopenharmony_ci#define RT5645_MIC1_CLK_MASK (0x1 << 13) 13028c2ecf20Sopenharmony_ci#define RT5645_MIC1_CLK_SFT 13 13038c2ecf20Sopenharmony_ci#define RT5645_MIC1_CLK_DIS (0x0 << 13) 13048c2ecf20Sopenharmony_ci#define RT5645_MIC1_CLK_EN (0x1 << 13) 13058c2ecf20Sopenharmony_ci#define RT5645_MIC2_CLK_MASK (0x1 << 12) 13068c2ecf20Sopenharmony_ci#define RT5645_MIC2_CLK_SFT 12 13078c2ecf20Sopenharmony_ci#define RT5645_MIC2_CLK_DIS (0x0 << 12) 13088c2ecf20Sopenharmony_ci#define RT5645_MIC2_CLK_EN (0x1 << 12) 13098c2ecf20Sopenharmony_ci#define RT5645_MIC1_OVCD_MASK (0x1 << 11) 13108c2ecf20Sopenharmony_ci#define RT5645_MIC1_OVCD_SFT 11 13118c2ecf20Sopenharmony_ci#define RT5645_MIC1_OVCD_DIS (0x0 << 11) 13128c2ecf20Sopenharmony_ci#define RT5645_MIC1_OVCD_EN (0x1 << 11) 13138c2ecf20Sopenharmony_ci#define RT5645_MIC1_OVTH_MASK (0x3 << 9) 13148c2ecf20Sopenharmony_ci#define RT5645_MIC1_OVTH_SFT 9 13158c2ecf20Sopenharmony_ci#define RT5645_MIC1_OVTH_600UA (0x0 << 9) 13168c2ecf20Sopenharmony_ci#define RT5645_MIC1_OVTH_1500UA (0x1 << 9) 13178c2ecf20Sopenharmony_ci#define RT5645_MIC1_OVTH_2000UA (0x2 << 9) 13188c2ecf20Sopenharmony_ci#define RT5645_MIC2_OVCD_MASK (0x1 << 8) 13198c2ecf20Sopenharmony_ci#define RT5645_MIC2_OVCD_SFT 8 13208c2ecf20Sopenharmony_ci#define RT5645_MIC2_OVCD_DIS (0x0 << 8) 13218c2ecf20Sopenharmony_ci#define RT5645_MIC2_OVCD_EN (0x1 << 8) 13228c2ecf20Sopenharmony_ci#define RT5645_MIC2_OVTH_MASK (0x3 << 6) 13238c2ecf20Sopenharmony_ci#define RT5645_MIC2_OVTH_SFT 6 13248c2ecf20Sopenharmony_ci#define RT5645_MIC2_OVTH_600UA (0x0 << 6) 13258c2ecf20Sopenharmony_ci#define RT5645_MIC2_OVTH_1500UA (0x1 << 6) 13268c2ecf20Sopenharmony_ci#define RT5645_MIC2_OVTH_2000UA (0x2 << 6) 13278c2ecf20Sopenharmony_ci#define RT5645_PWR_MB_MASK (0x1 << 5) 13288c2ecf20Sopenharmony_ci#define RT5645_PWR_MB_SFT 5 13298c2ecf20Sopenharmony_ci#define RT5645_PWR_MB_PD (0x0 << 5) 13308c2ecf20Sopenharmony_ci#define RT5645_PWR_MB_PU (0x1 << 5) 13318c2ecf20Sopenharmony_ci#define RT5645_PWR_CLK25M_MASK (0x1 << 4) 13328c2ecf20Sopenharmony_ci#define RT5645_PWR_CLK25M_SFT 4 13338c2ecf20Sopenharmony_ci#define RT5645_PWR_CLK25M_PD (0x0 << 4) 13348c2ecf20Sopenharmony_ci#define RT5645_PWR_CLK25M_PU (0x1 << 4) 13358c2ecf20Sopenharmony_ci#define RT5645_IRQ_CLK_MCLK (0x0 << 3) 13368c2ecf20Sopenharmony_ci#define RT5645_IRQ_CLK_INT (0x1 << 3) 13378c2ecf20Sopenharmony_ci#define RT5645_JD1_MODE_MASK (0x3 << 0) 13388c2ecf20Sopenharmony_ci#define RT5645_JD1_MODE_0 (0x0 << 0) 13398c2ecf20Sopenharmony_ci#define RT5645_JD1_MODE_1 (0x1 << 0) 13408c2ecf20Sopenharmony_ci#define RT5645_JD1_MODE_2 (0x2 << 0) 13418c2ecf20Sopenharmony_ci 13428c2ecf20Sopenharmony_ci/* VAD Control 4 (0x9d) */ 13438c2ecf20Sopenharmony_ci#define RT5645_VAD_SEL_MASK (0x3 << 8) 13448c2ecf20Sopenharmony_ci#define RT5645_VAD_SEL_SFT 8 13458c2ecf20Sopenharmony_ci 13468c2ecf20Sopenharmony_ci/* EQ Control 1 (0xb0) */ 13478c2ecf20Sopenharmony_ci#define RT5645_EQ_SRC_MASK (0x1 << 15) 13488c2ecf20Sopenharmony_ci#define RT5645_EQ_SRC_SFT 15 13498c2ecf20Sopenharmony_ci#define RT5645_EQ_SRC_DAC (0x0 << 15) 13508c2ecf20Sopenharmony_ci#define RT5645_EQ_SRC_ADC (0x1 << 15) 13518c2ecf20Sopenharmony_ci#define RT5645_EQ_UPD (0x1 << 14) 13528c2ecf20Sopenharmony_ci#define RT5645_EQ_UPD_BIT 14 13538c2ecf20Sopenharmony_ci#define RT5645_EQ_CD_MASK (0x1 << 13) 13548c2ecf20Sopenharmony_ci#define RT5645_EQ_CD_SFT 13 13558c2ecf20Sopenharmony_ci#define RT5645_EQ_CD_DIS (0x0 << 13) 13568c2ecf20Sopenharmony_ci#define RT5645_EQ_CD_EN (0x1 << 13) 13578c2ecf20Sopenharmony_ci#define RT5645_EQ_DITH_MASK (0x3 << 8) 13588c2ecf20Sopenharmony_ci#define RT5645_EQ_DITH_SFT 8 13598c2ecf20Sopenharmony_ci#define RT5645_EQ_DITH_NOR (0x0 << 8) 13608c2ecf20Sopenharmony_ci#define RT5645_EQ_DITH_LSB (0x1 << 8) 13618c2ecf20Sopenharmony_ci#define RT5645_EQ_DITH_LSB_1 (0x2 << 8) 13628c2ecf20Sopenharmony_ci#define RT5645_EQ_DITH_LSB_2 (0x3 << 8) 13638c2ecf20Sopenharmony_ci 13648c2ecf20Sopenharmony_ci/* EQ Control 2 (0xb1) */ 13658c2ecf20Sopenharmony_ci#define RT5645_EQ_HPF1_M_MASK (0x1 << 8) 13668c2ecf20Sopenharmony_ci#define RT5645_EQ_HPF1_M_SFT 8 13678c2ecf20Sopenharmony_ci#define RT5645_EQ_HPF1_M_HI (0x0 << 8) 13688c2ecf20Sopenharmony_ci#define RT5645_EQ_HPF1_M_1ST (0x1 << 8) 13698c2ecf20Sopenharmony_ci#define RT5645_EQ_LPF1_M_MASK (0x1 << 7) 13708c2ecf20Sopenharmony_ci#define RT5645_EQ_LPF1_M_SFT 7 13718c2ecf20Sopenharmony_ci#define RT5645_EQ_LPF1_M_LO (0x0 << 7) 13728c2ecf20Sopenharmony_ci#define RT5645_EQ_LPF1_M_1ST (0x1 << 7) 13738c2ecf20Sopenharmony_ci#define RT5645_EQ_HPF2_MASK (0x1 << 6) 13748c2ecf20Sopenharmony_ci#define RT5645_EQ_HPF2_SFT 6 13758c2ecf20Sopenharmony_ci#define RT5645_EQ_HPF2_DIS (0x0 << 6) 13768c2ecf20Sopenharmony_ci#define RT5645_EQ_HPF2_EN (0x1 << 6) 13778c2ecf20Sopenharmony_ci#define RT5645_EQ_HPF1_MASK (0x1 << 5) 13788c2ecf20Sopenharmony_ci#define RT5645_EQ_HPF1_SFT 5 13798c2ecf20Sopenharmony_ci#define RT5645_EQ_HPF1_DIS (0x0 << 5) 13808c2ecf20Sopenharmony_ci#define RT5645_EQ_HPF1_EN (0x1 << 5) 13818c2ecf20Sopenharmony_ci#define RT5645_EQ_BPF4_MASK (0x1 << 4) 13828c2ecf20Sopenharmony_ci#define RT5645_EQ_BPF4_SFT 4 13838c2ecf20Sopenharmony_ci#define RT5645_EQ_BPF4_DIS (0x0 << 4) 13848c2ecf20Sopenharmony_ci#define RT5645_EQ_BPF4_EN (0x1 << 4) 13858c2ecf20Sopenharmony_ci#define RT5645_EQ_BPF3_MASK (0x1 << 3) 13868c2ecf20Sopenharmony_ci#define RT5645_EQ_BPF3_SFT 3 13878c2ecf20Sopenharmony_ci#define RT5645_EQ_BPF3_DIS (0x0 << 3) 13888c2ecf20Sopenharmony_ci#define RT5645_EQ_BPF3_EN (0x1 << 3) 13898c2ecf20Sopenharmony_ci#define RT5645_EQ_BPF2_MASK (0x1 << 2) 13908c2ecf20Sopenharmony_ci#define RT5645_EQ_BPF2_SFT 2 13918c2ecf20Sopenharmony_ci#define RT5645_EQ_BPF2_DIS (0x0 << 2) 13928c2ecf20Sopenharmony_ci#define RT5645_EQ_BPF2_EN (0x1 << 2) 13938c2ecf20Sopenharmony_ci#define RT5645_EQ_BPF1_MASK (0x1 << 1) 13948c2ecf20Sopenharmony_ci#define RT5645_EQ_BPF1_SFT 1 13958c2ecf20Sopenharmony_ci#define RT5645_EQ_BPF1_DIS (0x0 << 1) 13968c2ecf20Sopenharmony_ci#define RT5645_EQ_BPF1_EN (0x1 << 1) 13978c2ecf20Sopenharmony_ci#define RT5645_EQ_LPF_MASK (0x1) 13988c2ecf20Sopenharmony_ci#define RT5645_EQ_LPF_SFT 0 13998c2ecf20Sopenharmony_ci#define RT5645_EQ_LPF_DIS (0x0) 14008c2ecf20Sopenharmony_ci#define RT5645_EQ_LPF_EN (0x1) 14018c2ecf20Sopenharmony_ci#define RT5645_EQ_CTRL_MASK (0x7f) 14028c2ecf20Sopenharmony_ci 14038c2ecf20Sopenharmony_ci/* Memory Test (0xb2) */ 14048c2ecf20Sopenharmony_ci#define RT5645_MT_MASK (0x1 << 15) 14058c2ecf20Sopenharmony_ci#define RT5645_MT_SFT 15 14068c2ecf20Sopenharmony_ci#define RT5645_MT_DIS (0x0 << 15) 14078c2ecf20Sopenharmony_ci#define RT5645_MT_EN (0x1 << 15) 14088c2ecf20Sopenharmony_ci 14098c2ecf20Sopenharmony_ci/* DRC/AGC Control 1 (0xb4) */ 14108c2ecf20Sopenharmony_ci#define RT5645_DRC_AGC_P_MASK (0x1 << 15) 14118c2ecf20Sopenharmony_ci#define RT5645_DRC_AGC_P_SFT 15 14128c2ecf20Sopenharmony_ci#define RT5645_DRC_AGC_P_DAC (0x0 << 15) 14138c2ecf20Sopenharmony_ci#define RT5645_DRC_AGC_P_ADC (0x1 << 15) 14148c2ecf20Sopenharmony_ci#define RT5645_DRC_AGC_MASK (0x1 << 14) 14158c2ecf20Sopenharmony_ci#define RT5645_DRC_AGC_SFT 14 14168c2ecf20Sopenharmony_ci#define RT5645_DRC_AGC_DIS (0x0 << 14) 14178c2ecf20Sopenharmony_ci#define RT5645_DRC_AGC_EN (0x1 << 14) 14188c2ecf20Sopenharmony_ci#define RT5645_DRC_AGC_UPD (0x1 << 13) 14198c2ecf20Sopenharmony_ci#define RT5645_DRC_AGC_UPD_BIT 13 14208c2ecf20Sopenharmony_ci#define RT5645_DRC_AGC_AR_MASK (0x1f << 8) 14218c2ecf20Sopenharmony_ci#define RT5645_DRC_AGC_AR_SFT 8 14228c2ecf20Sopenharmony_ci#define RT5645_DRC_AGC_R_MASK (0x7 << 5) 14238c2ecf20Sopenharmony_ci#define RT5645_DRC_AGC_R_SFT 5 14248c2ecf20Sopenharmony_ci#define RT5645_DRC_AGC_R_48K (0x1 << 5) 14258c2ecf20Sopenharmony_ci#define RT5645_DRC_AGC_R_96K (0x2 << 5) 14268c2ecf20Sopenharmony_ci#define RT5645_DRC_AGC_R_192K (0x3 << 5) 14278c2ecf20Sopenharmony_ci#define RT5645_DRC_AGC_R_441K (0x5 << 5) 14288c2ecf20Sopenharmony_ci#define RT5645_DRC_AGC_R_882K (0x6 << 5) 14298c2ecf20Sopenharmony_ci#define RT5645_DRC_AGC_R_1764K (0x7 << 5) 14308c2ecf20Sopenharmony_ci#define RT5645_DRC_AGC_RC_MASK (0x1f) 14318c2ecf20Sopenharmony_ci#define RT5645_DRC_AGC_RC_SFT 0 14328c2ecf20Sopenharmony_ci 14338c2ecf20Sopenharmony_ci/* DRC/AGC Control 2 (0xb5) */ 14348c2ecf20Sopenharmony_ci#define RT5645_DRC_AGC_POB_MASK (0x3f << 8) 14358c2ecf20Sopenharmony_ci#define RT5645_DRC_AGC_POB_SFT 8 14368c2ecf20Sopenharmony_ci#define RT5645_DRC_AGC_CP_MASK (0x1 << 7) 14378c2ecf20Sopenharmony_ci#define RT5645_DRC_AGC_CP_SFT 7 14388c2ecf20Sopenharmony_ci#define RT5645_DRC_AGC_CP_DIS (0x0 << 7) 14398c2ecf20Sopenharmony_ci#define RT5645_DRC_AGC_CP_EN (0x1 << 7) 14408c2ecf20Sopenharmony_ci#define RT5645_DRC_AGC_CPR_MASK (0x3 << 5) 14418c2ecf20Sopenharmony_ci#define RT5645_DRC_AGC_CPR_SFT 5 14428c2ecf20Sopenharmony_ci#define RT5645_DRC_AGC_CPR_1_1 (0x0 << 5) 14438c2ecf20Sopenharmony_ci#define RT5645_DRC_AGC_CPR_1_2 (0x1 << 5) 14448c2ecf20Sopenharmony_ci#define RT5645_DRC_AGC_CPR_1_3 (0x2 << 5) 14458c2ecf20Sopenharmony_ci#define RT5645_DRC_AGC_CPR_1_4 (0x3 << 5) 14468c2ecf20Sopenharmony_ci#define RT5645_DRC_AGC_PRB_MASK (0x1f) 14478c2ecf20Sopenharmony_ci#define RT5645_DRC_AGC_PRB_SFT 0 14488c2ecf20Sopenharmony_ci 14498c2ecf20Sopenharmony_ci/* DRC/AGC Control 3 (0xb6) */ 14508c2ecf20Sopenharmony_ci#define RT5645_DRC_AGC_NGB_MASK (0xf << 12) 14518c2ecf20Sopenharmony_ci#define RT5645_DRC_AGC_NGB_SFT 12 14528c2ecf20Sopenharmony_ci#define RT5645_DRC_AGC_TAR_MASK (0x1f << 7) 14538c2ecf20Sopenharmony_ci#define RT5645_DRC_AGC_TAR_SFT 7 14548c2ecf20Sopenharmony_ci#define RT5645_DRC_AGC_NG_MASK (0x1 << 6) 14558c2ecf20Sopenharmony_ci#define RT5645_DRC_AGC_NG_SFT 6 14568c2ecf20Sopenharmony_ci#define RT5645_DRC_AGC_NG_DIS (0x0 << 6) 14578c2ecf20Sopenharmony_ci#define RT5645_DRC_AGC_NG_EN (0x1 << 6) 14588c2ecf20Sopenharmony_ci#define RT5645_DRC_AGC_NGH_MASK (0x1 << 5) 14598c2ecf20Sopenharmony_ci#define RT5645_DRC_AGC_NGH_SFT 5 14608c2ecf20Sopenharmony_ci#define RT5645_DRC_AGC_NGH_DIS (0x0 << 5) 14618c2ecf20Sopenharmony_ci#define RT5645_DRC_AGC_NGH_EN (0x1 << 5) 14628c2ecf20Sopenharmony_ci#define RT5645_DRC_AGC_NGT_MASK (0x1f) 14638c2ecf20Sopenharmony_ci#define RT5645_DRC_AGC_NGT_SFT 0 14648c2ecf20Sopenharmony_ci 14658c2ecf20Sopenharmony_ci/* ANC Control 1 (0xb8) */ 14668c2ecf20Sopenharmony_ci#define RT5645_ANC_M_MASK (0x1 << 15) 14678c2ecf20Sopenharmony_ci#define RT5645_ANC_M_SFT 15 14688c2ecf20Sopenharmony_ci#define RT5645_ANC_M_NOR (0x0 << 15) 14698c2ecf20Sopenharmony_ci#define RT5645_ANC_M_REV (0x1 << 15) 14708c2ecf20Sopenharmony_ci#define RT5645_ANC_MASK (0x1 << 14) 14718c2ecf20Sopenharmony_ci#define RT5645_ANC_SFT 14 14728c2ecf20Sopenharmony_ci#define RT5645_ANC_DIS (0x0 << 14) 14738c2ecf20Sopenharmony_ci#define RT5645_ANC_EN (0x1 << 14) 14748c2ecf20Sopenharmony_ci#define RT5645_ANC_MD_MASK (0x3 << 12) 14758c2ecf20Sopenharmony_ci#define RT5645_ANC_MD_SFT 12 14768c2ecf20Sopenharmony_ci#define RT5645_ANC_MD_DIS (0x0 << 12) 14778c2ecf20Sopenharmony_ci#define RT5645_ANC_MD_67MS (0x1 << 12) 14788c2ecf20Sopenharmony_ci#define RT5645_ANC_MD_267MS (0x2 << 12) 14798c2ecf20Sopenharmony_ci#define RT5645_ANC_MD_1067MS (0x3 << 12) 14808c2ecf20Sopenharmony_ci#define RT5645_ANC_SN_MASK (0x1 << 11) 14818c2ecf20Sopenharmony_ci#define RT5645_ANC_SN_SFT 11 14828c2ecf20Sopenharmony_ci#define RT5645_ANC_SN_DIS (0x0 << 11) 14838c2ecf20Sopenharmony_ci#define RT5645_ANC_SN_EN (0x1 << 11) 14848c2ecf20Sopenharmony_ci#define RT5645_ANC_CLK_MASK (0x1 << 10) 14858c2ecf20Sopenharmony_ci#define RT5645_ANC_CLK_SFT 10 14868c2ecf20Sopenharmony_ci#define RT5645_ANC_CLK_ANC (0x0 << 10) 14878c2ecf20Sopenharmony_ci#define RT5645_ANC_CLK_REG (0x1 << 10) 14888c2ecf20Sopenharmony_ci#define RT5645_ANC_ZCD_MASK (0x3 << 8) 14898c2ecf20Sopenharmony_ci#define RT5645_ANC_ZCD_SFT 8 14908c2ecf20Sopenharmony_ci#define RT5645_ANC_ZCD_DIS (0x0 << 8) 14918c2ecf20Sopenharmony_ci#define RT5645_ANC_ZCD_T1 (0x1 << 8) 14928c2ecf20Sopenharmony_ci#define RT5645_ANC_ZCD_T2 (0x2 << 8) 14938c2ecf20Sopenharmony_ci#define RT5645_ANC_ZCD_WT (0x3 << 8) 14948c2ecf20Sopenharmony_ci#define RT5645_ANC_CS_MASK (0x1 << 7) 14958c2ecf20Sopenharmony_ci#define RT5645_ANC_CS_SFT 7 14968c2ecf20Sopenharmony_ci#define RT5645_ANC_CS_DIS (0x0 << 7) 14978c2ecf20Sopenharmony_ci#define RT5645_ANC_CS_EN (0x1 << 7) 14988c2ecf20Sopenharmony_ci#define RT5645_ANC_SW_MASK (0x1 << 6) 14998c2ecf20Sopenharmony_ci#define RT5645_ANC_SW_SFT 6 15008c2ecf20Sopenharmony_ci#define RT5645_ANC_SW_NOR (0x0 << 6) 15018c2ecf20Sopenharmony_ci#define RT5645_ANC_SW_AUTO (0x1 << 6) 15028c2ecf20Sopenharmony_ci#define RT5645_ANC_CO_L_MASK (0x3f) 15038c2ecf20Sopenharmony_ci#define RT5645_ANC_CO_L_SFT 0 15048c2ecf20Sopenharmony_ci 15058c2ecf20Sopenharmony_ci/* ANC Control 2 (0xb6) */ 15068c2ecf20Sopenharmony_ci#define RT5645_ANC_FG_R_MASK (0xf << 12) 15078c2ecf20Sopenharmony_ci#define RT5645_ANC_FG_R_SFT 12 15088c2ecf20Sopenharmony_ci#define RT5645_ANC_FG_L_MASK (0xf << 8) 15098c2ecf20Sopenharmony_ci#define RT5645_ANC_FG_L_SFT 8 15108c2ecf20Sopenharmony_ci#define RT5645_ANC_CG_R_MASK (0xf << 4) 15118c2ecf20Sopenharmony_ci#define RT5645_ANC_CG_R_SFT 4 15128c2ecf20Sopenharmony_ci#define RT5645_ANC_CG_L_MASK (0xf) 15138c2ecf20Sopenharmony_ci#define RT5645_ANC_CG_L_SFT 0 15148c2ecf20Sopenharmony_ci 15158c2ecf20Sopenharmony_ci/* ANC Control 3 (0xb6) */ 15168c2ecf20Sopenharmony_ci#define RT5645_ANC_CD_MASK (0x1 << 6) 15178c2ecf20Sopenharmony_ci#define RT5645_ANC_CD_SFT 6 15188c2ecf20Sopenharmony_ci#define RT5645_ANC_CD_BOTH (0x0 << 6) 15198c2ecf20Sopenharmony_ci#define RT5645_ANC_CD_IND (0x1 << 6) 15208c2ecf20Sopenharmony_ci#define RT5645_ANC_CO_R_MASK (0x3f) 15218c2ecf20Sopenharmony_ci#define RT5645_ANC_CO_R_SFT 0 15228c2ecf20Sopenharmony_ci 15238c2ecf20Sopenharmony_ci/* Jack Detect Control (0xbb) */ 15248c2ecf20Sopenharmony_ci#define RT5645_JD_MASK (0x7 << 13) 15258c2ecf20Sopenharmony_ci#define RT5645_JD_SFT 13 15268c2ecf20Sopenharmony_ci#define RT5645_JD_DIS (0x0 << 13) 15278c2ecf20Sopenharmony_ci#define RT5645_JD_GPIO1 (0x1 << 13) 15288c2ecf20Sopenharmony_ci#define RT5645_JD_JD1_IN4P (0x2 << 13) 15298c2ecf20Sopenharmony_ci#define RT5645_JD_JD2_IN4N (0x3 << 13) 15308c2ecf20Sopenharmony_ci#define RT5645_JD_GPIO2 (0x4 << 13) 15318c2ecf20Sopenharmony_ci#define RT5645_JD_GPIO3 (0x5 << 13) 15328c2ecf20Sopenharmony_ci#define RT5645_JD_GPIO4 (0x6 << 13) 15338c2ecf20Sopenharmony_ci#define RT5645_JD_HP_MASK (0x1 << 11) 15348c2ecf20Sopenharmony_ci#define RT5645_JD_HP_SFT 11 15358c2ecf20Sopenharmony_ci#define RT5645_JD_HP_DIS (0x0 << 11) 15368c2ecf20Sopenharmony_ci#define RT5645_JD_HP_EN (0x1 << 11) 15378c2ecf20Sopenharmony_ci#define RT5645_JD_HP_TRG_MASK (0x1 << 10) 15388c2ecf20Sopenharmony_ci#define RT5645_JD_HP_TRG_SFT 10 15398c2ecf20Sopenharmony_ci#define RT5645_JD_HP_TRG_LO (0x0 << 10) 15408c2ecf20Sopenharmony_ci#define RT5645_JD_HP_TRG_HI (0x1 << 10) 15418c2ecf20Sopenharmony_ci#define RT5645_JD_SPL_MASK (0x1 << 9) 15428c2ecf20Sopenharmony_ci#define RT5645_JD_SPL_SFT 9 15438c2ecf20Sopenharmony_ci#define RT5645_JD_SPL_DIS (0x0 << 9) 15448c2ecf20Sopenharmony_ci#define RT5645_JD_SPL_EN (0x1 << 9) 15458c2ecf20Sopenharmony_ci#define RT5645_JD_SPL_TRG_MASK (0x1 << 8) 15468c2ecf20Sopenharmony_ci#define RT5645_JD_SPL_TRG_SFT 8 15478c2ecf20Sopenharmony_ci#define RT5645_JD_SPL_TRG_LO (0x0 << 8) 15488c2ecf20Sopenharmony_ci#define RT5645_JD_SPL_TRG_HI (0x1 << 8) 15498c2ecf20Sopenharmony_ci#define RT5645_JD_SPR_MASK (0x1 << 7) 15508c2ecf20Sopenharmony_ci#define RT5645_JD_SPR_SFT 7 15518c2ecf20Sopenharmony_ci#define RT5645_JD_SPR_DIS (0x0 << 7) 15528c2ecf20Sopenharmony_ci#define RT5645_JD_SPR_EN (0x1 << 7) 15538c2ecf20Sopenharmony_ci#define RT5645_JD_SPR_TRG_MASK (0x1 << 6) 15548c2ecf20Sopenharmony_ci#define RT5645_JD_SPR_TRG_SFT 6 15558c2ecf20Sopenharmony_ci#define RT5645_JD_SPR_TRG_LO (0x0 << 6) 15568c2ecf20Sopenharmony_ci#define RT5645_JD_SPR_TRG_HI (0x1 << 6) 15578c2ecf20Sopenharmony_ci#define RT5645_JD_MO_MASK (0x1 << 5) 15588c2ecf20Sopenharmony_ci#define RT5645_JD_MO_SFT 5 15598c2ecf20Sopenharmony_ci#define RT5645_JD_MO_DIS (0x0 << 5) 15608c2ecf20Sopenharmony_ci#define RT5645_JD_MO_EN (0x1 << 5) 15618c2ecf20Sopenharmony_ci#define RT5645_JD_MO_TRG_MASK (0x1 << 4) 15628c2ecf20Sopenharmony_ci#define RT5645_JD_MO_TRG_SFT 4 15638c2ecf20Sopenharmony_ci#define RT5645_JD_MO_TRG_LO (0x0 << 4) 15648c2ecf20Sopenharmony_ci#define RT5645_JD_MO_TRG_HI (0x1 << 4) 15658c2ecf20Sopenharmony_ci#define RT5645_JD_LO_MASK (0x1 << 3) 15668c2ecf20Sopenharmony_ci#define RT5645_JD_LO_SFT 3 15678c2ecf20Sopenharmony_ci#define RT5645_JD_LO_DIS (0x0 << 3) 15688c2ecf20Sopenharmony_ci#define RT5645_JD_LO_EN (0x1 << 3) 15698c2ecf20Sopenharmony_ci#define RT5645_JD_LO_TRG_MASK (0x1 << 2) 15708c2ecf20Sopenharmony_ci#define RT5645_JD_LO_TRG_SFT 2 15718c2ecf20Sopenharmony_ci#define RT5645_JD_LO_TRG_LO (0x0 << 2) 15728c2ecf20Sopenharmony_ci#define RT5645_JD_LO_TRG_HI (0x1 << 2) 15738c2ecf20Sopenharmony_ci#define RT5645_JD1_IN4P_MASK (0x1 << 1) 15748c2ecf20Sopenharmony_ci#define RT5645_JD1_IN4P_SFT 1 15758c2ecf20Sopenharmony_ci#define RT5645_JD1_IN4P_DIS (0x0 << 1) 15768c2ecf20Sopenharmony_ci#define RT5645_JD1_IN4P_EN (0x1 << 1) 15778c2ecf20Sopenharmony_ci#define RT5645_JD2_IN4N_MASK (0x1) 15788c2ecf20Sopenharmony_ci#define RT5645_JD2_IN4N_SFT 0 15798c2ecf20Sopenharmony_ci#define RT5645_JD2_IN4N_DIS (0x0) 15808c2ecf20Sopenharmony_ci#define RT5645_JD2_IN4N_EN (0x1) 15818c2ecf20Sopenharmony_ci 15828c2ecf20Sopenharmony_ci/* Jack detect for ANC (0xbc) */ 15838c2ecf20Sopenharmony_ci#define RT5645_ANC_DET_MASK (0x3 << 4) 15848c2ecf20Sopenharmony_ci#define RT5645_ANC_DET_SFT 4 15858c2ecf20Sopenharmony_ci#define RT5645_ANC_DET_DIS (0x0 << 4) 15868c2ecf20Sopenharmony_ci#define RT5645_ANC_DET_MB1 (0x1 << 4) 15878c2ecf20Sopenharmony_ci#define RT5645_ANC_DET_MB2 (0x2 << 4) 15888c2ecf20Sopenharmony_ci#define RT5645_ANC_DET_JD (0x3 << 4) 15898c2ecf20Sopenharmony_ci#define RT5645_AD_TRG_MASK (0x1 << 3) 15908c2ecf20Sopenharmony_ci#define RT5645_AD_TRG_SFT 3 15918c2ecf20Sopenharmony_ci#define RT5645_AD_TRG_LO (0x0 << 3) 15928c2ecf20Sopenharmony_ci#define RT5645_AD_TRG_HI (0x1 << 3) 15938c2ecf20Sopenharmony_ci#define RT5645_ANCM_DET_MASK (0x3 << 4) 15948c2ecf20Sopenharmony_ci#define RT5645_ANCM_DET_SFT 4 15958c2ecf20Sopenharmony_ci#define RT5645_ANCM_DET_DIS (0x0 << 4) 15968c2ecf20Sopenharmony_ci#define RT5645_ANCM_DET_MB1 (0x1 << 4) 15978c2ecf20Sopenharmony_ci#define RT5645_ANCM_DET_MB2 (0x2 << 4) 15988c2ecf20Sopenharmony_ci#define RT5645_ANCM_DET_JD (0x3 << 4) 15998c2ecf20Sopenharmony_ci#define RT5645_AMD_TRG_MASK (0x1 << 3) 16008c2ecf20Sopenharmony_ci#define RT5645_AMD_TRG_SFT 3 16018c2ecf20Sopenharmony_ci#define RT5645_AMD_TRG_LO (0x0 << 3) 16028c2ecf20Sopenharmony_ci#define RT5645_AMD_TRG_HI (0x1 << 3) 16038c2ecf20Sopenharmony_ci 16048c2ecf20Sopenharmony_ci/* IRQ Control 1 (0xbd) */ 16058c2ecf20Sopenharmony_ci#define RT5645_IRQ_JD_MASK (0x1 << 15) 16068c2ecf20Sopenharmony_ci#define RT5645_IRQ_JD_SFT 15 16078c2ecf20Sopenharmony_ci#define RT5645_IRQ_JD_BP (0x0 << 15) 16088c2ecf20Sopenharmony_ci#define RT5645_IRQ_JD_NOR (0x1 << 15) 16098c2ecf20Sopenharmony_ci#define RT5645_IRQ_OT_MASK (0x1 << 14) 16108c2ecf20Sopenharmony_ci#define RT5645_IRQ_OT_SFT 14 16118c2ecf20Sopenharmony_ci#define RT5645_IRQ_OT_BP (0x0 << 14) 16128c2ecf20Sopenharmony_ci#define RT5645_IRQ_OT_NOR (0x1 << 14) 16138c2ecf20Sopenharmony_ci#define RT5645_JD_STKY_MASK (0x1 << 13) 16148c2ecf20Sopenharmony_ci#define RT5645_JD_STKY_SFT 13 16158c2ecf20Sopenharmony_ci#define RT5645_JD_STKY_DIS (0x0 << 13) 16168c2ecf20Sopenharmony_ci#define RT5645_JD_STKY_EN (0x1 << 13) 16178c2ecf20Sopenharmony_ci#define RT5645_OT_STKY_MASK (0x1 << 12) 16188c2ecf20Sopenharmony_ci#define RT5645_OT_STKY_SFT 12 16198c2ecf20Sopenharmony_ci#define RT5645_OT_STKY_DIS (0x0 << 12) 16208c2ecf20Sopenharmony_ci#define RT5645_OT_STKY_EN (0x1 << 12) 16218c2ecf20Sopenharmony_ci#define RT5645_JD_P_MASK (0x1 << 11) 16228c2ecf20Sopenharmony_ci#define RT5645_JD_P_SFT 11 16238c2ecf20Sopenharmony_ci#define RT5645_JD_P_NOR (0x0 << 11) 16248c2ecf20Sopenharmony_ci#define RT5645_JD_P_INV (0x1 << 11) 16258c2ecf20Sopenharmony_ci#define RT5645_OT_P_MASK (0x1 << 10) 16268c2ecf20Sopenharmony_ci#define RT5645_OT_P_SFT 10 16278c2ecf20Sopenharmony_ci#define RT5645_OT_P_NOR (0x0 << 10) 16288c2ecf20Sopenharmony_ci#define RT5645_OT_P_INV (0x1 << 10) 16298c2ecf20Sopenharmony_ci#define RT5645_IRQ_JD_1_1_EN (0x1 << 9) 16308c2ecf20Sopenharmony_ci#define RT5645_JD_1_1_MASK (0x1 << 7) 16318c2ecf20Sopenharmony_ci#define RT5645_JD_1_1_SFT 7 16328c2ecf20Sopenharmony_ci#define RT5645_JD_1_1_NOR (0x0 << 7) 16338c2ecf20Sopenharmony_ci#define RT5645_JD_1_1_INV (0x1 << 7) 16348c2ecf20Sopenharmony_ci 16358c2ecf20Sopenharmony_ci/* IRQ Control 2 (0xbe) */ 16368c2ecf20Sopenharmony_ci#define RT5645_IRQ_MB1_OC_MASK (0x1 << 15) 16378c2ecf20Sopenharmony_ci#define RT5645_IRQ_MB1_OC_SFT 15 16388c2ecf20Sopenharmony_ci#define RT5645_IRQ_MB1_OC_BP (0x0 << 15) 16398c2ecf20Sopenharmony_ci#define RT5645_IRQ_MB1_OC_NOR (0x1 << 15) 16408c2ecf20Sopenharmony_ci#define RT5645_IRQ_MB2_OC_MASK (0x1 << 14) 16418c2ecf20Sopenharmony_ci#define RT5645_IRQ_MB2_OC_SFT 14 16428c2ecf20Sopenharmony_ci#define RT5645_IRQ_MB2_OC_BP (0x0 << 14) 16438c2ecf20Sopenharmony_ci#define RT5645_IRQ_MB2_OC_NOR (0x1 << 14) 16448c2ecf20Sopenharmony_ci#define RT5645_MB1_OC_STKY_MASK (0x1 << 13) 16458c2ecf20Sopenharmony_ci#define RT5645_MB1_OC_STKY_SFT 13 16468c2ecf20Sopenharmony_ci#define RT5645_MB1_OC_STKY_DIS (0x0 << 13) 16478c2ecf20Sopenharmony_ci#define RT5645_MB1_OC_STKY_EN (0x1 << 13) 16488c2ecf20Sopenharmony_ci#define RT5645_MB2_OC_STKY_MASK (0x1 << 12) 16498c2ecf20Sopenharmony_ci#define RT5645_MB2_OC_STKY_SFT 12 16508c2ecf20Sopenharmony_ci#define RT5645_MB2_OC_STKY_DIS (0x0 << 12) 16518c2ecf20Sopenharmony_ci#define RT5645_MB2_OC_STKY_EN (0x1 << 12) 16528c2ecf20Sopenharmony_ci#define RT5645_MB1_OC_P_MASK (0x1 << 7) 16538c2ecf20Sopenharmony_ci#define RT5645_MB1_OC_P_SFT 7 16548c2ecf20Sopenharmony_ci#define RT5645_MB1_OC_P_NOR (0x0 << 7) 16558c2ecf20Sopenharmony_ci#define RT5645_MB1_OC_P_INV (0x1 << 7) 16568c2ecf20Sopenharmony_ci#define RT5645_MB2_OC_P_MASK (0x1 << 6) 16578c2ecf20Sopenharmony_ci#define RT5645_MB2_OC_P_SFT 6 16588c2ecf20Sopenharmony_ci#define RT5645_MB2_OC_P_NOR (0x0 << 6) 16598c2ecf20Sopenharmony_ci#define RT5645_MB2_OC_P_INV (0x1 << 6) 16608c2ecf20Sopenharmony_ci#define RT5645_MB1_OC_CLR (0x1 << 3) 16618c2ecf20Sopenharmony_ci#define RT5645_MB1_OC_CLR_SFT 3 16628c2ecf20Sopenharmony_ci#define RT5645_MB2_OC_CLR (0x1 << 2) 16638c2ecf20Sopenharmony_ci#define RT5645_MB2_OC_CLR_SFT 2 16648c2ecf20Sopenharmony_ci 16658c2ecf20Sopenharmony_ci/* GPIO Control 1 (0xc0) */ 16668c2ecf20Sopenharmony_ci#define RT5645_GP1_PIN_MASK (0x1 << 15) 16678c2ecf20Sopenharmony_ci#define RT5645_GP1_PIN_SFT 15 16688c2ecf20Sopenharmony_ci#define RT5645_GP1_PIN_GPIO1 (0x0 << 15) 16698c2ecf20Sopenharmony_ci#define RT5645_GP1_PIN_IRQ (0x1 << 15) 16708c2ecf20Sopenharmony_ci#define RT5645_GP2_PIN_MASK (0x1 << 14) 16718c2ecf20Sopenharmony_ci#define RT5645_GP2_PIN_SFT 14 16728c2ecf20Sopenharmony_ci#define RT5645_GP2_PIN_GPIO2 (0x0 << 14) 16738c2ecf20Sopenharmony_ci#define RT5645_GP2_PIN_DMIC1_SCL (0x1 << 14) 16748c2ecf20Sopenharmony_ci#define RT5645_GP3_PIN_MASK (0x3 << 12) 16758c2ecf20Sopenharmony_ci#define RT5645_GP3_PIN_SFT 12 16768c2ecf20Sopenharmony_ci#define RT5645_GP3_PIN_GPIO3 (0x0 << 12) 16778c2ecf20Sopenharmony_ci#define RT5645_GP3_PIN_DMIC1_SDA (0x1 << 12) 16788c2ecf20Sopenharmony_ci#define RT5645_GP3_PIN_IRQ (0x2 << 12) 16798c2ecf20Sopenharmony_ci#define RT5645_GP4_PIN_MASK (0x1 << 11) 16808c2ecf20Sopenharmony_ci#define RT5645_GP4_PIN_SFT 11 16818c2ecf20Sopenharmony_ci#define RT5645_GP4_PIN_GPIO4 (0x0 << 11) 16828c2ecf20Sopenharmony_ci#define RT5645_GP4_PIN_DMIC2_SDA (0x1 << 11) 16838c2ecf20Sopenharmony_ci#define RT5645_DP_SIG_MASK (0x1 << 10) 16848c2ecf20Sopenharmony_ci#define RT5645_DP_SIG_SFT 10 16858c2ecf20Sopenharmony_ci#define RT5645_DP_SIG_TEST (0x0 << 10) 16868c2ecf20Sopenharmony_ci#define RT5645_DP_SIG_AP (0x1 << 10) 16878c2ecf20Sopenharmony_ci#define RT5645_GPIO_M_MASK (0x1 << 9) 16888c2ecf20Sopenharmony_ci#define RT5645_GPIO_M_SFT 9 16898c2ecf20Sopenharmony_ci#define RT5645_GPIO_M_FLT (0x0 << 9) 16908c2ecf20Sopenharmony_ci#define RT5645_GPIO_M_PH (0x1 << 9) 16918c2ecf20Sopenharmony_ci#define RT5645_I2S2_SEL (0x1 << 8) 16928c2ecf20Sopenharmony_ci#define RT5645_I2S2_SEL_SFT 8 16938c2ecf20Sopenharmony_ci#define RT5645_GP5_PIN_MASK (0x1 << 7) 16948c2ecf20Sopenharmony_ci#define RT5645_GP5_PIN_SFT 7 16958c2ecf20Sopenharmony_ci#define RT5645_GP5_PIN_GPIO5 (0x0 << 7) 16968c2ecf20Sopenharmony_ci#define RT5645_GP5_PIN_DMIC1_SDA (0x1 << 7) 16978c2ecf20Sopenharmony_ci#define RT5645_GP6_PIN_MASK (0x1 << 6) 16988c2ecf20Sopenharmony_ci#define RT5645_GP6_PIN_SFT 6 16998c2ecf20Sopenharmony_ci#define RT5645_GP6_PIN_GPIO6 (0x0 << 6) 17008c2ecf20Sopenharmony_ci#define RT5645_GP6_PIN_DMIC2_SDA (0x1 << 6) 17018c2ecf20Sopenharmony_ci#define RT5645_I2S2_DAC_PIN_MASK (0x1 << 4) 17028c2ecf20Sopenharmony_ci#define RT5645_I2S2_DAC_PIN_SFT 4 17038c2ecf20Sopenharmony_ci#define RT5645_I2S2_DAC_PIN_I2S (0x0 << 4) 17048c2ecf20Sopenharmony_ci#define RT5645_I2S2_DAC_PIN_GPIO (0x1 << 4) 17058c2ecf20Sopenharmony_ci#define RT5645_GP8_PIN_MASK (0x1 << 3) 17068c2ecf20Sopenharmony_ci#define RT5645_GP8_PIN_SFT 3 17078c2ecf20Sopenharmony_ci#define RT5645_GP8_PIN_GPIO8 (0x0 << 3) 17088c2ecf20Sopenharmony_ci#define RT5645_GP8_PIN_DMIC2_SDA (0x1 << 3) 17098c2ecf20Sopenharmony_ci#define RT5645_GP12_PIN_MASK (0x1 << 2) 17108c2ecf20Sopenharmony_ci#define RT5645_GP12_PIN_SFT 2 17118c2ecf20Sopenharmony_ci#define RT5645_GP12_PIN_GPIO12 (0x0 << 2) 17128c2ecf20Sopenharmony_ci#define RT5645_GP12_PIN_DMIC2_SDA (0x1 << 2) 17138c2ecf20Sopenharmony_ci#define RT5645_GP11_PIN_MASK (0x1 << 1) 17148c2ecf20Sopenharmony_ci#define RT5645_GP11_PIN_SFT 1 17158c2ecf20Sopenharmony_ci#define RT5645_GP11_PIN_GPIO11 (0x0 << 1) 17168c2ecf20Sopenharmony_ci#define RT5645_GP11_PIN_DMIC1_SDA (0x1 << 1) 17178c2ecf20Sopenharmony_ci#define RT5645_GP10_PIN_MASK (0x1) 17188c2ecf20Sopenharmony_ci#define RT5645_GP10_PIN_SFT 0 17198c2ecf20Sopenharmony_ci#define RT5645_GP10_PIN_GPIO10 (0x0) 17208c2ecf20Sopenharmony_ci#define RT5645_GP10_PIN_DMIC2_SDA (0x1) 17218c2ecf20Sopenharmony_ci 17228c2ecf20Sopenharmony_ci/* GPIO Control 3 (0xc2) */ 17238c2ecf20Sopenharmony_ci#define RT5645_GP4_PF_MASK (0x1 << 11) 17248c2ecf20Sopenharmony_ci#define RT5645_GP4_PF_SFT 11 17258c2ecf20Sopenharmony_ci#define RT5645_GP4_PF_IN (0x0 << 11) 17268c2ecf20Sopenharmony_ci#define RT5645_GP4_PF_OUT (0x1 << 11) 17278c2ecf20Sopenharmony_ci#define RT5645_GP4_OUT_MASK (0x1 << 10) 17288c2ecf20Sopenharmony_ci#define RT5645_GP4_OUT_SFT 10 17298c2ecf20Sopenharmony_ci#define RT5645_GP4_OUT_LO (0x0 << 10) 17308c2ecf20Sopenharmony_ci#define RT5645_GP4_OUT_HI (0x1 << 10) 17318c2ecf20Sopenharmony_ci#define RT5645_GP4_P_MASK (0x1 << 9) 17328c2ecf20Sopenharmony_ci#define RT5645_GP4_P_SFT 9 17338c2ecf20Sopenharmony_ci#define RT5645_GP4_P_NOR (0x0 << 9) 17348c2ecf20Sopenharmony_ci#define RT5645_GP4_P_INV (0x1 << 9) 17358c2ecf20Sopenharmony_ci#define RT5645_GP3_PF_MASK (0x1 << 8) 17368c2ecf20Sopenharmony_ci#define RT5645_GP3_PF_SFT 8 17378c2ecf20Sopenharmony_ci#define RT5645_GP3_PF_IN (0x0 << 8) 17388c2ecf20Sopenharmony_ci#define RT5645_GP3_PF_OUT (0x1 << 8) 17398c2ecf20Sopenharmony_ci#define RT5645_GP3_OUT_MASK (0x1 << 7) 17408c2ecf20Sopenharmony_ci#define RT5645_GP3_OUT_SFT 7 17418c2ecf20Sopenharmony_ci#define RT5645_GP3_OUT_LO (0x0 << 7) 17428c2ecf20Sopenharmony_ci#define RT5645_GP3_OUT_HI (0x1 << 7) 17438c2ecf20Sopenharmony_ci#define RT5645_GP3_P_MASK (0x1 << 6) 17448c2ecf20Sopenharmony_ci#define RT5645_GP3_P_SFT 6 17458c2ecf20Sopenharmony_ci#define RT5645_GP3_P_NOR (0x0 << 6) 17468c2ecf20Sopenharmony_ci#define RT5645_GP3_P_INV (0x1 << 6) 17478c2ecf20Sopenharmony_ci#define RT5645_GP2_PF_MASK (0x1 << 5) 17488c2ecf20Sopenharmony_ci#define RT5645_GP2_PF_SFT 5 17498c2ecf20Sopenharmony_ci#define RT5645_GP2_PF_IN (0x0 << 5) 17508c2ecf20Sopenharmony_ci#define RT5645_GP2_PF_OUT (0x1 << 5) 17518c2ecf20Sopenharmony_ci#define RT5645_GP2_OUT_MASK (0x1 << 4) 17528c2ecf20Sopenharmony_ci#define RT5645_GP2_OUT_SFT 4 17538c2ecf20Sopenharmony_ci#define RT5645_GP2_OUT_LO (0x0 << 4) 17548c2ecf20Sopenharmony_ci#define RT5645_GP2_OUT_HI (0x1 << 4) 17558c2ecf20Sopenharmony_ci#define RT5645_GP2_P_MASK (0x1 << 3) 17568c2ecf20Sopenharmony_ci#define RT5645_GP2_P_SFT 3 17578c2ecf20Sopenharmony_ci#define RT5645_GP2_P_NOR (0x0 << 3) 17588c2ecf20Sopenharmony_ci#define RT5645_GP2_P_INV (0x1 << 3) 17598c2ecf20Sopenharmony_ci#define RT5645_GP1_PF_MASK (0x1 << 2) 17608c2ecf20Sopenharmony_ci#define RT5645_GP1_PF_SFT 2 17618c2ecf20Sopenharmony_ci#define RT5645_GP1_PF_IN (0x0 << 2) 17628c2ecf20Sopenharmony_ci#define RT5645_GP1_PF_OUT (0x1 << 2) 17638c2ecf20Sopenharmony_ci#define RT5645_GP1_OUT_MASK (0x1 << 1) 17648c2ecf20Sopenharmony_ci#define RT5645_GP1_OUT_SFT 1 17658c2ecf20Sopenharmony_ci#define RT5645_GP1_OUT_LO (0x0 << 1) 17668c2ecf20Sopenharmony_ci#define RT5645_GP1_OUT_HI (0x1 << 1) 17678c2ecf20Sopenharmony_ci#define RT5645_GP1_P_MASK (0x1) 17688c2ecf20Sopenharmony_ci#define RT5645_GP1_P_SFT 0 17698c2ecf20Sopenharmony_ci#define RT5645_GP1_P_NOR (0x0) 17708c2ecf20Sopenharmony_ci#define RT5645_GP1_P_INV (0x1) 17718c2ecf20Sopenharmony_ci 17728c2ecf20Sopenharmony_ci/* Programmable Register Array Control 1 (0xc8) */ 17738c2ecf20Sopenharmony_ci#define RT5645_REG_SEQ_MASK (0xf << 12) 17748c2ecf20Sopenharmony_ci#define RT5645_REG_SEQ_SFT 12 17758c2ecf20Sopenharmony_ci#define RT5645_SEQ1_ST_MASK (0x1 << 11) /*RO*/ 17768c2ecf20Sopenharmony_ci#define RT5645_SEQ1_ST_SFT 11 17778c2ecf20Sopenharmony_ci#define RT5645_SEQ1_ST_RUN (0x0 << 11) 17788c2ecf20Sopenharmony_ci#define RT5645_SEQ1_ST_FIN (0x1 << 11) 17798c2ecf20Sopenharmony_ci#define RT5645_SEQ2_ST_MASK (0x1 << 10) /*RO*/ 17808c2ecf20Sopenharmony_ci#define RT5645_SEQ2_ST_SFT 10 17818c2ecf20Sopenharmony_ci#define RT5645_SEQ2_ST_RUN (0x0 << 10) 17828c2ecf20Sopenharmony_ci#define RT5645_SEQ2_ST_FIN (0x1 << 10) 17838c2ecf20Sopenharmony_ci#define RT5645_REG_LV_MASK (0x1 << 9) 17848c2ecf20Sopenharmony_ci#define RT5645_REG_LV_SFT 9 17858c2ecf20Sopenharmony_ci#define RT5645_REG_LV_MX (0x0 << 9) 17868c2ecf20Sopenharmony_ci#define RT5645_REG_LV_PR (0x1 << 9) 17878c2ecf20Sopenharmony_ci#define RT5645_SEQ_2_PT_MASK (0x1 << 8) 17888c2ecf20Sopenharmony_ci#define RT5645_SEQ_2_PT_BIT 8 17898c2ecf20Sopenharmony_ci#define RT5645_REG_IDX_MASK (0xff) 17908c2ecf20Sopenharmony_ci#define RT5645_REG_IDX_SFT 0 17918c2ecf20Sopenharmony_ci 17928c2ecf20Sopenharmony_ci/* Programmable Register Array Control 2 (0xc9) */ 17938c2ecf20Sopenharmony_ci#define RT5645_REG_DAT_MASK (0xffff) 17948c2ecf20Sopenharmony_ci#define RT5645_REG_DAT_SFT 0 17958c2ecf20Sopenharmony_ci 17968c2ecf20Sopenharmony_ci/* Programmable Register Array Control 3 (0xca) */ 17978c2ecf20Sopenharmony_ci#define RT5645_SEQ_DLY_MASK (0xff << 8) 17988c2ecf20Sopenharmony_ci#define RT5645_SEQ_DLY_SFT 8 17998c2ecf20Sopenharmony_ci#define RT5645_PROG_MASK (0x1 << 7) 18008c2ecf20Sopenharmony_ci#define RT5645_PROG_SFT 7 18018c2ecf20Sopenharmony_ci#define RT5645_PROG_DIS (0x0 << 7) 18028c2ecf20Sopenharmony_ci#define RT5645_PROG_EN (0x1 << 7) 18038c2ecf20Sopenharmony_ci#define RT5645_SEQ1_PT_RUN (0x1 << 6) 18048c2ecf20Sopenharmony_ci#define RT5645_SEQ1_PT_RUN_BIT 6 18058c2ecf20Sopenharmony_ci#define RT5645_SEQ2_PT_RUN (0x1 << 5) 18068c2ecf20Sopenharmony_ci#define RT5645_SEQ2_PT_RUN_BIT 5 18078c2ecf20Sopenharmony_ci 18088c2ecf20Sopenharmony_ci/* Programmable Register Array Control 4 (0xcb) */ 18098c2ecf20Sopenharmony_ci#define RT5645_SEQ1_START_MASK (0xf << 8) 18108c2ecf20Sopenharmony_ci#define RT5645_SEQ1_START_SFT 8 18118c2ecf20Sopenharmony_ci#define RT5645_SEQ1_END_MASK (0xf) 18128c2ecf20Sopenharmony_ci#define RT5645_SEQ1_END_SFT 0 18138c2ecf20Sopenharmony_ci 18148c2ecf20Sopenharmony_ci/* Programmable Register Array Control 5 (0xcc) */ 18158c2ecf20Sopenharmony_ci#define RT5645_SEQ2_START_MASK (0xf << 8) 18168c2ecf20Sopenharmony_ci#define RT5645_SEQ2_START_SFT 8 18178c2ecf20Sopenharmony_ci#define RT5645_SEQ2_END_MASK (0xf) 18188c2ecf20Sopenharmony_ci#define RT5645_SEQ2_END_SFT 0 18198c2ecf20Sopenharmony_ci 18208c2ecf20Sopenharmony_ci/* Scramble Function (0xcd) */ 18218c2ecf20Sopenharmony_ci#define RT5645_SCB_KEY_MASK (0xff) 18228c2ecf20Sopenharmony_ci#define RT5645_SCB_KEY_SFT 0 18238c2ecf20Sopenharmony_ci 18248c2ecf20Sopenharmony_ci/* Scramble Control (0xce) */ 18258c2ecf20Sopenharmony_ci#define RT5645_SCB_SWAP_MASK (0x1 << 15) 18268c2ecf20Sopenharmony_ci#define RT5645_SCB_SWAP_SFT 15 18278c2ecf20Sopenharmony_ci#define RT5645_SCB_SWAP_DIS (0x0 << 15) 18288c2ecf20Sopenharmony_ci#define RT5645_SCB_SWAP_EN (0x1 << 15) 18298c2ecf20Sopenharmony_ci#define RT5645_SCB_MASK (0x1 << 14) 18308c2ecf20Sopenharmony_ci#define RT5645_SCB_SFT 14 18318c2ecf20Sopenharmony_ci#define RT5645_SCB_DIS (0x0 << 14) 18328c2ecf20Sopenharmony_ci#define RT5645_SCB_EN (0x1 << 14) 18338c2ecf20Sopenharmony_ci 18348c2ecf20Sopenharmony_ci/* Baseback Control (0xcf) */ 18358c2ecf20Sopenharmony_ci#define RT5645_BB_MASK (0x1 << 15) 18368c2ecf20Sopenharmony_ci#define RT5645_BB_SFT 15 18378c2ecf20Sopenharmony_ci#define RT5645_BB_DIS (0x0 << 15) 18388c2ecf20Sopenharmony_ci#define RT5645_BB_EN (0x1 << 15) 18398c2ecf20Sopenharmony_ci#define RT5645_BB_CT_MASK (0x7 << 12) 18408c2ecf20Sopenharmony_ci#define RT5645_BB_CT_SFT 12 18418c2ecf20Sopenharmony_ci#define RT5645_BB_CT_A (0x0 << 12) 18428c2ecf20Sopenharmony_ci#define RT5645_BB_CT_B (0x1 << 12) 18438c2ecf20Sopenharmony_ci#define RT5645_BB_CT_C (0x2 << 12) 18448c2ecf20Sopenharmony_ci#define RT5645_BB_CT_D (0x3 << 12) 18458c2ecf20Sopenharmony_ci#define RT5645_M_BB_L_MASK (0x1 << 9) 18468c2ecf20Sopenharmony_ci#define RT5645_M_BB_L_SFT 9 18478c2ecf20Sopenharmony_ci#define RT5645_M_BB_R_MASK (0x1 << 8) 18488c2ecf20Sopenharmony_ci#define RT5645_M_BB_R_SFT 8 18498c2ecf20Sopenharmony_ci#define RT5645_M_BB_HPF_L_MASK (0x1 << 7) 18508c2ecf20Sopenharmony_ci#define RT5645_M_BB_HPF_L_SFT 7 18518c2ecf20Sopenharmony_ci#define RT5645_M_BB_HPF_R_MASK (0x1 << 6) 18528c2ecf20Sopenharmony_ci#define RT5645_M_BB_HPF_R_SFT 6 18538c2ecf20Sopenharmony_ci#define RT5645_G_BB_BST_MASK (0x3f) 18548c2ecf20Sopenharmony_ci#define RT5645_G_BB_BST_SFT 0 18558c2ecf20Sopenharmony_ci#define RT5645_G_BB_BST_25DB 0x14 18568c2ecf20Sopenharmony_ci 18578c2ecf20Sopenharmony_ci/* MP3 Plus Control 1 (0xd0) */ 18588c2ecf20Sopenharmony_ci#define RT5645_M_MP3_L_MASK (0x1 << 15) 18598c2ecf20Sopenharmony_ci#define RT5645_M_MP3_L_SFT 15 18608c2ecf20Sopenharmony_ci#define RT5645_M_MP3_R_MASK (0x1 << 14) 18618c2ecf20Sopenharmony_ci#define RT5645_M_MP3_R_SFT 14 18628c2ecf20Sopenharmony_ci#define RT5645_M_MP3_MASK (0x1 << 13) 18638c2ecf20Sopenharmony_ci#define RT5645_M_MP3_SFT 13 18648c2ecf20Sopenharmony_ci#define RT5645_M_MP3_DIS (0x0 << 13) 18658c2ecf20Sopenharmony_ci#define RT5645_M_MP3_EN (0x1 << 13) 18668c2ecf20Sopenharmony_ci#define RT5645_EG_MP3_MASK (0x1f << 8) 18678c2ecf20Sopenharmony_ci#define RT5645_EG_MP3_SFT 8 18688c2ecf20Sopenharmony_ci#define RT5645_MP3_HLP_MASK (0x1 << 7) 18698c2ecf20Sopenharmony_ci#define RT5645_MP3_HLP_SFT 7 18708c2ecf20Sopenharmony_ci#define RT5645_MP3_HLP_DIS (0x0 << 7) 18718c2ecf20Sopenharmony_ci#define RT5645_MP3_HLP_EN (0x1 << 7) 18728c2ecf20Sopenharmony_ci#define RT5645_M_MP3_ORG_L_MASK (0x1 << 6) 18738c2ecf20Sopenharmony_ci#define RT5645_M_MP3_ORG_L_SFT 6 18748c2ecf20Sopenharmony_ci#define RT5645_M_MP3_ORG_R_MASK (0x1 << 5) 18758c2ecf20Sopenharmony_ci#define RT5645_M_MP3_ORG_R_SFT 5 18768c2ecf20Sopenharmony_ci 18778c2ecf20Sopenharmony_ci/* MP3 Plus Control 2 (0xd1) */ 18788c2ecf20Sopenharmony_ci#define RT5645_MP3_WT_MASK (0x1 << 13) 18798c2ecf20Sopenharmony_ci#define RT5645_MP3_WT_SFT 13 18808c2ecf20Sopenharmony_ci#define RT5645_MP3_WT_1_4 (0x0 << 13) 18818c2ecf20Sopenharmony_ci#define RT5645_MP3_WT_1_2 (0x1 << 13) 18828c2ecf20Sopenharmony_ci#define RT5645_OG_MP3_MASK (0x1f << 8) 18838c2ecf20Sopenharmony_ci#define RT5645_OG_MP3_SFT 8 18848c2ecf20Sopenharmony_ci#define RT5645_HG_MP3_MASK (0x3f) 18858c2ecf20Sopenharmony_ci#define RT5645_HG_MP3_SFT 0 18868c2ecf20Sopenharmony_ci 18878c2ecf20Sopenharmony_ci/* 3D HP Control 1 (0xd2) */ 18888c2ecf20Sopenharmony_ci#define RT5645_3D_CF_MASK (0x1 << 15) 18898c2ecf20Sopenharmony_ci#define RT5645_3D_CF_SFT 15 18908c2ecf20Sopenharmony_ci#define RT5645_3D_CF_DIS (0x0 << 15) 18918c2ecf20Sopenharmony_ci#define RT5645_3D_CF_EN (0x1 << 15) 18928c2ecf20Sopenharmony_ci#define RT5645_3D_HP_MASK (0x1 << 14) 18938c2ecf20Sopenharmony_ci#define RT5645_3D_HP_SFT 14 18948c2ecf20Sopenharmony_ci#define RT5645_3D_HP_DIS (0x0 << 14) 18958c2ecf20Sopenharmony_ci#define RT5645_3D_HP_EN (0x1 << 14) 18968c2ecf20Sopenharmony_ci#define RT5645_3D_BT_MASK (0x1 << 13) 18978c2ecf20Sopenharmony_ci#define RT5645_3D_BT_SFT 13 18988c2ecf20Sopenharmony_ci#define RT5645_3D_BT_DIS (0x0 << 13) 18998c2ecf20Sopenharmony_ci#define RT5645_3D_BT_EN (0x1 << 13) 19008c2ecf20Sopenharmony_ci#define RT5645_3D_1F_MIX_MASK (0x3 << 11) 19018c2ecf20Sopenharmony_ci#define RT5645_3D_1F_MIX_SFT 11 19028c2ecf20Sopenharmony_ci#define RT5645_3D_HP_M_MASK (0x1 << 10) 19038c2ecf20Sopenharmony_ci#define RT5645_3D_HP_M_SFT 10 19048c2ecf20Sopenharmony_ci#define RT5645_3D_HP_M_SUR (0x0 << 10) 19058c2ecf20Sopenharmony_ci#define RT5645_3D_HP_M_FRO (0x1 << 10) 19068c2ecf20Sopenharmony_ci#define RT5645_M_3D_HRTF_MASK (0x1 << 9) 19078c2ecf20Sopenharmony_ci#define RT5645_M_3D_HRTF_SFT 9 19088c2ecf20Sopenharmony_ci#define RT5645_M_3D_D2H_MASK (0x1 << 8) 19098c2ecf20Sopenharmony_ci#define RT5645_M_3D_D2H_SFT 8 19108c2ecf20Sopenharmony_ci#define RT5645_M_3D_D2R_MASK (0x1 << 7) 19118c2ecf20Sopenharmony_ci#define RT5645_M_3D_D2R_SFT 7 19128c2ecf20Sopenharmony_ci#define RT5645_M_3D_REVB_MASK (0x1 << 6) 19138c2ecf20Sopenharmony_ci#define RT5645_M_3D_REVB_SFT 6 19148c2ecf20Sopenharmony_ci 19158c2ecf20Sopenharmony_ci/* Adjustable high pass filter control 1 (0xd3) */ 19168c2ecf20Sopenharmony_ci#define RT5645_2ND_HPF_MASK (0x1 << 15) 19178c2ecf20Sopenharmony_ci#define RT5645_2ND_HPF_SFT 15 19188c2ecf20Sopenharmony_ci#define RT5645_2ND_HPF_DIS (0x0 << 15) 19198c2ecf20Sopenharmony_ci#define RT5645_2ND_HPF_EN (0x1 << 15) 19208c2ecf20Sopenharmony_ci#define RT5645_HPF_CF_L_MASK (0x7 << 12) 19218c2ecf20Sopenharmony_ci#define RT5645_HPF_CF_L_SFT 12 19228c2ecf20Sopenharmony_ci#define RT5645_1ST_HPF_MASK (0x1 << 11) 19238c2ecf20Sopenharmony_ci#define RT5645_1ST_HPF_SFT 11 19248c2ecf20Sopenharmony_ci#define RT5645_1ST_HPF_DIS (0x0 << 11) 19258c2ecf20Sopenharmony_ci#define RT5645_1ST_HPF_EN (0x1 << 11) 19268c2ecf20Sopenharmony_ci#define RT5645_HPF_CF_R_MASK (0x7 << 8) 19278c2ecf20Sopenharmony_ci#define RT5645_HPF_CF_R_SFT 8 19288c2ecf20Sopenharmony_ci#define RT5645_ZD_T_MASK (0x3 << 6) 19298c2ecf20Sopenharmony_ci#define RT5645_ZD_T_SFT 6 19308c2ecf20Sopenharmony_ci#define RT5645_ZD_F_MASK (0x3 << 4) 19318c2ecf20Sopenharmony_ci#define RT5645_ZD_F_SFT 4 19328c2ecf20Sopenharmony_ci#define RT5645_ZD_F_IM (0x0 << 4) 19338c2ecf20Sopenharmony_ci#define RT5645_ZD_F_ZC_IM (0x1 << 4) 19348c2ecf20Sopenharmony_ci#define RT5645_ZD_F_ZC_IOD (0x2 << 4) 19358c2ecf20Sopenharmony_ci#define RT5645_ZD_F_UN (0x3 << 4) 19368c2ecf20Sopenharmony_ci 19378c2ecf20Sopenharmony_ci/* HP calibration control and Amp detection (0xd6) */ 19388c2ecf20Sopenharmony_ci#define RT5645_SI_DAC_MASK (0x1 << 11) 19398c2ecf20Sopenharmony_ci#define RT5645_SI_DAC_SFT 11 19408c2ecf20Sopenharmony_ci#define RT5645_SI_DAC_AUTO (0x0 << 11) 19418c2ecf20Sopenharmony_ci#define RT5645_SI_DAC_TEST (0x1 << 11) 19428c2ecf20Sopenharmony_ci#define RT5645_DC_CAL_M_MASK (0x1 << 10) 19438c2ecf20Sopenharmony_ci#define RT5645_DC_CAL_M_SFT 10 19448c2ecf20Sopenharmony_ci#define RT5645_DC_CAL_M_CAL (0x0 << 10) 19458c2ecf20Sopenharmony_ci#define RT5645_DC_CAL_M_NOR (0x1 << 10) 19468c2ecf20Sopenharmony_ci#define RT5645_DC_CAL_MASK (0x1 << 9) 19478c2ecf20Sopenharmony_ci#define RT5645_DC_CAL_SFT 9 19488c2ecf20Sopenharmony_ci#define RT5645_DC_CAL_DIS (0x0 << 9) 19498c2ecf20Sopenharmony_ci#define RT5645_DC_CAL_EN (0x1 << 9) 19508c2ecf20Sopenharmony_ci#define RT5645_HPD_RCV_MASK (0x7 << 6) 19518c2ecf20Sopenharmony_ci#define RT5645_HPD_RCV_SFT 6 19528c2ecf20Sopenharmony_ci#define RT5645_HPD_PS_MASK (0x1 << 5) 19538c2ecf20Sopenharmony_ci#define RT5645_HPD_PS_SFT 5 19548c2ecf20Sopenharmony_ci#define RT5645_HPD_PS_DIS (0x0 << 5) 19558c2ecf20Sopenharmony_ci#define RT5645_HPD_PS_EN (0x1 << 5) 19568c2ecf20Sopenharmony_ci#define RT5645_CAL_M_MASK (0x1 << 4) 19578c2ecf20Sopenharmony_ci#define RT5645_CAL_M_SFT 4 19588c2ecf20Sopenharmony_ci#define RT5645_CAL_M_DEP (0x0 << 4) 19598c2ecf20Sopenharmony_ci#define RT5645_CAL_M_CAL (0x1 << 4) 19608c2ecf20Sopenharmony_ci#define RT5645_CAL_MASK (0x1 << 3) 19618c2ecf20Sopenharmony_ci#define RT5645_CAL_SFT 3 19628c2ecf20Sopenharmony_ci#define RT5645_CAL_DIS (0x0 << 3) 19638c2ecf20Sopenharmony_ci#define RT5645_CAL_EN (0x1 << 3) 19648c2ecf20Sopenharmony_ci#define RT5645_CAL_TEST_MASK (0x1 << 2) 19658c2ecf20Sopenharmony_ci#define RT5645_CAL_TEST_SFT 2 19668c2ecf20Sopenharmony_ci#define RT5645_CAL_TEST_DIS (0x0 << 2) 19678c2ecf20Sopenharmony_ci#define RT5645_CAL_TEST_EN (0x1 << 2) 19688c2ecf20Sopenharmony_ci#define RT5645_CAL_P_MASK (0x3) 19698c2ecf20Sopenharmony_ci#define RT5645_CAL_P_SFT 0 19708c2ecf20Sopenharmony_ci#define RT5645_CAL_P_NONE (0x0) 19718c2ecf20Sopenharmony_ci#define RT5645_CAL_P_CAL (0x1) 19728c2ecf20Sopenharmony_ci#define RT5645_CAL_P_DAC_CAL (0x2) 19738c2ecf20Sopenharmony_ci 19748c2ecf20Sopenharmony_ci/* Soft volume and zero cross control 1 (0xd9) */ 19758c2ecf20Sopenharmony_ci#define RT5645_SV_MASK (0x1 << 15) 19768c2ecf20Sopenharmony_ci#define RT5645_SV_SFT 15 19778c2ecf20Sopenharmony_ci#define RT5645_SV_DIS (0x0 << 15) 19788c2ecf20Sopenharmony_ci#define RT5645_SV_EN (0x1 << 15) 19798c2ecf20Sopenharmony_ci#define RT5645_SPO_SV_MASK (0x1 << 14) 19808c2ecf20Sopenharmony_ci#define RT5645_SPO_SV_SFT 14 19818c2ecf20Sopenharmony_ci#define RT5645_SPO_SV_DIS (0x0 << 14) 19828c2ecf20Sopenharmony_ci#define RT5645_SPO_SV_EN (0x1 << 14) 19838c2ecf20Sopenharmony_ci#define RT5645_OUT_SV_MASK (0x1 << 13) 19848c2ecf20Sopenharmony_ci#define RT5645_OUT_SV_SFT 13 19858c2ecf20Sopenharmony_ci#define RT5645_OUT_SV_DIS (0x0 << 13) 19868c2ecf20Sopenharmony_ci#define RT5645_OUT_SV_EN (0x1 << 13) 19878c2ecf20Sopenharmony_ci#define RT5645_HP_SV_MASK (0x1 << 12) 19888c2ecf20Sopenharmony_ci#define RT5645_HP_SV_SFT 12 19898c2ecf20Sopenharmony_ci#define RT5645_HP_SV_DIS (0x0 << 12) 19908c2ecf20Sopenharmony_ci#define RT5645_HP_SV_EN (0x1 << 12) 19918c2ecf20Sopenharmony_ci#define RT5645_ZCD_DIG_MASK (0x1 << 11) 19928c2ecf20Sopenharmony_ci#define RT5645_ZCD_DIG_SFT 11 19938c2ecf20Sopenharmony_ci#define RT5645_ZCD_DIG_DIS (0x0 << 11) 19948c2ecf20Sopenharmony_ci#define RT5645_ZCD_DIG_EN (0x1 << 11) 19958c2ecf20Sopenharmony_ci#define RT5645_ZCD_MASK (0x1 << 10) 19968c2ecf20Sopenharmony_ci#define RT5645_ZCD_SFT 10 19978c2ecf20Sopenharmony_ci#define RT5645_ZCD_PD (0x0 << 10) 19988c2ecf20Sopenharmony_ci#define RT5645_ZCD_PU (0x1 << 10) 19998c2ecf20Sopenharmony_ci#define RT5645_M_ZCD_MASK (0x3f << 4) 20008c2ecf20Sopenharmony_ci#define RT5645_M_ZCD_SFT 4 20018c2ecf20Sopenharmony_ci#define RT5645_M_ZCD_RM_L (0x1 << 9) 20028c2ecf20Sopenharmony_ci#define RT5645_M_ZCD_RM_R (0x1 << 8) 20038c2ecf20Sopenharmony_ci#define RT5645_M_ZCD_SM_L (0x1 << 7) 20048c2ecf20Sopenharmony_ci#define RT5645_M_ZCD_SM_R (0x1 << 6) 20058c2ecf20Sopenharmony_ci#define RT5645_M_ZCD_OM_L (0x1 << 5) 20068c2ecf20Sopenharmony_ci#define RT5645_M_ZCD_OM_R (0x1 << 4) 20078c2ecf20Sopenharmony_ci#define RT5645_SV_DLY_MASK (0xf) 20088c2ecf20Sopenharmony_ci#define RT5645_SV_DLY_SFT 0 20098c2ecf20Sopenharmony_ci 20108c2ecf20Sopenharmony_ci/* Soft volume and zero cross control 2 (0xda) */ 20118c2ecf20Sopenharmony_ci#define RT5645_ZCD_HP_MASK (0x1 << 15) 20128c2ecf20Sopenharmony_ci#define RT5645_ZCD_HP_SFT 15 20138c2ecf20Sopenharmony_ci#define RT5645_ZCD_HP_DIS (0x0 << 15) 20148c2ecf20Sopenharmony_ci#define RT5645_ZCD_HP_EN (0x1 << 15) 20158c2ecf20Sopenharmony_ci 20168c2ecf20Sopenharmony_ci 20178c2ecf20Sopenharmony_ci/* Codec Private Register definition */ 20188c2ecf20Sopenharmony_ci/* DAC ADC Digital Volume (0x00) */ 20198c2ecf20Sopenharmony_ci#define RT5645_DA1_ZDET_SFT 6 20208c2ecf20Sopenharmony_ci 20218c2ecf20Sopenharmony_ci/* 3D Speaker Control (0x63) */ 20228c2ecf20Sopenharmony_ci#define RT5645_3D_SPK_MASK (0x1 << 15) 20238c2ecf20Sopenharmony_ci#define RT5645_3D_SPK_SFT 15 20248c2ecf20Sopenharmony_ci#define RT5645_3D_SPK_DIS (0x0 << 15) 20258c2ecf20Sopenharmony_ci#define RT5645_3D_SPK_EN (0x1 << 15) 20268c2ecf20Sopenharmony_ci#define RT5645_3D_SPK_M_MASK (0x3 << 13) 20278c2ecf20Sopenharmony_ci#define RT5645_3D_SPK_M_SFT 13 20288c2ecf20Sopenharmony_ci#define RT5645_3D_SPK_CG_MASK (0x1f << 8) 20298c2ecf20Sopenharmony_ci#define RT5645_3D_SPK_CG_SFT 8 20308c2ecf20Sopenharmony_ci#define RT5645_3D_SPK_SG_MASK (0x1f) 20318c2ecf20Sopenharmony_ci#define RT5645_3D_SPK_SG_SFT 0 20328c2ecf20Sopenharmony_ci 20338c2ecf20Sopenharmony_ci/* Wind Noise Detection Control 1 (0x6c) */ 20348c2ecf20Sopenharmony_ci#define RT5645_WND_MASK (0x1 << 15) 20358c2ecf20Sopenharmony_ci#define RT5645_WND_SFT 15 20368c2ecf20Sopenharmony_ci#define RT5645_WND_DIS (0x0 << 15) 20378c2ecf20Sopenharmony_ci#define RT5645_WND_EN (0x1 << 15) 20388c2ecf20Sopenharmony_ci 20398c2ecf20Sopenharmony_ci/* Wind Noise Detection Control 2 (0x6d) */ 20408c2ecf20Sopenharmony_ci#define RT5645_WND_FC_NW_MASK (0x3f << 10) 20418c2ecf20Sopenharmony_ci#define RT5645_WND_FC_NW_SFT 10 20428c2ecf20Sopenharmony_ci#define RT5645_WND_FC_WK_MASK (0x3f << 4) 20438c2ecf20Sopenharmony_ci#define RT5645_WND_FC_WK_SFT 4 20448c2ecf20Sopenharmony_ci 20458c2ecf20Sopenharmony_ci/* Wind Noise Detection Control 3 (0x6e) */ 20468c2ecf20Sopenharmony_ci#define RT5645_HPF_FC_MASK (0x3f << 6) 20478c2ecf20Sopenharmony_ci#define RT5645_HPF_FC_SFT 6 20488c2ecf20Sopenharmony_ci#define RT5645_WND_FC_ST_MASK (0x3f) 20498c2ecf20Sopenharmony_ci#define RT5645_WND_FC_ST_SFT 0 20508c2ecf20Sopenharmony_ci 20518c2ecf20Sopenharmony_ci/* Wind Noise Detection Control 4 (0x6f) */ 20528c2ecf20Sopenharmony_ci#define RT5645_WND_TH_LO_MASK (0x3ff) 20538c2ecf20Sopenharmony_ci#define RT5645_WND_TH_LO_SFT 0 20548c2ecf20Sopenharmony_ci 20558c2ecf20Sopenharmony_ci/* Wind Noise Detection Control 5 (0x70) */ 20568c2ecf20Sopenharmony_ci#define RT5645_WND_TH_HI_MASK (0x3ff) 20578c2ecf20Sopenharmony_ci#define RT5645_WND_TH_HI_SFT 0 20588c2ecf20Sopenharmony_ci 20598c2ecf20Sopenharmony_ci/* Wind Noise Detection Control 8 (0x73) */ 20608c2ecf20Sopenharmony_ci#define RT5645_WND_WIND_MASK (0x1 << 13) /* Read-Only */ 20618c2ecf20Sopenharmony_ci#define RT5645_WND_WIND_SFT 13 20628c2ecf20Sopenharmony_ci#define RT5645_WND_STRONG_MASK (0x1 << 12) /* Read-Only */ 20638c2ecf20Sopenharmony_ci#define RT5645_WND_STRONG_SFT 12 20648c2ecf20Sopenharmony_cienum { 20658c2ecf20Sopenharmony_ci RT5645_NO_WIND, 20668c2ecf20Sopenharmony_ci RT5645_BREEZE, 20678c2ecf20Sopenharmony_ci RT5645_STORM, 20688c2ecf20Sopenharmony_ci}; 20698c2ecf20Sopenharmony_ci 20708c2ecf20Sopenharmony_ci/* Dipole Speaker Interface (0x75) */ 20718c2ecf20Sopenharmony_ci#define RT5645_DP_ATT_MASK (0x3 << 14) 20728c2ecf20Sopenharmony_ci#define RT5645_DP_ATT_SFT 14 20738c2ecf20Sopenharmony_ci#define RT5645_DP_SPK_MASK (0x1 << 10) 20748c2ecf20Sopenharmony_ci#define RT5645_DP_SPK_SFT 10 20758c2ecf20Sopenharmony_ci#define RT5645_DP_SPK_DIS (0x0 << 10) 20768c2ecf20Sopenharmony_ci#define RT5645_DP_SPK_EN (0x1 << 10) 20778c2ecf20Sopenharmony_ci 20788c2ecf20Sopenharmony_ci/* EQ Pre Volume Control (0xb3) */ 20798c2ecf20Sopenharmony_ci#define RT5645_EQ_PRE_VOL_MASK (0xffff) 20808c2ecf20Sopenharmony_ci#define RT5645_EQ_PRE_VOL_SFT 0 20818c2ecf20Sopenharmony_ci 20828c2ecf20Sopenharmony_ci/* EQ Post Volume Control (0xb4) */ 20838c2ecf20Sopenharmony_ci#define RT5645_EQ_PST_VOL_MASK (0xffff) 20848c2ecf20Sopenharmony_ci#define RT5645_EQ_PST_VOL_SFT 0 20858c2ecf20Sopenharmony_ci 20868c2ecf20Sopenharmony_ci/* Jack Detect Control 3 (0xf8) */ 20878c2ecf20Sopenharmony_ci#define RT5645_CMP_MIC_IN_DET_MASK (0x7 << 12) 20888c2ecf20Sopenharmony_ci#define RT5645_JD_CBJ_EN (0x1 << 7) 20898c2ecf20Sopenharmony_ci#define RT5645_JD_CBJ_POL (0x1 << 6) 20908c2ecf20Sopenharmony_ci#define RT5645_JD_TRI_CBJ_SEL_MASK (0x7 << 3) 20918c2ecf20Sopenharmony_ci#define RT5645_JD_TRI_CBJ_SEL_SFT (3) 20928c2ecf20Sopenharmony_ci#define RT5645_JD_TRI_HPO_SEL_MASK (0x7) 20938c2ecf20Sopenharmony_ci#define RT5645_JD_TRI_HPO_SEL_SFT (0) 20948c2ecf20Sopenharmony_ci#define RT5645_JD_F_GPIO_JD1 (0x0) 20958c2ecf20Sopenharmony_ci#define RT5645_JD_F_JD1_1 (0x1) 20968c2ecf20Sopenharmony_ci#define RT5645_JD_F_JD1_2 (0x2) 20978c2ecf20Sopenharmony_ci#define RT5645_JD_F_JD2 (0x3) 20988c2ecf20Sopenharmony_ci#define RT5645_JD_F_JD3 (0x4) 20998c2ecf20Sopenharmony_ci#define RT5645_JD_F_GPIO_JD2 (0x5) 21008c2ecf20Sopenharmony_ci#define RT5645_JD_F_MX0B_12 (0x6) 21018c2ecf20Sopenharmony_ci 21028c2ecf20Sopenharmony_ci/* Digital Misc Control (0xfa) */ 21038c2ecf20Sopenharmony_ci#define RT5645_RST_DSP (0x1 << 13) 21048c2ecf20Sopenharmony_ci#define RT5645_IF1_ADC1_IN1_SEL (0x1 << 12) 21058c2ecf20Sopenharmony_ci#define RT5645_IF1_ADC1_IN1_SFT 12 21068c2ecf20Sopenharmony_ci#define RT5645_IF1_ADC1_IN2_SEL (0x1 << 11) 21078c2ecf20Sopenharmony_ci#define RT5645_IF1_ADC1_IN2_SFT 11 21088c2ecf20Sopenharmony_ci#define RT5645_IF1_ADC2_IN1_SEL (0x1 << 10) 21098c2ecf20Sopenharmony_ci#define RT5645_IF1_ADC2_IN1_SFT 10 21108c2ecf20Sopenharmony_ci#define RT5645_DIG_GATE_CTRL 0x1 21118c2ecf20Sopenharmony_ci 21128c2ecf20Sopenharmony_ci/* General Control2 (0xfb) */ 21138c2ecf20Sopenharmony_ci#define RT5645_RXDC_SRC_MASK (0x1 << 7) 21148c2ecf20Sopenharmony_ci#define RT5645_RXDC_SRC_STO (0x0 << 7) 21158c2ecf20Sopenharmony_ci#define RT5645_RXDC_SRC_MONO (0x1 << 7) 21168c2ecf20Sopenharmony_ci#define RT5645_RXDC_SRC_SFT (7) 21178c2ecf20Sopenharmony_ci#define RT5645_MICBIAS1_POW_CTRL_SEL_MASK (0x1 << 5) 21188c2ecf20Sopenharmony_ci#define RT5645_MICBIAS1_POW_CTRL_SEL_A (0x0 << 5) 21198c2ecf20Sopenharmony_ci#define RT5645_MICBIAS1_POW_CTRL_SEL_M (0x1 << 5) 21208c2ecf20Sopenharmony_ci#define RT5645_MICBIAS2_POW_CTRL_SEL_MASK (0x1 << 4) 21218c2ecf20Sopenharmony_ci#define RT5645_MICBIAS2_POW_CTRL_SEL_A (0x0 << 4) 21228c2ecf20Sopenharmony_ci#define RT5645_MICBIAS2_POW_CTRL_SEL_M (0x1 << 4) 21238c2ecf20Sopenharmony_ci#define RT5645_RXDP2_SEL_MASK (0x1 << 3) 21248c2ecf20Sopenharmony_ci#define RT5645_RXDP2_SEL_IF2 (0x0 << 3) 21258c2ecf20Sopenharmony_ci#define RT5645_RXDP2_SEL_ADC (0x1 << 3) 21268c2ecf20Sopenharmony_ci#define RT5645_RXDP2_SEL_SFT (3) 21278c2ecf20Sopenharmony_ci 21288c2ecf20Sopenharmony_ci/* General Control3 (0xfc) */ 21298c2ecf20Sopenharmony_ci#define RT5645_JD_PSV_MODE (0x1 << 12) 21308c2ecf20Sopenharmony_ci#define RT5645_IRQ_CLK_GATE_CTRL (0x1 << 11) 21318c2ecf20Sopenharmony_ci#define RT5645_DET_CLK_MASK (0x3 << 9) 21328c2ecf20Sopenharmony_ci#define RT5645_DET_CLK_DIS (0x0 << 9) 21338c2ecf20Sopenharmony_ci#define RT5645_DET_CLK_MODE1 (0x1 << 9) 21348c2ecf20Sopenharmony_ci#define RT5645_DET_CLK_MODE2 (0x2 << 9) 21358c2ecf20Sopenharmony_ci#define RT5645_MICINDET_MANU (0x1 << 7) 21368c2ecf20Sopenharmony_ci#define RT5645_RING2_SLEEVE_GND (0x1 << 5) 21378c2ecf20Sopenharmony_ci 21388c2ecf20Sopenharmony_ci/* Vendor ID (0xfd) */ 21398c2ecf20Sopenharmony_ci#define RT5645_VER_C 0x2 21408c2ecf20Sopenharmony_ci#define RT5645_VER_D 0x3 21418c2ecf20Sopenharmony_ci 21428c2ecf20Sopenharmony_ci 21438c2ecf20Sopenharmony_ci/* Volume Rescale */ 21448c2ecf20Sopenharmony_ci#define RT5645_VOL_RSCL_MAX 0x27 21458c2ecf20Sopenharmony_ci#define RT5645_VOL_RSCL_RANGE 0x1F 21468c2ecf20Sopenharmony_ci/* Debug String Length */ 21478c2ecf20Sopenharmony_ci#define RT5645_REG_DISP_LEN 23 21488c2ecf20Sopenharmony_ci 21498c2ecf20Sopenharmony_ci 21508c2ecf20Sopenharmony_ci/* System Clock Source */ 21518c2ecf20Sopenharmony_cienum { 21528c2ecf20Sopenharmony_ci RT5645_SCLK_S_MCLK, 21538c2ecf20Sopenharmony_ci RT5645_SCLK_S_PLL1, 21548c2ecf20Sopenharmony_ci RT5645_SCLK_S_RCCLK, 21558c2ecf20Sopenharmony_ci}; 21568c2ecf20Sopenharmony_ci 21578c2ecf20Sopenharmony_ci/* PLL1 Source */ 21588c2ecf20Sopenharmony_cienum { 21598c2ecf20Sopenharmony_ci RT5645_PLL1_S_MCLK, 21608c2ecf20Sopenharmony_ci RT5645_PLL1_S_BCLK1, 21618c2ecf20Sopenharmony_ci RT5645_PLL1_S_BCLK2, 21628c2ecf20Sopenharmony_ci}; 21638c2ecf20Sopenharmony_ci 21648c2ecf20Sopenharmony_cienum { 21658c2ecf20Sopenharmony_ci RT5645_AIF1, 21668c2ecf20Sopenharmony_ci RT5645_AIF2, 21678c2ecf20Sopenharmony_ci RT5645_AIFS, 21688c2ecf20Sopenharmony_ci}; 21698c2ecf20Sopenharmony_ci 21708c2ecf20Sopenharmony_cienum { 21718c2ecf20Sopenharmony_ci RT5645_DMIC1_DISABLE, 21728c2ecf20Sopenharmony_ci RT5645_DMIC_DATA_IN2P, 21738c2ecf20Sopenharmony_ci RT5645_DMIC_DATA_GPIO6, 21748c2ecf20Sopenharmony_ci RT5645_DMIC_DATA_GPIO10, 21758c2ecf20Sopenharmony_ci RT5645_DMIC_DATA_GPIO12, 21768c2ecf20Sopenharmony_ci}; 21778c2ecf20Sopenharmony_ci 21788c2ecf20Sopenharmony_cienum { 21798c2ecf20Sopenharmony_ci RT5645_DMIC2_DISABLE, 21808c2ecf20Sopenharmony_ci RT5645_DMIC_DATA_IN2N, 21818c2ecf20Sopenharmony_ci RT5645_DMIC_DATA_GPIO5, 21828c2ecf20Sopenharmony_ci RT5645_DMIC_DATA_GPIO11, 21838c2ecf20Sopenharmony_ci}; 21848c2ecf20Sopenharmony_ci 21858c2ecf20Sopenharmony_cienum { 21868c2ecf20Sopenharmony_ci CODEC_TYPE_RT5645, 21878c2ecf20Sopenharmony_ci CODEC_TYPE_RT5650, 21888c2ecf20Sopenharmony_ci}; 21898c2ecf20Sopenharmony_ci 21908c2ecf20Sopenharmony_ci/* filter mask */ 21918c2ecf20Sopenharmony_cienum { 21928c2ecf20Sopenharmony_ci RT5645_DA_STEREO_FILTER = 0x1, 21938c2ecf20Sopenharmony_ci RT5645_DA_MONO_L_FILTER = (0x1 << 1), 21948c2ecf20Sopenharmony_ci RT5645_DA_MONO_R_FILTER = (0x1 << 2), 21958c2ecf20Sopenharmony_ci RT5645_AD_STEREO_FILTER = (0x1 << 3), 21968c2ecf20Sopenharmony_ci RT5645_AD_MONO_L_FILTER = (0x1 << 4), 21978c2ecf20Sopenharmony_ci RT5645_AD_MONO_R_FILTER = (0x1 << 5), 21988c2ecf20Sopenharmony_ci}; 21998c2ecf20Sopenharmony_ci 22008c2ecf20Sopenharmony_ciint rt5645_sel_asrc_clk_src(struct snd_soc_component *component, 22018c2ecf20Sopenharmony_ci unsigned int filter_mask, unsigned int clk_src); 22028c2ecf20Sopenharmony_ci 22038c2ecf20Sopenharmony_ciint rt5645_set_jack_detect(struct snd_soc_component *component, 22048c2ecf20Sopenharmony_ci struct snd_soc_jack *hp_jack, struct snd_soc_jack *mic_jack, 22058c2ecf20Sopenharmony_ci struct snd_soc_jack *btn_jack); 22068c2ecf20Sopenharmony_ci#endif /* __RT5645_H__ */ 2207