1*d2912cb1SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */ 22b26dd4cSOder Chiou /* 32b26dd4cSOder Chiou * rt5660.h -- RT5660 ALSA SoC audio driver 42b26dd4cSOder Chiou * 52b26dd4cSOder Chiou * Copyright 2016 Realtek Semiconductor Corp. 62b26dd4cSOder Chiou * Author: Oder Chiou <oder_chiou@realtek.com> 72b26dd4cSOder Chiou */ 82b26dd4cSOder Chiou 92b26dd4cSOder Chiou #ifndef _RT5660_H 102b26dd4cSOder Chiou #define _RT5660_H 112b26dd4cSOder Chiou 122b26dd4cSOder Chiou #include <linux/clk.h> 132b26dd4cSOder Chiou #include <sound/rt5660.h> 142b26dd4cSOder Chiou 152b26dd4cSOder Chiou /* Info */ 162b26dd4cSOder Chiou #define RT5660_RESET 0x00 172b26dd4cSOder Chiou #define RT5660_VENDOR_ID 0xfd 182b26dd4cSOder Chiou #define RT5660_VENDOR_ID1 0xfe 192b26dd4cSOder Chiou #define RT5660_VENDOR_ID2 0xff 202b26dd4cSOder Chiou /* I/O - Output */ 212b26dd4cSOder Chiou #define RT5660_SPK_VOL 0x01 222b26dd4cSOder Chiou #define RT5660_LOUT_VOL 0x02 232b26dd4cSOder Chiou /* I/O - Input */ 242b26dd4cSOder Chiou #define RT5660_IN1_IN2 0x0d 252b26dd4cSOder Chiou #define RT5660_IN3_IN4 0x0e 262b26dd4cSOder Chiou /* I/O - ADC/DAC/DMIC */ 272b26dd4cSOder Chiou #define RT5660_DAC1_DIG_VOL 0x19 282b26dd4cSOder Chiou #define RT5660_STO1_ADC_DIG_VOL 0x1c 292b26dd4cSOder Chiou #define RT5660_ADC_BST_VOL1 0x1e 302b26dd4cSOder Chiou /* Mixer - D-D */ 312b26dd4cSOder Chiou #define RT5660_STO1_ADC_MIXER 0x27 322b26dd4cSOder Chiou #define RT5660_AD_DA_MIXER 0x29 332b26dd4cSOder Chiou #define RT5660_STO_DAC_MIXER 0x2a 342b26dd4cSOder Chiou #define RT5660_DIG_INF1_DATA 0x2f 352b26dd4cSOder Chiou /* Mixer - ADC */ 362b26dd4cSOder Chiou #define RT5660_REC_L1_MIXER 0x3b 372b26dd4cSOder Chiou #define RT5660_REC_L2_MIXER 0x3c 382b26dd4cSOder Chiou #define RT5660_REC_R1_MIXER 0x3d 392b26dd4cSOder Chiou #define RT5660_REC_R2_MIXER 0x3e 402b26dd4cSOder Chiou /* Mixer - DAC */ 412b26dd4cSOder Chiou #define RT5660_LOUT_MIXER 0x45 422b26dd4cSOder Chiou #define RT5660_SPK_MIXER 0x46 432b26dd4cSOder Chiou #define RT5660_SPO_MIXER 0x48 442b26dd4cSOder Chiou #define RT5660_SPO_CLSD_RATIO 0x4a 452b26dd4cSOder Chiou #define RT5660_OUT_L_GAIN1 0x4d 462b26dd4cSOder Chiou #define RT5660_OUT_L_GAIN2 0x4e 472b26dd4cSOder Chiou #define RT5660_OUT_L1_MIXER 0x4f 482b26dd4cSOder Chiou #define RT5660_OUT_R_GAIN1 0x50 492b26dd4cSOder Chiou #define RT5660_OUT_R_GAIN2 0x51 502b26dd4cSOder Chiou #define RT5660_OUT_R1_MIXER 0x52 512b26dd4cSOder Chiou /* Power */ 522b26dd4cSOder Chiou #define RT5660_PWR_DIG1 0x61 532b26dd4cSOder Chiou #define RT5660_PWR_DIG2 0x62 542b26dd4cSOder Chiou #define RT5660_PWR_ANLG1 0x63 552b26dd4cSOder Chiou #define RT5660_PWR_ANLG2 0x64 562b26dd4cSOder Chiou #define RT5660_PWR_MIXER 0x65 572b26dd4cSOder Chiou #define RT5660_PWR_VOL 0x66 582b26dd4cSOder Chiou /* Private Register Control */ 592b26dd4cSOder Chiou #define RT5660_PRIV_INDEX 0x6a 602b26dd4cSOder Chiou #define RT5660_PRIV_DATA 0x6c 612b26dd4cSOder Chiou /* Format - ADC/DAC */ 622b26dd4cSOder Chiou #define RT5660_I2S1_SDP 0x70 632b26dd4cSOder Chiou #define RT5660_ADDA_CLK1 0x73 642b26dd4cSOder Chiou #define RT5660_ADDA_CLK2 0x74 652b26dd4cSOder Chiou #define RT5660_DMIC_CTRL1 0x75 662b26dd4cSOder Chiou /* Function - Analog */ 672b26dd4cSOder Chiou #define RT5660_GLB_CLK 0x80 682b26dd4cSOder Chiou #define RT5660_PLL_CTRL1 0x81 692b26dd4cSOder Chiou #define RT5660_PLL_CTRL2 0x82 702b26dd4cSOder Chiou #define RT5660_CLSD_AMP_OC_CTRL 0x8c 712b26dd4cSOder Chiou #define RT5660_CLSD_AMP_CTRL 0x8d 722b26dd4cSOder Chiou #define RT5660_LOUT_AMP_CTRL 0x8e 732b26dd4cSOder Chiou #define RT5660_SPK_AMP_SPKVDD 0x92 742b26dd4cSOder Chiou #define RT5660_MICBIAS 0x93 752b26dd4cSOder Chiou #define RT5660_CLSD_OUT_CTRL1 0xa1 762b26dd4cSOder Chiou #define RT5660_CLSD_OUT_CTRL2 0xa2 772b26dd4cSOder Chiou #define RT5660_DIPOLE_MIC_CTRL1 0xa3 782b26dd4cSOder Chiou #define RT5660_DIPOLE_MIC_CTRL2 0xa4 792b26dd4cSOder Chiou #define RT5660_DIPOLE_MIC_CTRL3 0xa5 802b26dd4cSOder Chiou #define RT5660_DIPOLE_MIC_CTRL4 0xa6 812b26dd4cSOder Chiou #define RT5660_DIPOLE_MIC_CTRL5 0xa7 822b26dd4cSOder Chiou #define RT5660_DIPOLE_MIC_CTRL6 0xa8 832b26dd4cSOder Chiou #define RT5660_DIPOLE_MIC_CTRL7 0xa9 842b26dd4cSOder Chiou #define RT5660_DIPOLE_MIC_CTRL8 0xaa 852b26dd4cSOder Chiou #define RT5660_DIPOLE_MIC_CTRL9 0xab 862b26dd4cSOder Chiou #define RT5660_DIPOLE_MIC_CTRL10 0xac 872b26dd4cSOder Chiou #define RT5660_DIPOLE_MIC_CTRL11 0xad 882b26dd4cSOder Chiou #define RT5660_DIPOLE_MIC_CTRL12 0xae 892b26dd4cSOder Chiou /* Function - Digital */ 902b26dd4cSOder Chiou #define RT5660_EQ_CTRL1 0xb0 912b26dd4cSOder Chiou #define RT5660_EQ_CTRL2 0xb1 922b26dd4cSOder Chiou #define RT5660_DRC_AGC_CTRL1 0xb3 932b26dd4cSOder Chiou #define RT5660_DRC_AGC_CTRL2 0xb4 942b26dd4cSOder Chiou #define RT5660_DRC_AGC_CTRL3 0xb5 952b26dd4cSOder Chiou #define RT5660_DRC_AGC_CTRL4 0xb6 962b26dd4cSOder Chiou #define RT5660_DRC_AGC_CTRL5 0xb7 972b26dd4cSOder Chiou #define RT5660_JD_CTRL 0xbb 982b26dd4cSOder Chiou #define RT5660_IRQ_CTRL1 0xbd 992b26dd4cSOder Chiou #define RT5660_IRQ_CTRL2 0xbe 1002b26dd4cSOder Chiou #define RT5660_INT_IRQ_ST 0xbf 1012b26dd4cSOder Chiou #define RT5660_GPIO_CTRL1 0xc0 1022b26dd4cSOder Chiou #define RT5660_GPIO_CTRL2 0xc2 1032b26dd4cSOder Chiou #define RT5660_WIND_FILTER_CTRL1 0xd3 1042b26dd4cSOder Chiou #define RT5660_SV_ZCD1 0xd9 1052b26dd4cSOder Chiou #define RT5660_SV_ZCD2 0xda 1062b26dd4cSOder Chiou #define RT5660_DRC1_LM_CTRL1 0xe0 1072b26dd4cSOder Chiou #define RT5660_DRC1_LM_CTRL2 0xe1 1082b26dd4cSOder Chiou #define RT5660_DRC2_LM_CTRL1 0xe2 1092b26dd4cSOder Chiou #define RT5660_DRC2_LM_CTRL2 0xe3 1102b26dd4cSOder Chiou #define RT5660_MULTI_DRC_CTRL 0xe4 1112b26dd4cSOder Chiou #define RT5660_DRC2_CTRL1 0xe5 1122b26dd4cSOder Chiou #define RT5660_DRC2_CTRL2 0xe6 1132b26dd4cSOder Chiou #define RT5660_DRC2_CTRL3 0xe7 1142b26dd4cSOder Chiou #define RT5660_DRC2_CTRL4 0xe8 1152b26dd4cSOder Chiou #define RT5660_DRC2_CTRL5 0xe9 1162b26dd4cSOder Chiou #define RT5660_ALC_PGA_CTRL1 0xea 1172b26dd4cSOder Chiou #define RT5660_ALC_PGA_CTRL2 0xeb 1182b26dd4cSOder Chiou #define RT5660_ALC_PGA_CTRL3 0xec 1192b26dd4cSOder Chiou #define RT5660_ALC_PGA_CTRL4 0xed 1202b26dd4cSOder Chiou #define RT5660_ALC_PGA_CTRL5 0xee 1212b26dd4cSOder Chiou #define RT5660_ALC_PGA_CTRL6 0xef 1222b26dd4cSOder Chiou #define RT5660_ALC_PGA_CTRL7 0xf0 1232b26dd4cSOder Chiou 1242b26dd4cSOder Chiou /* General Control */ 1252b26dd4cSOder Chiou #define RT5660_GEN_CTRL1 0xfa 1262b26dd4cSOder Chiou #define RT5660_GEN_CTRL2 0xfb 1272b26dd4cSOder Chiou #define RT5660_GEN_CTRL3 0xfc 1282b26dd4cSOder Chiou 1292b26dd4cSOder Chiou /* Index of Codec Private Register definition */ 1302b26dd4cSOder Chiou #define RT5660_CHOP_DAC_ADC 0x3d 1312b26dd4cSOder Chiou 1322b26dd4cSOder Chiou /* Global Definition */ 1332b26dd4cSOder Chiou #define RT5660_L_MUTE (0x1 << 15) 1342b26dd4cSOder Chiou #define RT5660_L_MUTE_SFT 15 1352b26dd4cSOder Chiou #define RT5660_VOL_L_MUTE (0x1 << 14) 1362b26dd4cSOder Chiou #define RT5660_VOL_L_SFT 14 1372b26dd4cSOder Chiou #define RT5660_R_MUTE (0x1 << 7) 1382b26dd4cSOder Chiou #define RT5660_R_MUTE_SFT 7 1392b26dd4cSOder Chiou #define RT5660_VOL_R_MUTE (0x1 << 6) 1402b26dd4cSOder Chiou #define RT5660_VOL_R_SFT 6 1412b26dd4cSOder Chiou #define RT5660_L_VOL_MASK (0x3f << 8) 1422b26dd4cSOder Chiou #define RT5660_L_VOL_SFT 8 1432b26dd4cSOder Chiou #define RT5660_R_VOL_MASK (0x3f) 1442b26dd4cSOder Chiou #define RT5660_R_VOL_SFT 0 1452b26dd4cSOder Chiou 1462b26dd4cSOder Chiou /* IN1 and IN2 Control (0x0d) */ 1472b26dd4cSOder Chiou #define RT5660_IN_DF1 (0x1 << 15) 1482b26dd4cSOder Chiou #define RT5660_IN_SFT1 15 1492b26dd4cSOder Chiou #define RT5660_BST_MASK1 (0x7f << 8) 1502b26dd4cSOder Chiou #define RT5660_BST_SFT1 8 1512b26dd4cSOder Chiou #define RT5660_IN_DF2 (0x1 << 7) 1522b26dd4cSOder Chiou #define RT5660_IN_SFT2 7 1532b26dd4cSOder Chiou #define RT5660_BST_MASK2 (0x7f << 0) 1542b26dd4cSOder Chiou #define RT5660_BST_SFT2 0 1552b26dd4cSOder Chiou 1562b26dd4cSOder Chiou /* IN3 and IN4 Control (0x0e) */ 1572b26dd4cSOder Chiou #define RT5660_IN_DF3 (0x1 << 15) 1582b26dd4cSOder Chiou #define RT5660_IN_SFT3 15 1592b26dd4cSOder Chiou #define RT5660_BST_MASK3 (0x7f << 8) 1602b26dd4cSOder Chiou #define RT5660_BST_SFT3 8 1612b26dd4cSOder Chiou #define RT5660_IN_DF4 (0x1 << 7) 1622b26dd4cSOder Chiou #define RT5660_IN_SFT4 7 1632b26dd4cSOder Chiou #define RT5660_BST_MASK4 (0x7f << 0) 1642b26dd4cSOder Chiou #define RT5660_BST_SFT4 0 1652b26dd4cSOder Chiou 1662b26dd4cSOder Chiou /* DAC1 Digital Volume (0x19) */ 1672b26dd4cSOder Chiou #define RT5660_DAC_L1_VOL_MASK (0x7f << 9) 1682b26dd4cSOder Chiou #define RT5660_DAC_L1_VOL_SFT 9 1692b26dd4cSOder Chiou #define RT5660_DAC_R1_VOL_MASK (0x7f << 1) 1702b26dd4cSOder Chiou #define RT5660_DAC_R1_VOL_SFT 1 1712b26dd4cSOder Chiou 1722b26dd4cSOder Chiou /* ADC Digital Volume Control (0x1c) */ 1732b26dd4cSOder Chiou #define RT5660_ADC_L_VOL_MASK (0x3f << 9) 1742b26dd4cSOder Chiou #define RT5660_ADC_L_VOL_SFT 9 1752b26dd4cSOder Chiou #define RT5660_ADC_R_VOL_MASK (0x3f << 1) 1762b26dd4cSOder Chiou #define RT5660_ADC_R_VOL_SFT 1 1772b26dd4cSOder Chiou 1782b26dd4cSOder Chiou /* ADC Boost Volume Control (0x1e) */ 1792b26dd4cSOder Chiou #define RT5660_STO1_ADC_L_BST_MASK (0x3 << 14) 1802b26dd4cSOder Chiou #define RT5660_STO1_ADC_L_BST_SFT 14 1812b26dd4cSOder Chiou #define RT5660_STO1_ADC_R_BST_MASK (0x3 << 12) 1822b26dd4cSOder Chiou #define RT5660_STO1_ADC_R_BST_SFT 12 1832b26dd4cSOder Chiou 1842b26dd4cSOder Chiou /* Stereo ADC Mixer Control (0x27) */ 1852b26dd4cSOder Chiou #define RT5660_M_ADC_L1 (0x1 << 14) 1862b26dd4cSOder Chiou #define RT5660_M_ADC_L1_SFT 14 1872b26dd4cSOder Chiou #define RT5660_M_ADC_L2 (0x1 << 13) 1882b26dd4cSOder Chiou #define RT5660_M_ADC_L2_SFT 13 1892b26dd4cSOder Chiou #define RT5660_M_ADC_R1 (0x1 << 6) 1902b26dd4cSOder Chiou #define RT5660_M_ADC_R1_SFT 6 1912b26dd4cSOder Chiou #define RT5660_M_ADC_R2 (0x1 << 5) 1922b26dd4cSOder Chiou #define RT5660_M_ADC_R2_SFT 5 1932b26dd4cSOder Chiou 1942b26dd4cSOder Chiou /* ADC Mixer to DAC Mixer Control (0x29) */ 1952b26dd4cSOder Chiou #define RT5660_M_ADCMIX_L (0x1 << 15) 1962b26dd4cSOder Chiou #define RT5660_M_ADCMIX_L_SFT 15 1972b26dd4cSOder Chiou #define RT5660_M_DAC1_L (0x1 << 14) 1982b26dd4cSOder Chiou #define RT5660_M_DAC1_L_SFT 14 1992b26dd4cSOder Chiou #define RT5660_M_ADCMIX_R (0x1 << 7) 2002b26dd4cSOder Chiou #define RT5660_M_ADCMIX_R_SFT 7 2012b26dd4cSOder Chiou #define RT5660_M_DAC1_R (0x1 << 6) 2022b26dd4cSOder Chiou #define RT5660_M_DAC1_R_SFT 6 2032b26dd4cSOder Chiou 2042b26dd4cSOder Chiou /* Stereo DAC Mixer Control (0x2a) */ 2052b26dd4cSOder Chiou #define RT5660_M_DAC_L1 (0x1 << 14) 2062b26dd4cSOder Chiou #define RT5660_M_DAC_L1_SFT 14 2072b26dd4cSOder Chiou #define RT5660_DAC_L1_STO_L_VOL_MASK (0x1 << 13) 2082b26dd4cSOder Chiou #define RT5660_DAC_L1_STO_L_VOL_SFT 13 2092b26dd4cSOder Chiou #define RT5660_M_DAC_R1_STO_L (0x1 << 9) 2102b26dd4cSOder Chiou #define RT5660_M_DAC_R1_STO_L_SFT 9 2112b26dd4cSOder Chiou #define RT5660_DAC_R1_STO_L_VOL_MASK (0x1 << 8) 2122b26dd4cSOder Chiou #define RT5660_DAC_R1_STO_L_VOL_SFT 8 2132b26dd4cSOder Chiou #define RT5660_M_DAC_R1 (0x1 << 6) 2142b26dd4cSOder Chiou #define RT5660_M_DAC_R1_SFT 6 2152b26dd4cSOder Chiou #define RT5660_DAC_R1_STO_R_VOL_MASK (0x1 << 5) 2162b26dd4cSOder Chiou #define RT5660_DAC_R1_STO_R_VOL_SFT 5 2172b26dd4cSOder Chiou #define RT5660_M_DAC_L1_STO_R (0x1 << 1) 2182b26dd4cSOder Chiou #define RT5660_M_DAC_L1_STO_R_SFT 1 2192b26dd4cSOder Chiou #define RT5660_DAC_L1_STO_R_VOL_MASK (0x1) 2202b26dd4cSOder Chiou #define RT5660_DAC_L1_STO_R_VOL_SFT 0 2212b26dd4cSOder Chiou 2222b26dd4cSOder Chiou /* Digital Interface Data Control (0x2f) */ 2232b26dd4cSOder Chiou #define RT5660_IF1_DAC_IN_SEL (0x3 << 14) 2242b26dd4cSOder Chiou #define RT5660_IF1_DAC_IN_SFT 14 2252b26dd4cSOder Chiou #define RT5660_IF1_ADC_IN_SEL (0x3 << 12) 2262b26dd4cSOder Chiou #define RT5660_IF1_ADC_IN_SFT 12 2272b26dd4cSOder Chiou 2282b26dd4cSOder Chiou /* REC Left Mixer Control 1 (0x3b) */ 2292b26dd4cSOder Chiou #define RT5660_G_BST3_RM_L_MASK (0x7 << 4) 2302b26dd4cSOder Chiou #define RT5660_G_BST3_RM_L_SFT 4 2312b26dd4cSOder Chiou #define RT5660_G_BST2_RM_L_MASK (0x7 << 1) 2322b26dd4cSOder Chiou #define RT5660_G_BST2_RM_L_SFT 1 2332b26dd4cSOder Chiou 2342b26dd4cSOder Chiou /* REC Left Mixer Control 2 (0x3c) */ 2352b26dd4cSOder Chiou #define RT5660_G_BST1_RM_L_MASK (0x7 << 13) 2362b26dd4cSOder Chiou #define RT5660_G_BST1_RM_L_SFT 13 2372b26dd4cSOder Chiou #define RT5660_G_OM_L_RM_L_MASK (0x7 << 10) 2382b26dd4cSOder Chiou #define RT5660_G_OM_L_RM_L_SFT 10 2392b26dd4cSOder Chiou #define RT5660_M_BST3_RM_L (0x1 << 3) 2402b26dd4cSOder Chiou #define RT5660_M_BST3_RM_L_SFT 3 2412b26dd4cSOder Chiou #define RT5660_M_BST2_RM_L (0x1 << 2) 2422b26dd4cSOder Chiou #define RT5660_M_BST2_RM_L_SFT 2 2432b26dd4cSOder Chiou #define RT5660_M_BST1_RM_L (0x1 << 1) 2442b26dd4cSOder Chiou #define RT5660_M_BST1_RM_L_SFT 1 2452b26dd4cSOder Chiou #define RT5660_M_OM_L_RM_L (0x1) 2462b26dd4cSOder Chiou #define RT5660_M_OM_L_RM_L_SFT 0 2472b26dd4cSOder Chiou 2482b26dd4cSOder Chiou /* REC Right Mixer Control 1 (0x3d) */ 2492b26dd4cSOder Chiou #define RT5660_G_BST3_RM_R_MASK (0x7 << 4) 2502b26dd4cSOder Chiou #define RT5660_G_BST3_RM_R_SFT 4 2512b26dd4cSOder Chiou #define RT5660_G_BST2_RM_R_MASK (0x7 << 1) 2522b26dd4cSOder Chiou #define RT5660_G_BST2_RM_R_SFT 1 2532b26dd4cSOder Chiou 2542b26dd4cSOder Chiou /* REC Right Mixer Control 2 (0x3e) */ 2552b26dd4cSOder Chiou #define RT5660_G_BST1_RM_R_MASK (0x7 << 13) 2562b26dd4cSOder Chiou #define RT5660_G_BST1_RM_R_SFT 13 2572b26dd4cSOder Chiou #define RT5660_G_OM_R_RM_R_MASK (0x7 << 10) 2582b26dd4cSOder Chiou #define RT5660_G_OM_R_RM_R_SFT 10 2592b26dd4cSOder Chiou #define RT5660_M_BST3_RM_R (0x1 << 3) 2602b26dd4cSOder Chiou #define RT5660_M_BST3_RM_R_SFT 3 2612b26dd4cSOder Chiou #define RT5660_M_BST2_RM_R (0x1 << 2) 2622b26dd4cSOder Chiou #define RT5660_M_BST2_RM_R_SFT 2 2632b26dd4cSOder Chiou #define RT5660_M_BST1_RM_R (0x1 << 1) 2642b26dd4cSOder Chiou #define RT5660_M_BST1_RM_R_SFT 1 2652b26dd4cSOder Chiou #define RT5660_M_OM_R_RM_R (0x1) 2662b26dd4cSOder Chiou #define RT5660_M_OM_R_RM_R_SFT 0 2672b26dd4cSOder Chiou 2682b26dd4cSOder Chiou /* LOUTMIX Control (0x45) */ 2692b26dd4cSOder Chiou #define RT5660_M_DAC1_LM (0x1 << 14) 2702b26dd4cSOder Chiou #define RT5660_M_DAC1_LM_SFT 14 2712b26dd4cSOder Chiou #define RT5660_M_LOVOL_M (0x1 << 13) 2722b26dd4cSOder Chiou #define RT5660_M_LOVOL_LM_SFT 13 2732b26dd4cSOder Chiou 2742b26dd4cSOder Chiou /* SPK Mixer Control (0x46) */ 2752b26dd4cSOder Chiou #define RT5660_G_BST3_SM_MASK (0x3 << 14) 2762b26dd4cSOder Chiou #define RT5660_G_BST3_SM_SFT 14 2772b26dd4cSOder Chiou #define RT5660_G_BST1_SM_MASK (0x3 << 12) 2782b26dd4cSOder Chiou #define RT5660_G_BST1_SM_SFT 12 2792b26dd4cSOder Chiou #define RT5660_G_DACl_SM_MASK (0x3 << 10) 2802b26dd4cSOder Chiou #define RT5660_G_DACl_SM_SFT 10 2812b26dd4cSOder Chiou #define RT5660_G_DACR_SM_MASK (0x3 << 8) 2822b26dd4cSOder Chiou #define RT5660_G_DACR_SM_SFT 8 2832b26dd4cSOder Chiou #define RT5660_G_OM_L_SM_MASK (0x3 << 6) 2842b26dd4cSOder Chiou #define RT5660_G_OM_L_SM_SFT 6 2852b26dd4cSOder Chiou #define RT5660_M_DACR_SM (0x1 << 5) 2862b26dd4cSOder Chiou #define RT5660_M_DACR_SM_SFT 5 2872b26dd4cSOder Chiou #define RT5660_M_BST1_SM (0x1 << 4) 2882b26dd4cSOder Chiou #define RT5660_M_BST1_SM_SFT 4 2892b26dd4cSOder Chiou #define RT5660_M_BST3_SM (0x1 << 3) 2902b26dd4cSOder Chiou #define RT5660_M_BST3_SM_SFT 3 2912b26dd4cSOder Chiou #define RT5660_M_DACL_SM (0x1 << 2) 2922b26dd4cSOder Chiou #define RT5660_M_DACL_SM_SFT 2 2932b26dd4cSOder Chiou #define RT5660_M_OM_L_SM (0x1 << 1) 2942b26dd4cSOder Chiou #define RT5660_M_OM_L_SM_SFT 1 2952b26dd4cSOder Chiou 2962b26dd4cSOder Chiou /* SPOMIX Control (0x48) */ 2972b26dd4cSOder Chiou #define RT5660_M_DAC_R_SPM (0x1 << 14) 2982b26dd4cSOder Chiou #define RT5660_M_DAC_R_SPM_SFT 14 2992b26dd4cSOder Chiou #define RT5660_M_DAC_L_SPM (0x1 << 13) 3002b26dd4cSOder Chiou #define RT5660_M_DAC_L_SPM_SFT 13 3012b26dd4cSOder Chiou #define RT5660_M_SV_SPM (0x1 << 12) 3022b26dd4cSOder Chiou #define RT5660_M_SV_SPM_SFT 12 3032b26dd4cSOder Chiou #define RT5660_M_BST1_SPM (0x1 << 11) 3042b26dd4cSOder Chiou #define RT5660_M_BST1_SPM_SFT 11 3052b26dd4cSOder Chiou 3062b26dd4cSOder Chiou /* Output Left Mixer Control 1 (0x4d) */ 3072b26dd4cSOder Chiou #define RT5660_G_BST3_OM_L_MASK (0x7 << 13) 3082b26dd4cSOder Chiou #define RT5660_G_BST3_OM_L_SFT 13 3092b26dd4cSOder Chiou #define RT5660_G_BST2_OM_L_MASK (0x7 << 10) 3102b26dd4cSOder Chiou #define RT5660_G_BST2_OM_L_SFT 10 3112b26dd4cSOder Chiou #define RT5660_G_BST1_OM_L_MASK (0x7 << 7) 3122b26dd4cSOder Chiou #define RT5660_G_BST1_OM_L_SFT 7 3132b26dd4cSOder Chiou #define RT5660_G_RM_L_OM_L_MASK (0x7 << 1) 3142b26dd4cSOder Chiou #define RT5660_G_RM_L_OM_L_SFT 1 3152b26dd4cSOder Chiou 3162b26dd4cSOder Chiou /* Output Left Mixer Control 2 (0x4e) */ 3172b26dd4cSOder Chiou #define RT5660_G_DAC_R1_OM_L_MASK (0x7 << 10) 3182b26dd4cSOder Chiou #define RT5660_G_DAC_R1_OM_L_SFT 10 3192b26dd4cSOder Chiou #define RT5660_G_DAC_L1_OM_L_MASK (0x7 << 7) 3202b26dd4cSOder Chiou #define RT5660_G_DAC_L1_OM_L_SFT 7 3212b26dd4cSOder Chiou 3222b26dd4cSOder Chiou /* Output Left Mixer Control 3 (0x4f) */ 3232b26dd4cSOder Chiou #define RT5660_M_BST3_OM_L (0x1 << 5) 3242b26dd4cSOder Chiou #define RT5660_M_BST3_OM_L_SFT 5 3252b26dd4cSOder Chiou #define RT5660_M_BST2_OM_L (0x1 << 4) 3262b26dd4cSOder Chiou #define RT5660_M_BST2_OM_L_SFT 4 3272b26dd4cSOder Chiou #define RT5660_M_BST1_OM_L (0x1 << 3) 3282b26dd4cSOder Chiou #define RT5660_M_BST1_OM_L_SFT 3 3292b26dd4cSOder Chiou #define RT5660_M_RM_L_OM_L (0x1 << 2) 3302b26dd4cSOder Chiou #define RT5660_M_RM_L_OM_L_SFT 2 3312b26dd4cSOder Chiou #define RT5660_M_DAC_R_OM_L (0x1 << 1) 3322b26dd4cSOder Chiou #define RT5660_M_DAC_R_OM_L_SFT 1 3332b26dd4cSOder Chiou #define RT5660_M_DAC_L_OM_L (0x1) 3342b26dd4cSOder Chiou #define RT5660_M_DAC_L_OM_L_SFT 0 3352b26dd4cSOder Chiou 3362b26dd4cSOder Chiou /* Output Right Mixer Control 1 (0x50) */ 3372b26dd4cSOder Chiou #define RT5660_G_BST2_OM_R_MASK (0x7 << 10) 3382b26dd4cSOder Chiou #define RT5660_G_BST2_OM_R_SFT 10 3392b26dd4cSOder Chiou #define RT5660_G_BST1_OM_R_MASK (0x7 << 7) 3402b26dd4cSOder Chiou #define RT5660_G_BST1_OM_R_SFT 7 3412b26dd4cSOder Chiou #define RT5660_G_RM_R_OM_R_MASK (0x7 << 1) 3422b26dd4cSOder Chiou #define RT5660_G_RM_R_OM_R_SFT 1 3432b26dd4cSOder Chiou 3442b26dd4cSOder Chiou /* Output Right Mixer Control 2 (0x51) */ 3452b26dd4cSOder Chiou #define RT5660_G_DAC_L_OM_R_MASK (0x7 << 10) 3462b26dd4cSOder Chiou #define RT5660_G_DAC_L_OM_R_SFT 10 3472b26dd4cSOder Chiou #define RT5660_G_DAC_R_OM_R_MASK (0x7 << 7) 3482b26dd4cSOder Chiou #define RT5660_G_DAC_R_OM_R_SFT 7 3492b26dd4cSOder Chiou 3502b26dd4cSOder Chiou /* Output Right Mixer Control 3 (0x52) */ 3512b26dd4cSOder Chiou #define RT5660_M_BST2_OM_R (0x1 << 4) 3522b26dd4cSOder Chiou #define RT5660_M_BST2_OM_R_SFT 4 3532b26dd4cSOder Chiou #define RT5660_M_BST1_OM_R (0x1 << 3) 3542b26dd4cSOder Chiou #define RT5660_M_BST1_OM_R_SFT 3 3552b26dd4cSOder Chiou #define RT5660_M_RM_R_OM_R (0x1 << 2) 3562b26dd4cSOder Chiou #define RT5660_M_RM_R_OM_R_SFT 2 3572b26dd4cSOder Chiou #define RT5660_M_DAC_L_OM_R (0x1 << 1) 3582b26dd4cSOder Chiou #define RT5660_M_DAC_L_OM_R_SFT 1 3592b26dd4cSOder Chiou #define RT5660_M_DAC_R_OM_R (0x1) 3602b26dd4cSOder Chiou #define RT5660_M_DAC_R_OM_R_SFT 0 3612b26dd4cSOder Chiou 3622b26dd4cSOder Chiou /* Power Management for Digital 1 (0x61) */ 3632b26dd4cSOder Chiou #define RT5660_PWR_I2S1 (0x1 << 15) 3642b26dd4cSOder Chiou #define RT5660_PWR_I2S1_BIT 15 3652b26dd4cSOder Chiou #define RT5660_PWR_DAC_L1 (0x1 << 12) 3662b26dd4cSOder Chiou #define RT5660_PWR_DAC_L1_BIT 12 3672b26dd4cSOder Chiou #define RT5660_PWR_DAC_R1 (0x1 << 11) 3682b26dd4cSOder Chiou #define RT5660_PWR_DAC_R1_BIT 11 3692b26dd4cSOder Chiou #define RT5660_PWR_ADC_L (0x1 << 2) 3702b26dd4cSOder Chiou #define RT5660_PWR_ADC_L_BIT 2 3712b26dd4cSOder Chiou #define RT5660_PWR_ADC_R (0x1 << 1) 3722b26dd4cSOder Chiou #define RT5660_PWR_ADC_R_BIT 1 3732b26dd4cSOder Chiou #define RT5660_PWR_CLS_D (0x1) 3742b26dd4cSOder Chiou #define RT5660_PWR_CLS_D_BIT 0 3752b26dd4cSOder Chiou 3762b26dd4cSOder Chiou /* Power Management for Digital 2 (0x62) */ 3772b26dd4cSOder Chiou #define RT5660_PWR_ADC_S1F (0x1 << 15) 3782b26dd4cSOder Chiou #define RT5660_PWR_ADC_S1F_BIT 15 3792b26dd4cSOder Chiou #define RT5660_PWR_DAC_S1F (0x1 << 11) 3802b26dd4cSOder Chiou #define RT5660_PWR_DAC_S1F_BIT 11 3812b26dd4cSOder Chiou 3822b26dd4cSOder Chiou /* Power Management for Analog 1 (0x63) */ 3832b26dd4cSOder Chiou #define RT5660_PWR_VREF1 (0x1 << 15) 3842b26dd4cSOder Chiou #define RT5660_PWR_VREF1_BIT 15 3852b26dd4cSOder Chiou #define RT5660_PWR_FV1 (0x1 << 14) 3862b26dd4cSOder Chiou #define RT5660_PWR_FV1_BIT 14 3872b26dd4cSOder Chiou #define RT5660_PWR_MB (0x1 << 13) 3882b26dd4cSOder Chiou #define RT5660_PWR_MB_BIT 13 3892b26dd4cSOder Chiou #define RT5660_PWR_BG (0x1 << 11) 3902b26dd4cSOder Chiou #define RT5660_PWR_BG_BIT 11 3912b26dd4cSOder Chiou #define RT5660_PWR_HP_L (0x1 << 7) 3922b26dd4cSOder Chiou #define RT5660_PWR_HP_L_BIT 7 3932b26dd4cSOder Chiou #define RT5660_PWR_HP_R (0x1 << 6) 3942b26dd4cSOder Chiou #define RT5660_PWR_HP_R_BIT 6 3952b26dd4cSOder Chiou #define RT5660_PWR_HA (0x1 << 5) 3962b26dd4cSOder Chiou #define RT5660_PWR_HA_BIT 5 3972b26dd4cSOder Chiou #define RT5660_PWR_VREF2 (0x1 << 4) 3982b26dd4cSOder Chiou #define RT5660_PWR_VREF2_BIT 4 3992b26dd4cSOder Chiou #define RT5660_PWR_FV2 (0x1 << 3) 4002b26dd4cSOder Chiou #define RT5660_PWR_FV2_BIT 3 4012b26dd4cSOder Chiou #define RT5660_PWR_LDO2 (0x1 << 2) 4022b26dd4cSOder Chiou #define RT5660_PWR_LDO2_BIT 2 4032b26dd4cSOder Chiou 4042b26dd4cSOder Chiou /* Power Management for Analog 2 (0x64) */ 4052b26dd4cSOder Chiou #define RT5660_PWR_BST1 (0x1 << 15) 4062b26dd4cSOder Chiou #define RT5660_PWR_BST1_BIT 15 4072b26dd4cSOder Chiou #define RT5660_PWR_BST2 (0x1 << 14) 4082b26dd4cSOder Chiou #define RT5660_PWR_BST2_BIT 14 4092b26dd4cSOder Chiou #define RT5660_PWR_BST3 (0x1 << 13) 4102b26dd4cSOder Chiou #define RT5660_PWR_BST3_BIT 13 4112b26dd4cSOder Chiou #define RT5660_PWR_MB1 (0x1 << 11) 4122b26dd4cSOder Chiou #define RT5660_PWR_MB1_BIT 11 4132b26dd4cSOder Chiou #define RT5660_PWR_MB2 (0x1 << 10) 4142b26dd4cSOder Chiou #define RT5660_PWR_MB2_BIT 10 4152b26dd4cSOder Chiou #define RT5660_PWR_PLL (0x1 << 9) 4162b26dd4cSOder Chiou #define RT5660_PWR_PLL_BIT 9 4172b26dd4cSOder Chiou 4182b26dd4cSOder Chiou /* Power Management for Mixer (0x65) */ 4192b26dd4cSOder Chiou #define RT5660_PWR_OM_L (0x1 << 15) 4202b26dd4cSOder Chiou #define RT5660_PWR_OM_L_BIT 15 4212b26dd4cSOder Chiou #define RT5660_PWR_OM_R (0x1 << 14) 4222b26dd4cSOder Chiou #define RT5660_PWR_OM_R_BIT 14 4232b26dd4cSOder Chiou #define RT5660_PWR_SM (0x1 << 13) 4242b26dd4cSOder Chiou #define RT5660_PWR_SM_BIT 13 4252b26dd4cSOder Chiou #define RT5660_PWR_RM_L (0x1 << 11) 4262b26dd4cSOder Chiou #define RT5660_PWR_RM_L_BIT 11 4272b26dd4cSOder Chiou #define RT5660_PWR_RM_R (0x1 << 10) 4282b26dd4cSOder Chiou #define RT5660_PWR_RM_R_BIT 10 4292b26dd4cSOder Chiou 4302b26dd4cSOder Chiou /* Power Management for Volume (0x66) */ 4312b26dd4cSOder Chiou #define RT5660_PWR_SV (0x1 << 15) 4322b26dd4cSOder Chiou #define RT5660_PWR_SV_BIT 15 4332b26dd4cSOder Chiou #define RT5660_PWR_LV_L (0x1 << 11) 4342b26dd4cSOder Chiou #define RT5660_PWR_LV_L_BIT 11 4352b26dd4cSOder Chiou #define RT5660_PWR_LV_R (0x1 << 10) 4362b26dd4cSOder Chiou #define RT5660_PWR_LV_R_BIT 10 4372b26dd4cSOder Chiou 4382b26dd4cSOder Chiou /* I2S1 Audio Serial Data Port Control (0x70) */ 4392b26dd4cSOder Chiou #define RT5660_I2S_MS_MASK (0x1 << 15) 4402b26dd4cSOder Chiou #define RT5660_I2S_MS_SFT 15 4412b26dd4cSOder Chiou #define RT5660_I2S_MS_M (0x0 << 15) 4422b26dd4cSOder Chiou #define RT5660_I2S_MS_S (0x1 << 15) 4432b26dd4cSOder Chiou #define RT5660_I2S_O_CP_MASK (0x3 << 10) 4442b26dd4cSOder Chiou #define RT5660_I2S_O_CP_SFT 10 4452b26dd4cSOder Chiou #define RT5660_I2S_O_CP_OFF (0x0 << 10) 4462b26dd4cSOder Chiou #define RT5660_I2S_O_CP_U_LAW (0x1 << 10) 4472b26dd4cSOder Chiou #define RT5660_I2S_O_CP_A_LAW (0x2 << 10) 4482b26dd4cSOder Chiou #define RT5660_I2S_I_CP_MASK (0x3 << 8) 4492b26dd4cSOder Chiou #define RT5660_I2S_I_CP_SFT 8 4502b26dd4cSOder Chiou #define RT5660_I2S_I_CP_OFF (0x0 << 8) 4512b26dd4cSOder Chiou #define RT5660_I2S_I_CP_U_LAW (0x1 << 8) 4522b26dd4cSOder Chiou #define RT5660_I2S_I_CP_A_LAW (0x2 << 8) 4532b26dd4cSOder Chiou #define RT5660_I2S_BP_MASK (0x1 << 7) 4542b26dd4cSOder Chiou #define RT5660_I2S_BP_SFT 7 4552b26dd4cSOder Chiou #define RT5660_I2S_BP_NOR (0x0 << 7) 4562b26dd4cSOder Chiou #define RT5660_I2S_BP_INV (0x1 << 7) 4572b26dd4cSOder Chiou #define RT5660_I2S_DL_MASK (0x3 << 2) 4582b26dd4cSOder Chiou #define RT5660_I2S_DL_SFT 2 4592b26dd4cSOder Chiou #define RT5660_I2S_DL_16 (0x0 << 2) 4602b26dd4cSOder Chiou #define RT5660_I2S_DL_20 (0x1 << 2) 4612b26dd4cSOder Chiou #define RT5660_I2S_DL_24 (0x2 << 2) 4622b26dd4cSOder Chiou #define RT5660_I2S_DL_8 (0x3 << 2) 4632b26dd4cSOder Chiou #define RT5660_I2S_DF_MASK (0x3) 4642b26dd4cSOder Chiou #define RT5660_I2S_DF_SFT 0 4652b26dd4cSOder Chiou #define RT5660_I2S_DF_I2S (0x0) 4662b26dd4cSOder Chiou #define RT5660_I2S_DF_LEFT (0x1) 4672b26dd4cSOder Chiou #define RT5660_I2S_DF_PCM_A (0x2) 4682b26dd4cSOder Chiou #define RT5660_I2S_DF_PCM_B (0x3) 4692b26dd4cSOder Chiou 4702b26dd4cSOder Chiou /* ADC/DAC Clock Control 1 (0x73) */ 4712b26dd4cSOder Chiou #define RT5660_I2S_BCLK_MS1_MASK (0x1 << 15) 4722b26dd4cSOder Chiou #define RT5660_I2S_BCLK_MS1_SFT 15 4732b26dd4cSOder Chiou #define RT5660_I2S_BCLK_MS1_32 (0x0 << 15) 4742b26dd4cSOder Chiou #define RT5660_I2S_BCLK_MS1_64 (0x1 << 15) 4752b26dd4cSOder Chiou #define RT5660_I2S_PD1_MASK (0x7 << 12) 4762b26dd4cSOder Chiou #define RT5660_I2S_PD1_SFT 12 4772b26dd4cSOder Chiou #define RT5660_I2S_PD1_1 (0x0 << 12) 4782b26dd4cSOder Chiou #define RT5660_I2S_PD1_2 (0x1 << 12) 4792b26dd4cSOder Chiou #define RT5660_I2S_PD1_3 (0x2 << 12) 4802b26dd4cSOder Chiou #define RT5660_I2S_PD1_4 (0x3 << 12) 4812b26dd4cSOder Chiou #define RT5660_I2S_PD1_6 (0x4 << 12) 4822b26dd4cSOder Chiou #define RT5660_I2S_PD1_8 (0x5 << 12) 4832b26dd4cSOder Chiou #define RT5660_I2S_PD1_12 (0x6 << 12) 4842b26dd4cSOder Chiou #define RT5660_I2S_PD1_16 (0x7 << 12) 4852b26dd4cSOder Chiou #define RT5660_DAC_OSR_MASK (0x3 << 2) 4862b26dd4cSOder Chiou #define RT5660_DAC_OSR_SFT 2 4872b26dd4cSOder Chiou #define RT5660_DAC_OSR_128 (0x0 << 2) 4882b26dd4cSOder Chiou #define RT5660_DAC_OSR_64 (0x1 << 2) 4892b26dd4cSOder Chiou #define RT5660_DAC_OSR_32 (0x2 << 2) 4902b26dd4cSOder Chiou #define RT5660_DAC_OSR_16 (0x3 << 2) 4912b26dd4cSOder Chiou #define RT5660_ADC_OSR_MASK (0x3) 4922b26dd4cSOder Chiou #define RT5660_ADC_OSR_SFT 0 4932b26dd4cSOder Chiou #define RT5660_ADC_OSR_128 (0x0) 4942b26dd4cSOder Chiou #define RT5660_ADC_OSR_64 (0x1) 4952b26dd4cSOder Chiou #define RT5660_ADC_OSR_32 (0x2) 4962b26dd4cSOder Chiou #define RT5660_ADC_OSR_16 (0x3) 4972b26dd4cSOder Chiou 4982b26dd4cSOder Chiou /* ADC/DAC Clock Control 2 (0x74) */ 4992b26dd4cSOder Chiou #define RT5660_RESET_ADF (0x1 << 13) 5002b26dd4cSOder Chiou #define RT5660_RESET_ADF_SFT 13 5012b26dd4cSOder Chiou #define RT5660_RESET_DAF (0x1 << 12) 5022b26dd4cSOder Chiou #define RT5660_RESET_DAF_SFT 12 5032b26dd4cSOder Chiou #define RT5660_DAHPF_EN (0x1 << 11) 5042b26dd4cSOder Chiou #define RT5660_DAHPF_EN_SFT 11 5052b26dd4cSOder Chiou #define RT5660_ADHPF_EN (0x1 << 10) 5062b26dd4cSOder Chiou #define RT5660_ADHPF_EN_SFT 10 5072b26dd4cSOder Chiou 5082b26dd4cSOder Chiou /* Digital Microphone Control (0x75) */ 5092b26dd4cSOder Chiou #define RT5660_DMIC_1_EN_MASK (0x1 << 15) 5102b26dd4cSOder Chiou #define RT5660_DMIC_1_EN_SFT 15 5112b26dd4cSOder Chiou #define RT5660_DMIC_1_DIS (0x0 << 15) 5122b26dd4cSOder Chiou #define RT5660_DMIC_1_EN (0x1 << 15) 5132b26dd4cSOder Chiou #define RT5660_DMIC_1L_LH_MASK (0x1 << 13) 5142b26dd4cSOder Chiou #define RT5660_DMIC_1L_LH_SFT 13 5152b26dd4cSOder Chiou #define RT5660_DMIC_1L_LH_RISING (0x0 << 13) 5162b26dd4cSOder Chiou #define RT5660_DMIC_1L_LH_FALLING (0x1 << 13) 5172b26dd4cSOder Chiou #define RT5660_DMIC_1R_LH_MASK (0x1 << 12) 5182b26dd4cSOder Chiou #define RT5660_DMIC_1R_LH_SFT 12 5192b26dd4cSOder Chiou #define RT5660_DMIC_1R_LH_RISING (0x0 << 12) 5202b26dd4cSOder Chiou #define RT5660_DMIC_1R_LH_FALLING (0x1 << 12) 5212b26dd4cSOder Chiou #define RT5660_SEL_DMIC_DATA_MASK (0x1 << 11) 5222b26dd4cSOder Chiou #define RT5660_SEL_DMIC_DATA_SFT 11 5232b26dd4cSOder Chiou #define RT5660_SEL_DMIC_DATA_GPIO2 (0x0 << 11) 5242b26dd4cSOder Chiou #define RT5660_SEL_DMIC_DATA_IN1P (0x1 << 11) 5252b26dd4cSOder Chiou #define RT5660_DMIC_CLK_MASK (0x7 << 5) 5262b26dd4cSOder Chiou #define RT5660_DMIC_CLK_SFT 5 5272b26dd4cSOder Chiou 5282b26dd4cSOder Chiou /* Global Clock Control (0x80) */ 5292b26dd4cSOder Chiou #define RT5660_SCLK_SRC_MASK (0x3 << 14) 5302b26dd4cSOder Chiou #define RT5660_SCLK_SRC_SFT 14 5312b26dd4cSOder Chiou #define RT5660_SCLK_SRC_MCLK (0x0 << 14) 5322b26dd4cSOder Chiou #define RT5660_SCLK_SRC_PLL1 (0x1 << 14) 5332b26dd4cSOder Chiou #define RT5660_SCLK_SRC_RCCLK (0x2 << 14) 5342b26dd4cSOder Chiou #define RT5660_PLL1_SRC_MASK (0x3 << 12) 5352b26dd4cSOder Chiou #define RT5660_PLL1_SRC_SFT 12 5362b26dd4cSOder Chiou #define RT5660_PLL1_SRC_MCLK (0x0 << 12) 5372b26dd4cSOder Chiou #define RT5660_PLL1_SRC_BCLK1 (0x1 << 12) 5382b26dd4cSOder Chiou #define RT5660_PLL1_SRC_RCCLK (0x2 << 12) 5392b26dd4cSOder Chiou #define RT5660_PLL1_PD_MASK (0x1 << 3) 5402b26dd4cSOder Chiou #define RT5660_PLL1_PD_SFT 3 5412b26dd4cSOder Chiou #define RT5660_PLL1_PD_1 (0x0 << 3) 5422b26dd4cSOder Chiou #define RT5660_PLL1_PD_2 (0x1 << 3) 5432b26dd4cSOder Chiou 5442b26dd4cSOder Chiou #define RT5660_PLL_INP_MAX 40000000 5452b26dd4cSOder Chiou #define RT5660_PLL_INP_MIN 256000 5462b26dd4cSOder Chiou /* PLL M/N/K Code Control 1 (0x81) */ 5472b26dd4cSOder Chiou #define RT5660_PLL_N_MAX 0x1ff 5482b26dd4cSOder Chiou #define RT5660_PLL_N_MASK (RT5660_PLL_N_MAX << 7) 5492b26dd4cSOder Chiou #define RT5660_PLL_N_SFT 7 5502b26dd4cSOder Chiou #define RT5660_PLL_K_MAX 0x1f 5512b26dd4cSOder Chiou #define RT5660_PLL_K_MASK (RT5660_PLL_K_MAX) 5522b26dd4cSOder Chiou #define RT5660_PLL_K_SFT 0 5532b26dd4cSOder Chiou 5542b26dd4cSOder Chiou /* PLL M/N/K Code Control 2 (0x82) */ 5552b26dd4cSOder Chiou #define RT5660_PLL_M_MAX 0xf 5562b26dd4cSOder Chiou #define RT5660_PLL_M_MASK (RT5660_PLL_M_MAX << 12) 5572b26dd4cSOder Chiou #define RT5660_PLL_M_SFT 12 5582b26dd4cSOder Chiou #define RT5660_PLL_M_BP (0x1 << 11) 5592b26dd4cSOder Chiou #define RT5660_PLL_M_BP_SFT 11 5602b26dd4cSOder Chiou 5612b26dd4cSOder Chiou /* Class D Over Current Control (0x8c) */ 5622b26dd4cSOder Chiou #define RT5660_CLSD_OC_MASK (0x1 << 9) 5632b26dd4cSOder Chiou #define RT5660_CLSD_OC_SFT 9 5642b26dd4cSOder Chiou #define RT5660_CLSD_OC_PU (0x0 << 9) 5652b26dd4cSOder Chiou #define RT5660_CLSD_OC_PD (0x1 << 9) 5662b26dd4cSOder Chiou #define RT5660_AUTO_PD_MASK (0x1 << 8) 5672b26dd4cSOder Chiou #define RT5660_AUTO_PD_SFT 8 5682b26dd4cSOder Chiou #define RT5660_AUTO_PD_DIS (0x0 << 8) 5692b26dd4cSOder Chiou #define RT5660_AUTO_PD_EN (0x1 << 8) 5702b26dd4cSOder Chiou #define RT5660_CLSD_OC_TH_MASK (0x3f) 5712b26dd4cSOder Chiou #define RT5660_CLSD_OC_TH_SFT 0 5722b26dd4cSOder Chiou 5732b26dd4cSOder Chiou /* Class D Output Control (0x8d) */ 5742b26dd4cSOder Chiou #define RT5660_CLSD_RATIO_MASK (0xf << 12) 5752b26dd4cSOder Chiou #define RT5660_CLSD_RATIO_SFT 12 5762b26dd4cSOder Chiou 5772b26dd4cSOder Chiou /* Lout Amp Control 1 (0x8e) */ 5782b26dd4cSOder Chiou #define RT5660_LOUT_CO_MASK (0x1 << 4) 5792b26dd4cSOder Chiou #define RT5660_LOUT_CO_SFT 4 5802b26dd4cSOder Chiou #define RT5660_LOUT_CO_DIS (0x0 << 4) 5812b26dd4cSOder Chiou #define RT5660_LOUT_CO_EN (0x1 << 4) 5822b26dd4cSOder Chiou #define RT5660_LOUT_CB_MASK (0x1) 5832b26dd4cSOder Chiou #define RT5660_LOUT_CB_SFT 0 5842b26dd4cSOder Chiou #define RT5660_LOUT_CB_PD (0x0) 5852b26dd4cSOder Chiou #define RT5660_LOUT_CB_PU (0x1) 5862b26dd4cSOder Chiou 5872b26dd4cSOder Chiou /* SPKVDD detection control (0x92) */ 5882b26dd4cSOder Chiou #define RT5660_SPKVDD_DET_MASK (0x1 << 15) 5892b26dd4cSOder Chiou #define RT5660_SPKVDD_DET_SFT 15 5902b26dd4cSOder Chiou #define RT5660_SPKVDD_DET_DIS (0x0 << 15) 5912b26dd4cSOder Chiou #define RT5660_SPKVDD_DET_EN (0x1 << 15) 5922b26dd4cSOder Chiou #define RT5660_SPK_AG_MASK (0x1 << 14) 5932b26dd4cSOder Chiou #define RT5660_SPK_AG_SFT 14 5942b26dd4cSOder Chiou #define RT5660_SPK_AG_DIS (0x0 << 14) 5952b26dd4cSOder Chiou #define RT5660_SPK_AG_EN (0x1 << 14) 5962b26dd4cSOder Chiou 5972b26dd4cSOder Chiou /* Micbias Control (0x93) */ 5982b26dd4cSOder Chiou #define RT5660_MIC1_BS_MASK (0x1 << 15) 5992b26dd4cSOder Chiou #define RT5660_MIC1_BS_SFT 15 6002b26dd4cSOder Chiou #define RT5660_MIC1_BS_9AV (0x0 << 15) 6012b26dd4cSOder Chiou #define RT5660_MIC1_BS_75AV (0x1 << 15) 6022b26dd4cSOder Chiou #define RT5660_MIC2_BS_MASK (0x1 << 14) 6032b26dd4cSOder Chiou #define RT5660_MIC2_BS_SFT 14 6042b26dd4cSOder Chiou #define RT5660_MIC2_BS_9AV (0x0 << 14) 6052b26dd4cSOder Chiou #define RT5660_MIC2_BS_75AV (0x1 << 14) 6062b26dd4cSOder Chiou #define RT5660_MIC1_OVCD_MASK (0x1 << 11) 6072b26dd4cSOder Chiou #define RT5660_MIC1_OVCD_SFT 11 6082b26dd4cSOder Chiou #define RT5660_MIC1_OVCD_DIS (0x0 << 11) 6092b26dd4cSOder Chiou #define RT5660_MIC1_OVCD_EN (0x1 << 11) 6102b26dd4cSOder Chiou #define RT5660_MIC1_OVTH_MASK (0x3 << 9) 6112b26dd4cSOder Chiou #define RT5660_MIC1_OVTH_SFT 9 6122b26dd4cSOder Chiou #define RT5660_MIC1_OVTH_600UA (0x0 << 9) 6132b26dd4cSOder Chiou #define RT5660_MIC1_OVTH_1500UA (0x1 << 9) 6142b26dd4cSOder Chiou #define RT5660_MIC1_OVTH_2000UA (0x2 << 9) 6152b26dd4cSOder Chiou #define RT5660_MIC2_OVCD_MASK (0x1 << 8) 6162b26dd4cSOder Chiou #define RT5660_MIC2_OVCD_SFT 8 6172b26dd4cSOder Chiou #define RT5660_MIC2_OVCD_DIS (0x0 << 8) 6182b26dd4cSOder Chiou #define RT5660_MIC2_OVCD_EN (0x1 << 8) 6192b26dd4cSOder Chiou #define RT5660_MIC2_OVTH_MASK (0x3 << 6) 6202b26dd4cSOder Chiou #define RT5660_MIC2_OVTH_SFT 6 6212b26dd4cSOder Chiou #define RT5660_MIC2_OVTH_600UA (0x0 << 6) 6222b26dd4cSOder Chiou #define RT5660_MIC2_OVTH_1500UA (0x1 << 6) 6232b26dd4cSOder Chiou #define RT5660_MIC2_OVTH_2000UA (0x2 << 6) 6242b26dd4cSOder Chiou #define RT5660_PWR_CLK25M_MASK (0x1 << 4) 6252b26dd4cSOder Chiou #define RT5660_PWR_CLK25M_SFT 4 6262b26dd4cSOder Chiou #define RT5660_PWR_CLK25M_PD (0x0 << 4) 6272b26dd4cSOder Chiou #define RT5660_PWR_CLK25M_PU (0x1 << 4) 6282b26dd4cSOder Chiou 6292b26dd4cSOder Chiou /* EQ Control 1 (0xb0) */ 6302b26dd4cSOder Chiou #define RT5660_EQ_SRC_MASK (0x1 << 15) 6312b26dd4cSOder Chiou #define RT5660_EQ_SRC_SFT 15 6322b26dd4cSOder Chiou #define RT5660_EQ_SRC_DAC (0x0 << 15) 6332b26dd4cSOder Chiou #define RT5660_EQ_SRC_ADC (0x1 << 15) 6342b26dd4cSOder Chiou #define RT5660_EQ_UPD (0x1 << 14) 6352b26dd4cSOder Chiou #define RT5660_EQ_UPD_BIT 14 6362b26dd4cSOder Chiou 6372b26dd4cSOder Chiou /* Jack Detect Control (0xbb) */ 6382b26dd4cSOder Chiou #define RT5660_JD_MASK (0x3 << 14) 6392b26dd4cSOder Chiou #define RT5660_JD_SFT 14 6402b26dd4cSOder Chiou #define RT5660_JD_DIS (0x0 << 14) 6412b26dd4cSOder Chiou #define RT5660_JD_GPIO1 (0x1 << 14) 6422b26dd4cSOder Chiou #define RT5660_JD_GPIO2 (0x2 << 14) 6432b26dd4cSOder Chiou #define RT5660_JD_LOUT_MASK (0x1 << 11) 6442b26dd4cSOder Chiou #define RT5660_JD_LOUT_SFT 11 6452b26dd4cSOder Chiou #define RT5660_JD_LOUT_DIS (0x0 << 11) 6462b26dd4cSOder Chiou #define RT5660_JD_LOUT_EN (0x1 << 11) 6472b26dd4cSOder Chiou #define RT5660_JD_LOUT_TRG_MASK (0x1 << 10) 6482b26dd4cSOder Chiou #define RT5660_JD_LOUT_TRG_SFT 10 6492b26dd4cSOder Chiou #define RT5660_JD_LOUT_TRG_LO (0x0 << 10) 6502b26dd4cSOder Chiou #define RT5660_JD_LOUT_TRG_HI (0x1 << 10) 6512b26dd4cSOder Chiou #define RT5660_JD_SPO_MASK (0x1 << 9) 6522b26dd4cSOder Chiou #define RT5660_JD_SPO_SFT 9 6532b26dd4cSOder Chiou #define RT5660_JD_SPO_DIS (0x0 << 9) 6542b26dd4cSOder Chiou #define RT5660_JD_SPO_EN (0x1 << 9) 6552b26dd4cSOder Chiou #define RT5660_JD_SPO_TRG_MASK (0x1 << 8) 6562b26dd4cSOder Chiou #define RT5660_JD_SPO_TRG_SFT 8 6572b26dd4cSOder Chiou #define RT5660_JD_SPO_TRG_LO (0x0 << 8) 6582b26dd4cSOder Chiou #define RT5660_JD_SPO_TRG_HI (0x1 << 8) 6592b26dd4cSOder Chiou 6602b26dd4cSOder Chiou /* IRQ Control 1 (0xbd) */ 6612b26dd4cSOder Chiou #define RT5660_IRQ_JD_MASK (0x1 << 15) 6622b26dd4cSOder Chiou #define RT5660_IRQ_JD_SFT 15 6632b26dd4cSOder Chiou #define RT5660_IRQ_JD_BP (0x0 << 15) 6642b26dd4cSOder Chiou #define RT5660_IRQ_JD_NOR (0x1 << 15) 6652b26dd4cSOder Chiou #define RT5660_IRQ_OT_MASK (0x1 << 14) 6662b26dd4cSOder Chiou #define RT5660_IRQ_OT_SFT 14 6672b26dd4cSOder Chiou #define RT5660_IRQ_OT_BP (0x0 << 14) 6682b26dd4cSOder Chiou #define RT5660_IRQ_OT_NOR (0x1 << 14) 6692b26dd4cSOder Chiou #define RT5660_JD_STKY_MASK (0x1 << 13) 6702b26dd4cSOder Chiou #define RT5660_JD_STKY_SFT 13 6712b26dd4cSOder Chiou #define RT5660_JD_STKY_DIS (0x0 << 13) 6722b26dd4cSOder Chiou #define RT5660_JD_STKY_EN (0x1 << 13) 6732b26dd4cSOder Chiou #define RT5660_OT_STKY_MASK (0x1 << 12) 6742b26dd4cSOder Chiou #define RT5660_OT_STKY_SFT 12 6752b26dd4cSOder Chiou #define RT5660_OT_STKY_DIS (0x0 << 12) 6762b26dd4cSOder Chiou #define RT5660_OT_STKY_EN (0x1 << 12) 6772b26dd4cSOder Chiou #define RT5660_JD_P_MASK (0x1 << 11) 6782b26dd4cSOder Chiou #define RT5660_JD_P_SFT 11 6792b26dd4cSOder Chiou #define RT5660_JD_P_NOR (0x0 << 11) 6802b26dd4cSOder Chiou #define RT5660_JD_P_INV (0x1 << 11) 6812b26dd4cSOder Chiou #define RT5660_OT_P_MASK (0x1 << 10) 6822b26dd4cSOder Chiou #define RT5660_OT_P_SFT 10 6832b26dd4cSOder Chiou #define RT5660_OT_P_NOR (0x0 << 10) 6842b26dd4cSOder Chiou #define RT5660_OT_P_INV (0x1 << 10) 6852b26dd4cSOder Chiou 6862b26dd4cSOder Chiou /* IRQ Control 2 (0xbe) */ 6872b26dd4cSOder Chiou #define RT5660_IRQ_MB1_OC_MASK (0x1 << 15) 6882b26dd4cSOder Chiou #define RT5660_IRQ_MB1_OC_SFT 15 6892b26dd4cSOder Chiou #define RT5660_IRQ_MB1_OC_BP (0x0 << 15) 6902b26dd4cSOder Chiou #define RT5660_IRQ_MB1_OC_NOR (0x1 << 15) 6912b26dd4cSOder Chiou #define RT5660_IRQ_MB2_OC_MASK (0x1 << 14) 6922b26dd4cSOder Chiou #define RT5660_IRQ_MB2_OC_SFT 14 6932b26dd4cSOder Chiou #define RT5660_IRQ_MB2_OC_BP (0x0 << 14) 6942b26dd4cSOder Chiou #define RT5660_IRQ_MB2_OC_NOR (0x1 << 14) 6952b26dd4cSOder Chiou #define RT5660_MB1_OC_STKY_MASK (0x1 << 11) 6962b26dd4cSOder Chiou #define RT5660_MB1_OC_STKY_SFT 11 6972b26dd4cSOder Chiou #define RT5660_MB1_OC_STKY_DIS (0x0 << 11) 6982b26dd4cSOder Chiou #define RT5660_MB1_OC_STKY_EN (0x1 << 11) 6992b26dd4cSOder Chiou #define RT5660_MB2_OC_STKY_MASK (0x1 << 10) 7002b26dd4cSOder Chiou #define RT5660_MB2_OC_STKY_SFT 10 7012b26dd4cSOder Chiou #define RT5660_MB2_OC_STKY_DIS (0x0 << 10) 7022b26dd4cSOder Chiou #define RT5660_MB2_OC_STKY_EN (0x1 << 10) 7032b26dd4cSOder Chiou #define RT5660_MB1_OC_P_MASK (0x1 << 7) 7042b26dd4cSOder Chiou #define RT5660_MB1_OC_P_SFT 7 7052b26dd4cSOder Chiou #define RT5660_MB1_OC_P_NOR (0x0 << 7) 7062b26dd4cSOder Chiou #define RT5660_MB1_OC_P_INV (0x1 << 7) 7072b26dd4cSOder Chiou #define RT5660_MB2_OC_P_MASK (0x1 << 6) 7082b26dd4cSOder Chiou #define RT5660_MB2_OC_P_SFT 6 7092b26dd4cSOder Chiou #define RT5660_MB2_OC_P_NOR (0x0 << 6) 7102b26dd4cSOder Chiou #define RT5660_MB2_OC_P_INV (0x1 << 6) 7112b26dd4cSOder Chiou #define RT5660_MB1_OC_CLR (0x1 << 3) 7122b26dd4cSOder Chiou #define RT5660_MB1_OC_CLR_SFT 3 7132b26dd4cSOder Chiou #define RT5660_MB2_OC_CLR (0x1 << 2) 7142b26dd4cSOder Chiou #define RT5660_MB2_OC_CLR_SFT 2 7152b26dd4cSOder Chiou 7162b26dd4cSOder Chiou /* GPIO Control 1 (0xc0) */ 7172b26dd4cSOder Chiou #define RT5660_GP2_PIN_MASK (0x1 << 14) 7182b26dd4cSOder Chiou #define RT5660_GP2_PIN_SFT 14 7192b26dd4cSOder Chiou #define RT5660_GP2_PIN_GPIO2 (0x0 << 14) 7202b26dd4cSOder Chiou #define RT5660_GP2_PIN_DMIC1_SDA (0x1 << 14) 7212b26dd4cSOder Chiou #define RT5660_GP1_PIN_MASK (0x3 << 12) 7222b26dd4cSOder Chiou #define RT5660_GP1_PIN_SFT 12 7232b26dd4cSOder Chiou #define RT5660_GP1_PIN_GPIO1 (0x0 << 12) 7242b26dd4cSOder Chiou #define RT5660_GP1_PIN_DMIC1_SCL (0x1 << 12) 7252b26dd4cSOder Chiou #define RT5660_GP1_PIN_IRQ (0x2 << 12) 7262b26dd4cSOder Chiou #define RT5660_GPIO_M_MASK (0x1 << 9) 7272b26dd4cSOder Chiou #define RT5660_GPIO_M_SFT 9 7282b26dd4cSOder Chiou #define RT5660_GPIO_M_FLT (0x0 << 9) 7292b26dd4cSOder Chiou #define RT5660_GPIO_M_PH (0x1 << 9) 7302b26dd4cSOder Chiou 7312b26dd4cSOder Chiou /* GPIO Control 3 (0xc2) */ 7322b26dd4cSOder Chiou #define RT5660_GP2_PF_MASK (0x1 << 5) 7332b26dd4cSOder Chiou #define RT5660_GP2_PF_SFT 5 7342b26dd4cSOder Chiou #define RT5660_GP2_PF_IN (0x0 << 5) 7352b26dd4cSOder Chiou #define RT5660_GP2_PF_OUT (0x1 << 5) 7362b26dd4cSOder Chiou #define RT5660_GP2_OUT_MASK (0x1 << 4) 7372b26dd4cSOder Chiou #define RT5660_GP2_OUT_SFT 4 7382b26dd4cSOder Chiou #define RT5660_GP2_OUT_LO (0x0 << 4) 7392b26dd4cSOder Chiou #define RT5660_GP2_OUT_HI (0x1 << 4) 7402b26dd4cSOder Chiou #define RT5660_GP2_P_MASK (0x1 << 3) 7412b26dd4cSOder Chiou #define RT5660_GP2_P_SFT 3 7422b26dd4cSOder Chiou #define RT5660_GP2_P_NOR (0x0 << 3) 7432b26dd4cSOder Chiou #define RT5660_GP2_P_INV (0x1 << 3) 7442b26dd4cSOder Chiou #define RT5660_GP1_PF_MASK (0x1 << 2) 7452b26dd4cSOder Chiou #define RT5660_GP1_PF_SFT 2 7462b26dd4cSOder Chiou #define RT5660_GP1_PF_IN (0x0 << 2) 7472b26dd4cSOder Chiou #define RT5660_GP1_PF_OUT (0x1 << 2) 7482b26dd4cSOder Chiou #define RT5660_GP1_OUT_MASK (0x1 << 1) 7492b26dd4cSOder Chiou #define RT5660_GP1_OUT_SFT 1 7502b26dd4cSOder Chiou #define RT5660_GP1_OUT_LO (0x0 << 1) 7512b26dd4cSOder Chiou #define RT5660_GP1_OUT_HI (0x1 << 1) 7522b26dd4cSOder Chiou #define RT5660_GP1_P_MASK (0x1) 7532b26dd4cSOder Chiou #define RT5660_GP1_P_SFT 0 7542b26dd4cSOder Chiou #define RT5660_GP1_P_NOR (0x0) 7552b26dd4cSOder Chiou #define RT5660_GP1_P_INV (0x1) 7562b26dd4cSOder Chiou 7572b26dd4cSOder Chiou /* Soft volume and zero cross control 1 (0xd9) */ 7582b26dd4cSOder Chiou #define RT5660_SV_MASK (0x1 << 15) 7592b26dd4cSOder Chiou #define RT5660_SV_SFT 15 7602b26dd4cSOder Chiou #define RT5660_SV_DIS (0x0 << 15) 7612b26dd4cSOder Chiou #define RT5660_SV_EN (0x1 << 15) 7622b26dd4cSOder Chiou #define RT5660_SPO_SV_MASK (0x1 << 14) 7632b26dd4cSOder Chiou #define RT5660_SPO_SV_SFT 14 7642b26dd4cSOder Chiou #define RT5660_SPO_SV_DIS (0x0 << 14) 7652b26dd4cSOder Chiou #define RT5660_SPO_SV_EN (0x1 << 14) 7662b26dd4cSOder Chiou #define RT5660_OUT_SV_MASK (0x1 << 12) 7672b26dd4cSOder Chiou #define RT5660_OUT_SV_SFT 12 7682b26dd4cSOder Chiou #define RT5660_OUT_SV_DIS (0x0 << 12) 7692b26dd4cSOder Chiou #define RT5660_OUT_SV_EN (0x1 << 12) 7702b26dd4cSOder Chiou #define RT5660_ZCD_DIG_MASK (0x1 << 11) 7712b26dd4cSOder Chiou #define RT5660_ZCD_DIG_SFT 11 7722b26dd4cSOder Chiou #define RT5660_ZCD_DIG_DIS (0x0 << 11) 7732b26dd4cSOder Chiou #define RT5660_ZCD_DIG_EN (0x1 << 11) 7742b26dd4cSOder Chiou #define RT5660_ZCD_MASK (0x1 << 10) 7752b26dd4cSOder Chiou #define RT5660_ZCD_SFT 10 7762b26dd4cSOder Chiou #define RT5660_ZCD_PD (0x0 << 10) 7772b26dd4cSOder Chiou #define RT5660_ZCD_PU (0x1 << 10) 7782b26dd4cSOder Chiou #define RT5660_SV_DLY_MASK (0xf) 7792b26dd4cSOder Chiou #define RT5660_SV_DLY_SFT 0 7802b26dd4cSOder Chiou 7812b26dd4cSOder Chiou /* Soft volume and zero cross control 2 (0xda) */ 7822b26dd4cSOder Chiou #define RT5660_ZCD_SPO_MASK (0x1 << 15) 7832b26dd4cSOder Chiou #define RT5660_ZCD_SPO_SFT 15 7842b26dd4cSOder Chiou #define RT5660_ZCD_SPO_DIS (0x0 << 15) 7852b26dd4cSOder Chiou #define RT5660_ZCD_SPO_EN (0x1 << 15) 7862b26dd4cSOder Chiou #define RT5660_ZCD_OMR_MASK (0x1 << 8) 7872b26dd4cSOder Chiou #define RT5660_ZCD_OMR_SFT 8 7882b26dd4cSOder Chiou #define RT5660_ZCD_OMR_DIS (0x0 << 8) 7892b26dd4cSOder Chiou #define RT5660_ZCD_OMR_EN (0x1 << 8) 7902b26dd4cSOder Chiou #define RT5660_ZCD_OML_MASK (0x1 << 7) 7912b26dd4cSOder Chiou #define RT5660_ZCD_OML_SFT 7 7922b26dd4cSOder Chiou #define RT5660_ZCD_OML_DIS (0x0 << 7) 7932b26dd4cSOder Chiou #define RT5660_ZCD_OML_EN (0x1 << 7) 7942b26dd4cSOder Chiou #define RT5660_ZCD_SPM_MASK (0x1 << 6) 7952b26dd4cSOder Chiou #define RT5660_ZCD_SPM_SFT 6 7962b26dd4cSOder Chiou #define RT5660_ZCD_SPM_DIS (0x0 << 6) 7972b26dd4cSOder Chiou #define RT5660_ZCD_SPM_EN (0x1 << 6) 7982b26dd4cSOder Chiou #define RT5660_ZCD_RMR_MASK (0x1 << 5) 7992b26dd4cSOder Chiou #define RT5660_ZCD_RMR_SFT 5 8002b26dd4cSOder Chiou #define RT5660_ZCD_RMR_DIS (0x0 << 5) 8012b26dd4cSOder Chiou #define RT5660_ZCD_RMR_EN (0x1 << 5) 8022b26dd4cSOder Chiou #define RT5660_ZCD_RML_MASK (0x1 << 4) 8032b26dd4cSOder Chiou #define RT5660_ZCD_RML_SFT 4 8042b26dd4cSOder Chiou #define RT5660_ZCD_RML_DIS (0x0 << 4) 8052b26dd4cSOder Chiou #define RT5660_ZCD_RML_EN (0x1 << 4) 8062b26dd4cSOder Chiou 8072b26dd4cSOder Chiou /* General Control 1 (0xfa) */ 8082b26dd4cSOder Chiou #define RT5660_PWR_VREF_HP (0x1 << 11) 8092b26dd4cSOder Chiou #define RT5660_PWR_VREF_HP_SFT 11 810d01580c3SBard Liao #define RT5660_AUTO_DIS_AMP (0x1 << 6) 811d01580c3SBard Liao #define RT5660_MCLK_DET (0x1 << 5) 812d01580c3SBard Liao #define RT5660_POW_CLKDET (0x1 << 1) 8132b26dd4cSOder Chiou #define RT5660_DIG_GATE_CTRL (0x1) 8142b26dd4cSOder Chiou #define RT5660_DIG_GATE_CTRL_SFT 0 8152b26dd4cSOder Chiou 8162b26dd4cSOder Chiou /* System Clock Source */ 8172b26dd4cSOder Chiou #define RT5660_SCLK_S_MCLK 0 8182b26dd4cSOder Chiou #define RT5660_SCLK_S_PLL1 1 8192b26dd4cSOder Chiou #define RT5660_SCLK_S_RCCLK 2 8202b26dd4cSOder Chiou 8212b26dd4cSOder Chiou /* PLL1 Source */ 8222b26dd4cSOder Chiou #define RT5660_PLL1_S_MCLK 0 8232b26dd4cSOder Chiou #define RT5660_PLL1_S_BCLK 1 8242b26dd4cSOder Chiou 8252b26dd4cSOder Chiou enum { 8262b26dd4cSOder Chiou RT5660_AIF1, 8272b26dd4cSOder Chiou RT5660_AIFS, 8282b26dd4cSOder Chiou }; 8292b26dd4cSOder Chiou 8302b26dd4cSOder Chiou struct rt5660_priv { 831ca04dd8aSKuninori Morimoto struct snd_soc_component *component; 8322b26dd4cSOder Chiou struct rt5660_platform_data pdata; 8332b26dd4cSOder Chiou struct regmap *regmap; 8342b26dd4cSOder Chiou struct clk *mclk; 8352b26dd4cSOder Chiou 8362b26dd4cSOder Chiou int sysclk; 8372b26dd4cSOder Chiou int sysclk_src; 8382b26dd4cSOder Chiou int lrck[RT5660_AIFS]; 8392b26dd4cSOder Chiou int bclk[RT5660_AIFS]; 8402b26dd4cSOder Chiou int master[RT5660_AIFS]; 8412b26dd4cSOder Chiou 8422b26dd4cSOder Chiou int pll_src; 8432b26dd4cSOder Chiou int pll_in; 8442b26dd4cSOder Chiou int pll_out; 8452b26dd4cSOder Chiou }; 8462b26dd4cSOder Chiou 8472b26dd4cSOder Chiou #endif 848