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