11319b2f6SOder Chiou /* 21319b2f6SOder Chiou * rt5645.h -- RT5645 ALSA SoC audio driver 31319b2f6SOder Chiou * 41319b2f6SOder Chiou * Copyright 2013 Realtek Microelectronics 51319b2f6SOder Chiou * Author: Bard Liao <bardliao@realtek.com> 61319b2f6SOder Chiou * 71319b2f6SOder Chiou * This program is free software; you can redistribute it and/or modify 81319b2f6SOder Chiou * it under the terms of the GNU General Public License version 2 as 91319b2f6SOder Chiou * published by the Free Software Foundation. 101319b2f6SOder Chiou */ 111319b2f6SOder Chiou 121319b2f6SOder Chiou #ifndef __RT5645_H__ 131319b2f6SOder Chiou #define __RT5645_H__ 141319b2f6SOder Chiou 151319b2f6SOder Chiou #include <sound/rt5645.h> 161319b2f6SOder Chiou 171319b2f6SOder Chiou /* Info */ 181319b2f6SOder Chiou #define RT5645_RESET 0x00 191319b2f6SOder Chiou #define RT5645_VENDOR_ID 0xfd 201319b2f6SOder Chiou #define RT5645_VENDOR_ID1 0xfe 211319b2f6SOder Chiou #define RT5645_VENDOR_ID2 0xff 221319b2f6SOder Chiou /* I/O - Output */ 231319b2f6SOder Chiou #define RT5645_SPK_VOL 0x01 241319b2f6SOder Chiou #define RT5645_HP_VOL 0x02 251319b2f6SOder Chiou #define RT5645_LOUT1 0x03 261319b2f6SOder Chiou #define RT5645_LOUT_CTRL 0x05 271319b2f6SOder Chiou /* I/O - Input */ 281319b2f6SOder Chiou #define RT5645_IN1_CTRL1 0x0a 291319b2f6SOder Chiou #define RT5645_IN1_CTRL2 0x0b 301319b2f6SOder Chiou #define RT5645_IN1_CTRL3 0x0c 311319b2f6SOder Chiou #define RT5645_IN2_CTRL 0x0d 321319b2f6SOder Chiou #define RT5645_INL1_INR1_VOL 0x0f 331319b2f6SOder Chiou #define RT5645_SPK_FUNC_LIM 0x14 341319b2f6SOder Chiou #define RT5645_ADJ_HPF_CTRL 0x16 351319b2f6SOder Chiou /* I/O - ADC/DAC/DMIC */ 361319b2f6SOder Chiou #define RT5645_DAC1_DIG_VOL 0x19 371319b2f6SOder Chiou #define RT5645_DAC2_DIG_VOL 0x1a 381319b2f6SOder Chiou #define RT5645_DAC_CTRL 0x1b 391319b2f6SOder Chiou #define RT5645_STO1_ADC_DIG_VOL 0x1c 401319b2f6SOder Chiou #define RT5645_MONO_ADC_DIG_VOL 0x1d 411319b2f6SOder Chiou #define RT5645_ADC_BST_VOL1 0x1e 421319b2f6SOder Chiou /* Mixer - D-D */ 431319b2f6SOder Chiou #define RT5645_ADC_BST_VOL2 0x20 441319b2f6SOder Chiou #define RT5645_STO1_ADC_MIXER 0x27 451319b2f6SOder Chiou #define RT5645_MONO_ADC_MIXER 0x28 461319b2f6SOder Chiou #define RT5645_AD_DA_MIXER 0x29 471319b2f6SOder Chiou #define RT5645_STO_DAC_MIXER 0x2a 481319b2f6SOder Chiou #define RT5645_MONO_DAC_MIXER 0x2b 491319b2f6SOder Chiou #define RT5645_DIG_MIXER 0x2c 505c4ca99dSBard Liao #define RT5650_A_DAC_SOUR 0x2d 511319b2f6SOder Chiou #define RT5645_DIG_INF1_DATA 0x2f 521319b2f6SOder Chiou /* Mixer - PDM */ 531319b2f6SOder Chiou #define RT5645_PDM_OUT_CTRL 0x31 541319b2f6SOder Chiou /* Mixer - ADC */ 551319b2f6SOder Chiou #define RT5645_REC_L1_MIXER 0x3b 561319b2f6SOder Chiou #define RT5645_REC_L2_MIXER 0x3c 571319b2f6SOder Chiou #define RT5645_REC_R1_MIXER 0x3d 581319b2f6SOder Chiou #define RT5645_REC_R2_MIXER 0x3e 591319b2f6SOder Chiou /* Mixer - DAC */ 601319b2f6SOder Chiou #define RT5645_HPMIXL_CTRL 0x3f 611319b2f6SOder Chiou #define RT5645_HPOMIXL_CTRL 0x40 621319b2f6SOder Chiou #define RT5645_HPMIXR_CTRL 0x41 631319b2f6SOder Chiou #define RT5645_HPOMIXR_CTRL 0x42 641319b2f6SOder Chiou #define RT5645_HPO_MIXER 0x45 651319b2f6SOder Chiou #define RT5645_SPK_L_MIXER 0x46 661319b2f6SOder Chiou #define RT5645_SPK_R_MIXER 0x47 671319b2f6SOder Chiou #define RT5645_SPO_MIXER 0x48 681319b2f6SOder Chiou #define RT5645_SPO_CLSD_RATIO 0x4a 691319b2f6SOder Chiou #define RT5645_OUT_L_GAIN1 0x4d 701319b2f6SOder Chiou #define RT5645_OUT_L_GAIN2 0x4e 711319b2f6SOder Chiou #define RT5645_OUT_L1_MIXER 0x4f 721319b2f6SOder Chiou #define RT5645_OUT_R_GAIN1 0x50 731319b2f6SOder Chiou #define RT5645_OUT_R_GAIN2 0x51 741319b2f6SOder Chiou #define RT5645_OUT_R1_MIXER 0x52 751319b2f6SOder Chiou #define RT5645_LOUT_MIXER 0x53 761319b2f6SOder Chiou /* Haptic */ 771319b2f6SOder Chiou #define RT5645_HAPTIC_CTRL1 0x56 781319b2f6SOder Chiou #define RT5645_HAPTIC_CTRL2 0x57 791319b2f6SOder Chiou #define RT5645_HAPTIC_CTRL3 0x58 801319b2f6SOder Chiou #define RT5645_HAPTIC_CTRL4 0x59 811319b2f6SOder Chiou #define RT5645_HAPTIC_CTRL5 0x5a 821319b2f6SOder Chiou #define RT5645_HAPTIC_CTRL6 0x5b 831319b2f6SOder Chiou #define RT5645_HAPTIC_CTRL7 0x5c 841319b2f6SOder Chiou #define RT5645_HAPTIC_CTRL8 0x5d 851319b2f6SOder Chiou #define RT5645_HAPTIC_CTRL9 0x5e 861319b2f6SOder Chiou #define RT5645_HAPTIC_CTRL10 0x5f 871319b2f6SOder Chiou /* Power */ 881319b2f6SOder Chiou #define RT5645_PWR_DIG1 0x61 891319b2f6SOder Chiou #define RT5645_PWR_DIG2 0x62 901319b2f6SOder Chiou #define RT5645_PWR_ANLG1 0x63 911319b2f6SOder Chiou #define RT5645_PWR_ANLG2 0x64 921319b2f6SOder Chiou #define RT5645_PWR_MIXER 0x65 931319b2f6SOder Chiou #define RT5645_PWR_VOL 0x66 941319b2f6SOder Chiou /* Private Register Control */ 951319b2f6SOder Chiou #define RT5645_PRIV_INDEX 0x6a 961319b2f6SOder Chiou #define RT5645_PRIV_DATA 0x6c 971319b2f6SOder Chiou /* Format - ADC/DAC */ 981319b2f6SOder Chiou #define RT5645_I2S1_SDP 0x70 991319b2f6SOder Chiou #define RT5645_I2S2_SDP 0x71 1001319b2f6SOder Chiou #define RT5645_ADDA_CLK1 0x73 1011319b2f6SOder Chiou #define RT5645_ADDA_CLK2 0x74 1021319b2f6SOder Chiou #define RT5645_DMIC_CTRL1 0x75 1031319b2f6SOder Chiou #define RT5645_DMIC_CTRL2 0x76 1041319b2f6SOder Chiou /* Format - TDM Control */ 1051319b2f6SOder Chiou #define RT5645_TDM_CTRL_1 0x77 1061319b2f6SOder Chiou #define RT5645_TDM_CTRL_2 0x78 1071319b2f6SOder Chiou #define RT5645_TDM_CTRL_3 0x79 10821ab3f2bSBard Liao #define RT5650_TDM_CTRL_4 0x7a 1091319b2f6SOder Chiou 1101319b2f6SOder Chiou /* Function - Analog */ 1111319b2f6SOder Chiou #define RT5645_GLB_CLK 0x80 1121319b2f6SOder Chiou #define RT5645_PLL_CTRL1 0x81 1131319b2f6SOder Chiou #define RT5645_PLL_CTRL2 0x82 1141319b2f6SOder Chiou #define RT5645_ASRC_1 0x83 1151319b2f6SOder Chiou #define RT5645_ASRC_2 0x84 1161319b2f6SOder Chiou #define RT5645_ASRC_3 0x85 1171319b2f6SOder Chiou #define RT5645_ASRC_4 0x8a 1181319b2f6SOder Chiou #define RT5645_DEPOP_M1 0x8e 1191319b2f6SOder Chiou #define RT5645_DEPOP_M2 0x8f 1201319b2f6SOder Chiou #define RT5645_DEPOP_M3 0x90 1211319b2f6SOder Chiou #define RT5645_CHARGE_PUMP 0x91 1221319b2f6SOder Chiou #define RT5645_MICBIAS 0x93 1231319b2f6SOder Chiou #define RT5645_A_JD_CTRL1 0x94 1241319b2f6SOder Chiou #define RT5645_VAD_CTRL4 0x9d 1251319b2f6SOder Chiou #define RT5645_CLSD_OUT_CTRL 0xa0 1261319b2f6SOder Chiou /* Function - Digital */ 1271319b2f6SOder Chiou #define RT5645_ADC_EQ_CTRL1 0xae 1281319b2f6SOder Chiou #define RT5645_ADC_EQ_CTRL2 0xaf 1291319b2f6SOder Chiou #define RT5645_EQ_CTRL1 0xb0 1301319b2f6SOder Chiou #define RT5645_EQ_CTRL2 0xb1 1311319b2f6SOder Chiou #define RT5645_ALC_CTRL_1 0xb3 1321319b2f6SOder Chiou #define RT5645_ALC_CTRL_2 0xb4 1331319b2f6SOder Chiou #define RT5645_ALC_CTRL_3 0xb5 1341319b2f6SOder Chiou #define RT5645_ALC_CTRL_4 0xb6 1351319b2f6SOder Chiou #define RT5645_ALC_CTRL_5 0xb7 1361319b2f6SOder Chiou #define RT5645_JD_CTRL 0xbb 1371319b2f6SOder Chiou #define RT5645_IRQ_CTRL1 0xbc 1381319b2f6SOder Chiou #define RT5645_IRQ_CTRL2 0xbd 1391319b2f6SOder Chiou #define RT5645_IRQ_CTRL3 0xbe 1401319b2f6SOder Chiou #define RT5645_INT_IRQ_ST 0xbf 1411319b2f6SOder Chiou #define RT5645_GPIO_CTRL1 0xc0 1421319b2f6SOder Chiou #define RT5645_GPIO_CTRL2 0xc1 1431319b2f6SOder Chiou #define RT5645_GPIO_CTRL3 0xc2 1441319b2f6SOder Chiou #define RT5645_BASS_BACK 0xcf 1451319b2f6SOder Chiou #define RT5645_MP3_PLUS1 0xd0 1461319b2f6SOder Chiou #define RT5645_MP3_PLUS2 0xd1 1471319b2f6SOder Chiou #define RT5645_ADJ_HPF1 0xd3 1481319b2f6SOder Chiou #define RT5645_ADJ_HPF2 0xd4 1491319b2f6SOder Chiou #define RT5645_HP_CALIB_AMP_DET 0xd6 1501319b2f6SOder Chiou #define RT5645_SV_ZCD1 0xd9 1511319b2f6SOder Chiou #define RT5645_SV_ZCD2 0xda 1521319b2f6SOder Chiou #define RT5645_IL_CMD 0xdb 1531319b2f6SOder Chiou #define RT5645_IL_CMD2 0xdc 1541319b2f6SOder Chiou #define RT5645_IL_CMD3 0xdd 1555c4ca99dSBard Liao #define RT5650_4BTN_IL_CMD1 0xdf 1565c4ca99dSBard Liao #define RT5650_4BTN_IL_CMD2 0xe0 1571319b2f6SOder Chiou #define RT5645_DRC1_HL_CTRL1 0xe7 1581319b2f6SOder Chiou #define RT5645_DRC2_HL_CTRL1 0xe9 1591319b2f6SOder Chiou #define RT5645_MUTI_DRC_CTRL1 0xea 1601319b2f6SOder Chiou #define RT5645_ADC_MONO_HP_CTRL1 0xec 1611319b2f6SOder Chiou #define RT5645_ADC_MONO_HP_CTRL2 0xed 1621319b2f6SOder Chiou #define RT5645_DRC2_CTRL1 0xf0 1631319b2f6SOder Chiou #define RT5645_DRC2_CTRL2 0xf1 1641319b2f6SOder Chiou #define RT5645_DRC2_CTRL3 0xf2 1651319b2f6SOder Chiou #define RT5645_DRC2_CTRL4 0xf3 1661319b2f6SOder Chiou #define RT5645_DRC2_CTRL5 0xf4 1671319b2f6SOder Chiou #define RT5645_JD_CTRL3 0xf8 1681319b2f6SOder Chiou #define RT5645_JD_CTRL4 0xf9 1691319b2f6SOder Chiou /* General Control */ 1701319b2f6SOder Chiou #define RT5645_GEN_CTRL1 0xfa 1711319b2f6SOder Chiou #define RT5645_GEN_CTRL2 0xfb 1721319b2f6SOder Chiou #define RT5645_GEN_CTRL3 0xfc 1731319b2f6SOder Chiou 1741319b2f6SOder Chiou 1751319b2f6SOder Chiou /* Index of Codec Private Register definition */ 1761319b2f6SOder Chiou #define RT5645_DIG_VOL 0x00 1771319b2f6SOder Chiou #define RT5645_PR_ALC_CTRL_1 0x01 1781319b2f6SOder Chiou #define RT5645_PR_ALC_CTRL_2 0x02 1791319b2f6SOder Chiou #define RT5645_PR_ALC_CTRL_3 0x03 1801319b2f6SOder Chiou #define RT5645_PR_ALC_CTRL_4 0x04 1811319b2f6SOder Chiou #define RT5645_PR_ALC_CTRL_5 0x05 1821319b2f6SOder Chiou #define RT5645_PR_ALC_CTRL_6 0x06 1831319b2f6SOder Chiou #define RT5645_BIAS_CUR1 0x12 1841319b2f6SOder Chiou #define RT5645_BIAS_CUR3 0x14 1851319b2f6SOder Chiou #define RT5645_CLSD_INT_REG1 0x1c 1861319b2f6SOder Chiou #define RT5645_MAMP_INT_REG2 0x37 1871319b2f6SOder Chiou #define RT5645_CHOP_DAC_ADC 0x3d 1881319b2f6SOder Chiou #define RT5645_MIXER_INT_REG 0x3f 1891319b2f6SOder Chiou #define RT5645_3D_SPK 0x63 1901319b2f6SOder Chiou #define RT5645_WND_1 0x6c 1911319b2f6SOder Chiou #define RT5645_WND_2 0x6d 1921319b2f6SOder Chiou #define RT5645_WND_3 0x6e 1931319b2f6SOder Chiou #define RT5645_WND_4 0x6f 1941319b2f6SOder Chiou #define RT5645_WND_5 0x70 1951319b2f6SOder Chiou #define RT5645_WND_8 0x73 1961319b2f6SOder Chiou #define RT5645_DIP_SPK_INF 0x75 1971319b2f6SOder Chiou #define RT5645_HP_DCC_INT1 0x77 1981319b2f6SOder Chiou #define RT5645_EQ_BW_LOP 0xa0 1991319b2f6SOder Chiou #define RT5645_EQ_GN_LOP 0xa1 2001319b2f6SOder Chiou #define RT5645_EQ_FC_BP1 0xa2 2011319b2f6SOder Chiou #define RT5645_EQ_BW_BP1 0xa3 2021319b2f6SOder Chiou #define RT5645_EQ_GN_BP1 0xa4 2031319b2f6SOder Chiou #define RT5645_EQ_FC_BP2 0xa5 2041319b2f6SOder Chiou #define RT5645_EQ_BW_BP2 0xa6 2051319b2f6SOder Chiou #define RT5645_EQ_GN_BP2 0xa7 2061319b2f6SOder Chiou #define RT5645_EQ_FC_BP3 0xa8 2071319b2f6SOder Chiou #define RT5645_EQ_BW_BP3 0xa9 2081319b2f6SOder Chiou #define RT5645_EQ_GN_BP3 0xaa 2091319b2f6SOder Chiou #define RT5645_EQ_FC_BP4 0xab 2101319b2f6SOder Chiou #define RT5645_EQ_BW_BP4 0xac 2111319b2f6SOder Chiou #define RT5645_EQ_GN_BP4 0xad 2121319b2f6SOder Chiou #define RT5645_EQ_FC_HIP1 0xae 2131319b2f6SOder Chiou #define RT5645_EQ_GN_HIP1 0xaf 2141319b2f6SOder Chiou #define RT5645_EQ_FC_HIP2 0xb0 2151319b2f6SOder Chiou #define RT5645_EQ_BW_HIP2 0xb1 2161319b2f6SOder Chiou #define RT5645_EQ_GN_HIP2 0xb2 2171319b2f6SOder Chiou #define RT5645_EQ_PRE_VOL 0xb3 2181319b2f6SOder Chiou #define RT5645_EQ_PST_VOL 0xb4 2191319b2f6SOder Chiou 2201319b2f6SOder Chiou 2211319b2f6SOder Chiou /* global definition */ 2221319b2f6SOder Chiou #define RT5645_L_MUTE (0x1 << 15) 2231319b2f6SOder Chiou #define RT5645_L_MUTE_SFT 15 2241319b2f6SOder Chiou #define RT5645_VOL_L_MUTE (0x1 << 14) 2251319b2f6SOder Chiou #define RT5645_VOL_L_SFT 14 2261319b2f6SOder Chiou #define RT5645_R_MUTE (0x1 << 7) 2271319b2f6SOder Chiou #define RT5645_R_MUTE_SFT 7 2281319b2f6SOder Chiou #define RT5645_VOL_R_MUTE (0x1 << 6) 2291319b2f6SOder Chiou #define RT5645_VOL_R_SFT 6 2301319b2f6SOder Chiou #define RT5645_L_VOL_MASK (0x3f << 8) 2311319b2f6SOder Chiou #define RT5645_L_VOL_SFT 8 2321319b2f6SOder Chiou #define RT5645_R_VOL_MASK (0x3f) 2331319b2f6SOder Chiou #define RT5645_R_VOL_SFT 0 2341319b2f6SOder Chiou 2351319b2f6SOder Chiou /* IN1 Control 1 (0x0a) */ 2361319b2f6SOder Chiou #define RT5645_CBJ_BST1_MASK (0xf << 12) 2371319b2f6SOder Chiou #define RT5645_CBJ_BST1_SFT (12) 2381319b2f6SOder Chiou #define RT5645_CBJ_JD_HP_EN (0x1 << 9) 2391319b2f6SOder Chiou #define RT5645_CBJ_JD_MIC_EN (0x1 << 8) 2401319b2f6SOder Chiou #define RT5645_CBJ_JD_MIC_SW_EN (0x1 << 7) 2411319b2f6SOder Chiou #define RT5645_CBJ_MIC_SEL_R (0x1 << 6) 2421319b2f6SOder Chiou #define RT5645_CBJ_MIC_SEL_L (0x1 << 5) 2431319b2f6SOder Chiou #define RT5645_CBJ_MIC_SW (0x1 << 4) 2441319b2f6SOder Chiou #define RT5645_CBJ_BST1_EN (0x1 << 2) 2451319b2f6SOder Chiou 2461319b2f6SOder Chiou /* IN1 Control 2 (0x0b) */ 2471319b2f6SOder Chiou #define RT5645_CBJ_MN_JD (0x1 << 12) 2481319b2f6SOder Chiou #define RT5645_CAPLESS_EN (0x1 << 11) 2491319b2f6SOder Chiou #define RT5645_CBJ_DET_MODE (0x1 << 7) 2501319b2f6SOder Chiou 2511319b2f6SOder Chiou /* IN1 Control 3 (0x0c) */ 2521319b2f6SOder Chiou #define RT5645_CBJ_TIE_G_L (0x1 << 15) 2531319b2f6SOder Chiou #define RT5645_CBJ_TIE_G_R (0x1 << 14) 2541319b2f6SOder Chiou 2551319b2f6SOder Chiou /* IN2 Control (0x0d) */ 2561319b2f6SOder Chiou #define RT5645_BST_MASK1 (0xf<<12) 2571319b2f6SOder Chiou #define RT5645_BST_SFT1 12 2581319b2f6SOder Chiou #define RT5645_BST_MASK2 (0xf<<8) 2591319b2f6SOder Chiou #define RT5645_BST_SFT2 8 2601319b2f6SOder Chiou #define RT5645_IN_DF2 (0x1 << 6) 2611319b2f6SOder Chiou #define RT5645_IN_SFT2 6 2621319b2f6SOder Chiou 2631319b2f6SOder Chiou /* INL and INR Volume Control (0x0f) */ 2641319b2f6SOder Chiou #define RT5645_INL_SEL_MASK (0x1 << 15) 2651319b2f6SOder Chiou #define RT5645_INL_SEL_SFT 15 2661319b2f6SOder Chiou #define RT5645_INL_SEL_IN4P (0x0 << 15) 2671319b2f6SOder Chiou #define RT5645_INL_SEL_MONOP (0x1 << 15) 2681319b2f6SOder Chiou #define RT5645_INL_VOL_MASK (0x1f << 8) 2691319b2f6SOder Chiou #define RT5645_INL_VOL_SFT 8 2701319b2f6SOder Chiou #define RT5645_INR_SEL_MASK (0x1 << 7) 2711319b2f6SOder Chiou #define RT5645_INR_SEL_SFT 7 2721319b2f6SOder Chiou #define RT5645_INR_SEL_IN4N (0x0 << 7) 2731319b2f6SOder Chiou #define RT5645_INR_SEL_MONON (0x1 << 7) 2741319b2f6SOder Chiou #define RT5645_INR_VOL_MASK (0x1f) 2751319b2f6SOder Chiou #define RT5645_INR_VOL_SFT 0 2761319b2f6SOder Chiou 2771319b2f6SOder Chiou /* DAC1 Digital Volume (0x19) */ 2781319b2f6SOder Chiou #define RT5645_DAC_L1_VOL_MASK (0xff << 8) 2791319b2f6SOder Chiou #define RT5645_DAC_L1_VOL_SFT 8 2801319b2f6SOder Chiou #define RT5645_DAC_R1_VOL_MASK (0xff) 2811319b2f6SOder Chiou #define RT5645_DAC_R1_VOL_SFT 0 2821319b2f6SOder Chiou 2831319b2f6SOder Chiou /* DAC2 Digital Volume (0x1a) */ 2841319b2f6SOder Chiou #define RT5645_DAC_L2_VOL_MASK (0xff << 8) 2851319b2f6SOder Chiou #define RT5645_DAC_L2_VOL_SFT 8 2861319b2f6SOder Chiou #define RT5645_DAC_R2_VOL_MASK (0xff) 2871319b2f6SOder Chiou #define RT5645_DAC_R2_VOL_SFT 0 2881319b2f6SOder Chiou 2891319b2f6SOder Chiou /* DAC2 Control (0x1b) */ 2901319b2f6SOder Chiou #define RT5645_M_DAC_L2_VOL (0x1 << 13) 2911319b2f6SOder Chiou #define RT5645_M_DAC_L2_VOL_SFT 13 2921319b2f6SOder Chiou #define RT5645_M_DAC_R2_VOL (0x1 << 12) 2931319b2f6SOder Chiou #define RT5645_M_DAC_R2_VOL_SFT 12 2941319b2f6SOder Chiou #define RT5645_DAC2_L_SEL_MASK (0x7 << 4) 2951319b2f6SOder Chiou #define RT5645_DAC2_L_SEL_SFT 4 2961319b2f6SOder Chiou #define RT5645_DAC2_R_SEL_MASK (0x7 << 0) 2971319b2f6SOder Chiou #define RT5645_DAC2_R_SEL_SFT 0 2981319b2f6SOder Chiou 2991319b2f6SOder Chiou /* ADC Digital Volume Control (0x1c) */ 3001319b2f6SOder Chiou #define RT5645_ADC_L_VOL_MASK (0x7f << 8) 3011319b2f6SOder Chiou #define RT5645_ADC_L_VOL_SFT 8 3021319b2f6SOder Chiou #define RT5645_ADC_R_VOL_MASK (0x7f) 3031319b2f6SOder Chiou #define RT5645_ADC_R_VOL_SFT 0 3041319b2f6SOder Chiou 3051319b2f6SOder Chiou /* Mono ADC Digital Volume Control (0x1d) */ 3061319b2f6SOder Chiou #define RT5645_MONO_ADC_L_VOL_MASK (0x7f << 8) 3071319b2f6SOder Chiou #define RT5645_MONO_ADC_L_VOL_SFT 8 3081319b2f6SOder Chiou #define RT5645_MONO_ADC_R_VOL_MASK (0x7f) 3091319b2f6SOder Chiou #define RT5645_MONO_ADC_R_VOL_SFT 0 3101319b2f6SOder Chiou 3111319b2f6SOder Chiou /* ADC Boost Volume Control (0x1e) */ 3121319b2f6SOder Chiou #define RT5645_STO1_ADC_L_BST_MASK (0x3 << 14) 3131319b2f6SOder Chiou #define RT5645_STO1_ADC_L_BST_SFT 14 3141319b2f6SOder Chiou #define RT5645_STO1_ADC_R_BST_MASK (0x3 << 12) 3151319b2f6SOder Chiou #define RT5645_STO1_ADC_R_BST_SFT 12 3161319b2f6SOder Chiou #define RT5645_STO1_ADC_COMP_MASK (0x3 << 10) 3171319b2f6SOder Chiou #define RT5645_STO1_ADC_COMP_SFT 10 3181319b2f6SOder Chiou #define RT5645_STO2_ADC_L_BST_MASK (0x3 << 8) 3191319b2f6SOder Chiou #define RT5645_STO2_ADC_L_BST_SFT 8 3201319b2f6SOder Chiou #define RT5645_STO2_ADC_R_BST_MASK (0x3 << 6) 3211319b2f6SOder Chiou #define RT5645_STO2_ADC_R_BST_SFT 6 3221319b2f6SOder Chiou #define RT5645_STO2_ADC_COMP_MASK (0x3 << 4) 3231319b2f6SOder Chiou #define RT5645_STO2_ADC_COMP_SFT 4 3241319b2f6SOder Chiou 3251319b2f6SOder Chiou /* Stereo2 ADC Mixer Control (0x26) */ 3261319b2f6SOder Chiou #define RT5645_STO2_ADC_SRC_MASK (0x1 << 15) 3271319b2f6SOder Chiou #define RT5645_STO2_ADC_SRC_SFT 15 3281319b2f6SOder Chiou 3291319b2f6SOder Chiou /* Stereo ADC Mixer Control (0x27) */ 3301319b2f6SOder Chiou #define RT5645_M_ADC_L1 (0x1 << 14) 3311319b2f6SOder Chiou #define RT5645_M_ADC_L1_SFT 14 3321319b2f6SOder Chiou #define RT5645_M_ADC_L2 (0x1 << 13) 3331319b2f6SOder Chiou #define RT5645_M_ADC_L2_SFT 13 3341319b2f6SOder Chiou #define RT5645_ADC_1_SRC_MASK (0x1 << 12) 3351319b2f6SOder Chiou #define RT5645_ADC_1_SRC_SFT 12 3361319b2f6SOder Chiou #define RT5645_ADC_1_SRC_ADC (0x1 << 12) 3371319b2f6SOder Chiou #define RT5645_ADC_1_SRC_DACMIX (0x0 << 12) 3381319b2f6SOder Chiou #define RT5645_ADC_2_SRC_MASK (0x1 << 11) 3391319b2f6SOder Chiou #define RT5645_ADC_2_SRC_SFT 11 3401319b2f6SOder Chiou #define RT5645_DMIC_SRC_MASK (0x1 << 8) 3411319b2f6SOder Chiou #define RT5645_DMIC_SRC_SFT 8 3421319b2f6SOder Chiou #define RT5645_M_ADC_R1 (0x1 << 6) 3431319b2f6SOder Chiou #define RT5645_M_ADC_R1_SFT 6 3441319b2f6SOder Chiou #define RT5645_M_ADC_R2 (0x1 << 5) 3451319b2f6SOder Chiou #define RT5645_M_ADC_R2_SFT 5 3461319b2f6SOder Chiou #define RT5645_DMIC3_SRC_MASK (0x1 << 1) 3471319b2f6SOder Chiou #define RT5645_DMIC3_SRC_SFT 0 3481319b2f6SOder Chiou 3491319b2f6SOder Chiou /* Mono ADC Mixer Control (0x28) */ 3501319b2f6SOder Chiou #define RT5645_M_MONO_ADC_L1 (0x1 << 14) 3511319b2f6SOder Chiou #define RT5645_M_MONO_ADC_L1_SFT 14 3521319b2f6SOder Chiou #define RT5645_M_MONO_ADC_L2 (0x1 << 13) 3531319b2f6SOder Chiou #define RT5645_M_MONO_ADC_L2_SFT 13 3541319b2f6SOder Chiou #define RT5645_MONO_ADC_L1_SRC_MASK (0x1 << 12) 3551319b2f6SOder Chiou #define RT5645_MONO_ADC_L1_SRC_SFT 12 3561319b2f6SOder Chiou #define RT5645_MONO_ADC_L1_SRC_DACMIXL (0x0 << 12) 3571319b2f6SOder Chiou #define RT5645_MONO_ADC_L1_SRC_ADCL (0x1 << 12) 3581319b2f6SOder Chiou #define RT5645_MONO_ADC_L2_SRC_MASK (0x1 << 11) 3591319b2f6SOder Chiou #define RT5645_MONO_ADC_L2_SRC_SFT 11 3601319b2f6SOder Chiou #define RT5645_MONO_DMIC_L_SRC_MASK (0x1 << 8) 3611319b2f6SOder Chiou #define RT5645_MONO_DMIC_L_SRC_SFT 8 3621319b2f6SOder Chiou #define RT5645_M_MONO_ADC_R1 (0x1 << 6) 3631319b2f6SOder Chiou #define RT5645_M_MONO_ADC_R1_SFT 6 3641319b2f6SOder Chiou #define RT5645_M_MONO_ADC_R2 (0x1 << 5) 3651319b2f6SOder Chiou #define RT5645_M_MONO_ADC_R2_SFT 5 3661319b2f6SOder Chiou #define RT5645_MONO_ADC_R1_SRC_MASK (0x1 << 4) 3671319b2f6SOder Chiou #define RT5645_MONO_ADC_R1_SRC_SFT 4 3681319b2f6SOder Chiou #define RT5645_MONO_ADC_R1_SRC_ADCR (0x1 << 4) 3691319b2f6SOder Chiou #define RT5645_MONO_ADC_R1_SRC_DACMIXR (0x0 << 4) 3701319b2f6SOder Chiou #define RT5645_MONO_ADC_R2_SRC_MASK (0x1 << 3) 3711319b2f6SOder Chiou #define RT5645_MONO_ADC_R2_SRC_SFT 3 3721319b2f6SOder Chiou #define RT5645_MONO_DMIC_R_SRC_MASK (0x3) 3731319b2f6SOder Chiou #define RT5645_MONO_DMIC_R_SRC_SFT 0 3741319b2f6SOder Chiou 3751319b2f6SOder Chiou /* ADC Mixer to DAC Mixer Control (0x29) */ 3761319b2f6SOder Chiou #define RT5645_M_ADCMIX_L (0x1 << 15) 3771319b2f6SOder Chiou #define RT5645_M_ADCMIX_L_SFT 15 3781319b2f6SOder Chiou #define RT5645_M_DAC1_L (0x1 << 14) 3791319b2f6SOder Chiou #define RT5645_M_DAC1_L_SFT 14 3801319b2f6SOder Chiou #define RT5645_DAC1_R_SEL_MASK (0x3 << 10) 3811319b2f6SOder Chiou #define RT5645_DAC1_R_SEL_SFT 10 3821319b2f6SOder Chiou #define RT5645_DAC1_R_SEL_IF1 (0x0 << 10) 3831319b2f6SOder Chiou #define RT5645_DAC1_R_SEL_IF2 (0x1 << 10) 3841319b2f6SOder Chiou #define RT5645_DAC1_R_SEL_IF3 (0x2 << 10) 3851319b2f6SOder Chiou #define RT5645_DAC1_R_SEL_IF4 (0x3 << 10) 3861319b2f6SOder Chiou #define RT5645_DAC1_L_SEL_MASK (0x3 << 8) 3871319b2f6SOder Chiou #define RT5645_DAC1_L_SEL_SFT 8 3881319b2f6SOder Chiou #define RT5645_DAC1_L_SEL_IF1 (0x0 << 8) 3891319b2f6SOder Chiou #define RT5645_DAC1_L_SEL_IF2 (0x1 << 8) 3901319b2f6SOder Chiou #define RT5645_DAC1_L_SEL_IF3 (0x2 << 8) 3911319b2f6SOder Chiou #define RT5645_DAC1_L_SEL_IF4 (0x3 << 8) 3921319b2f6SOder Chiou #define RT5645_M_ADCMIX_R (0x1 << 7) 3931319b2f6SOder Chiou #define RT5645_M_ADCMIX_R_SFT 7 3941319b2f6SOder Chiou #define RT5645_M_DAC1_R (0x1 << 6) 3951319b2f6SOder Chiou #define RT5645_M_DAC1_R_SFT 6 3961319b2f6SOder Chiou 3971319b2f6SOder Chiou /* Stereo DAC Mixer Control (0x2a) */ 3981319b2f6SOder Chiou #define RT5645_M_DAC_L1 (0x1 << 14) 3991319b2f6SOder Chiou #define RT5645_M_DAC_L1_SFT 14 4001319b2f6SOder Chiou #define RT5645_DAC_L1_STO_L_VOL_MASK (0x1 << 13) 4011319b2f6SOder Chiou #define RT5645_DAC_L1_STO_L_VOL_SFT 13 4021319b2f6SOder Chiou #define RT5645_M_DAC_L2 (0x1 << 12) 4031319b2f6SOder Chiou #define RT5645_M_DAC_L2_SFT 12 4041319b2f6SOder Chiou #define RT5645_DAC_L2_STO_L_VOL_MASK (0x1 << 11) 4051319b2f6SOder Chiou #define RT5645_DAC_L2_STO_L_VOL_SFT 11 4061319b2f6SOder Chiou #define RT5645_M_ANC_DAC_L (0x1 << 10) 4071319b2f6SOder Chiou #define RT5645_M_ANC_DAC_L_SFT 10 4081319b2f6SOder Chiou #define RT5645_M_DAC_R1_STO_L (0x1 << 9) 4091319b2f6SOder Chiou #define RT5645_M_DAC_R1_STO_L_SFT 9 4101319b2f6SOder Chiou #define RT5645_DAC_R1_STO_L_VOL_MASK (0x1 << 8) 4111319b2f6SOder Chiou #define RT5645_DAC_R1_STO_L_VOL_SFT 8 4121319b2f6SOder Chiou #define RT5645_M_DAC_R1 (0x1 << 6) 4131319b2f6SOder Chiou #define RT5645_M_DAC_R1_SFT 6 4141319b2f6SOder Chiou #define RT5645_DAC_R1_STO_R_VOL_MASK (0x1 << 5) 4151319b2f6SOder Chiou #define RT5645_DAC_R1_STO_R_VOL_SFT 5 4161319b2f6SOder Chiou #define RT5645_M_DAC_R2 (0x1 << 4) 4171319b2f6SOder Chiou #define RT5645_M_DAC_R2_SFT 4 4181319b2f6SOder Chiou #define RT5645_DAC_R2_STO_R_VOL_MASK (0x1 << 3) 4191319b2f6SOder Chiou #define RT5645_DAC_R2_STO_R_VOL_SFT 3 4201319b2f6SOder Chiou #define RT5645_M_ANC_DAC_R (0x1 << 2) 4211319b2f6SOder Chiou #define RT5645_M_ANC_DAC_R_SFT 2 4221319b2f6SOder Chiou #define RT5645_M_DAC_L1_STO_R (0x1 << 1) 4231319b2f6SOder Chiou #define RT5645_M_DAC_L1_STO_R_SFT 1 4241319b2f6SOder Chiou #define RT5645_DAC_L1_STO_R_VOL_MASK (0x1) 4251319b2f6SOder Chiou #define RT5645_DAC_L1_STO_R_VOL_SFT 0 4261319b2f6SOder Chiou 4271319b2f6SOder Chiou /* Mono DAC Mixer Control (0x2b) */ 4281319b2f6SOder Chiou #define RT5645_M_DAC_L1_MONO_L (0x1 << 14) 4291319b2f6SOder Chiou #define RT5645_M_DAC_L1_MONO_L_SFT 14 4301319b2f6SOder Chiou #define RT5645_DAC_L1_MONO_L_VOL_MASK (0x1 << 13) 4311319b2f6SOder Chiou #define RT5645_DAC_L1_MONO_L_VOL_SFT 13 4321319b2f6SOder Chiou #define RT5645_M_DAC_L2_MONO_L (0x1 << 12) 4331319b2f6SOder Chiou #define RT5645_M_DAC_L2_MONO_L_SFT 12 4341319b2f6SOder Chiou #define RT5645_DAC_L2_MONO_L_VOL_MASK (0x1 << 11) 4351319b2f6SOder Chiou #define RT5645_DAC_L2_MONO_L_VOL_SFT 11 4361319b2f6SOder Chiou #define RT5645_M_DAC_R2_MONO_L (0x1 << 10) 4371319b2f6SOder Chiou #define RT5645_M_DAC_R2_MONO_L_SFT 10 4381319b2f6SOder Chiou #define RT5645_DAC_R2_MONO_L_VOL_MASK (0x1 << 9) 4391319b2f6SOder Chiou #define RT5645_DAC_R2_MONO_L_VOL_SFT 9 4401319b2f6SOder Chiou #define RT5645_M_DAC_R1_MONO_R (0x1 << 6) 4411319b2f6SOder Chiou #define RT5645_M_DAC_R1_MONO_R_SFT 6 4421319b2f6SOder Chiou #define RT5645_DAC_R1_MONO_R_VOL_MASK (0x1 << 5) 4431319b2f6SOder Chiou #define RT5645_DAC_R1_MONO_R_VOL_SFT 5 4441319b2f6SOder Chiou #define RT5645_M_DAC_R2_MONO_R (0x1 << 4) 4451319b2f6SOder Chiou #define RT5645_M_DAC_R2_MONO_R_SFT 4 4461319b2f6SOder Chiou #define RT5645_DAC_R2_MONO_R_VOL_MASK (0x1 << 3) 4471319b2f6SOder Chiou #define RT5645_DAC_R2_MONO_R_VOL_SFT 3 4481319b2f6SOder Chiou #define RT5645_M_DAC_L2_MONO_R (0x1 << 2) 4491319b2f6SOder Chiou #define RT5645_M_DAC_L2_MONO_R_SFT 2 4501319b2f6SOder Chiou #define RT5645_DAC_L2_MONO_R_VOL_MASK (0x1 << 1) 4511319b2f6SOder Chiou #define RT5645_DAC_L2_MONO_R_VOL_SFT 1 4521319b2f6SOder Chiou 4531319b2f6SOder Chiou /* Digital Mixer Control (0x2c) */ 4541319b2f6SOder Chiou #define RT5645_M_STO_L_DAC_L (0x1 << 15) 4551319b2f6SOder Chiou #define RT5645_M_STO_L_DAC_L_SFT 15 4561319b2f6SOder Chiou #define RT5645_STO_L_DAC_L_VOL_MASK (0x1 << 14) 4571319b2f6SOder Chiou #define RT5645_STO_L_DAC_L_VOL_SFT 14 4581319b2f6SOder Chiou #define RT5645_M_DAC_L2_DAC_L (0x1 << 13) 4591319b2f6SOder Chiou #define RT5645_M_DAC_L2_DAC_L_SFT 13 4601319b2f6SOder Chiou #define RT5645_DAC_L2_DAC_L_VOL_MASK (0x1 << 12) 4611319b2f6SOder Chiou #define RT5645_DAC_L2_DAC_L_VOL_SFT 12 4621319b2f6SOder Chiou #define RT5645_M_STO_R_DAC_R (0x1 << 11) 4631319b2f6SOder Chiou #define RT5645_M_STO_R_DAC_R_SFT 11 4641319b2f6SOder Chiou #define RT5645_STO_R_DAC_R_VOL_MASK (0x1 << 10) 4651319b2f6SOder Chiou #define RT5645_STO_R_DAC_R_VOL_SFT 10 4661319b2f6SOder Chiou #define RT5645_M_DAC_R2_DAC_R (0x1 << 9) 4671319b2f6SOder Chiou #define RT5645_M_DAC_R2_DAC_R_SFT 9 4681319b2f6SOder Chiou #define RT5645_DAC_R2_DAC_R_VOL_MASK (0x1 << 8) 4691319b2f6SOder Chiou #define RT5645_DAC_R2_DAC_R_VOL_SFT 8 4701319b2f6SOder Chiou #define RT5645_M_DAC_R2_DAC_L (0x1 << 7) 4711319b2f6SOder Chiou #define RT5645_M_DAC_R2_DAC_L_SFT 7 4721319b2f6SOder Chiou #define RT5645_DAC_R2_DAC_L_VOL_MASK (0x1 << 6) 4731319b2f6SOder Chiou #define RT5645_DAC_R2_DAC_L_VOL_SFT 6 4741319b2f6SOder Chiou #define RT5645_M_DAC_L2_DAC_R (0x1 << 5) 4751319b2f6SOder Chiou #define RT5645_M_DAC_L2_DAC_R_SFT 5 4761319b2f6SOder Chiou #define RT5645_DAC_L2_DAC_R_VOL_MASK (0x1 << 4) 4771319b2f6SOder Chiou #define RT5645_DAC_L2_DAC_R_VOL_SFT 4 4781319b2f6SOder Chiou 4795c4ca99dSBard Liao /* Analog DAC1/2 Input Source Control (0x2d) */ 4805c4ca99dSBard Liao #define RT5650_A_DAC1_L_IN_SFT 3 4815c4ca99dSBard Liao #define RT5650_A_DAC1_R_IN_SFT 2 4825c4ca99dSBard Liao #define RT5650_A_DAC2_L_IN_SFT 1 4835c4ca99dSBard Liao #define RT5650_A_DAC2_R_IN_SFT 0 4845c4ca99dSBard Liao 4851319b2f6SOder Chiou /* Digital Interface Data Control (0x2f) */ 4861319b2f6SOder Chiou #define RT5645_IF1_ADC2_IN_SEL (0x1 << 15) 4871319b2f6SOder Chiou #define RT5645_IF1_ADC2_IN_SFT 15 4881319b2f6SOder Chiou #define RT5645_IF2_ADC_IN_MASK (0x7 << 12) 4891319b2f6SOder Chiou #define RT5645_IF2_ADC_IN_SFT 12 4901319b2f6SOder Chiou #define RT5645_IF2_DAC_SEL_MASK (0x3 << 10) 4911319b2f6SOder Chiou #define RT5645_IF2_DAC_SEL_SFT 10 4921319b2f6SOder Chiou #define RT5645_IF2_ADC_SEL_MASK (0x3 << 8) 4931319b2f6SOder Chiou #define RT5645_IF2_ADC_SEL_SFT 8 4941319b2f6SOder Chiou #define RT5645_IF3_DAC_SEL_MASK (0x3 << 6) 4951319b2f6SOder Chiou #define RT5645_IF3_DAC_SEL_SFT 6 4961319b2f6SOder Chiou #define RT5645_IF3_ADC_SEL_MASK (0x3 << 4) 4971319b2f6SOder Chiou #define RT5645_IF3_ADC_SEL_SFT 4 4981319b2f6SOder Chiou #define RT5645_IF3_ADC_IN_MASK (0x7) 4991319b2f6SOder Chiou #define RT5645_IF3_ADC_IN_SFT 0 5001319b2f6SOder Chiou 5011319b2f6SOder Chiou /* PDM Output Control (0x31) */ 5021319b2f6SOder Chiou #define RT5645_PDM1_L_MASK (0x1 << 15) 5031319b2f6SOder Chiou #define RT5645_PDM1_L_SFT 15 5041319b2f6SOder Chiou #define RT5645_M_PDM1_L (0x1 << 14) 5051319b2f6SOder Chiou #define RT5645_M_PDM1_L_SFT 14 5061319b2f6SOder Chiou #define RT5645_PDM1_R_MASK (0x1 << 13) 5071319b2f6SOder Chiou #define RT5645_PDM1_R_SFT 13 5081319b2f6SOder Chiou #define RT5645_M_PDM1_R (0x1 << 12) 5091319b2f6SOder Chiou #define RT5645_M_PDM1_R_SFT 12 5101319b2f6SOder Chiou #define RT5645_PDM2_L_MASK (0x1 << 11) 5111319b2f6SOder Chiou #define RT5645_PDM2_L_SFT 11 5121319b2f6SOder Chiou #define RT5645_M_PDM2_L (0x1 << 10) 5131319b2f6SOder Chiou #define RT5645_M_PDM2_L_SFT 10 5141319b2f6SOder Chiou #define RT5645_PDM2_R_MASK (0x1 << 9) 5151319b2f6SOder Chiou #define RT5645_PDM2_R_SFT 9 5161319b2f6SOder Chiou #define RT5645_M_PDM2_R (0x1 << 8) 5171319b2f6SOder Chiou #define RT5645_M_PDM2_R_SFT 8 5181319b2f6SOder Chiou #define RT5645_PDM2_BUSY (0x1 << 7) 5191319b2f6SOder Chiou #define RT5645_PDM1_BUSY (0x1 << 6) 5201319b2f6SOder Chiou #define RT5645_PDM_PATTERN (0x1 << 5) 5211319b2f6SOder Chiou #define RT5645_PDM_GAIN (0x1 << 4) 5221319b2f6SOder Chiou #define RT5645_PDM_DIV_MASK (0x3) 5231319b2f6SOder Chiou 5241319b2f6SOder Chiou /* REC Left Mixer Control 1 (0x3b) */ 5251319b2f6SOder Chiou #define RT5645_G_HP_L_RM_L_MASK (0x7 << 13) 5261319b2f6SOder Chiou #define RT5645_G_HP_L_RM_L_SFT 13 5271319b2f6SOder Chiou #define RT5645_G_IN_L_RM_L_MASK (0x7 << 10) 5281319b2f6SOder Chiou #define RT5645_G_IN_L_RM_L_SFT 10 5291319b2f6SOder Chiou #define RT5645_G_BST4_RM_L_MASK (0x7 << 7) 5301319b2f6SOder Chiou #define RT5645_G_BST4_RM_L_SFT 7 5311319b2f6SOder Chiou #define RT5645_G_BST3_RM_L_MASK (0x7 << 4) 5321319b2f6SOder Chiou #define RT5645_G_BST3_RM_L_SFT 4 5331319b2f6SOder Chiou #define RT5645_G_BST2_RM_L_MASK (0x7 << 1) 5341319b2f6SOder Chiou #define RT5645_G_BST2_RM_L_SFT 1 5351319b2f6SOder Chiou 5361319b2f6SOder Chiou /* REC Left Mixer Control 2 (0x3c) */ 5371319b2f6SOder Chiou #define RT5645_G_BST1_RM_L_MASK (0x7 << 13) 5381319b2f6SOder Chiou #define RT5645_G_BST1_RM_L_SFT 13 5391319b2f6SOder Chiou #define RT5645_G_OM_L_RM_L_MASK (0x7 << 10) 5401319b2f6SOder Chiou #define RT5645_G_OM_L_RM_L_SFT 10 5411319b2f6SOder Chiou #define RT5645_M_MM_L_RM_L (0x1 << 6) 5421319b2f6SOder Chiou #define RT5645_M_MM_L_RM_L_SFT 6 5431319b2f6SOder Chiou #define RT5645_M_IN_L_RM_L (0x1 << 5) 5441319b2f6SOder Chiou #define RT5645_M_IN_L_RM_L_SFT 5 5451319b2f6SOder Chiou #define RT5645_M_HP_L_RM_L (0x1 << 4) 5461319b2f6SOder Chiou #define RT5645_M_HP_L_RM_L_SFT 4 5471319b2f6SOder Chiou #define RT5645_M_BST3_RM_L (0x1 << 3) 5481319b2f6SOder Chiou #define RT5645_M_BST3_RM_L_SFT 3 5491319b2f6SOder Chiou #define RT5645_M_BST2_RM_L (0x1 << 2) 5501319b2f6SOder Chiou #define RT5645_M_BST2_RM_L_SFT 2 5511319b2f6SOder Chiou #define RT5645_M_BST1_RM_L (0x1 << 1) 5521319b2f6SOder Chiou #define RT5645_M_BST1_RM_L_SFT 1 5531319b2f6SOder Chiou #define RT5645_M_OM_L_RM_L (0x1) 5541319b2f6SOder Chiou #define RT5645_M_OM_L_RM_L_SFT 0 5551319b2f6SOder Chiou 5561319b2f6SOder Chiou /* REC Right Mixer Control 1 (0x3d) */ 5571319b2f6SOder Chiou #define RT5645_G_HP_R_RM_R_MASK (0x7 << 13) 5581319b2f6SOder Chiou #define RT5645_G_HP_R_RM_R_SFT 13 5591319b2f6SOder Chiou #define RT5645_G_IN_R_RM_R_MASK (0x7 << 10) 5601319b2f6SOder Chiou #define RT5645_G_IN_R_RM_R_SFT 10 5611319b2f6SOder Chiou #define RT5645_G_BST4_RM_R_MASK (0x7 << 7) 5621319b2f6SOder Chiou #define RT5645_G_BST4_RM_R_SFT 7 5631319b2f6SOder Chiou #define RT5645_G_BST3_RM_R_MASK (0x7 << 4) 5641319b2f6SOder Chiou #define RT5645_G_BST3_RM_R_SFT 4 5651319b2f6SOder Chiou #define RT5645_G_BST2_RM_R_MASK (0x7 << 1) 5661319b2f6SOder Chiou #define RT5645_G_BST2_RM_R_SFT 1 5671319b2f6SOder Chiou 5681319b2f6SOder Chiou /* REC Right Mixer Control 2 (0x3e) */ 5691319b2f6SOder Chiou #define RT5645_G_BST1_RM_R_MASK (0x7 << 13) 5701319b2f6SOder Chiou #define RT5645_G_BST1_RM_R_SFT 13 5711319b2f6SOder Chiou #define RT5645_G_OM_R_RM_R_MASK (0x7 << 10) 5721319b2f6SOder Chiou #define RT5645_G_OM_R_RM_R_SFT 10 5731319b2f6SOder Chiou #define RT5645_M_MM_R_RM_R (0x1 << 6) 5741319b2f6SOder Chiou #define RT5645_M_MM_R_RM_R_SFT 6 5751319b2f6SOder Chiou #define RT5645_M_IN_R_RM_R (0x1 << 5) 5761319b2f6SOder Chiou #define RT5645_M_IN_R_RM_R_SFT 5 5771319b2f6SOder Chiou #define RT5645_M_HP_R_RM_R (0x1 << 4) 5781319b2f6SOder Chiou #define RT5645_M_HP_R_RM_R_SFT 4 5791319b2f6SOder Chiou #define RT5645_M_BST3_RM_R (0x1 << 3) 5801319b2f6SOder Chiou #define RT5645_M_BST3_RM_R_SFT 3 5811319b2f6SOder Chiou #define RT5645_M_BST2_RM_R (0x1 << 2) 5821319b2f6SOder Chiou #define RT5645_M_BST2_RM_R_SFT 2 5831319b2f6SOder Chiou #define RT5645_M_BST1_RM_R (0x1 << 1) 5841319b2f6SOder Chiou #define RT5645_M_BST1_RM_R_SFT 1 5851319b2f6SOder Chiou #define RT5645_M_OM_R_RM_R (0x1) 5861319b2f6SOder Chiou #define RT5645_M_OM_R_RM_R_SFT 0 5871319b2f6SOder Chiou 5881319b2f6SOder Chiou /* HPOMIX Control (0x40) (0x42) */ 5891319b2f6SOder Chiou #define RT5645_M_BST1_HV (0x1 << 4) 5901319b2f6SOder Chiou #define RT5645_M_BST1_HV_SFT 4 5911319b2f6SOder Chiou #define RT5645_M_BST2_HV (0x1 << 4) 5921319b2f6SOder Chiou #define RT5645_M_BST2_HV_SFT 4 5931319b2f6SOder Chiou #define RT5645_M_BST3_HV (0x1 << 3) 5941319b2f6SOder Chiou #define RT5645_M_BST3_HV_SFT 3 5951319b2f6SOder Chiou #define RT5645_M_IN_HV (0x1 << 2) 5961319b2f6SOder Chiou #define RT5645_M_IN_HV_SFT 2 5971319b2f6SOder Chiou #define RT5645_M_DAC2_HV (0x1 << 1) 5981319b2f6SOder Chiou #define RT5645_M_DAC2_HV_SFT 1 5991319b2f6SOder Chiou #define RT5645_M_DAC1_HV (0x1 << 0) 6001319b2f6SOder Chiou #define RT5645_M_DAC1_HV_SFT 0 6011319b2f6SOder Chiou 6021319b2f6SOder Chiou /* HPMIX Control (0x45) */ 6031319b2f6SOder Chiou #define RT5645_M_DAC1_HM (0x1 << 14) 6041319b2f6SOder Chiou #define RT5645_M_DAC1_HM_SFT 14 6051319b2f6SOder Chiou #define RT5645_M_HPVOL_HM (0x1 << 13) 6061319b2f6SOder Chiou #define RT5645_M_HPVOL_HM_SFT 13 6072d4e2d02SBard Liao #define RT5645_IRQ_PSV_MODE (0x1 << 12) 6081319b2f6SOder Chiou 6091319b2f6SOder Chiou /* SPK Left Mixer Control (0x46) */ 6101319b2f6SOder Chiou #define RT5645_G_RM_L_SM_L_MASK (0x3 << 14) 6111319b2f6SOder Chiou #define RT5645_G_RM_L_SM_L_SFT 14 6121319b2f6SOder Chiou #define RT5645_G_IN_L_SM_L_MASK (0x3 << 12) 6131319b2f6SOder Chiou #define RT5645_G_IN_L_SM_L_SFT 12 6141319b2f6SOder Chiou #define RT5645_G_DAC_L1_SM_L_MASK (0x3 << 10) 6151319b2f6SOder Chiou #define RT5645_G_DAC_L1_SM_L_SFT 10 6161319b2f6SOder Chiou #define RT5645_G_DAC_L2_SM_L_MASK (0x3 << 8) 6171319b2f6SOder Chiou #define RT5645_G_DAC_L2_SM_L_SFT 8 6181319b2f6SOder Chiou #define RT5645_G_OM_L_SM_L_MASK (0x3 << 6) 6191319b2f6SOder Chiou #define RT5645_G_OM_L_SM_L_SFT 6 6201319b2f6SOder Chiou #define RT5645_M_BST1_L_SM_L (0x1 << 5) 6211319b2f6SOder Chiou #define RT5645_M_BST1_L_SM_L_SFT 5 6221319b2f6SOder Chiou #define RT5645_M_IN_L_SM_L (0x1 << 3) 6231319b2f6SOder Chiou #define RT5645_M_IN_L_SM_L_SFT 3 6241319b2f6SOder Chiou #define RT5645_M_DAC_L1_SM_L (0x1 << 1) 6251319b2f6SOder Chiou #define RT5645_M_DAC_L1_SM_L_SFT 1 6261319b2f6SOder Chiou #define RT5645_M_DAC_L2_SM_L (0x1 << 2) 6271319b2f6SOder Chiou #define RT5645_M_DAC_L2_SM_L_SFT 2 6281319b2f6SOder Chiou #define RT5645_M_BST3_L_SM_L (0x1 << 4) 6291319b2f6SOder Chiou #define RT5645_M_BST3_L_SM_L_SFT 4 6301319b2f6SOder Chiou 6311319b2f6SOder Chiou /* SPK Right Mixer Control (0x47) */ 6321319b2f6SOder Chiou #define RT5645_G_RM_R_SM_R_MASK (0x3 << 14) 6331319b2f6SOder Chiou #define RT5645_G_RM_R_SM_R_SFT 14 6341319b2f6SOder Chiou #define RT5645_G_IN_R_SM_R_MASK (0x3 << 12) 6351319b2f6SOder Chiou #define RT5645_G_IN_R_SM_R_SFT 12 6361319b2f6SOder Chiou #define RT5645_G_DAC_R1_SM_R_MASK (0x3 << 10) 6371319b2f6SOder Chiou #define RT5645_G_DAC_R1_SM_R_SFT 10 6381319b2f6SOder Chiou #define RT5645_G_DAC_R2_SM_R_MASK (0x3 << 8) 6391319b2f6SOder Chiou #define RT5645_G_DAC_R2_SM_R_SFT 8 6401319b2f6SOder Chiou #define RT5645_G_OM_R_SM_R_MASK (0x3 << 6) 6411319b2f6SOder Chiou #define RT5645_G_OM_R_SM_R_SFT 6 6421319b2f6SOder Chiou #define RT5645_M_BST2_R_SM_R (0x1 << 5) 6431319b2f6SOder Chiou #define RT5645_M_BST2_R_SM_R_SFT 5 6441319b2f6SOder Chiou #define RT5645_M_IN_R_SM_R (0x1 << 3) 6451319b2f6SOder Chiou #define RT5645_M_IN_R_SM_R_SFT 3 6461319b2f6SOder Chiou #define RT5645_M_DAC_R1_SM_R (0x1 << 1) 6471319b2f6SOder Chiou #define RT5645_M_DAC_R1_SM_R_SFT 1 6481319b2f6SOder Chiou #define RT5645_M_DAC_R2_SM_R (0x1 << 2) 6491319b2f6SOder Chiou #define RT5645_M_DAC_R2_SM_R_SFT 2 6501319b2f6SOder Chiou #define RT5645_M_BST3_R_SM_R (0x1 << 4) 6511319b2f6SOder Chiou #define RT5645_M_BST3_R_SM_R_SFT 4 6521319b2f6SOder Chiou 6531319b2f6SOder Chiou /* SPOLMIX Control (0x48) */ 6541319b2f6SOder Chiou #define RT5645_M_DAC_L1_SPM_L (0x1 << 15) 6551319b2f6SOder Chiou #define RT5645_M_DAC_L1_SPM_L_SFT 15 6561319b2f6SOder Chiou #define RT5645_M_DAC_R1_SPM_L (0x1 << 14) 6571319b2f6SOder Chiou #define RT5645_M_DAC_R1_SPM_L_SFT 14 6581319b2f6SOder Chiou #define RT5645_M_SV_L_SPM_L (0x1 << 13) 6591319b2f6SOder Chiou #define RT5645_M_SV_L_SPM_L_SFT 13 6601319b2f6SOder Chiou #define RT5645_M_SV_R_SPM_L (0x1 << 12) 6611319b2f6SOder Chiou #define RT5645_M_SV_R_SPM_L_SFT 12 6621319b2f6SOder Chiou #define RT5645_M_BST3_SPM_L (0x1 << 11) 6631319b2f6SOder Chiou #define RT5645_M_BST3_SPM_L_SFT 11 6641319b2f6SOder Chiou #define RT5645_M_DAC_R1_SPM_R (0x1 << 2) 6651319b2f6SOder Chiou #define RT5645_M_DAC_R1_SPM_R_SFT 2 6661319b2f6SOder Chiou #define RT5645_M_BST3_SPM_R (0x1 << 1) 6671319b2f6SOder Chiou #define RT5645_M_BST3_SPM_R_SFT 1 6681319b2f6SOder Chiou #define RT5645_M_SV_R_SPM_R (0x1 << 0) 6691319b2f6SOder Chiou #define RT5645_M_SV_R_SPM_R_SFT 0 6701319b2f6SOder Chiou 6711319b2f6SOder Chiou /* Mono Output Mixer Control (0x4c) */ 6721319b2f6SOder Chiou #define RT5645_M_OV_L_MM (0x1 << 9) 6731319b2f6SOder Chiou #define RT5645_M_OV_L_MM_SFT 9 6741319b2f6SOder Chiou #define RT5645_M_DAC_L2_MA (0x1 << 8) 6751319b2f6SOder Chiou #define RT5645_M_DAC_L2_MA_SFT 8 6761319b2f6SOder Chiou #define RT5645_G_MONOMIX_MASK (0x1 << 10) 6771319b2f6SOder Chiou #define RT5645_G_MONOMIX_SFT 10 6781319b2f6SOder Chiou #define RT5645_M_BST2_MM (0x1 << 4) 6791319b2f6SOder Chiou #define RT5645_M_BST2_MM_SFT 4 6801319b2f6SOder Chiou #define RT5645_M_DAC_R1_MM (0x1 << 3) 6811319b2f6SOder Chiou #define RT5645_M_DAC_R1_MM_SFT 3 6821319b2f6SOder Chiou #define RT5645_M_DAC_R2_MM (0x1 << 2) 6831319b2f6SOder Chiou #define RT5645_M_DAC_R2_MM_SFT 2 6841319b2f6SOder Chiou #define RT5645_M_DAC_L2_MM (0x1 << 1) 6851319b2f6SOder Chiou #define RT5645_M_DAC_L2_MM_SFT 1 6861319b2f6SOder Chiou #define RT5645_M_BST3_MM (0x1 << 0) 6871319b2f6SOder Chiou #define RT5645_M_BST3_MM_SFT 0 6881319b2f6SOder Chiou 6891319b2f6SOder Chiou /* Output Left Mixer Control 1 (0x4d) */ 6901319b2f6SOder Chiou #define RT5645_G_BST3_OM_L_MASK (0x7 << 13) 6911319b2f6SOder Chiou #define RT5645_G_BST3_OM_L_SFT 13 6921319b2f6SOder Chiou #define RT5645_G_BST2_OM_L_MASK (0x7 << 10) 6931319b2f6SOder Chiou #define RT5645_G_BST2_OM_L_SFT 10 6941319b2f6SOder Chiou #define RT5645_G_BST1_OM_L_MASK (0x7 << 7) 6951319b2f6SOder Chiou #define RT5645_G_BST1_OM_L_SFT 7 6961319b2f6SOder Chiou #define RT5645_G_IN_L_OM_L_MASK (0x7 << 4) 6971319b2f6SOder Chiou #define RT5645_G_IN_L_OM_L_SFT 4 6981319b2f6SOder Chiou #define RT5645_G_RM_L_OM_L_MASK (0x7 << 1) 6991319b2f6SOder Chiou #define RT5645_G_RM_L_OM_L_SFT 1 7001319b2f6SOder Chiou 7011319b2f6SOder Chiou /* Output Left Mixer Control 2 (0x4e) */ 7021319b2f6SOder Chiou #define RT5645_G_DAC_R2_OM_L_MASK (0x7 << 13) 7031319b2f6SOder Chiou #define RT5645_G_DAC_R2_OM_L_SFT 13 7041319b2f6SOder Chiou #define RT5645_G_DAC_L2_OM_L_MASK (0x7 << 10) 7051319b2f6SOder Chiou #define RT5645_G_DAC_L2_OM_L_SFT 10 7061319b2f6SOder Chiou #define RT5645_G_DAC_L1_OM_L_MASK (0x7 << 7) 7071319b2f6SOder Chiou #define RT5645_G_DAC_L1_OM_L_SFT 7 7081319b2f6SOder Chiou 7091319b2f6SOder Chiou /* Output Left Mixer Control 3 (0x4f) */ 7101319b2f6SOder Chiou #define RT5645_M_BST3_OM_L (0x1 << 4) 7111319b2f6SOder Chiou #define RT5645_M_BST3_OM_L_SFT 4 7121319b2f6SOder Chiou #define RT5645_M_BST1_OM_L (0x1 << 3) 7131319b2f6SOder Chiou #define RT5645_M_BST1_OM_L_SFT 3 7141319b2f6SOder Chiou #define RT5645_M_IN_L_OM_L (0x1 << 2) 7151319b2f6SOder Chiou #define RT5645_M_IN_L_OM_L_SFT 2 7161319b2f6SOder Chiou #define RT5645_M_DAC_L2_OM_L (0x1 << 1) 7171319b2f6SOder Chiou #define RT5645_M_DAC_L2_OM_L_SFT 1 7181319b2f6SOder Chiou #define RT5645_M_DAC_L1_OM_L (0x1) 7191319b2f6SOder Chiou #define RT5645_M_DAC_L1_OM_L_SFT 0 7201319b2f6SOder Chiou 7211319b2f6SOder Chiou /* Output Right Mixer Control 1 (0x50) */ 7221319b2f6SOder Chiou #define RT5645_G_BST4_OM_R_MASK (0x7 << 13) 7231319b2f6SOder Chiou #define RT5645_G_BST4_OM_R_SFT 13 7241319b2f6SOder Chiou #define RT5645_G_BST2_OM_R_MASK (0x7 << 10) 7251319b2f6SOder Chiou #define RT5645_G_BST2_OM_R_SFT 10 7261319b2f6SOder Chiou #define RT5645_G_BST1_OM_R_MASK (0x7 << 7) 7271319b2f6SOder Chiou #define RT5645_G_BST1_OM_R_SFT 7 7281319b2f6SOder Chiou #define RT5645_G_IN_R_OM_R_MASK (0x7 << 4) 7291319b2f6SOder Chiou #define RT5645_G_IN_R_OM_R_SFT 4 7301319b2f6SOder Chiou #define RT5645_G_RM_R_OM_R_MASK (0x7 << 1) 7311319b2f6SOder Chiou #define RT5645_G_RM_R_OM_R_SFT 1 7321319b2f6SOder Chiou 7331319b2f6SOder Chiou /* Output Right Mixer Control 2 (0x51) */ 7341319b2f6SOder Chiou #define RT5645_G_DAC_L2_OM_R_MASK (0x7 << 13) 7351319b2f6SOder Chiou #define RT5645_G_DAC_L2_OM_R_SFT 13 7361319b2f6SOder Chiou #define RT5645_G_DAC_R2_OM_R_MASK (0x7 << 10) 7371319b2f6SOder Chiou #define RT5645_G_DAC_R2_OM_R_SFT 10 7381319b2f6SOder Chiou #define RT5645_G_DAC_R1_OM_R_MASK (0x7 << 7) 7391319b2f6SOder Chiou #define RT5645_G_DAC_R1_OM_R_SFT 7 7401319b2f6SOder Chiou 7411319b2f6SOder Chiou /* Output Right Mixer Control 3 (0x52) */ 7421319b2f6SOder Chiou #define RT5645_M_BST3_OM_R (0x1 << 4) 7431319b2f6SOder Chiou #define RT5645_M_BST3_OM_R_SFT 4 7441319b2f6SOder Chiou #define RT5645_M_BST2_OM_R (0x1 << 3) 7451319b2f6SOder Chiou #define RT5645_M_BST2_OM_R_SFT 3 7461319b2f6SOder Chiou #define RT5645_M_IN_R_OM_R (0x1 << 2) 7471319b2f6SOder Chiou #define RT5645_M_IN_R_OM_R_SFT 2 7481319b2f6SOder Chiou #define RT5645_M_DAC_R2_OM_R (0x1 << 1) 7491319b2f6SOder Chiou #define RT5645_M_DAC_R2_OM_R_SFT 1 7501319b2f6SOder Chiou #define RT5645_M_DAC_R1_OM_R (0x1) 7511319b2f6SOder Chiou #define RT5645_M_DAC_R1_OM_R_SFT 0 7521319b2f6SOder Chiou 7531319b2f6SOder Chiou /* LOUT Mixer Control (0x53) */ 7541319b2f6SOder Chiou #define RT5645_M_DAC_L1_LM (0x1 << 15) 7551319b2f6SOder Chiou #define RT5645_M_DAC_L1_LM_SFT 15 7561319b2f6SOder Chiou #define RT5645_M_DAC_R1_LM (0x1 << 14) 7571319b2f6SOder Chiou #define RT5645_M_DAC_R1_LM_SFT 14 7581319b2f6SOder Chiou #define RT5645_M_OV_L_LM (0x1 << 13) 7591319b2f6SOder Chiou #define RT5645_M_OV_L_LM_SFT 13 7601319b2f6SOder Chiou #define RT5645_M_OV_R_LM (0x1 << 12) 7611319b2f6SOder Chiou #define RT5645_M_OV_R_LM_SFT 12 7621319b2f6SOder Chiou #define RT5645_G_LOUTMIX_MASK (0x1 << 11) 7631319b2f6SOder Chiou #define RT5645_G_LOUTMIX_SFT 11 7641319b2f6SOder Chiou 7651319b2f6SOder Chiou /* Power Management for Digital 1 (0x61) */ 7661319b2f6SOder Chiou #define RT5645_PWR_I2S1 (0x1 << 15) 7671319b2f6SOder Chiou #define RT5645_PWR_I2S1_BIT 15 7681319b2f6SOder Chiou #define RT5645_PWR_I2S2 (0x1 << 14) 7691319b2f6SOder Chiou #define RT5645_PWR_I2S2_BIT 14 7701319b2f6SOder Chiou #define RT5645_PWR_I2S3 (0x1 << 13) 7711319b2f6SOder Chiou #define RT5645_PWR_I2S3_BIT 13 7721319b2f6SOder Chiou #define RT5645_PWR_DAC_L1 (0x1 << 12) 7731319b2f6SOder Chiou #define RT5645_PWR_DAC_L1_BIT 12 7741319b2f6SOder Chiou #define RT5645_PWR_DAC_R1 (0x1 << 11) 7751319b2f6SOder Chiou #define RT5645_PWR_DAC_R1_BIT 11 7761319b2f6SOder Chiou #define RT5645_PWR_CLS_D_R (0x1 << 9) 7771319b2f6SOder Chiou #define RT5645_PWR_CLS_D_R_BIT 9 7781319b2f6SOder Chiou #define RT5645_PWR_CLS_D_L (0x1 << 8) 7791319b2f6SOder Chiou #define RT5645_PWR_CLS_D_L_BIT 8 7801319b2f6SOder Chiou #define RT5645_PWR_ADC_R (0x1 << 1) 7811319b2f6SOder Chiou #define RT5645_PWR_ADC_R_BIT 1 7821319b2f6SOder Chiou #define RT5645_PWR_DAC_L2 (0x1 << 7) 7831319b2f6SOder Chiou #define RT5645_PWR_DAC_L2_BIT 7 7841319b2f6SOder Chiou #define RT5645_PWR_DAC_R2 (0x1 << 6) 7851319b2f6SOder Chiou #define RT5645_PWR_DAC_R2_BIT 6 7861319b2f6SOder Chiou #define RT5645_PWR_ADC_L (0x1 << 2) 7871319b2f6SOder Chiou #define RT5645_PWR_ADC_L_BIT 2 7881319b2f6SOder Chiou #define RT5645_PWR_ADC_R (0x1 << 1) 7891319b2f6SOder Chiou #define RT5645_PWR_ADC_R_BIT 1 7901319b2f6SOder Chiou #define RT5645_PWR_CLS_D (0x1) 7911319b2f6SOder Chiou #define RT5645_PWR_CLS_D_BIT 0 7921319b2f6SOder Chiou 7931319b2f6SOder Chiou /* Power Management for Digital 2 (0x62) */ 7941319b2f6SOder Chiou #define RT5645_PWR_ADC_S1F (0x1 << 15) 7951319b2f6SOder Chiou #define RT5645_PWR_ADC_S1F_BIT 15 7961319b2f6SOder Chiou #define RT5645_PWR_ADC_MF_L (0x1 << 14) 7971319b2f6SOder Chiou #define RT5645_PWR_ADC_MF_L_BIT 14 7981319b2f6SOder Chiou #define RT5645_PWR_ADC_MF_R (0x1 << 13) 7991319b2f6SOder Chiou #define RT5645_PWR_ADC_MF_R_BIT 13 8001319b2f6SOder Chiou #define RT5645_PWR_I2S_DSP (0x1 << 12) 8011319b2f6SOder Chiou #define RT5645_PWR_I2S_DSP_BIT 12 8021319b2f6SOder Chiou #define RT5645_PWR_DAC_S1F (0x1 << 11) 8031319b2f6SOder Chiou #define RT5645_PWR_DAC_S1F_BIT 11 8041319b2f6SOder Chiou #define RT5645_PWR_DAC_MF_L (0x1 << 10) 8051319b2f6SOder Chiou #define RT5645_PWR_DAC_MF_L_BIT 10 8061319b2f6SOder Chiou #define RT5645_PWR_DAC_MF_R (0x1 << 9) 8071319b2f6SOder Chiou #define RT5645_PWR_DAC_MF_R_BIT 9 8081319b2f6SOder Chiou #define RT5645_PWR_PDM1 (0x1 << 7) 8091319b2f6SOder Chiou #define RT5645_PWR_PDM1_BIT 7 8101319b2f6SOder Chiou #define RT5645_PWR_PDM2 (0x1 << 6) 8111319b2f6SOder Chiou #define RT5645_PWR_PDM2_BIT 6 8121319b2f6SOder Chiou #define RT5645_PWR_IPTV (0x1 << 1) 8131319b2f6SOder Chiou #define RT5645_PWR_IPTV_BIT 1 8141319b2f6SOder Chiou #define RT5645_PWR_PAD (0x1) 8151319b2f6SOder Chiou #define RT5645_PWR_PAD_BIT 0 8161319b2f6SOder Chiou 8171319b2f6SOder Chiou /* Power Management for Analog 1 (0x63) */ 8181319b2f6SOder Chiou #define RT5645_PWR_VREF1 (0x1 << 15) 8191319b2f6SOder Chiou #define RT5645_PWR_VREF1_BIT 15 8201319b2f6SOder Chiou #define RT5645_PWR_FV1 (0x1 << 14) 8211319b2f6SOder Chiou #define RT5645_PWR_FV1_BIT 14 8221319b2f6SOder Chiou #define RT5645_PWR_MB (0x1 << 13) 8231319b2f6SOder Chiou #define RT5645_PWR_MB_BIT 13 8241319b2f6SOder Chiou #define RT5645_PWR_LM (0x1 << 12) 8251319b2f6SOder Chiou #define RT5645_PWR_LM_BIT 12 8261319b2f6SOder Chiou #define RT5645_PWR_BG (0x1 << 11) 8271319b2f6SOder Chiou #define RT5645_PWR_BG_BIT 11 8281319b2f6SOder Chiou #define RT5645_PWR_MA (0x1 << 10) 8291319b2f6SOder Chiou #define RT5645_PWR_MA_BIT 10 8301319b2f6SOder Chiou #define RT5645_PWR_HP_L (0x1 << 7) 8311319b2f6SOder Chiou #define RT5645_PWR_HP_L_BIT 7 8321319b2f6SOder Chiou #define RT5645_PWR_HP_R (0x1 << 6) 8331319b2f6SOder Chiou #define RT5645_PWR_HP_R_BIT 6 8341319b2f6SOder Chiou #define RT5645_PWR_HA (0x1 << 5) 8351319b2f6SOder Chiou #define RT5645_PWR_HA_BIT 5 8361319b2f6SOder Chiou #define RT5645_PWR_VREF2 (0x1 << 4) 8371319b2f6SOder Chiou #define RT5645_PWR_VREF2_BIT 4 8381319b2f6SOder Chiou #define RT5645_PWR_FV2 (0x1 << 3) 8391319b2f6SOder Chiou #define RT5645_PWR_FV2_BIT 3 8401319b2f6SOder Chiou #define RT5645_LDO_SEL_MASK (0x3) 8411319b2f6SOder Chiou #define RT5645_LDO_SEL_SFT 0 8421319b2f6SOder Chiou 8431319b2f6SOder Chiou /* Power Management for Analog 2 (0x64) */ 8441319b2f6SOder Chiou #define RT5645_PWR_BST1 (0x1 << 15) 8451319b2f6SOder Chiou #define RT5645_PWR_BST1_BIT 15 8461319b2f6SOder Chiou #define RT5645_PWR_BST2 (0x1 << 14) 8471319b2f6SOder Chiou #define RT5645_PWR_BST2_BIT 14 8481319b2f6SOder Chiou #define RT5645_PWR_BST3 (0x1 << 13) 8491319b2f6SOder Chiou #define RT5645_PWR_BST3_BIT 13 8501319b2f6SOder Chiou #define RT5645_PWR_BST4 (0x1 << 12) 8511319b2f6SOder Chiou #define RT5645_PWR_BST4_BIT 12 8521319b2f6SOder Chiou #define RT5645_PWR_MB1 (0x1 << 11) 8531319b2f6SOder Chiou #define RT5645_PWR_MB1_BIT 11 8541319b2f6SOder Chiou #define RT5645_PWR_MB2 (0x1 << 10) 8551319b2f6SOder Chiou #define RT5645_PWR_MB2_BIT 10 8561319b2f6SOder Chiou #define RT5645_PWR_PLL (0x1 << 9) 8571319b2f6SOder Chiou #define RT5645_PWR_PLL_BIT 9 8581319b2f6SOder Chiou #define RT5645_PWR_BST2_P (0x1 << 5) 8591319b2f6SOder Chiou #define RT5645_PWR_BST2_P_BIT 5 8601319b2f6SOder Chiou #define RT5645_PWR_BST3_P (0x1 << 4) 8611319b2f6SOder Chiou #define RT5645_PWR_BST3_P_BIT 4 8621319b2f6SOder Chiou #define RT5645_PWR_BST4_P (0x1 << 3) 8631319b2f6SOder Chiou #define RT5645_PWR_BST4_P_BIT 3 8641319b2f6SOder Chiou #define RT5645_PWR_JD1 (0x1 << 2) 8651319b2f6SOder Chiou #define RT5645_PWR_JD1_BIT 2 8661319b2f6SOder Chiou #define RT5645_PWR_JD (0x1 << 1) 8671319b2f6SOder Chiou #define RT5645_PWR_JD_BIT 1 8681319b2f6SOder Chiou 8691319b2f6SOder Chiou /* Power Management for Mixer (0x65) */ 8701319b2f6SOder Chiou #define RT5645_PWR_OM_L (0x1 << 15) 8711319b2f6SOder Chiou #define RT5645_PWR_OM_L_BIT 15 8721319b2f6SOder Chiou #define RT5645_PWR_OM_R (0x1 << 14) 8731319b2f6SOder Chiou #define RT5645_PWR_OM_R_BIT 14 8741319b2f6SOder Chiou #define RT5645_PWR_SM_L (0x1 << 13) 8751319b2f6SOder Chiou #define RT5645_PWR_SM_L_BIT 13 8761319b2f6SOder Chiou #define RT5645_PWR_SM_R (0x1 << 12) 8771319b2f6SOder Chiou #define RT5645_PWR_SM_R_BIT 12 8781319b2f6SOder Chiou #define RT5645_PWR_RM_L (0x1 << 11) 8791319b2f6SOder Chiou #define RT5645_PWR_RM_L_BIT 11 8801319b2f6SOder Chiou #define RT5645_PWR_RM_R (0x1 << 10) 8811319b2f6SOder Chiou #define RT5645_PWR_RM_R_BIT 10 8821319b2f6SOder Chiou #define RT5645_PWR_MM (0x1 << 8) 8831319b2f6SOder Chiou #define RT5645_PWR_MM_BIT 8 8841319b2f6SOder Chiou #define RT5645_PWR_HM_L (0x1 << 7) 8851319b2f6SOder Chiou #define RT5645_PWR_HM_L_BIT 7 8861319b2f6SOder Chiou #define RT5645_PWR_HM_R (0x1 << 6) 8871319b2f6SOder Chiou #define RT5645_PWR_HM_R_BIT 6 8881319b2f6SOder Chiou #define RT5645_PWR_LDO2 (0x1 << 1) 8891319b2f6SOder Chiou #define RT5645_PWR_LDO2_BIT 1 8901319b2f6SOder Chiou 8911319b2f6SOder Chiou /* Power Management for Volume (0x66) */ 8921319b2f6SOder Chiou #define RT5645_PWR_SV_L (0x1 << 15) 8931319b2f6SOder Chiou #define RT5645_PWR_SV_L_BIT 15 8941319b2f6SOder Chiou #define RT5645_PWR_SV_R (0x1 << 14) 8951319b2f6SOder Chiou #define RT5645_PWR_SV_R_BIT 14 8961319b2f6SOder Chiou #define RT5645_PWR_HV_L (0x1 << 11) 8971319b2f6SOder Chiou #define RT5645_PWR_HV_L_BIT 11 8981319b2f6SOder Chiou #define RT5645_PWR_HV_R (0x1 << 10) 8991319b2f6SOder Chiou #define RT5645_PWR_HV_R_BIT 10 9001319b2f6SOder Chiou #define RT5645_PWR_IN_L (0x1 << 9) 9011319b2f6SOder Chiou #define RT5645_PWR_IN_L_BIT 9 9021319b2f6SOder Chiou #define RT5645_PWR_IN_R (0x1 << 8) 9031319b2f6SOder Chiou #define RT5645_PWR_IN_R_BIT 8 9041319b2f6SOder Chiou #define RT5645_PWR_MIC_DET (0x1 << 5) 9051319b2f6SOder Chiou #define RT5645_PWR_MIC_DET_BIT 5 9061319b2f6SOder Chiou 9071319b2f6SOder Chiou /* I2S1/2 Audio Serial Data Port Control (0x70 0x71) */ 9081319b2f6SOder Chiou #define RT5645_I2S_MS_MASK (0x1 << 15) 9091319b2f6SOder Chiou #define RT5645_I2S_MS_SFT 15 9101319b2f6SOder Chiou #define RT5645_I2S_MS_M (0x0 << 15) 9111319b2f6SOder Chiou #define RT5645_I2S_MS_S (0x1 << 15) 9121319b2f6SOder Chiou #define RT5645_I2S_O_CP_MASK (0x3 << 10) 9131319b2f6SOder Chiou #define RT5645_I2S_O_CP_SFT 10 9141319b2f6SOder Chiou #define RT5645_I2S_O_CP_OFF (0x0 << 10) 9151319b2f6SOder Chiou #define RT5645_I2S_O_CP_U_LAW (0x1 << 10) 9161319b2f6SOder Chiou #define RT5645_I2S_O_CP_A_LAW (0x2 << 10) 9171319b2f6SOder Chiou #define RT5645_I2S_I_CP_MASK (0x3 << 8) 9181319b2f6SOder Chiou #define RT5645_I2S_I_CP_SFT 8 9191319b2f6SOder Chiou #define RT5645_I2S_I_CP_OFF (0x0 << 8) 9201319b2f6SOder Chiou #define RT5645_I2S_I_CP_U_LAW (0x1 << 8) 9211319b2f6SOder Chiou #define RT5645_I2S_I_CP_A_LAW (0x2 << 8) 9221319b2f6SOder Chiou #define RT5645_I2S_BP_MASK (0x1 << 7) 9231319b2f6SOder Chiou #define RT5645_I2S_BP_SFT 7 9241319b2f6SOder Chiou #define RT5645_I2S_BP_NOR (0x0 << 7) 9251319b2f6SOder Chiou #define RT5645_I2S_BP_INV (0x1 << 7) 9261319b2f6SOder Chiou #define RT5645_I2S_DL_MASK (0x3 << 2) 9271319b2f6SOder Chiou #define RT5645_I2S_DL_SFT 2 9281319b2f6SOder Chiou #define RT5645_I2S_DL_16 (0x0 << 2) 9291319b2f6SOder Chiou #define RT5645_I2S_DL_20 (0x1 << 2) 9301319b2f6SOder Chiou #define RT5645_I2S_DL_24 (0x2 << 2) 9311319b2f6SOder Chiou #define RT5645_I2S_DL_8 (0x3 << 2) 9321319b2f6SOder Chiou #define RT5645_I2S_DF_MASK (0x3) 9331319b2f6SOder Chiou #define RT5645_I2S_DF_SFT 0 9341319b2f6SOder Chiou #define RT5645_I2S_DF_I2S (0x0) 9351319b2f6SOder Chiou #define RT5645_I2S_DF_LEFT (0x1) 9361319b2f6SOder Chiou #define RT5645_I2S_DF_PCM_A (0x2) 9371319b2f6SOder Chiou #define RT5645_I2S_DF_PCM_B (0x3) 9381319b2f6SOder Chiou 9391319b2f6SOder Chiou /* I2S2 Audio Serial Data Port Control (0x71) */ 9401319b2f6SOder Chiou #define RT5645_I2S2_SDI_MASK (0x1 << 6) 9411319b2f6SOder Chiou #define RT5645_I2S2_SDI_SFT 6 9421319b2f6SOder Chiou #define RT5645_I2S2_SDI_I2S1 (0x0 << 6) 9431319b2f6SOder Chiou #define RT5645_I2S2_SDI_I2S2 (0x1 << 6) 9441319b2f6SOder Chiou 9451319b2f6SOder Chiou /* ADC/DAC Clock Control 1 (0x73) */ 9461319b2f6SOder Chiou #define RT5645_I2S_PD1_MASK (0x7 << 12) 9471319b2f6SOder Chiou #define RT5645_I2S_PD1_SFT 12 9481319b2f6SOder Chiou #define RT5645_I2S_PD1_1 (0x0 << 12) 9491319b2f6SOder Chiou #define RT5645_I2S_PD1_2 (0x1 << 12) 9501319b2f6SOder Chiou #define RT5645_I2S_PD1_3 (0x2 << 12) 9511319b2f6SOder Chiou #define RT5645_I2S_PD1_4 (0x3 << 12) 9521319b2f6SOder Chiou #define RT5645_I2S_PD1_6 (0x4 << 12) 9531319b2f6SOder Chiou #define RT5645_I2S_PD1_8 (0x5 << 12) 9541319b2f6SOder Chiou #define RT5645_I2S_PD1_12 (0x6 << 12) 9551319b2f6SOder Chiou #define RT5645_I2S_PD1_16 (0x7 << 12) 9561319b2f6SOder Chiou #define RT5645_I2S_BCLK_MS2_MASK (0x1 << 11) 9571319b2f6SOder Chiou #define RT5645_I2S_BCLK_MS2_SFT 11 9581319b2f6SOder Chiou #define RT5645_I2S_BCLK_MS2_32 (0x0 << 11) 9591319b2f6SOder Chiou #define RT5645_I2S_BCLK_MS2_64 (0x1 << 11) 9601319b2f6SOder Chiou #define RT5645_I2S_PD2_MASK (0x7 << 8) 9611319b2f6SOder Chiou #define RT5645_I2S_PD2_SFT 8 9621319b2f6SOder Chiou #define RT5645_I2S_PD2_1 (0x0 << 8) 9631319b2f6SOder Chiou #define RT5645_I2S_PD2_2 (0x1 << 8) 9641319b2f6SOder Chiou #define RT5645_I2S_PD2_3 (0x2 << 8) 9651319b2f6SOder Chiou #define RT5645_I2S_PD2_4 (0x3 << 8) 9661319b2f6SOder Chiou #define RT5645_I2S_PD2_6 (0x4 << 8) 9671319b2f6SOder Chiou #define RT5645_I2S_PD2_8 (0x5 << 8) 9681319b2f6SOder Chiou #define RT5645_I2S_PD2_12 (0x6 << 8) 9691319b2f6SOder Chiou #define RT5645_I2S_PD2_16 (0x7 << 8) 9701319b2f6SOder Chiou #define RT5645_I2S_BCLK_MS3_MASK (0x1 << 7) 9711319b2f6SOder Chiou #define RT5645_I2S_BCLK_MS3_SFT 7 9721319b2f6SOder Chiou #define RT5645_I2S_BCLK_MS3_32 (0x0 << 7) 9731319b2f6SOder Chiou #define RT5645_I2S_BCLK_MS3_64 (0x1 << 7) 9741319b2f6SOder Chiou #define RT5645_I2S_PD3_MASK (0x7 << 4) 9751319b2f6SOder Chiou #define RT5645_I2S_PD3_SFT 4 9761319b2f6SOder Chiou #define RT5645_I2S_PD3_1 (0x0 << 4) 9771319b2f6SOder Chiou #define RT5645_I2S_PD3_2 (0x1 << 4) 9781319b2f6SOder Chiou #define RT5645_I2S_PD3_3 (0x2 << 4) 9791319b2f6SOder Chiou #define RT5645_I2S_PD3_4 (0x3 << 4) 9801319b2f6SOder Chiou #define RT5645_I2S_PD3_6 (0x4 << 4) 9811319b2f6SOder Chiou #define RT5645_I2S_PD3_8 (0x5 << 4) 9821319b2f6SOder Chiou #define RT5645_I2S_PD3_12 (0x6 << 4) 9831319b2f6SOder Chiou #define RT5645_I2S_PD3_16 (0x7 << 4) 9841319b2f6SOder Chiou #define RT5645_DAC_OSR_MASK (0x3 << 2) 9851319b2f6SOder Chiou #define RT5645_DAC_OSR_SFT 2 9861319b2f6SOder Chiou #define RT5645_DAC_OSR_128 (0x0 << 2) 9871319b2f6SOder Chiou #define RT5645_DAC_OSR_64 (0x1 << 2) 9881319b2f6SOder Chiou #define RT5645_DAC_OSR_32 (0x2 << 2) 9891319b2f6SOder Chiou #define RT5645_DAC_OSR_16 (0x3 << 2) 9901319b2f6SOder Chiou #define RT5645_ADC_OSR_MASK (0x3) 9911319b2f6SOder Chiou #define RT5645_ADC_OSR_SFT 0 9921319b2f6SOder Chiou #define RT5645_ADC_OSR_128 (0x0) 9931319b2f6SOder Chiou #define RT5645_ADC_OSR_64 (0x1) 9941319b2f6SOder Chiou #define RT5645_ADC_OSR_32 (0x2) 9951319b2f6SOder Chiou #define RT5645_ADC_OSR_16 (0x3) 9961319b2f6SOder Chiou 9971319b2f6SOder Chiou /* ADC/DAC Clock Control 2 (0x74) */ 9981319b2f6SOder Chiou #define RT5645_DAC_L_OSR_MASK (0x3 << 14) 9991319b2f6SOder Chiou #define RT5645_DAC_L_OSR_SFT 14 10001319b2f6SOder Chiou #define RT5645_DAC_L_OSR_128 (0x0 << 14) 10011319b2f6SOder Chiou #define RT5645_DAC_L_OSR_64 (0x1 << 14) 10021319b2f6SOder Chiou #define RT5645_DAC_L_OSR_32 (0x2 << 14) 10031319b2f6SOder Chiou #define RT5645_DAC_L_OSR_16 (0x3 << 14) 10041319b2f6SOder Chiou #define RT5645_ADC_R_OSR_MASK (0x3 << 12) 10051319b2f6SOder Chiou #define RT5645_ADC_R_OSR_SFT 12 10061319b2f6SOder Chiou #define RT5645_ADC_R_OSR_128 (0x0 << 12) 10071319b2f6SOder Chiou #define RT5645_ADC_R_OSR_64 (0x1 << 12) 10081319b2f6SOder Chiou #define RT5645_ADC_R_OSR_32 (0x2 << 12) 10091319b2f6SOder Chiou #define RT5645_ADC_R_OSR_16 (0x3 << 12) 10101319b2f6SOder Chiou #define RT5645_DAHPF_EN (0x1 << 11) 10111319b2f6SOder Chiou #define RT5645_DAHPF_EN_SFT 11 10121319b2f6SOder Chiou #define RT5645_ADHPF_EN (0x1 << 10) 10131319b2f6SOder Chiou #define RT5645_ADHPF_EN_SFT 10 10141319b2f6SOder Chiou 10151319b2f6SOder Chiou /* Digital Microphone Control (0x75) */ 10161319b2f6SOder Chiou #define RT5645_DMIC_1_EN_MASK (0x1 << 15) 10171319b2f6SOder Chiou #define RT5645_DMIC_1_EN_SFT 15 10181319b2f6SOder Chiou #define RT5645_DMIC_1_DIS (0x0 << 15) 10191319b2f6SOder Chiou #define RT5645_DMIC_1_EN (0x1 << 15) 10201319b2f6SOder Chiou #define RT5645_DMIC_2_EN_MASK (0x1 << 14) 10211319b2f6SOder Chiou #define RT5645_DMIC_2_EN_SFT 14 10221319b2f6SOder Chiou #define RT5645_DMIC_2_DIS (0x0 << 14) 10231319b2f6SOder Chiou #define RT5645_DMIC_2_EN (0x1 << 14) 10241319b2f6SOder Chiou #define RT5645_DMIC_1L_LH_MASK (0x1 << 13) 10251319b2f6SOder Chiou #define RT5645_DMIC_1L_LH_SFT 13 10261319b2f6SOder Chiou #define RT5645_DMIC_1L_LH_FALLING (0x0 << 13) 10271319b2f6SOder Chiou #define RT5645_DMIC_1L_LH_RISING (0x1 << 13) 10281319b2f6SOder Chiou #define RT5645_DMIC_1R_LH_MASK (0x1 << 12) 10291319b2f6SOder Chiou #define RT5645_DMIC_1R_LH_SFT 12 10301319b2f6SOder Chiou #define RT5645_DMIC_1R_LH_FALLING (0x0 << 12) 10311319b2f6SOder Chiou #define RT5645_DMIC_1R_LH_RISING (0x1 << 12) 10321319b2f6SOder Chiou #define RT5645_DMIC_2_DP_MASK (0x3 << 10) 10331319b2f6SOder Chiou #define RT5645_DMIC_2_DP_SFT 10 10341319b2f6SOder Chiou #define RT5645_DMIC_2_DP_GPIO6 (0x0 << 10) 10351319b2f6SOder Chiou #define RT5645_DMIC_2_DP_GPIO10 (0x1 << 10) 10361319b2f6SOder Chiou #define RT5645_DMIC_2_DP_GPIO12 (0x2 << 10) 10371319b2f6SOder Chiou #define RT5645_DMIC_2_DP_IN2P (0x3 << 10) 10381319b2f6SOder Chiou #define RT5645_DMIC_2L_LH_MASK (0x1 << 9) 10391319b2f6SOder Chiou #define RT5645_DMIC_2L_LH_SFT 9 10401319b2f6SOder Chiou #define RT5645_DMIC_2L_LH_FALLING (0x0 << 9) 10411319b2f6SOder Chiou #define RT5645_DMIC_2L_LH_RISING (0x1 << 9) 10421319b2f6SOder Chiou #define RT5645_DMIC_2R_LH_MASK (0x1 << 8) 10431319b2f6SOder Chiou #define RT5645_DMIC_2R_LH_SFT 8 10441319b2f6SOder Chiou #define RT5645_DMIC_2R_LH_FALLING (0x0 << 8) 10451319b2f6SOder Chiou #define RT5645_DMIC_2R_LH_RISING (0x1 << 8) 10461319b2f6SOder Chiou #define RT5645_DMIC_CLK_MASK (0x7 << 5) 10471319b2f6SOder Chiou #define RT5645_DMIC_CLK_SFT 5 10481319b2f6SOder Chiou #define RT5645_DMIC_3_EN_MASK (0x1 << 4) 10491319b2f6SOder Chiou #define RT5645_DMIC_3_EN_SFT 4 10501319b2f6SOder Chiou #define RT5645_DMIC_3_DIS (0x0 << 4) 10511319b2f6SOder Chiou #define RT5645_DMIC_3_EN (0x1 << 4) 10521319b2f6SOder Chiou #define RT5645_DMIC_1_DP_MASK (0x3 << 0) 10531319b2f6SOder Chiou #define RT5645_DMIC_1_DP_SFT 0 10541319b2f6SOder Chiou #define RT5645_DMIC_1_DP_GPIO5 (0x0 << 0) 10551319b2f6SOder Chiou #define RT5645_DMIC_1_DP_IN2N (0x1 << 0) 10561319b2f6SOder Chiou #define RT5645_DMIC_1_DP_GPIO11 (0x2 << 0) 10571319b2f6SOder Chiou 10581319b2f6SOder Chiou /* TDM Control 1 (0x77) */ 10591319b2f6SOder Chiou #define RT5645_IF1_ADC_IN_MASK (0x3 << 8) 10601319b2f6SOder Chiou #define RT5645_IF1_ADC_IN_SFT 8 10611319b2f6SOder Chiou 10621319b2f6SOder Chiou /* Global Clock Control (0x80) */ 10631319b2f6SOder Chiou #define RT5645_SCLK_SRC_MASK (0x3 << 14) 10641319b2f6SOder Chiou #define RT5645_SCLK_SRC_SFT 14 10651319b2f6SOder Chiou #define RT5645_SCLK_SRC_MCLK (0x0 << 14) 10661319b2f6SOder Chiou #define RT5645_SCLK_SRC_PLL1 (0x1 << 14) 1067de97c15bSBard Liao #define RT5645_SCLK_SRC_RCCLK (0x2 << 14) 1068de97c15bSBard Liao #define RT5645_PLL1_SRC_MASK (0x7 << 11) 1069de97c15bSBard Liao #define RT5645_PLL1_SRC_SFT 11 1070de97c15bSBard Liao #define RT5645_PLL1_SRC_MCLK (0x0 << 11) 1071de97c15bSBard Liao #define RT5645_PLL1_SRC_BCLK1 (0x1 << 11) 1072de97c15bSBard Liao #define RT5645_PLL1_SRC_BCLK2 (0x2 << 11) 1073de97c15bSBard Liao #define RT5645_PLL1_SRC_BCLK3 (0x3 << 11) 1074de97c15bSBard Liao #define RT5645_PLL1_SRC_RCCLK (0x4 << 11) 10751319b2f6SOder Chiou #define RT5645_PLL1_PD_MASK (0x1 << 3) 10761319b2f6SOder Chiou #define RT5645_PLL1_PD_SFT 3 10771319b2f6SOder Chiou #define RT5645_PLL1_PD_1 (0x0 << 3) 10781319b2f6SOder Chiou #define RT5645_PLL1_PD_2 (0x1 << 3) 10791319b2f6SOder Chiou 10801319b2f6SOder Chiou #define RT5645_PLL_INP_MAX 40000000 10811319b2f6SOder Chiou #define RT5645_PLL_INP_MIN 256000 10821319b2f6SOder Chiou /* PLL M/N/K Code Control 1 (0x81) */ 10831319b2f6SOder Chiou #define RT5645_PLL_N_MAX 0x1ff 10841319b2f6SOder Chiou #define RT5645_PLL_N_MASK (RT5645_PLL_N_MAX << 7) 10851319b2f6SOder Chiou #define RT5645_PLL_N_SFT 7 10861319b2f6SOder Chiou #define RT5645_PLL_K_MAX 0x1f 10871319b2f6SOder Chiou #define RT5645_PLL_K_MASK (RT5645_PLL_K_MAX) 10881319b2f6SOder Chiou #define RT5645_PLL_K_SFT 0 10891319b2f6SOder Chiou 10901319b2f6SOder Chiou /* PLL M/N/K Code Control 2 (0x82) */ 10911319b2f6SOder Chiou #define RT5645_PLL_M_MAX 0xf 10921319b2f6SOder Chiou #define RT5645_PLL_M_MASK (RT5645_PLL_M_MAX << 12) 10931319b2f6SOder Chiou #define RT5645_PLL_M_SFT 12 10941319b2f6SOder Chiou #define RT5645_PLL_M_BP (0x1 << 11) 10951319b2f6SOder Chiou #define RT5645_PLL_M_BP_SFT 11 10961319b2f6SOder Chiou 10971319b2f6SOder Chiou /* ASRC Control 1 (0x83) */ 10981319b2f6SOder Chiou #define RT5645_STO_T_MASK (0x1 << 15) 10991319b2f6SOder Chiou #define RT5645_STO_T_SFT 15 11001319b2f6SOder Chiou #define RT5645_STO_T_SCLK (0x0 << 15) 11011319b2f6SOder Chiou #define RT5645_STO_T_LRCK1 (0x1 << 15) 11021319b2f6SOder Chiou #define RT5645_M1_T_MASK (0x1 << 14) 11031319b2f6SOder Chiou #define RT5645_M1_T_SFT 14 11041319b2f6SOder Chiou #define RT5645_M1_T_I2S2 (0x0 << 14) 11051319b2f6SOder Chiou #define RT5645_M1_T_I2S2_D3 (0x1 << 14) 11061319b2f6SOder Chiou #define RT5645_I2S2_F_MASK (0x1 << 12) 11071319b2f6SOder Chiou #define RT5645_I2S2_F_SFT 12 11081319b2f6SOder Chiou #define RT5645_I2S2_F_I2S2_D2 (0x0 << 12) 11091319b2f6SOder Chiou #define RT5645_I2S2_F_I2S1_TCLK (0x1 << 12) 11101319b2f6SOder Chiou #define RT5645_DMIC_1_M_MASK (0x1 << 9) 11111319b2f6SOder Chiou #define RT5645_DMIC_1_M_SFT 9 11121319b2f6SOder Chiou #define RT5645_DMIC_1_M_NOR (0x0 << 9) 11131319b2f6SOder Chiou #define RT5645_DMIC_1_M_ASYN (0x1 << 9) 11141319b2f6SOder Chiou #define RT5645_DMIC_2_M_MASK (0x1 << 8) 11151319b2f6SOder Chiou #define RT5645_DMIC_2_M_SFT 8 11161319b2f6SOder Chiou #define RT5645_DMIC_2_M_NOR (0x0 << 8) 11171319b2f6SOder Chiou #define RT5645_DMIC_2_M_ASYN (0x1 << 8) 11181319b2f6SOder Chiou 111979080a8bSFang, Yang A /* ASRC clock source selection (0x84, 0x85) */ 112079080a8bSFang, Yang A #define RT5645_CLK_SEL_SYS (0x0) 112179080a8bSFang, Yang A #define RT5645_CLK_SEL_I2S1_ASRC (0x1) 112279080a8bSFang, Yang A #define RT5645_CLK_SEL_I2S2_ASRC (0x2) 112379080a8bSFang, Yang A #define RT5645_CLK_SEL_SYS2 (0x5) 112479080a8bSFang, Yang A 11251319b2f6SOder Chiou /* ASRC Control 2 (0x84) */ 112679080a8bSFang, Yang A #define RT5645_DA_STO_CLK_SEL_MASK (0xf << 12) 112779080a8bSFang, Yang A #define RT5645_DA_STO_CLK_SEL_SFT 12 112879080a8bSFang, Yang A #define RT5645_DA_MONOL_CLK_SEL_MASK (0xf << 8) 112979080a8bSFang, Yang A #define RT5645_DA_MONOL_CLK_SEL_SFT 8 113079080a8bSFang, Yang A #define RT5645_DA_MONOR_CLK_SEL_MASK (0xf << 4) 113179080a8bSFang, Yang A #define RT5645_DA_MONOR_CLK_SEL_SFT 4 113279080a8bSFang, Yang A #define RT5645_AD_STO1_CLK_SEL_MASK (0xf << 0) 113379080a8bSFang, Yang A #define RT5645_AD_STO1_CLK_SEL_SFT 0 11341319b2f6SOder Chiou 11351319b2f6SOder Chiou /* ASRC Control 3 (0x85) */ 113679080a8bSFang, Yang A #define RT5645_AD_MONOL_CLK_SEL_MASK (0xf << 4) 113779080a8bSFang, Yang A #define RT5645_AD_MONOL_CLK_SEL_SFT 4 113879080a8bSFang, Yang A #define RT5645_AD_MONOR_CLK_SEL_MASK (0xf << 0) 113979080a8bSFang, Yang A #define RT5645_AD_MONOR_CLK_SEL_SFT 0 11401319b2f6SOder Chiou 11411319b2f6SOder Chiou /* ASRC Control 4 (0x89) */ 11421319b2f6SOder Chiou #define RT5645_I2S1_PD_MASK (0x7 << 12) 11431319b2f6SOder Chiou #define RT5645_I2S1_PD_SFT 12 11441319b2f6SOder Chiou #define RT5645_I2S2_PD_MASK (0x7 << 8) 11451319b2f6SOder Chiou #define RT5645_I2S2_PD_SFT 8 11461319b2f6SOder Chiou 11471319b2f6SOder Chiou /* HPOUT Over Current Detection (0x8b) */ 11481319b2f6SOder Chiou #define RT5645_HP_OVCD_MASK (0x1 << 10) 11491319b2f6SOder Chiou #define RT5645_HP_OVCD_SFT 10 11501319b2f6SOder Chiou #define RT5645_HP_OVCD_DIS (0x0 << 10) 11511319b2f6SOder Chiou #define RT5645_HP_OVCD_EN (0x1 << 10) 11521319b2f6SOder Chiou #define RT5645_HP_OC_TH_MASK (0x3 << 8) 11531319b2f6SOder Chiou #define RT5645_HP_OC_TH_SFT 8 11541319b2f6SOder Chiou #define RT5645_HP_OC_TH_90 (0x0 << 8) 11551319b2f6SOder Chiou #define RT5645_HP_OC_TH_105 (0x1 << 8) 11561319b2f6SOder Chiou #define RT5645_HP_OC_TH_120 (0x2 << 8) 11571319b2f6SOder Chiou #define RT5645_HP_OC_TH_135 (0x3 << 8) 11581319b2f6SOder Chiou 11591319b2f6SOder Chiou /* Class D Over Current Control (0x8c) */ 11601319b2f6SOder Chiou #define RT5645_CLSD_OC_MASK (0x1 << 9) 11611319b2f6SOder Chiou #define RT5645_CLSD_OC_SFT 9 11621319b2f6SOder Chiou #define RT5645_CLSD_OC_PU (0x0 << 9) 11631319b2f6SOder Chiou #define RT5645_CLSD_OC_PD (0x1 << 9) 11641319b2f6SOder Chiou #define RT5645_AUTO_PD_MASK (0x1 << 8) 11651319b2f6SOder Chiou #define RT5645_AUTO_PD_SFT 8 11661319b2f6SOder Chiou #define RT5645_AUTO_PD_DIS (0x0 << 8) 11671319b2f6SOder Chiou #define RT5645_AUTO_PD_EN (0x1 << 8) 11681319b2f6SOder Chiou #define RT5645_CLSD_OC_TH_MASK (0x3f) 11691319b2f6SOder Chiou #define RT5645_CLSD_OC_TH_SFT 0 11701319b2f6SOder Chiou 11711319b2f6SOder Chiou /* Class D Output Control (0x8d) */ 11721319b2f6SOder Chiou #define RT5645_CLSD_RATIO_MASK (0xf << 12) 11731319b2f6SOder Chiou #define RT5645_CLSD_RATIO_SFT 12 11741319b2f6SOder Chiou #define RT5645_CLSD_OM_MASK (0x1 << 11) 11751319b2f6SOder Chiou #define RT5645_CLSD_OM_SFT 11 11761319b2f6SOder Chiou #define RT5645_CLSD_OM_MONO (0x0 << 11) 11771319b2f6SOder Chiou #define RT5645_CLSD_OM_STO (0x1 << 11) 11781319b2f6SOder Chiou #define RT5645_CLSD_SCH_MASK (0x1 << 10) 11791319b2f6SOder Chiou #define RT5645_CLSD_SCH_SFT 10 11801319b2f6SOder Chiou #define RT5645_CLSD_SCH_L (0x0 << 10) 11811319b2f6SOder Chiou #define RT5645_CLSD_SCH_S (0x1 << 10) 11821319b2f6SOder Chiou 11831319b2f6SOder Chiou /* Depop Mode Control 1 (0x8e) */ 11841319b2f6SOder Chiou #define RT5645_SMT_TRIG_MASK (0x1 << 15) 11851319b2f6SOder Chiou #define RT5645_SMT_TRIG_SFT 15 11861319b2f6SOder Chiou #define RT5645_SMT_TRIG_DIS (0x0 << 15) 11871319b2f6SOder Chiou #define RT5645_SMT_TRIG_EN (0x1 << 15) 11881319b2f6SOder Chiou #define RT5645_HP_L_SMT_MASK (0x1 << 9) 11891319b2f6SOder Chiou #define RT5645_HP_L_SMT_SFT 9 11901319b2f6SOder Chiou #define RT5645_HP_L_SMT_DIS (0x0 << 9) 11911319b2f6SOder Chiou #define RT5645_HP_L_SMT_EN (0x1 << 9) 11921319b2f6SOder Chiou #define RT5645_HP_R_SMT_MASK (0x1 << 8) 11931319b2f6SOder Chiou #define RT5645_HP_R_SMT_SFT 8 11941319b2f6SOder Chiou #define RT5645_HP_R_SMT_DIS (0x0 << 8) 11951319b2f6SOder Chiou #define RT5645_HP_R_SMT_EN (0x1 << 8) 11961319b2f6SOder Chiou #define RT5645_HP_CD_PD_MASK (0x1 << 7) 11971319b2f6SOder Chiou #define RT5645_HP_CD_PD_SFT 7 11981319b2f6SOder Chiou #define RT5645_HP_CD_PD_DIS (0x0 << 7) 11991319b2f6SOder Chiou #define RT5645_HP_CD_PD_EN (0x1 << 7) 12001319b2f6SOder Chiou #define RT5645_RSTN_MASK (0x1 << 6) 12011319b2f6SOder Chiou #define RT5645_RSTN_SFT 6 12021319b2f6SOder Chiou #define RT5645_RSTN_DIS (0x0 << 6) 12031319b2f6SOder Chiou #define RT5645_RSTN_EN (0x1 << 6) 12041319b2f6SOder Chiou #define RT5645_RSTP_MASK (0x1 << 5) 12051319b2f6SOder Chiou #define RT5645_RSTP_SFT 5 12061319b2f6SOder Chiou #define RT5645_RSTP_DIS (0x0 << 5) 12071319b2f6SOder Chiou #define RT5645_RSTP_EN (0x1 << 5) 12081319b2f6SOder Chiou #define RT5645_HP_CO_MASK (0x1 << 4) 12091319b2f6SOder Chiou #define RT5645_HP_CO_SFT 4 12101319b2f6SOder Chiou #define RT5645_HP_CO_DIS (0x0 << 4) 12111319b2f6SOder Chiou #define RT5645_HP_CO_EN (0x1 << 4) 12121319b2f6SOder Chiou #define RT5645_HP_CP_MASK (0x1 << 3) 12131319b2f6SOder Chiou #define RT5645_HP_CP_SFT 3 12141319b2f6SOder Chiou #define RT5645_HP_CP_PD (0x0 << 3) 12151319b2f6SOder Chiou #define RT5645_HP_CP_PU (0x1 << 3) 12161319b2f6SOder Chiou #define RT5645_HP_SG_MASK (0x1 << 2) 12171319b2f6SOder Chiou #define RT5645_HP_SG_SFT 2 12181319b2f6SOder Chiou #define RT5645_HP_SG_DIS (0x0 << 2) 12191319b2f6SOder Chiou #define RT5645_HP_SG_EN (0x1 << 2) 12201319b2f6SOder Chiou #define RT5645_HP_DP_MASK (0x1 << 1) 12211319b2f6SOder Chiou #define RT5645_HP_DP_SFT 1 12221319b2f6SOder Chiou #define RT5645_HP_DP_PD (0x0 << 1) 12231319b2f6SOder Chiou #define RT5645_HP_DP_PU (0x1 << 1) 12241319b2f6SOder Chiou #define RT5645_HP_CB_MASK (0x1) 12251319b2f6SOder Chiou #define RT5645_HP_CB_SFT 0 12261319b2f6SOder Chiou #define RT5645_HP_CB_PD (0x0) 12271319b2f6SOder Chiou #define RT5645_HP_CB_PU (0x1) 12281319b2f6SOder Chiou 12291319b2f6SOder Chiou /* Depop Mode Control 2 (0x8f) */ 12301319b2f6SOder Chiou #define RT5645_DEPOP_MASK (0x1 << 13) 12311319b2f6SOder Chiou #define RT5645_DEPOP_SFT 13 12321319b2f6SOder Chiou #define RT5645_DEPOP_AUTO (0x0 << 13) 12331319b2f6SOder Chiou #define RT5645_DEPOP_MAN (0x1 << 13) 12341319b2f6SOder Chiou #define RT5645_RAMP_MASK (0x1 << 12) 12351319b2f6SOder Chiou #define RT5645_RAMP_SFT 12 12361319b2f6SOder Chiou #define RT5645_RAMP_DIS (0x0 << 12) 12371319b2f6SOder Chiou #define RT5645_RAMP_EN (0x1 << 12) 12381319b2f6SOder Chiou #define RT5645_BPS_MASK (0x1 << 11) 12391319b2f6SOder Chiou #define RT5645_BPS_SFT 11 12401319b2f6SOder Chiou #define RT5645_BPS_DIS (0x0 << 11) 12411319b2f6SOder Chiou #define RT5645_BPS_EN (0x1 << 11) 12421319b2f6SOder Chiou #define RT5645_FAST_UPDN_MASK (0x1 << 10) 12431319b2f6SOder Chiou #define RT5645_FAST_UPDN_SFT 10 12441319b2f6SOder Chiou #define RT5645_FAST_UPDN_DIS (0x0 << 10) 12451319b2f6SOder Chiou #define RT5645_FAST_UPDN_EN (0x1 << 10) 12461319b2f6SOder Chiou #define RT5645_MRES_MASK (0x3 << 8) 12471319b2f6SOder Chiou #define RT5645_MRES_SFT 8 12481319b2f6SOder Chiou #define RT5645_MRES_15MO (0x0 << 8) 12491319b2f6SOder Chiou #define RT5645_MRES_25MO (0x1 << 8) 12501319b2f6SOder Chiou #define RT5645_MRES_35MO (0x2 << 8) 12511319b2f6SOder Chiou #define RT5645_MRES_45MO (0x3 << 8) 12521319b2f6SOder Chiou #define RT5645_VLO_MASK (0x1 << 7) 12531319b2f6SOder Chiou #define RT5645_VLO_SFT 7 12541319b2f6SOder Chiou #define RT5645_VLO_3V (0x0 << 7) 12551319b2f6SOder Chiou #define RT5645_VLO_32V (0x1 << 7) 12561319b2f6SOder Chiou #define RT5645_DIG_DP_MASK (0x1 << 6) 12571319b2f6SOder Chiou #define RT5645_DIG_DP_SFT 6 12581319b2f6SOder Chiou #define RT5645_DIG_DP_DIS (0x0 << 6) 12591319b2f6SOder Chiou #define RT5645_DIG_DP_EN (0x1 << 6) 12601319b2f6SOder Chiou #define RT5645_DP_TH_MASK (0x3 << 4) 12611319b2f6SOder Chiou #define RT5645_DP_TH_SFT 4 12621319b2f6SOder Chiou 12631319b2f6SOder Chiou /* Depop Mode Control 3 (0x90) */ 12641319b2f6SOder Chiou #define RT5645_CP_SYS_MASK (0x7 << 12) 12651319b2f6SOder Chiou #define RT5645_CP_SYS_SFT 12 12661319b2f6SOder Chiou #define RT5645_CP_FQ1_MASK (0x7 << 8) 12671319b2f6SOder Chiou #define RT5645_CP_FQ1_SFT 8 12681319b2f6SOder Chiou #define RT5645_CP_FQ2_MASK (0x7 << 4) 12691319b2f6SOder Chiou #define RT5645_CP_FQ2_SFT 4 12701319b2f6SOder Chiou #define RT5645_CP_FQ3_MASK (0x7) 12711319b2f6SOder Chiou #define RT5645_CP_FQ3_SFT 0 12721319b2f6SOder Chiou #define RT5645_CP_FQ_1_5_KHZ 0 12731319b2f6SOder Chiou #define RT5645_CP_FQ_3_KHZ 1 12741319b2f6SOder Chiou #define RT5645_CP_FQ_6_KHZ 2 12751319b2f6SOder Chiou #define RT5645_CP_FQ_12_KHZ 3 12761319b2f6SOder Chiou #define RT5645_CP_FQ_24_KHZ 4 12771319b2f6SOder Chiou #define RT5645_CP_FQ_48_KHZ 5 12781319b2f6SOder Chiou #define RT5645_CP_FQ_96_KHZ 6 12791319b2f6SOder Chiou #define RT5645_CP_FQ_192_KHZ 7 12801319b2f6SOder Chiou 12811319b2f6SOder Chiou /* PV detection and SPK gain control (0x92) */ 12821319b2f6SOder Chiou #define RT5645_PVDD_DET_MASK (0x1 << 15) 12831319b2f6SOder Chiou #define RT5645_PVDD_DET_SFT 15 12841319b2f6SOder Chiou #define RT5645_PVDD_DET_DIS (0x0 << 15) 12851319b2f6SOder Chiou #define RT5645_PVDD_DET_EN (0x1 << 15) 12861319b2f6SOder Chiou #define RT5645_SPK_AG_MASK (0x1 << 14) 12871319b2f6SOder Chiou #define RT5645_SPK_AG_SFT 14 12881319b2f6SOder Chiou #define RT5645_SPK_AG_DIS (0x0 << 14) 12891319b2f6SOder Chiou #define RT5645_SPK_AG_EN (0x1 << 14) 12901319b2f6SOder Chiou 12911319b2f6SOder Chiou /* Micbias Control (0x93) */ 12921319b2f6SOder Chiou #define RT5645_MIC1_BS_MASK (0x1 << 15) 12931319b2f6SOder Chiou #define RT5645_MIC1_BS_SFT 15 12941319b2f6SOder Chiou #define RT5645_MIC1_BS_9AV (0x0 << 15) 12951319b2f6SOder Chiou #define RT5645_MIC1_BS_75AV (0x1 << 15) 12961319b2f6SOder Chiou #define RT5645_MIC2_BS_MASK (0x1 << 14) 12971319b2f6SOder Chiou #define RT5645_MIC2_BS_SFT 14 12981319b2f6SOder Chiou #define RT5645_MIC2_BS_9AV (0x0 << 14) 12991319b2f6SOder Chiou #define RT5645_MIC2_BS_75AV (0x1 << 14) 13001319b2f6SOder Chiou #define RT5645_MIC1_CLK_MASK (0x1 << 13) 13011319b2f6SOder Chiou #define RT5645_MIC1_CLK_SFT 13 13021319b2f6SOder Chiou #define RT5645_MIC1_CLK_DIS (0x0 << 13) 13031319b2f6SOder Chiou #define RT5645_MIC1_CLK_EN (0x1 << 13) 13041319b2f6SOder Chiou #define RT5645_MIC2_CLK_MASK (0x1 << 12) 13051319b2f6SOder Chiou #define RT5645_MIC2_CLK_SFT 12 13061319b2f6SOder Chiou #define RT5645_MIC2_CLK_DIS (0x0 << 12) 13071319b2f6SOder Chiou #define RT5645_MIC2_CLK_EN (0x1 << 12) 13081319b2f6SOder Chiou #define RT5645_MIC1_OVCD_MASK (0x1 << 11) 13091319b2f6SOder Chiou #define RT5645_MIC1_OVCD_SFT 11 13101319b2f6SOder Chiou #define RT5645_MIC1_OVCD_DIS (0x0 << 11) 13111319b2f6SOder Chiou #define RT5645_MIC1_OVCD_EN (0x1 << 11) 13121319b2f6SOder Chiou #define RT5645_MIC1_OVTH_MASK (0x3 << 9) 13131319b2f6SOder Chiou #define RT5645_MIC1_OVTH_SFT 9 13141319b2f6SOder Chiou #define RT5645_MIC1_OVTH_600UA (0x0 << 9) 13151319b2f6SOder Chiou #define RT5645_MIC1_OVTH_1500UA (0x1 << 9) 13161319b2f6SOder Chiou #define RT5645_MIC1_OVTH_2000UA (0x2 << 9) 13171319b2f6SOder Chiou #define RT5645_MIC2_OVCD_MASK (0x1 << 8) 13181319b2f6SOder Chiou #define RT5645_MIC2_OVCD_SFT 8 13191319b2f6SOder Chiou #define RT5645_MIC2_OVCD_DIS (0x0 << 8) 13201319b2f6SOder Chiou #define RT5645_MIC2_OVCD_EN (0x1 << 8) 13211319b2f6SOder Chiou #define RT5645_MIC2_OVTH_MASK (0x3 << 6) 13221319b2f6SOder Chiou #define RT5645_MIC2_OVTH_SFT 6 13231319b2f6SOder Chiou #define RT5645_MIC2_OVTH_600UA (0x0 << 6) 13241319b2f6SOder Chiou #define RT5645_MIC2_OVTH_1500UA (0x1 << 6) 13251319b2f6SOder Chiou #define RT5645_MIC2_OVTH_2000UA (0x2 << 6) 13261319b2f6SOder Chiou #define RT5645_PWR_MB_MASK (0x1 << 5) 13271319b2f6SOder Chiou #define RT5645_PWR_MB_SFT 5 13281319b2f6SOder Chiou #define RT5645_PWR_MB_PD (0x0 << 5) 13291319b2f6SOder Chiou #define RT5645_PWR_MB_PU (0x1 << 5) 13301319b2f6SOder Chiou #define RT5645_PWR_CLK25M_MASK (0x1 << 4) 13311319b2f6SOder Chiou #define RT5645_PWR_CLK25M_SFT 4 13321319b2f6SOder Chiou #define RT5645_PWR_CLK25M_PD (0x0 << 4) 13331319b2f6SOder Chiou #define RT5645_PWR_CLK25M_PU (0x1 << 4) 1334bb656addSBard Liao #define RT5645_IRQ_CLK_MCLK (0x0 << 3) 1335bb656addSBard Liao #define RT5645_IRQ_CLK_INT (0x1 << 3) 13362d4e2d02SBard Liao #define RT5645_JD1_MODE_MASK (0x3 << 0) 13372d4e2d02SBard Liao #define RT5645_JD1_MODE_0 (0x0 << 0) 13382d4e2d02SBard Liao #define RT5645_JD1_MODE_1 (0x1 << 0) 13392d4e2d02SBard Liao #define RT5645_JD1_MODE_2 (0x2 << 0) 13401319b2f6SOder Chiou 13411319b2f6SOder Chiou /* VAD Control 4 (0x9d) */ 13421319b2f6SOder Chiou #define RT5645_VAD_SEL_MASK (0x3 << 8) 13431319b2f6SOder Chiou #define RT5645_VAD_SEL_SFT 8 13441319b2f6SOder Chiou 13451319b2f6SOder Chiou /* EQ Control 1 (0xb0) */ 13461319b2f6SOder Chiou #define RT5645_EQ_SRC_MASK (0x1 << 15) 13471319b2f6SOder Chiou #define RT5645_EQ_SRC_SFT 15 13481319b2f6SOder Chiou #define RT5645_EQ_SRC_DAC (0x0 << 15) 13491319b2f6SOder Chiou #define RT5645_EQ_SRC_ADC (0x1 << 15) 13501319b2f6SOder Chiou #define RT5645_EQ_UPD (0x1 << 14) 13511319b2f6SOder Chiou #define RT5645_EQ_UPD_BIT 14 13521319b2f6SOder Chiou #define RT5645_EQ_CD_MASK (0x1 << 13) 13531319b2f6SOder Chiou #define RT5645_EQ_CD_SFT 13 13541319b2f6SOder Chiou #define RT5645_EQ_CD_DIS (0x0 << 13) 13551319b2f6SOder Chiou #define RT5645_EQ_CD_EN (0x1 << 13) 13561319b2f6SOder Chiou #define RT5645_EQ_DITH_MASK (0x3 << 8) 13571319b2f6SOder Chiou #define RT5645_EQ_DITH_SFT 8 13581319b2f6SOder Chiou #define RT5645_EQ_DITH_NOR (0x0 << 8) 13591319b2f6SOder Chiou #define RT5645_EQ_DITH_LSB (0x1 << 8) 13601319b2f6SOder Chiou #define RT5645_EQ_DITH_LSB_1 (0x2 << 8) 13611319b2f6SOder Chiou #define RT5645_EQ_DITH_LSB_2 (0x3 << 8) 13621319b2f6SOder Chiou 13631319b2f6SOder Chiou /* EQ Control 2 (0xb1) */ 13641319b2f6SOder Chiou #define RT5645_EQ_HPF1_M_MASK (0x1 << 8) 13651319b2f6SOder Chiou #define RT5645_EQ_HPF1_M_SFT 8 13661319b2f6SOder Chiou #define RT5645_EQ_HPF1_M_HI (0x0 << 8) 13671319b2f6SOder Chiou #define RT5645_EQ_HPF1_M_1ST (0x1 << 8) 13681319b2f6SOder Chiou #define RT5645_EQ_LPF1_M_MASK (0x1 << 7) 13691319b2f6SOder Chiou #define RT5645_EQ_LPF1_M_SFT 7 13701319b2f6SOder Chiou #define RT5645_EQ_LPF1_M_LO (0x0 << 7) 13711319b2f6SOder Chiou #define RT5645_EQ_LPF1_M_1ST (0x1 << 7) 13721319b2f6SOder Chiou #define RT5645_EQ_HPF2_MASK (0x1 << 6) 13731319b2f6SOder Chiou #define RT5645_EQ_HPF2_SFT 6 13741319b2f6SOder Chiou #define RT5645_EQ_HPF2_DIS (0x0 << 6) 13751319b2f6SOder Chiou #define RT5645_EQ_HPF2_EN (0x1 << 6) 13761319b2f6SOder Chiou #define RT5645_EQ_HPF1_MASK (0x1 << 5) 13771319b2f6SOder Chiou #define RT5645_EQ_HPF1_SFT 5 13781319b2f6SOder Chiou #define RT5645_EQ_HPF1_DIS (0x0 << 5) 13791319b2f6SOder Chiou #define RT5645_EQ_HPF1_EN (0x1 << 5) 13801319b2f6SOder Chiou #define RT5645_EQ_BPF4_MASK (0x1 << 4) 13811319b2f6SOder Chiou #define RT5645_EQ_BPF4_SFT 4 13821319b2f6SOder Chiou #define RT5645_EQ_BPF4_DIS (0x0 << 4) 13831319b2f6SOder Chiou #define RT5645_EQ_BPF4_EN (0x1 << 4) 13841319b2f6SOder Chiou #define RT5645_EQ_BPF3_MASK (0x1 << 3) 13851319b2f6SOder Chiou #define RT5645_EQ_BPF3_SFT 3 13861319b2f6SOder Chiou #define RT5645_EQ_BPF3_DIS (0x0 << 3) 13871319b2f6SOder Chiou #define RT5645_EQ_BPF3_EN (0x1 << 3) 13881319b2f6SOder Chiou #define RT5645_EQ_BPF2_MASK (0x1 << 2) 13891319b2f6SOder Chiou #define RT5645_EQ_BPF2_SFT 2 13901319b2f6SOder Chiou #define RT5645_EQ_BPF2_DIS (0x0 << 2) 13911319b2f6SOder Chiou #define RT5645_EQ_BPF2_EN (0x1 << 2) 13921319b2f6SOder Chiou #define RT5645_EQ_BPF1_MASK (0x1 << 1) 13931319b2f6SOder Chiou #define RT5645_EQ_BPF1_SFT 1 13941319b2f6SOder Chiou #define RT5645_EQ_BPF1_DIS (0x0 << 1) 13951319b2f6SOder Chiou #define RT5645_EQ_BPF1_EN (0x1 << 1) 13961319b2f6SOder Chiou #define RT5645_EQ_LPF_MASK (0x1) 13971319b2f6SOder Chiou #define RT5645_EQ_LPF_SFT 0 13981319b2f6SOder Chiou #define RT5645_EQ_LPF_DIS (0x0) 13991319b2f6SOder Chiou #define RT5645_EQ_LPF_EN (0x1) 14001319b2f6SOder Chiou #define RT5645_EQ_CTRL_MASK (0x7f) 14011319b2f6SOder Chiou 14021319b2f6SOder Chiou /* Memory Test (0xb2) */ 14031319b2f6SOder Chiou #define RT5645_MT_MASK (0x1 << 15) 14041319b2f6SOder Chiou #define RT5645_MT_SFT 15 14051319b2f6SOder Chiou #define RT5645_MT_DIS (0x0 << 15) 14061319b2f6SOder Chiou #define RT5645_MT_EN (0x1 << 15) 14071319b2f6SOder Chiou 14081319b2f6SOder Chiou /* DRC/AGC Control 1 (0xb4) */ 14091319b2f6SOder Chiou #define RT5645_DRC_AGC_P_MASK (0x1 << 15) 14101319b2f6SOder Chiou #define RT5645_DRC_AGC_P_SFT 15 14111319b2f6SOder Chiou #define RT5645_DRC_AGC_P_DAC (0x0 << 15) 14121319b2f6SOder Chiou #define RT5645_DRC_AGC_P_ADC (0x1 << 15) 14131319b2f6SOder Chiou #define RT5645_DRC_AGC_MASK (0x1 << 14) 14141319b2f6SOder Chiou #define RT5645_DRC_AGC_SFT 14 14151319b2f6SOder Chiou #define RT5645_DRC_AGC_DIS (0x0 << 14) 14161319b2f6SOder Chiou #define RT5645_DRC_AGC_EN (0x1 << 14) 14171319b2f6SOder Chiou #define RT5645_DRC_AGC_UPD (0x1 << 13) 14181319b2f6SOder Chiou #define RT5645_DRC_AGC_UPD_BIT 13 14191319b2f6SOder Chiou #define RT5645_DRC_AGC_AR_MASK (0x1f << 8) 14201319b2f6SOder Chiou #define RT5645_DRC_AGC_AR_SFT 8 14211319b2f6SOder Chiou #define RT5645_DRC_AGC_R_MASK (0x7 << 5) 14221319b2f6SOder Chiou #define RT5645_DRC_AGC_R_SFT 5 14231319b2f6SOder Chiou #define RT5645_DRC_AGC_R_48K (0x1 << 5) 14241319b2f6SOder Chiou #define RT5645_DRC_AGC_R_96K (0x2 << 5) 14251319b2f6SOder Chiou #define RT5645_DRC_AGC_R_192K (0x3 << 5) 14261319b2f6SOder Chiou #define RT5645_DRC_AGC_R_441K (0x5 << 5) 14271319b2f6SOder Chiou #define RT5645_DRC_AGC_R_882K (0x6 << 5) 14281319b2f6SOder Chiou #define RT5645_DRC_AGC_R_1764K (0x7 << 5) 14291319b2f6SOder Chiou #define RT5645_DRC_AGC_RC_MASK (0x1f) 14301319b2f6SOder Chiou #define RT5645_DRC_AGC_RC_SFT 0 14311319b2f6SOder Chiou 14321319b2f6SOder Chiou /* DRC/AGC Control 2 (0xb5) */ 14331319b2f6SOder Chiou #define RT5645_DRC_AGC_POB_MASK (0x3f << 8) 14341319b2f6SOder Chiou #define RT5645_DRC_AGC_POB_SFT 8 14351319b2f6SOder Chiou #define RT5645_DRC_AGC_CP_MASK (0x1 << 7) 14361319b2f6SOder Chiou #define RT5645_DRC_AGC_CP_SFT 7 14371319b2f6SOder Chiou #define RT5645_DRC_AGC_CP_DIS (0x0 << 7) 14381319b2f6SOder Chiou #define RT5645_DRC_AGC_CP_EN (0x1 << 7) 14391319b2f6SOder Chiou #define RT5645_DRC_AGC_CPR_MASK (0x3 << 5) 14401319b2f6SOder Chiou #define RT5645_DRC_AGC_CPR_SFT 5 14411319b2f6SOder Chiou #define RT5645_DRC_AGC_CPR_1_1 (0x0 << 5) 14421319b2f6SOder Chiou #define RT5645_DRC_AGC_CPR_1_2 (0x1 << 5) 14431319b2f6SOder Chiou #define RT5645_DRC_AGC_CPR_1_3 (0x2 << 5) 14441319b2f6SOder Chiou #define RT5645_DRC_AGC_CPR_1_4 (0x3 << 5) 14451319b2f6SOder Chiou #define RT5645_DRC_AGC_PRB_MASK (0x1f) 14461319b2f6SOder Chiou #define RT5645_DRC_AGC_PRB_SFT 0 14471319b2f6SOder Chiou 14481319b2f6SOder Chiou /* DRC/AGC Control 3 (0xb6) */ 14491319b2f6SOder Chiou #define RT5645_DRC_AGC_NGB_MASK (0xf << 12) 14501319b2f6SOder Chiou #define RT5645_DRC_AGC_NGB_SFT 12 14511319b2f6SOder Chiou #define RT5645_DRC_AGC_TAR_MASK (0x1f << 7) 14521319b2f6SOder Chiou #define RT5645_DRC_AGC_TAR_SFT 7 14531319b2f6SOder Chiou #define RT5645_DRC_AGC_NG_MASK (0x1 << 6) 14541319b2f6SOder Chiou #define RT5645_DRC_AGC_NG_SFT 6 14551319b2f6SOder Chiou #define RT5645_DRC_AGC_NG_DIS (0x0 << 6) 14561319b2f6SOder Chiou #define RT5645_DRC_AGC_NG_EN (0x1 << 6) 14571319b2f6SOder Chiou #define RT5645_DRC_AGC_NGH_MASK (0x1 << 5) 14581319b2f6SOder Chiou #define RT5645_DRC_AGC_NGH_SFT 5 14591319b2f6SOder Chiou #define RT5645_DRC_AGC_NGH_DIS (0x0 << 5) 14601319b2f6SOder Chiou #define RT5645_DRC_AGC_NGH_EN (0x1 << 5) 14611319b2f6SOder Chiou #define RT5645_DRC_AGC_NGT_MASK (0x1f) 14621319b2f6SOder Chiou #define RT5645_DRC_AGC_NGT_SFT 0 14631319b2f6SOder Chiou 14641319b2f6SOder Chiou /* ANC Control 1 (0xb8) */ 14651319b2f6SOder Chiou #define RT5645_ANC_M_MASK (0x1 << 15) 14661319b2f6SOder Chiou #define RT5645_ANC_M_SFT 15 14671319b2f6SOder Chiou #define RT5645_ANC_M_NOR (0x0 << 15) 14681319b2f6SOder Chiou #define RT5645_ANC_M_REV (0x1 << 15) 14691319b2f6SOder Chiou #define RT5645_ANC_MASK (0x1 << 14) 14701319b2f6SOder Chiou #define RT5645_ANC_SFT 14 14711319b2f6SOder Chiou #define RT5645_ANC_DIS (0x0 << 14) 14721319b2f6SOder Chiou #define RT5645_ANC_EN (0x1 << 14) 14731319b2f6SOder Chiou #define RT5645_ANC_MD_MASK (0x3 << 12) 14741319b2f6SOder Chiou #define RT5645_ANC_MD_SFT 12 14751319b2f6SOder Chiou #define RT5645_ANC_MD_DIS (0x0 << 12) 14761319b2f6SOder Chiou #define RT5645_ANC_MD_67MS (0x1 << 12) 14771319b2f6SOder Chiou #define RT5645_ANC_MD_267MS (0x2 << 12) 14781319b2f6SOder Chiou #define RT5645_ANC_MD_1067MS (0x3 << 12) 14791319b2f6SOder Chiou #define RT5645_ANC_SN_MASK (0x1 << 11) 14801319b2f6SOder Chiou #define RT5645_ANC_SN_SFT 11 14811319b2f6SOder Chiou #define RT5645_ANC_SN_DIS (0x0 << 11) 14821319b2f6SOder Chiou #define RT5645_ANC_SN_EN (0x1 << 11) 14831319b2f6SOder Chiou #define RT5645_ANC_CLK_MASK (0x1 << 10) 14841319b2f6SOder Chiou #define RT5645_ANC_CLK_SFT 10 14851319b2f6SOder Chiou #define RT5645_ANC_CLK_ANC (0x0 << 10) 14861319b2f6SOder Chiou #define RT5645_ANC_CLK_REG (0x1 << 10) 14871319b2f6SOder Chiou #define RT5645_ANC_ZCD_MASK (0x3 << 8) 14881319b2f6SOder Chiou #define RT5645_ANC_ZCD_SFT 8 14891319b2f6SOder Chiou #define RT5645_ANC_ZCD_DIS (0x0 << 8) 14901319b2f6SOder Chiou #define RT5645_ANC_ZCD_T1 (0x1 << 8) 14911319b2f6SOder Chiou #define RT5645_ANC_ZCD_T2 (0x2 << 8) 14921319b2f6SOder Chiou #define RT5645_ANC_ZCD_WT (0x3 << 8) 14931319b2f6SOder Chiou #define RT5645_ANC_CS_MASK (0x1 << 7) 14941319b2f6SOder Chiou #define RT5645_ANC_CS_SFT 7 14951319b2f6SOder Chiou #define RT5645_ANC_CS_DIS (0x0 << 7) 14961319b2f6SOder Chiou #define RT5645_ANC_CS_EN (0x1 << 7) 14971319b2f6SOder Chiou #define RT5645_ANC_SW_MASK (0x1 << 6) 14981319b2f6SOder Chiou #define RT5645_ANC_SW_SFT 6 14991319b2f6SOder Chiou #define RT5645_ANC_SW_NOR (0x0 << 6) 15001319b2f6SOder Chiou #define RT5645_ANC_SW_AUTO (0x1 << 6) 15011319b2f6SOder Chiou #define RT5645_ANC_CO_L_MASK (0x3f) 15021319b2f6SOder Chiou #define RT5645_ANC_CO_L_SFT 0 15031319b2f6SOder Chiou 15041319b2f6SOder Chiou /* ANC Control 2 (0xb6) */ 15051319b2f6SOder Chiou #define RT5645_ANC_FG_R_MASK (0xf << 12) 15061319b2f6SOder Chiou #define RT5645_ANC_FG_R_SFT 12 15071319b2f6SOder Chiou #define RT5645_ANC_FG_L_MASK (0xf << 8) 15081319b2f6SOder Chiou #define RT5645_ANC_FG_L_SFT 8 15091319b2f6SOder Chiou #define RT5645_ANC_CG_R_MASK (0xf << 4) 15101319b2f6SOder Chiou #define RT5645_ANC_CG_R_SFT 4 15111319b2f6SOder Chiou #define RT5645_ANC_CG_L_MASK (0xf) 15121319b2f6SOder Chiou #define RT5645_ANC_CG_L_SFT 0 15131319b2f6SOder Chiou 15141319b2f6SOder Chiou /* ANC Control 3 (0xb6) */ 15151319b2f6SOder Chiou #define RT5645_ANC_CD_MASK (0x1 << 6) 15161319b2f6SOder Chiou #define RT5645_ANC_CD_SFT 6 15171319b2f6SOder Chiou #define RT5645_ANC_CD_BOTH (0x0 << 6) 15181319b2f6SOder Chiou #define RT5645_ANC_CD_IND (0x1 << 6) 15191319b2f6SOder Chiou #define RT5645_ANC_CO_R_MASK (0x3f) 15201319b2f6SOder Chiou #define RT5645_ANC_CO_R_SFT 0 15211319b2f6SOder Chiou 15221319b2f6SOder Chiou /* Jack Detect Control (0xbb) */ 15231319b2f6SOder Chiou #define RT5645_JD_MASK (0x7 << 13) 15241319b2f6SOder Chiou #define RT5645_JD_SFT 13 15251319b2f6SOder Chiou #define RT5645_JD_DIS (0x0 << 13) 15261319b2f6SOder Chiou #define RT5645_JD_GPIO1 (0x1 << 13) 15271319b2f6SOder Chiou #define RT5645_JD_JD1_IN4P (0x2 << 13) 15281319b2f6SOder Chiou #define RT5645_JD_JD2_IN4N (0x3 << 13) 15291319b2f6SOder Chiou #define RT5645_JD_GPIO2 (0x4 << 13) 15301319b2f6SOder Chiou #define RT5645_JD_GPIO3 (0x5 << 13) 15311319b2f6SOder Chiou #define RT5645_JD_GPIO4 (0x6 << 13) 15321319b2f6SOder Chiou #define RT5645_JD_HP_MASK (0x1 << 11) 15331319b2f6SOder Chiou #define RT5645_JD_HP_SFT 11 15341319b2f6SOder Chiou #define RT5645_JD_HP_DIS (0x0 << 11) 15351319b2f6SOder Chiou #define RT5645_JD_HP_EN (0x1 << 11) 15361319b2f6SOder Chiou #define RT5645_JD_HP_TRG_MASK (0x1 << 10) 15371319b2f6SOder Chiou #define RT5645_JD_HP_TRG_SFT 10 15381319b2f6SOder Chiou #define RT5645_JD_HP_TRG_LO (0x0 << 10) 15391319b2f6SOder Chiou #define RT5645_JD_HP_TRG_HI (0x1 << 10) 15401319b2f6SOder Chiou #define RT5645_JD_SPL_MASK (0x1 << 9) 15411319b2f6SOder Chiou #define RT5645_JD_SPL_SFT 9 15421319b2f6SOder Chiou #define RT5645_JD_SPL_DIS (0x0 << 9) 15431319b2f6SOder Chiou #define RT5645_JD_SPL_EN (0x1 << 9) 15441319b2f6SOder Chiou #define RT5645_JD_SPL_TRG_MASK (0x1 << 8) 15451319b2f6SOder Chiou #define RT5645_JD_SPL_TRG_SFT 8 15461319b2f6SOder Chiou #define RT5645_JD_SPL_TRG_LO (0x0 << 8) 15471319b2f6SOder Chiou #define RT5645_JD_SPL_TRG_HI (0x1 << 8) 15481319b2f6SOder Chiou #define RT5645_JD_SPR_MASK (0x1 << 7) 15491319b2f6SOder Chiou #define RT5645_JD_SPR_SFT 7 15501319b2f6SOder Chiou #define RT5645_JD_SPR_DIS (0x0 << 7) 15511319b2f6SOder Chiou #define RT5645_JD_SPR_EN (0x1 << 7) 15521319b2f6SOder Chiou #define RT5645_JD_SPR_TRG_MASK (0x1 << 6) 15531319b2f6SOder Chiou #define RT5645_JD_SPR_TRG_SFT 6 15541319b2f6SOder Chiou #define RT5645_JD_SPR_TRG_LO (0x0 << 6) 15551319b2f6SOder Chiou #define RT5645_JD_SPR_TRG_HI (0x1 << 6) 15561319b2f6SOder Chiou #define RT5645_JD_MO_MASK (0x1 << 5) 15571319b2f6SOder Chiou #define RT5645_JD_MO_SFT 5 15581319b2f6SOder Chiou #define RT5645_JD_MO_DIS (0x0 << 5) 15591319b2f6SOder Chiou #define RT5645_JD_MO_EN (0x1 << 5) 15601319b2f6SOder Chiou #define RT5645_JD_MO_TRG_MASK (0x1 << 4) 15611319b2f6SOder Chiou #define RT5645_JD_MO_TRG_SFT 4 15621319b2f6SOder Chiou #define RT5645_JD_MO_TRG_LO (0x0 << 4) 15631319b2f6SOder Chiou #define RT5645_JD_MO_TRG_HI (0x1 << 4) 15641319b2f6SOder Chiou #define RT5645_JD_LO_MASK (0x1 << 3) 15651319b2f6SOder Chiou #define RT5645_JD_LO_SFT 3 15661319b2f6SOder Chiou #define RT5645_JD_LO_DIS (0x0 << 3) 15671319b2f6SOder Chiou #define RT5645_JD_LO_EN (0x1 << 3) 15681319b2f6SOder Chiou #define RT5645_JD_LO_TRG_MASK (0x1 << 2) 15691319b2f6SOder Chiou #define RT5645_JD_LO_TRG_SFT 2 15701319b2f6SOder Chiou #define RT5645_JD_LO_TRG_LO (0x0 << 2) 15711319b2f6SOder Chiou #define RT5645_JD_LO_TRG_HI (0x1 << 2) 15721319b2f6SOder Chiou #define RT5645_JD1_IN4P_MASK (0x1 << 1) 15731319b2f6SOder Chiou #define RT5645_JD1_IN4P_SFT 1 15741319b2f6SOder Chiou #define RT5645_JD1_IN4P_DIS (0x0 << 1) 15751319b2f6SOder Chiou #define RT5645_JD1_IN4P_EN (0x1 << 1) 15761319b2f6SOder Chiou #define RT5645_JD2_IN4N_MASK (0x1) 15771319b2f6SOder Chiou #define RT5645_JD2_IN4N_SFT 0 15781319b2f6SOder Chiou #define RT5645_JD2_IN4N_DIS (0x0) 15791319b2f6SOder Chiou #define RT5645_JD2_IN4N_EN (0x1) 15801319b2f6SOder Chiou 15811319b2f6SOder Chiou /* Jack detect for ANC (0xbc) */ 15821319b2f6SOder Chiou #define RT5645_ANC_DET_MASK (0x3 << 4) 15831319b2f6SOder Chiou #define RT5645_ANC_DET_SFT 4 15841319b2f6SOder Chiou #define RT5645_ANC_DET_DIS (0x0 << 4) 15851319b2f6SOder Chiou #define RT5645_ANC_DET_MB1 (0x1 << 4) 15861319b2f6SOder Chiou #define RT5645_ANC_DET_MB2 (0x2 << 4) 15871319b2f6SOder Chiou #define RT5645_ANC_DET_JD (0x3 << 4) 15881319b2f6SOder Chiou #define RT5645_AD_TRG_MASK (0x1 << 3) 15891319b2f6SOder Chiou #define RT5645_AD_TRG_SFT 3 15901319b2f6SOder Chiou #define RT5645_AD_TRG_LO (0x0 << 3) 15911319b2f6SOder Chiou #define RT5645_AD_TRG_HI (0x1 << 3) 15921319b2f6SOder Chiou #define RT5645_ANCM_DET_MASK (0x3 << 4) 15931319b2f6SOder Chiou #define RT5645_ANCM_DET_SFT 4 15941319b2f6SOder Chiou #define RT5645_ANCM_DET_DIS (0x0 << 4) 15951319b2f6SOder Chiou #define RT5645_ANCM_DET_MB1 (0x1 << 4) 15961319b2f6SOder Chiou #define RT5645_ANCM_DET_MB2 (0x2 << 4) 15971319b2f6SOder Chiou #define RT5645_ANCM_DET_JD (0x3 << 4) 15981319b2f6SOder Chiou #define RT5645_AMD_TRG_MASK (0x1 << 3) 15991319b2f6SOder Chiou #define RT5645_AMD_TRG_SFT 3 16001319b2f6SOder Chiou #define RT5645_AMD_TRG_LO (0x0 << 3) 16011319b2f6SOder Chiou #define RT5645_AMD_TRG_HI (0x1 << 3) 16021319b2f6SOder Chiou 16031319b2f6SOder Chiou /* IRQ Control 1 (0xbd) */ 16041319b2f6SOder Chiou #define RT5645_IRQ_JD_MASK (0x1 << 15) 16051319b2f6SOder Chiou #define RT5645_IRQ_JD_SFT 15 16061319b2f6SOder Chiou #define RT5645_IRQ_JD_BP (0x0 << 15) 16071319b2f6SOder Chiou #define RT5645_IRQ_JD_NOR (0x1 << 15) 16081319b2f6SOder Chiou #define RT5645_IRQ_OT_MASK (0x1 << 14) 16091319b2f6SOder Chiou #define RT5645_IRQ_OT_SFT 14 16101319b2f6SOder Chiou #define RT5645_IRQ_OT_BP (0x0 << 14) 16111319b2f6SOder Chiou #define RT5645_IRQ_OT_NOR (0x1 << 14) 16121319b2f6SOder Chiou #define RT5645_JD_STKY_MASK (0x1 << 13) 16131319b2f6SOder Chiou #define RT5645_JD_STKY_SFT 13 16141319b2f6SOder Chiou #define RT5645_JD_STKY_DIS (0x0 << 13) 16151319b2f6SOder Chiou #define RT5645_JD_STKY_EN (0x1 << 13) 16161319b2f6SOder Chiou #define RT5645_OT_STKY_MASK (0x1 << 12) 16171319b2f6SOder Chiou #define RT5645_OT_STKY_SFT 12 16181319b2f6SOder Chiou #define RT5645_OT_STKY_DIS (0x0 << 12) 16191319b2f6SOder Chiou #define RT5645_OT_STKY_EN (0x1 << 12) 16201319b2f6SOder Chiou #define RT5645_JD_P_MASK (0x1 << 11) 16211319b2f6SOder Chiou #define RT5645_JD_P_SFT 11 16221319b2f6SOder Chiou #define RT5645_JD_P_NOR (0x0 << 11) 16231319b2f6SOder Chiou #define RT5645_JD_P_INV (0x1 << 11) 16241319b2f6SOder Chiou #define RT5645_OT_P_MASK (0x1 << 10) 16251319b2f6SOder Chiou #define RT5645_OT_P_SFT 10 16261319b2f6SOder Chiou #define RT5645_OT_P_NOR (0x0 << 10) 16271319b2f6SOder Chiou #define RT5645_OT_P_INV (0x1 << 10) 16282d4e2d02SBard Liao #define RT5645_IRQ_JD_1_1_EN (0x1 << 9) 16291319b2f6SOder Chiou 16301319b2f6SOder Chiou /* IRQ Control 2 (0xbe) */ 16311319b2f6SOder Chiou #define RT5645_IRQ_MB1_OC_MASK (0x1 << 15) 16321319b2f6SOder Chiou #define RT5645_IRQ_MB1_OC_SFT 15 16331319b2f6SOder Chiou #define RT5645_IRQ_MB1_OC_BP (0x0 << 15) 16341319b2f6SOder Chiou #define RT5645_IRQ_MB1_OC_NOR (0x1 << 15) 16351319b2f6SOder Chiou #define RT5645_IRQ_MB2_OC_MASK (0x1 << 14) 16361319b2f6SOder Chiou #define RT5645_IRQ_MB2_OC_SFT 14 16371319b2f6SOder Chiou #define RT5645_IRQ_MB2_OC_BP (0x0 << 14) 16381319b2f6SOder Chiou #define RT5645_IRQ_MB2_OC_NOR (0x1 << 14) 16391319b2f6SOder Chiou #define RT5645_MB1_OC_STKY_MASK (0x1 << 13) 16401319b2f6SOder Chiou #define RT5645_MB1_OC_STKY_SFT 13 16411319b2f6SOder Chiou #define RT5645_MB1_OC_STKY_DIS (0x0 << 13) 16421319b2f6SOder Chiou #define RT5645_MB1_OC_STKY_EN (0x1 << 13) 16431319b2f6SOder Chiou #define RT5645_MB2_OC_STKY_MASK (0x1 << 12) 16441319b2f6SOder Chiou #define RT5645_MB2_OC_STKY_SFT 12 16451319b2f6SOder Chiou #define RT5645_MB2_OC_STKY_DIS (0x0 << 12) 16461319b2f6SOder Chiou #define RT5645_MB2_OC_STKY_EN (0x1 << 12) 16471319b2f6SOder Chiou #define RT5645_MB1_OC_P_MASK (0x1 << 7) 16481319b2f6SOder Chiou #define RT5645_MB1_OC_P_SFT 7 16491319b2f6SOder Chiou #define RT5645_MB1_OC_P_NOR (0x0 << 7) 16501319b2f6SOder Chiou #define RT5645_MB1_OC_P_INV (0x1 << 7) 16511319b2f6SOder Chiou #define RT5645_MB2_OC_P_MASK (0x1 << 6) 16521319b2f6SOder Chiou #define RT5645_MB2_OC_P_SFT 6 16531319b2f6SOder Chiou #define RT5645_MB2_OC_P_NOR (0x0 << 6) 16541319b2f6SOder Chiou #define RT5645_MB2_OC_P_INV (0x1 << 6) 16551319b2f6SOder Chiou #define RT5645_MB1_OC_CLR (0x1 << 3) 16561319b2f6SOder Chiou #define RT5645_MB1_OC_CLR_SFT 3 16571319b2f6SOder Chiou #define RT5645_MB2_OC_CLR (0x1 << 2) 16581319b2f6SOder Chiou #define RT5645_MB2_OC_CLR_SFT 2 16591319b2f6SOder Chiou 16601319b2f6SOder Chiou /* GPIO Control 1 (0xc0) */ 16611319b2f6SOder Chiou #define RT5645_GP1_PIN_MASK (0x1 << 15) 16621319b2f6SOder Chiou #define RT5645_GP1_PIN_SFT 15 16631319b2f6SOder Chiou #define RT5645_GP1_PIN_GPIO1 (0x0 << 15) 16641319b2f6SOder Chiou #define RT5645_GP1_PIN_IRQ (0x1 << 15) 16651319b2f6SOder Chiou #define RT5645_GP2_PIN_MASK (0x1 << 14) 16661319b2f6SOder Chiou #define RT5645_GP2_PIN_SFT 14 16671319b2f6SOder Chiou #define RT5645_GP2_PIN_GPIO2 (0x0 << 14) 16681319b2f6SOder Chiou #define RT5645_GP2_PIN_DMIC1_SCL (0x1 << 14) 16691319b2f6SOder Chiou #define RT5645_GP3_PIN_MASK (0x3 << 12) 16701319b2f6SOder Chiou #define RT5645_GP3_PIN_SFT 12 16711319b2f6SOder Chiou #define RT5645_GP3_PIN_GPIO3 (0x0 << 12) 16721319b2f6SOder Chiou #define RT5645_GP3_PIN_DMIC1_SDA (0x1 << 12) 16731319b2f6SOder Chiou #define RT5645_GP3_PIN_IRQ (0x2 << 12) 16741319b2f6SOder Chiou #define RT5645_GP4_PIN_MASK (0x1 << 11) 16751319b2f6SOder Chiou #define RT5645_GP4_PIN_SFT 11 16761319b2f6SOder Chiou #define RT5645_GP4_PIN_GPIO4 (0x0 << 11) 16771319b2f6SOder Chiou #define RT5645_GP4_PIN_DMIC2_SDA (0x1 << 11) 16781319b2f6SOder Chiou #define RT5645_DP_SIG_MASK (0x1 << 10) 16791319b2f6SOder Chiou #define RT5645_DP_SIG_SFT 10 16801319b2f6SOder Chiou #define RT5645_DP_SIG_TEST (0x0 << 10) 16811319b2f6SOder Chiou #define RT5645_DP_SIG_AP (0x1 << 10) 16821319b2f6SOder Chiou #define RT5645_GPIO_M_MASK (0x1 << 9) 16831319b2f6SOder Chiou #define RT5645_GPIO_M_SFT 9 16841319b2f6SOder Chiou #define RT5645_GPIO_M_FLT (0x0 << 9) 16851319b2f6SOder Chiou #define RT5645_GPIO_M_PH (0x1 << 9) 16861319b2f6SOder Chiou #define RT5645_I2S2_SEL (0x1 << 8) 16871319b2f6SOder Chiou #define RT5645_I2S2_SEL_SFT 8 16881319b2f6SOder Chiou #define RT5645_GP5_PIN_MASK (0x1 << 7) 16891319b2f6SOder Chiou #define RT5645_GP5_PIN_SFT 7 16901319b2f6SOder Chiou #define RT5645_GP5_PIN_GPIO5 (0x0 << 7) 16911319b2f6SOder Chiou #define RT5645_GP5_PIN_DMIC1_SDA (0x1 << 7) 16921319b2f6SOder Chiou #define RT5645_GP6_PIN_MASK (0x1 << 6) 16931319b2f6SOder Chiou #define RT5645_GP6_PIN_SFT 6 16941319b2f6SOder Chiou #define RT5645_GP6_PIN_GPIO6 (0x0 << 6) 16951319b2f6SOder Chiou #define RT5645_GP6_PIN_DMIC2_SDA (0x1 << 6) 16961319b2f6SOder Chiou #define RT5645_GP8_PIN_MASK (0x1 << 3) 16971319b2f6SOder Chiou #define RT5645_GP8_PIN_SFT 3 16981319b2f6SOder Chiou #define RT5645_GP8_PIN_GPIO8 (0x0 << 3) 16991319b2f6SOder Chiou #define RT5645_GP8_PIN_DMIC2_SDA (0x1 << 3) 17001319b2f6SOder Chiou #define RT5645_GP12_PIN_MASK (0x1 << 2) 17011319b2f6SOder Chiou #define RT5645_GP12_PIN_SFT 2 17021319b2f6SOder Chiou #define RT5645_GP12_PIN_GPIO12 (0x0 << 2) 17031319b2f6SOder Chiou #define RT5645_GP12_PIN_DMIC2_SDA (0x1 << 2) 17041319b2f6SOder Chiou #define RT5645_GP11_PIN_MASK (0x1 << 1) 17051319b2f6SOder Chiou #define RT5645_GP11_PIN_SFT 1 17061319b2f6SOder Chiou #define RT5645_GP11_PIN_GPIO11 (0x0 << 1) 17071319b2f6SOder Chiou #define RT5645_GP11_PIN_DMIC1_SDA (0x1 << 1) 17081319b2f6SOder Chiou #define RT5645_GP10_PIN_MASK (0x1) 17091319b2f6SOder Chiou #define RT5645_GP10_PIN_SFT 0 17101319b2f6SOder Chiou #define RT5645_GP10_PIN_GPIO10 (0x0) 17111319b2f6SOder Chiou #define RT5645_GP10_PIN_DMIC2_SDA (0x1) 17121319b2f6SOder Chiou 17131319b2f6SOder Chiou /* GPIO Control 3 (0xc2) */ 17141319b2f6SOder Chiou #define RT5645_GP4_PF_MASK (0x1 << 11) 17151319b2f6SOder Chiou #define RT5645_GP4_PF_SFT 11 17161319b2f6SOder Chiou #define RT5645_GP4_PF_IN (0x0 << 11) 17171319b2f6SOder Chiou #define RT5645_GP4_PF_OUT (0x1 << 11) 17181319b2f6SOder Chiou #define RT5645_GP4_OUT_MASK (0x1 << 10) 17191319b2f6SOder Chiou #define RT5645_GP4_OUT_SFT 10 17201319b2f6SOder Chiou #define RT5645_GP4_OUT_LO (0x0 << 10) 17211319b2f6SOder Chiou #define RT5645_GP4_OUT_HI (0x1 << 10) 17221319b2f6SOder Chiou #define RT5645_GP4_P_MASK (0x1 << 9) 17231319b2f6SOder Chiou #define RT5645_GP4_P_SFT 9 17241319b2f6SOder Chiou #define RT5645_GP4_P_NOR (0x0 << 9) 17251319b2f6SOder Chiou #define RT5645_GP4_P_INV (0x1 << 9) 17261319b2f6SOder Chiou #define RT5645_GP3_PF_MASK (0x1 << 8) 17271319b2f6SOder Chiou #define RT5645_GP3_PF_SFT 8 17281319b2f6SOder Chiou #define RT5645_GP3_PF_IN (0x0 << 8) 17291319b2f6SOder Chiou #define RT5645_GP3_PF_OUT (0x1 << 8) 17301319b2f6SOder Chiou #define RT5645_GP3_OUT_MASK (0x1 << 7) 17311319b2f6SOder Chiou #define RT5645_GP3_OUT_SFT 7 17321319b2f6SOder Chiou #define RT5645_GP3_OUT_LO (0x0 << 7) 17331319b2f6SOder Chiou #define RT5645_GP3_OUT_HI (0x1 << 7) 17341319b2f6SOder Chiou #define RT5645_GP3_P_MASK (0x1 << 6) 17351319b2f6SOder Chiou #define RT5645_GP3_P_SFT 6 17361319b2f6SOder Chiou #define RT5645_GP3_P_NOR (0x0 << 6) 17371319b2f6SOder Chiou #define RT5645_GP3_P_INV (0x1 << 6) 17381319b2f6SOder Chiou #define RT5645_GP2_PF_MASK (0x1 << 5) 17391319b2f6SOder Chiou #define RT5645_GP2_PF_SFT 5 17401319b2f6SOder Chiou #define RT5645_GP2_PF_IN (0x0 << 5) 17411319b2f6SOder Chiou #define RT5645_GP2_PF_OUT (0x1 << 5) 17421319b2f6SOder Chiou #define RT5645_GP2_OUT_MASK (0x1 << 4) 17431319b2f6SOder Chiou #define RT5645_GP2_OUT_SFT 4 17441319b2f6SOder Chiou #define RT5645_GP2_OUT_LO (0x0 << 4) 17451319b2f6SOder Chiou #define RT5645_GP2_OUT_HI (0x1 << 4) 17461319b2f6SOder Chiou #define RT5645_GP2_P_MASK (0x1 << 3) 17471319b2f6SOder Chiou #define RT5645_GP2_P_SFT 3 17481319b2f6SOder Chiou #define RT5645_GP2_P_NOR (0x0 << 3) 17491319b2f6SOder Chiou #define RT5645_GP2_P_INV (0x1 << 3) 17501319b2f6SOder Chiou #define RT5645_GP1_PF_MASK (0x1 << 2) 17511319b2f6SOder Chiou #define RT5645_GP1_PF_SFT 2 17521319b2f6SOder Chiou #define RT5645_GP1_PF_IN (0x0 << 2) 17531319b2f6SOder Chiou #define RT5645_GP1_PF_OUT (0x1 << 2) 17541319b2f6SOder Chiou #define RT5645_GP1_OUT_MASK (0x1 << 1) 17551319b2f6SOder Chiou #define RT5645_GP1_OUT_SFT 1 17561319b2f6SOder Chiou #define RT5645_GP1_OUT_LO (0x0 << 1) 17571319b2f6SOder Chiou #define RT5645_GP1_OUT_HI (0x1 << 1) 17581319b2f6SOder Chiou #define RT5645_GP1_P_MASK (0x1) 17591319b2f6SOder Chiou #define RT5645_GP1_P_SFT 0 17601319b2f6SOder Chiou #define RT5645_GP1_P_NOR (0x0) 17611319b2f6SOder Chiou #define RT5645_GP1_P_INV (0x1) 17621319b2f6SOder Chiou 17631319b2f6SOder Chiou /* Programmable Register Array Control 1 (0xc8) */ 17641319b2f6SOder Chiou #define RT5645_REG_SEQ_MASK (0xf << 12) 17651319b2f6SOder Chiou #define RT5645_REG_SEQ_SFT 12 17661319b2f6SOder Chiou #define RT5645_SEQ1_ST_MASK (0x1 << 11) /*RO*/ 17671319b2f6SOder Chiou #define RT5645_SEQ1_ST_SFT 11 17681319b2f6SOder Chiou #define RT5645_SEQ1_ST_RUN (0x0 << 11) 17691319b2f6SOder Chiou #define RT5645_SEQ1_ST_FIN (0x1 << 11) 17701319b2f6SOder Chiou #define RT5645_SEQ2_ST_MASK (0x1 << 10) /*RO*/ 17711319b2f6SOder Chiou #define RT5645_SEQ2_ST_SFT 10 17721319b2f6SOder Chiou #define RT5645_SEQ2_ST_RUN (0x0 << 10) 17731319b2f6SOder Chiou #define RT5645_SEQ2_ST_FIN (0x1 << 10) 17741319b2f6SOder Chiou #define RT5645_REG_LV_MASK (0x1 << 9) 17751319b2f6SOder Chiou #define RT5645_REG_LV_SFT 9 17761319b2f6SOder Chiou #define RT5645_REG_LV_MX (0x0 << 9) 17771319b2f6SOder Chiou #define RT5645_REG_LV_PR (0x1 << 9) 17781319b2f6SOder Chiou #define RT5645_SEQ_2_PT_MASK (0x1 << 8) 17791319b2f6SOder Chiou #define RT5645_SEQ_2_PT_BIT 8 17801319b2f6SOder Chiou #define RT5645_REG_IDX_MASK (0xff) 17811319b2f6SOder Chiou #define RT5645_REG_IDX_SFT 0 17821319b2f6SOder Chiou 17831319b2f6SOder Chiou /* Programmable Register Array Control 2 (0xc9) */ 17841319b2f6SOder Chiou #define RT5645_REG_DAT_MASK (0xffff) 17851319b2f6SOder Chiou #define RT5645_REG_DAT_SFT 0 17861319b2f6SOder Chiou 17871319b2f6SOder Chiou /* Programmable Register Array Control 3 (0xca) */ 17881319b2f6SOder Chiou #define RT5645_SEQ_DLY_MASK (0xff << 8) 17891319b2f6SOder Chiou #define RT5645_SEQ_DLY_SFT 8 17901319b2f6SOder Chiou #define RT5645_PROG_MASK (0x1 << 7) 17911319b2f6SOder Chiou #define RT5645_PROG_SFT 7 17921319b2f6SOder Chiou #define RT5645_PROG_DIS (0x0 << 7) 17931319b2f6SOder Chiou #define RT5645_PROG_EN (0x1 << 7) 17941319b2f6SOder Chiou #define RT5645_SEQ1_PT_RUN (0x1 << 6) 17951319b2f6SOder Chiou #define RT5645_SEQ1_PT_RUN_BIT 6 17961319b2f6SOder Chiou #define RT5645_SEQ2_PT_RUN (0x1 << 5) 17971319b2f6SOder Chiou #define RT5645_SEQ2_PT_RUN_BIT 5 17981319b2f6SOder Chiou 17991319b2f6SOder Chiou /* Programmable Register Array Control 4 (0xcb) */ 18001319b2f6SOder Chiou #define RT5645_SEQ1_START_MASK (0xf << 8) 18011319b2f6SOder Chiou #define RT5645_SEQ1_START_SFT 8 18021319b2f6SOder Chiou #define RT5645_SEQ1_END_MASK (0xf) 18031319b2f6SOder Chiou #define RT5645_SEQ1_END_SFT 0 18041319b2f6SOder Chiou 18051319b2f6SOder Chiou /* Programmable Register Array Control 5 (0xcc) */ 18061319b2f6SOder Chiou #define RT5645_SEQ2_START_MASK (0xf << 8) 18071319b2f6SOder Chiou #define RT5645_SEQ2_START_SFT 8 18081319b2f6SOder Chiou #define RT5645_SEQ2_END_MASK (0xf) 18091319b2f6SOder Chiou #define RT5645_SEQ2_END_SFT 0 18101319b2f6SOder Chiou 18111319b2f6SOder Chiou /* Scramble Function (0xcd) */ 18121319b2f6SOder Chiou #define RT5645_SCB_KEY_MASK (0xff) 18131319b2f6SOder Chiou #define RT5645_SCB_KEY_SFT 0 18141319b2f6SOder Chiou 18151319b2f6SOder Chiou /* Scramble Control (0xce) */ 18161319b2f6SOder Chiou #define RT5645_SCB_SWAP_MASK (0x1 << 15) 18171319b2f6SOder Chiou #define RT5645_SCB_SWAP_SFT 15 18181319b2f6SOder Chiou #define RT5645_SCB_SWAP_DIS (0x0 << 15) 18191319b2f6SOder Chiou #define RT5645_SCB_SWAP_EN (0x1 << 15) 18201319b2f6SOder Chiou #define RT5645_SCB_MASK (0x1 << 14) 18211319b2f6SOder Chiou #define RT5645_SCB_SFT 14 18221319b2f6SOder Chiou #define RT5645_SCB_DIS (0x0 << 14) 18231319b2f6SOder Chiou #define RT5645_SCB_EN (0x1 << 14) 18241319b2f6SOder Chiou 18251319b2f6SOder Chiou /* Baseback Control (0xcf) */ 18261319b2f6SOder Chiou #define RT5645_BB_MASK (0x1 << 15) 18271319b2f6SOder Chiou #define RT5645_BB_SFT 15 18281319b2f6SOder Chiou #define RT5645_BB_DIS (0x0 << 15) 18291319b2f6SOder Chiou #define RT5645_BB_EN (0x1 << 15) 18301319b2f6SOder Chiou #define RT5645_BB_CT_MASK (0x7 << 12) 18311319b2f6SOder Chiou #define RT5645_BB_CT_SFT 12 18321319b2f6SOder Chiou #define RT5645_BB_CT_A (0x0 << 12) 18331319b2f6SOder Chiou #define RT5645_BB_CT_B (0x1 << 12) 18341319b2f6SOder Chiou #define RT5645_BB_CT_C (0x2 << 12) 18351319b2f6SOder Chiou #define RT5645_BB_CT_D (0x3 << 12) 18361319b2f6SOder Chiou #define RT5645_M_BB_L_MASK (0x1 << 9) 18371319b2f6SOder Chiou #define RT5645_M_BB_L_SFT 9 18381319b2f6SOder Chiou #define RT5645_M_BB_R_MASK (0x1 << 8) 18391319b2f6SOder Chiou #define RT5645_M_BB_R_SFT 8 18401319b2f6SOder Chiou #define RT5645_M_BB_HPF_L_MASK (0x1 << 7) 18411319b2f6SOder Chiou #define RT5645_M_BB_HPF_L_SFT 7 18421319b2f6SOder Chiou #define RT5645_M_BB_HPF_R_MASK (0x1 << 6) 18431319b2f6SOder Chiou #define RT5645_M_BB_HPF_R_SFT 6 18441319b2f6SOder Chiou #define RT5645_G_BB_BST_MASK (0x3f) 18451319b2f6SOder Chiou #define RT5645_G_BB_BST_SFT 0 1846850577dbSBard Liao #define RT5645_G_BB_BST_25DB 0x14 18471319b2f6SOder Chiou 18481319b2f6SOder Chiou /* MP3 Plus Control 1 (0xd0) */ 18491319b2f6SOder Chiou #define RT5645_M_MP3_L_MASK (0x1 << 15) 18501319b2f6SOder Chiou #define RT5645_M_MP3_L_SFT 15 18511319b2f6SOder Chiou #define RT5645_M_MP3_R_MASK (0x1 << 14) 18521319b2f6SOder Chiou #define RT5645_M_MP3_R_SFT 14 18531319b2f6SOder Chiou #define RT5645_M_MP3_MASK (0x1 << 13) 18541319b2f6SOder Chiou #define RT5645_M_MP3_SFT 13 18551319b2f6SOder Chiou #define RT5645_M_MP3_DIS (0x0 << 13) 18561319b2f6SOder Chiou #define RT5645_M_MP3_EN (0x1 << 13) 18571319b2f6SOder Chiou #define RT5645_EG_MP3_MASK (0x1f << 8) 18581319b2f6SOder Chiou #define RT5645_EG_MP3_SFT 8 18591319b2f6SOder Chiou #define RT5645_MP3_HLP_MASK (0x1 << 7) 18601319b2f6SOder Chiou #define RT5645_MP3_HLP_SFT 7 18611319b2f6SOder Chiou #define RT5645_MP3_HLP_DIS (0x0 << 7) 18621319b2f6SOder Chiou #define RT5645_MP3_HLP_EN (0x1 << 7) 18631319b2f6SOder Chiou #define RT5645_M_MP3_ORG_L_MASK (0x1 << 6) 18641319b2f6SOder Chiou #define RT5645_M_MP3_ORG_L_SFT 6 18651319b2f6SOder Chiou #define RT5645_M_MP3_ORG_R_MASK (0x1 << 5) 18661319b2f6SOder Chiou #define RT5645_M_MP3_ORG_R_SFT 5 18671319b2f6SOder Chiou 18681319b2f6SOder Chiou /* MP3 Plus Control 2 (0xd1) */ 18691319b2f6SOder Chiou #define RT5645_MP3_WT_MASK (0x1 << 13) 18701319b2f6SOder Chiou #define RT5645_MP3_WT_SFT 13 18711319b2f6SOder Chiou #define RT5645_MP3_WT_1_4 (0x0 << 13) 18721319b2f6SOder Chiou #define RT5645_MP3_WT_1_2 (0x1 << 13) 18731319b2f6SOder Chiou #define RT5645_OG_MP3_MASK (0x1f << 8) 18741319b2f6SOder Chiou #define RT5645_OG_MP3_SFT 8 18751319b2f6SOder Chiou #define RT5645_HG_MP3_MASK (0x3f) 18761319b2f6SOder Chiou #define RT5645_HG_MP3_SFT 0 18771319b2f6SOder Chiou 18781319b2f6SOder Chiou /* 3D HP Control 1 (0xd2) */ 18791319b2f6SOder Chiou #define RT5645_3D_CF_MASK (0x1 << 15) 18801319b2f6SOder Chiou #define RT5645_3D_CF_SFT 15 18811319b2f6SOder Chiou #define RT5645_3D_CF_DIS (0x0 << 15) 18821319b2f6SOder Chiou #define RT5645_3D_CF_EN (0x1 << 15) 18831319b2f6SOder Chiou #define RT5645_3D_HP_MASK (0x1 << 14) 18841319b2f6SOder Chiou #define RT5645_3D_HP_SFT 14 18851319b2f6SOder Chiou #define RT5645_3D_HP_DIS (0x0 << 14) 18861319b2f6SOder Chiou #define RT5645_3D_HP_EN (0x1 << 14) 18871319b2f6SOder Chiou #define RT5645_3D_BT_MASK (0x1 << 13) 18881319b2f6SOder Chiou #define RT5645_3D_BT_SFT 13 18891319b2f6SOder Chiou #define RT5645_3D_BT_DIS (0x0 << 13) 18901319b2f6SOder Chiou #define RT5645_3D_BT_EN (0x1 << 13) 18911319b2f6SOder Chiou #define RT5645_3D_1F_MIX_MASK (0x3 << 11) 18921319b2f6SOder Chiou #define RT5645_3D_1F_MIX_SFT 11 18931319b2f6SOder Chiou #define RT5645_3D_HP_M_MASK (0x1 << 10) 18941319b2f6SOder Chiou #define RT5645_3D_HP_M_SFT 10 18951319b2f6SOder Chiou #define RT5645_3D_HP_M_SUR (0x0 << 10) 18961319b2f6SOder Chiou #define RT5645_3D_HP_M_FRO (0x1 << 10) 18971319b2f6SOder Chiou #define RT5645_M_3D_HRTF_MASK (0x1 << 9) 18981319b2f6SOder Chiou #define RT5645_M_3D_HRTF_SFT 9 18991319b2f6SOder Chiou #define RT5645_M_3D_D2H_MASK (0x1 << 8) 19001319b2f6SOder Chiou #define RT5645_M_3D_D2H_SFT 8 19011319b2f6SOder Chiou #define RT5645_M_3D_D2R_MASK (0x1 << 7) 19021319b2f6SOder Chiou #define RT5645_M_3D_D2R_SFT 7 19031319b2f6SOder Chiou #define RT5645_M_3D_REVB_MASK (0x1 << 6) 19041319b2f6SOder Chiou #define RT5645_M_3D_REVB_SFT 6 19051319b2f6SOder Chiou 19061319b2f6SOder Chiou /* Adjustable high pass filter control 1 (0xd3) */ 19071319b2f6SOder Chiou #define RT5645_2ND_HPF_MASK (0x1 << 15) 19081319b2f6SOder Chiou #define RT5645_2ND_HPF_SFT 15 19091319b2f6SOder Chiou #define RT5645_2ND_HPF_DIS (0x0 << 15) 19101319b2f6SOder Chiou #define RT5645_2ND_HPF_EN (0x1 << 15) 19111319b2f6SOder Chiou #define RT5645_HPF_CF_L_MASK (0x7 << 12) 19121319b2f6SOder Chiou #define RT5645_HPF_CF_L_SFT 12 19131319b2f6SOder Chiou #define RT5645_1ST_HPF_MASK (0x1 << 11) 19141319b2f6SOder Chiou #define RT5645_1ST_HPF_SFT 11 19151319b2f6SOder Chiou #define RT5645_1ST_HPF_DIS (0x0 << 11) 19161319b2f6SOder Chiou #define RT5645_1ST_HPF_EN (0x1 << 11) 19171319b2f6SOder Chiou #define RT5645_HPF_CF_R_MASK (0x7 << 8) 19181319b2f6SOder Chiou #define RT5645_HPF_CF_R_SFT 8 19191319b2f6SOder Chiou #define RT5645_ZD_T_MASK (0x3 << 6) 19201319b2f6SOder Chiou #define RT5645_ZD_T_SFT 6 19211319b2f6SOder Chiou #define RT5645_ZD_F_MASK (0x3 << 4) 19221319b2f6SOder Chiou #define RT5645_ZD_F_SFT 4 19231319b2f6SOder Chiou #define RT5645_ZD_F_IM (0x0 << 4) 19241319b2f6SOder Chiou #define RT5645_ZD_F_ZC_IM (0x1 << 4) 19251319b2f6SOder Chiou #define RT5645_ZD_F_ZC_IOD (0x2 << 4) 19261319b2f6SOder Chiou #define RT5645_ZD_F_UN (0x3 << 4) 19271319b2f6SOder Chiou 19281319b2f6SOder Chiou /* HP calibration control and Amp detection (0xd6) */ 19291319b2f6SOder Chiou #define RT5645_SI_DAC_MASK (0x1 << 11) 19301319b2f6SOder Chiou #define RT5645_SI_DAC_SFT 11 19311319b2f6SOder Chiou #define RT5645_SI_DAC_AUTO (0x0 << 11) 19321319b2f6SOder Chiou #define RT5645_SI_DAC_TEST (0x1 << 11) 19331319b2f6SOder Chiou #define RT5645_DC_CAL_M_MASK (0x1 << 10) 19341319b2f6SOder Chiou #define RT5645_DC_CAL_M_SFT 10 19351319b2f6SOder Chiou #define RT5645_DC_CAL_M_CAL (0x0 << 10) 19361319b2f6SOder Chiou #define RT5645_DC_CAL_M_NOR (0x1 << 10) 19371319b2f6SOder Chiou #define RT5645_DC_CAL_MASK (0x1 << 9) 19381319b2f6SOder Chiou #define RT5645_DC_CAL_SFT 9 19391319b2f6SOder Chiou #define RT5645_DC_CAL_DIS (0x0 << 9) 19401319b2f6SOder Chiou #define RT5645_DC_CAL_EN (0x1 << 9) 19411319b2f6SOder Chiou #define RT5645_HPD_RCV_MASK (0x7 << 6) 19421319b2f6SOder Chiou #define RT5645_HPD_RCV_SFT 6 19431319b2f6SOder Chiou #define RT5645_HPD_PS_MASK (0x1 << 5) 19441319b2f6SOder Chiou #define RT5645_HPD_PS_SFT 5 19451319b2f6SOder Chiou #define RT5645_HPD_PS_DIS (0x0 << 5) 19461319b2f6SOder Chiou #define RT5645_HPD_PS_EN (0x1 << 5) 19471319b2f6SOder Chiou #define RT5645_CAL_M_MASK (0x1 << 4) 19481319b2f6SOder Chiou #define RT5645_CAL_M_SFT 4 19491319b2f6SOder Chiou #define RT5645_CAL_M_DEP (0x0 << 4) 19501319b2f6SOder Chiou #define RT5645_CAL_M_CAL (0x1 << 4) 19511319b2f6SOder Chiou #define RT5645_CAL_MASK (0x1 << 3) 19521319b2f6SOder Chiou #define RT5645_CAL_SFT 3 19531319b2f6SOder Chiou #define RT5645_CAL_DIS (0x0 << 3) 19541319b2f6SOder Chiou #define RT5645_CAL_EN (0x1 << 3) 19551319b2f6SOder Chiou #define RT5645_CAL_TEST_MASK (0x1 << 2) 19561319b2f6SOder Chiou #define RT5645_CAL_TEST_SFT 2 19571319b2f6SOder Chiou #define RT5645_CAL_TEST_DIS (0x0 << 2) 19581319b2f6SOder Chiou #define RT5645_CAL_TEST_EN (0x1 << 2) 19591319b2f6SOder Chiou #define RT5645_CAL_P_MASK (0x3) 19601319b2f6SOder Chiou #define RT5645_CAL_P_SFT 0 19611319b2f6SOder Chiou #define RT5645_CAL_P_NONE (0x0) 19621319b2f6SOder Chiou #define RT5645_CAL_P_CAL (0x1) 19631319b2f6SOder Chiou #define RT5645_CAL_P_DAC_CAL (0x2) 19641319b2f6SOder Chiou 19651319b2f6SOder Chiou /* Soft volume and zero cross control 1 (0xd9) */ 19661319b2f6SOder Chiou #define RT5645_SV_MASK (0x1 << 15) 19671319b2f6SOder Chiou #define RT5645_SV_SFT 15 19681319b2f6SOder Chiou #define RT5645_SV_DIS (0x0 << 15) 19691319b2f6SOder Chiou #define RT5645_SV_EN (0x1 << 15) 19701319b2f6SOder Chiou #define RT5645_SPO_SV_MASK (0x1 << 14) 19711319b2f6SOder Chiou #define RT5645_SPO_SV_SFT 14 19721319b2f6SOder Chiou #define RT5645_SPO_SV_DIS (0x0 << 14) 19731319b2f6SOder Chiou #define RT5645_SPO_SV_EN (0x1 << 14) 19741319b2f6SOder Chiou #define RT5645_OUT_SV_MASK (0x1 << 13) 19751319b2f6SOder Chiou #define RT5645_OUT_SV_SFT 13 19761319b2f6SOder Chiou #define RT5645_OUT_SV_DIS (0x0 << 13) 19771319b2f6SOder Chiou #define RT5645_OUT_SV_EN (0x1 << 13) 19781319b2f6SOder Chiou #define RT5645_HP_SV_MASK (0x1 << 12) 19791319b2f6SOder Chiou #define RT5645_HP_SV_SFT 12 19801319b2f6SOder Chiou #define RT5645_HP_SV_DIS (0x0 << 12) 19811319b2f6SOder Chiou #define RT5645_HP_SV_EN (0x1 << 12) 19821319b2f6SOder Chiou #define RT5645_ZCD_DIG_MASK (0x1 << 11) 19831319b2f6SOder Chiou #define RT5645_ZCD_DIG_SFT 11 19841319b2f6SOder Chiou #define RT5645_ZCD_DIG_DIS (0x0 << 11) 19851319b2f6SOder Chiou #define RT5645_ZCD_DIG_EN (0x1 << 11) 19861319b2f6SOder Chiou #define RT5645_ZCD_MASK (0x1 << 10) 19871319b2f6SOder Chiou #define RT5645_ZCD_SFT 10 19881319b2f6SOder Chiou #define RT5645_ZCD_PD (0x0 << 10) 19891319b2f6SOder Chiou #define RT5645_ZCD_PU (0x1 << 10) 19901319b2f6SOder Chiou #define RT5645_M_ZCD_MASK (0x3f << 4) 19911319b2f6SOder Chiou #define RT5645_M_ZCD_SFT 4 19921319b2f6SOder Chiou #define RT5645_M_ZCD_RM_L (0x1 << 9) 19931319b2f6SOder Chiou #define RT5645_M_ZCD_RM_R (0x1 << 8) 19941319b2f6SOder Chiou #define RT5645_M_ZCD_SM_L (0x1 << 7) 19951319b2f6SOder Chiou #define RT5645_M_ZCD_SM_R (0x1 << 6) 19961319b2f6SOder Chiou #define RT5645_M_ZCD_OM_L (0x1 << 5) 19971319b2f6SOder Chiou #define RT5645_M_ZCD_OM_R (0x1 << 4) 19981319b2f6SOder Chiou #define RT5645_SV_DLY_MASK (0xf) 19991319b2f6SOder Chiou #define RT5645_SV_DLY_SFT 0 20001319b2f6SOder Chiou 20011319b2f6SOder Chiou /* Soft volume and zero cross control 2 (0xda) */ 20021319b2f6SOder Chiou #define RT5645_ZCD_HP_MASK (0x1 << 15) 20031319b2f6SOder Chiou #define RT5645_ZCD_HP_SFT 15 20041319b2f6SOder Chiou #define RT5645_ZCD_HP_DIS (0x0 << 15) 20051319b2f6SOder Chiou #define RT5645_ZCD_HP_EN (0x1 << 15) 20061319b2f6SOder Chiou 20071319b2f6SOder Chiou 20081319b2f6SOder Chiou /* Codec Private Register definition */ 20091319b2f6SOder Chiou /* 3D Speaker Control (0x63) */ 20101319b2f6SOder Chiou #define RT5645_3D_SPK_MASK (0x1 << 15) 20111319b2f6SOder Chiou #define RT5645_3D_SPK_SFT 15 20121319b2f6SOder Chiou #define RT5645_3D_SPK_DIS (0x0 << 15) 20131319b2f6SOder Chiou #define RT5645_3D_SPK_EN (0x1 << 15) 20141319b2f6SOder Chiou #define RT5645_3D_SPK_M_MASK (0x3 << 13) 20151319b2f6SOder Chiou #define RT5645_3D_SPK_M_SFT 13 20161319b2f6SOder Chiou #define RT5645_3D_SPK_CG_MASK (0x1f << 8) 20171319b2f6SOder Chiou #define RT5645_3D_SPK_CG_SFT 8 20181319b2f6SOder Chiou #define RT5645_3D_SPK_SG_MASK (0x1f) 20191319b2f6SOder Chiou #define RT5645_3D_SPK_SG_SFT 0 20201319b2f6SOder Chiou 20211319b2f6SOder Chiou /* Wind Noise Detection Control 1 (0x6c) */ 20221319b2f6SOder Chiou #define RT5645_WND_MASK (0x1 << 15) 20231319b2f6SOder Chiou #define RT5645_WND_SFT 15 20241319b2f6SOder Chiou #define RT5645_WND_DIS (0x0 << 15) 20251319b2f6SOder Chiou #define RT5645_WND_EN (0x1 << 15) 20261319b2f6SOder Chiou 20271319b2f6SOder Chiou /* Wind Noise Detection Control 2 (0x6d) */ 20281319b2f6SOder Chiou #define RT5645_WND_FC_NW_MASK (0x3f << 10) 20291319b2f6SOder Chiou #define RT5645_WND_FC_NW_SFT 10 20301319b2f6SOder Chiou #define RT5645_WND_FC_WK_MASK (0x3f << 4) 20311319b2f6SOder Chiou #define RT5645_WND_FC_WK_SFT 4 20321319b2f6SOder Chiou 20331319b2f6SOder Chiou /* Wind Noise Detection Control 3 (0x6e) */ 20341319b2f6SOder Chiou #define RT5645_HPF_FC_MASK (0x3f << 6) 20351319b2f6SOder Chiou #define RT5645_HPF_FC_SFT 6 20361319b2f6SOder Chiou #define RT5645_WND_FC_ST_MASK (0x3f) 20371319b2f6SOder Chiou #define RT5645_WND_FC_ST_SFT 0 20381319b2f6SOder Chiou 20391319b2f6SOder Chiou /* Wind Noise Detection Control 4 (0x6f) */ 20401319b2f6SOder Chiou #define RT5645_WND_TH_LO_MASK (0x3ff) 20411319b2f6SOder Chiou #define RT5645_WND_TH_LO_SFT 0 20421319b2f6SOder Chiou 20431319b2f6SOder Chiou /* Wind Noise Detection Control 5 (0x70) */ 20441319b2f6SOder Chiou #define RT5645_WND_TH_HI_MASK (0x3ff) 20451319b2f6SOder Chiou #define RT5645_WND_TH_HI_SFT 0 20461319b2f6SOder Chiou 20471319b2f6SOder Chiou /* Wind Noise Detection Control 8 (0x73) */ 20481319b2f6SOder Chiou #define RT5645_WND_WIND_MASK (0x1 << 13) /* Read-Only */ 20491319b2f6SOder Chiou #define RT5645_WND_WIND_SFT 13 20501319b2f6SOder Chiou #define RT5645_WND_STRONG_MASK (0x1 << 12) /* Read-Only */ 20511319b2f6SOder Chiou #define RT5645_WND_STRONG_SFT 12 20521319b2f6SOder Chiou enum { 20531319b2f6SOder Chiou RT5645_NO_WIND, 20541319b2f6SOder Chiou RT5645_BREEZE, 20551319b2f6SOder Chiou RT5645_STORM, 20561319b2f6SOder Chiou }; 20571319b2f6SOder Chiou 20581319b2f6SOder Chiou /* Dipole Speaker Interface (0x75) */ 20591319b2f6SOder Chiou #define RT5645_DP_ATT_MASK (0x3 << 14) 20601319b2f6SOder Chiou #define RT5645_DP_ATT_SFT 14 20611319b2f6SOder Chiou #define RT5645_DP_SPK_MASK (0x1 << 10) 20621319b2f6SOder Chiou #define RT5645_DP_SPK_SFT 10 20631319b2f6SOder Chiou #define RT5645_DP_SPK_DIS (0x0 << 10) 20641319b2f6SOder Chiou #define RT5645_DP_SPK_EN (0x1 << 10) 20651319b2f6SOder Chiou 20661319b2f6SOder Chiou /* EQ Pre Volume Control (0xb3) */ 20671319b2f6SOder Chiou #define RT5645_EQ_PRE_VOL_MASK (0xffff) 20681319b2f6SOder Chiou #define RT5645_EQ_PRE_VOL_SFT 0 20691319b2f6SOder Chiou 20701319b2f6SOder Chiou /* EQ Post Volume Control (0xb4) */ 20711319b2f6SOder Chiou #define RT5645_EQ_PST_VOL_MASK (0xffff) 20721319b2f6SOder Chiou #define RT5645_EQ_PST_VOL_SFT 0 20731319b2f6SOder Chiou 20741319b2f6SOder Chiou /* Jack Detect Control 3 (0xf8) */ 20751319b2f6SOder Chiou #define RT5645_CMP_MIC_IN_DET_MASK (0x7 << 12) 20761319b2f6SOder Chiou #define RT5645_JD_CBJ_EN (0x1 << 7) 20771319b2f6SOder Chiou #define RT5645_JD_CBJ_POL (0x1 << 6) 20781319b2f6SOder Chiou #define RT5645_JD_TRI_CBJ_SEL_MASK (0x7 << 3) 20791319b2f6SOder Chiou #define RT5645_JD_TRI_CBJ_SEL_SFT (3) 20801319b2f6SOder Chiou #define RT5645_JD_TRI_HPO_SEL_MASK (0x7) 20811319b2f6SOder Chiou #define RT5645_JD_TRI_HPO_SEL_SFT (0) 20821319b2f6SOder Chiou #define RT5645_JD_F_GPIO_JD1 (0x0) 20831319b2f6SOder Chiou #define RT5645_JD_F_JD1_1 (0x1) 20841319b2f6SOder Chiou #define RT5645_JD_F_JD1_2 (0x2) 20851319b2f6SOder Chiou #define RT5645_JD_F_JD2 (0x3) 20861319b2f6SOder Chiou #define RT5645_JD_F_JD3 (0x4) 20871319b2f6SOder Chiou #define RT5645_JD_F_GPIO_JD2 (0x5) 20881319b2f6SOder Chiou #define RT5645_JD_F_MX0B_12 (0x6) 20891319b2f6SOder Chiou 20901319b2f6SOder Chiou /* Digital Misc Control (0xfa) */ 20911319b2f6SOder Chiou #define RT5645_RST_DSP (0x1 << 13) 20921319b2f6SOder Chiou #define RT5645_IF1_ADC1_IN1_SEL (0x1 << 12) 20931319b2f6SOder Chiou #define RT5645_IF1_ADC1_IN1_SFT 12 20941319b2f6SOder Chiou #define RT5645_IF1_ADC1_IN2_SEL (0x1 << 11) 20951319b2f6SOder Chiou #define RT5645_IF1_ADC1_IN2_SFT 11 20961319b2f6SOder Chiou #define RT5645_IF1_ADC2_IN1_SEL (0x1 << 10) 20971319b2f6SOder Chiou #define RT5645_IF1_ADC2_IN1_SFT 10 20981319b2f6SOder Chiou #define RT5645_DIG_GATE_CTRL 0x1 20991319b2f6SOder Chiou 21001319b2f6SOder Chiou /* General Control2 (0xfb) */ 21011319b2f6SOder Chiou #define RT5645_RXDC_SRC_MASK (0x1 << 7) 21021319b2f6SOder Chiou #define RT5645_RXDC_SRC_STO (0x0 << 7) 21031319b2f6SOder Chiou #define RT5645_RXDC_SRC_MONO (0x1 << 7) 21041319b2f6SOder Chiou #define RT5645_RXDC_SRC_SFT (7) 21051319b2f6SOder Chiou #define RT5645_RXDP2_SEL_MASK (0x1 << 3) 21061319b2f6SOder Chiou #define RT5645_RXDP2_SEL_IF2 (0x0 << 3) 21071319b2f6SOder Chiou #define RT5645_RXDP2_SEL_ADC (0x1 << 3) 21081319b2f6SOder Chiou #define RT5645_RXDP2_SEL_SFT (3) 21091319b2f6SOder Chiou 2110bb656addSBard Liao /* General Control3 (0xfc) */ 21112d4e2d02SBard Liao #define RT5645_JD_PSV_MODE (0x1 << 12) 2112bb656addSBard Liao #define RT5645_IRQ_CLK_GATE_CTRL (0x1 << 11) 2113bb656addSBard Liao #define RT5645_MICINDET_MANU (0x1 << 7) 21141319b2f6SOder Chiou 21151319b2f6SOder Chiou /* Vendor ID (0xfd) */ 21161319b2f6SOder Chiou #define RT5645_VER_C 0x2 21171319b2f6SOder Chiou #define RT5645_VER_D 0x3 21181319b2f6SOder Chiou 21191319b2f6SOder Chiou 21201319b2f6SOder Chiou /* Volume Rescale */ 21211319b2f6SOder Chiou #define RT5645_VOL_RSCL_MAX 0x27 21221319b2f6SOder Chiou #define RT5645_VOL_RSCL_RANGE 0x1F 21231319b2f6SOder Chiou /* Debug String Length */ 21241319b2f6SOder Chiou #define RT5645_REG_DISP_LEN 23 21251319b2f6SOder Chiou 21261319b2f6SOder Chiou 21271319b2f6SOder Chiou /* System Clock Source */ 21281319b2f6SOder Chiou enum { 21291319b2f6SOder Chiou RT5645_SCLK_S_MCLK, 21301319b2f6SOder Chiou RT5645_SCLK_S_PLL1, 21311319b2f6SOder Chiou RT5645_SCLK_S_RCCLK, 21321319b2f6SOder Chiou }; 21331319b2f6SOder Chiou 21341319b2f6SOder Chiou /* PLL1 Source */ 21351319b2f6SOder Chiou enum { 21361319b2f6SOder Chiou RT5645_PLL1_S_MCLK, 21371319b2f6SOder Chiou RT5645_PLL1_S_BCLK1, 21381319b2f6SOder Chiou RT5645_PLL1_S_BCLK2, 21391319b2f6SOder Chiou }; 21401319b2f6SOder Chiou 21411319b2f6SOder Chiou enum { 21421319b2f6SOder Chiou RT5645_AIF1, 21431319b2f6SOder Chiou RT5645_AIF2, 21441319b2f6SOder Chiou RT5645_AIFS, 21451319b2f6SOder Chiou }; 21461319b2f6SOder Chiou 21471319b2f6SOder Chiou enum { 2148*ac4fc3eeSBard Liao RT5645_DMIC1_DISABLE, 21491319b2f6SOder Chiou RT5645_DMIC_DATA_IN2P, 21501319b2f6SOder Chiou RT5645_DMIC_DATA_GPIO6, 21511319b2f6SOder Chiou RT5645_DMIC_DATA_GPIO10, 21521319b2f6SOder Chiou RT5645_DMIC_DATA_GPIO12, 21531319b2f6SOder Chiou }; 21541319b2f6SOder Chiou 21551319b2f6SOder Chiou enum { 2156*ac4fc3eeSBard Liao RT5645_DMIC2_DISABLE, 21571319b2f6SOder Chiou RT5645_DMIC_DATA_IN2N, 21581319b2f6SOder Chiou RT5645_DMIC_DATA_GPIO5, 21591319b2f6SOder Chiou RT5645_DMIC_DATA_GPIO11, 21601319b2f6SOder Chiou }; 21611319b2f6SOder Chiou 21625c4ca99dSBard Liao enum { 21635c4ca99dSBard Liao CODEC_TYPE_RT5645, 21645c4ca99dSBard Liao CODEC_TYPE_RT5650, 21655c4ca99dSBard Liao }; 21665c4ca99dSBard Liao 216779080a8bSFang, Yang A /* filter mask */ 216879080a8bSFang, Yang A enum { 216979080a8bSFang, Yang A RT5645_DA_STEREO_FILTER = 0x1, 217079080a8bSFang, Yang A RT5645_DA_MONO_L_FILTER = (0x1 << 1), 217179080a8bSFang, Yang A RT5645_DA_MONO_R_FILTER = (0x1 << 2), 217279080a8bSFang, Yang A RT5645_AD_STEREO_FILTER = (0x1 << 3), 217379080a8bSFang, Yang A RT5645_AD_MONO_L_FILTER = (0x1 << 4), 217479080a8bSFang, Yang A RT5645_AD_MONO_R_FILTER = (0x1 << 5), 217579080a8bSFang, Yang A }; 217679080a8bSFang, Yang A 217779080a8bSFang, Yang A int rt5645_sel_asrc_clk_src(struct snd_soc_codec *codec, 217879080a8bSFang, Yang A unsigned int filter_mask, unsigned int clk_src); 217979080a8bSFang, Yang A 21801319b2f6SOder Chiou struct rt5645_priv { 21811319b2f6SOder Chiou struct snd_soc_codec *codec; 21821319b2f6SOder Chiou struct rt5645_platform_data pdata; 21831319b2f6SOder Chiou struct regmap *regmap; 2184f3fa1bbdSOder Chiou struct i2c_client *i2c; 2185471f208aSBard Liao struct snd_soc_jack *hp_jack; 2186471f208aSBard Liao struct snd_soc_jack *mic_jack; 21876e747d53SBard Liao struct snd_soc_jack *btn_jack; 2188cd6e82b8SOder Chiou struct delayed_work jack_detect_work; 21891319b2f6SOder Chiou 21905c4ca99dSBard Liao int codec_type; 21911319b2f6SOder Chiou int sysclk; 21921319b2f6SOder Chiou int sysclk_src; 21931319b2f6SOder Chiou int lrck[RT5645_AIFS]; 21941319b2f6SOder Chiou int bclk[RT5645_AIFS]; 21951319b2f6SOder Chiou int master[RT5645_AIFS]; 21961319b2f6SOder Chiou 21971319b2f6SOder Chiou int pll_src; 21981319b2f6SOder Chiou int pll_in; 21991319b2f6SOder Chiou int pll_out; 22006e747d53SBard Liao 22016e747d53SBard Liao int jack_type; 22026e747d53SBard Liao bool en_button_func; 22031319b2f6SOder Chiou }; 22041319b2f6SOder Chiou 2205f3fa1bbdSOder Chiou int rt5645_set_jack_detect(struct snd_soc_codec *codec, 22066e747d53SBard Liao struct snd_soc_jack *hp_jack, struct snd_soc_jack *mic_jack, 22076e747d53SBard Liao struct snd_soc_jack *btn_jack); 22081319b2f6SOder Chiou #endif /* __RT5645_H__ */ 2209