1*cf885929SSimon Glass /* SPDX-License-Identifier: GPL-2.0+ */ 2*cf885929SSimon Glass /* 3*cf885929SSimon Glass * rt5677.h -- RealTek ALC5677 ALSA SoC Audio driver 4*cf885929SSimon Glass * 5*cf885929SSimon Glass * Copyright 2013 Realtek Semiconductor Corp. 6*cf885929SSimon Glass * Author: Oder Chiou <oder_chiou@realtek.com> 7*cf885929SSimon Glass * 8*cf885929SSimon Glass * Based on the file by the same name in Chromium OS dc 9*cf885929SSimon Glass */ 10*cf885929SSimon Glass 11*cf885929SSimon Glass #ifndef __DRIVERS_SOUND_RT5677_H__ 12*cf885929SSimon Glass #define __DRIVERS_SOUND_RT5677_H__ 13*cf885929SSimon Glass 14*cf885929SSimon Glass /* 15*cf885929SSimon Glass * RT5677 Registers Definition 16*cf885929SSimon Glass */ 17*cf885929SSimon Glass 18*cf885929SSimon Glass /* Info */ 19*cf885929SSimon Glass #define RT5677_RESET 0x00 20*cf885929SSimon Glass #define RT5677_VENDOR_ID 0xfd 21*cf885929SSimon Glass #define RT5677_VENDOR_ID1 0xfe 22*cf885929SSimon Glass #define RT5677_VENDOR_ID2 0xff 23*cf885929SSimon Glass 24*cf885929SSimon Glass #define RT5677_REG_CNT (RT5677_VENDOR_ID2 + 1) 25*cf885929SSimon Glass #define RT5677_PR_REG_CNT 255 26*cf885929SSimon Glass 27*cf885929SSimon Glass /* I/O - Output */ 28*cf885929SSimon Glass #define RT5677_LOUT1 0x01 29*cf885929SSimon Glass /* I/O - Input */ 30*cf885929SSimon Glass #define RT5677_IN1 0x03 31*cf885929SSimon Glass #define RT5677_MICBIAS 0x04 32*cf885929SSimon Glass /* I/O - SLIMBus */ 33*cf885929SSimon Glass #define RT5677_SLIMBUS_PARAM 0x07 34*cf885929SSimon Glass #define RT5677_SLIMBUS_RX 0x08 35*cf885929SSimon Glass #define RT5677_SLIMBUS_CTRL 0x09 36*cf885929SSimon Glass /* I/O */ 37*cf885929SSimon Glass #define RT5677_SIDETONE_CTRL 0x13 38*cf885929SSimon Glass /* I/O - ADC/DAC */ 39*cf885929SSimon Glass #define RT5677_ANA_DAC1_2_3_SRC 0x15 40*cf885929SSimon Glass #define RT5677_IF_DSP_DAC3_4_MIXER 0x16 41*cf885929SSimon Glass #define RT5677_DAC4_DIG_VOL 0x17 42*cf885929SSimon Glass #define RT5677_DAC3_DIG_VOL 0x18 43*cf885929SSimon Glass #define RT5677_DAC1_DIG_VOL 0x19 44*cf885929SSimon Glass #define RT5677_DAC2_DIG_VOL 0x1a 45*cf885929SSimon Glass #define RT5677_IF_DSP_DAC2_MIXER 0x1b 46*cf885929SSimon Glass #define RT5677_STO1_ADC_DIG_VOL 0x1c 47*cf885929SSimon Glass #define RT5677_MONO_ADC_DIG_VOL 0x1d 48*cf885929SSimon Glass #define RT5677_STO1_2_ADC_BST 0x1e 49*cf885929SSimon Glass #define RT5677_STO2_ADC_DIG_VOL 0x1f 50*cf885929SSimon Glass /* Mixer - D-D */ 51*cf885929SSimon Glass #define RT5677_ADC_BST_CTRL2 0x20 52*cf885929SSimon Glass #define RT5677_STO3_4_ADC_BST 0x21 53*cf885929SSimon Glass #define RT5677_STO3_ADC_DIG_VOL 0x22 54*cf885929SSimon Glass #define RT5677_STO4_ADC_DIG_VOL 0x23 55*cf885929SSimon Glass #define RT5677_STO4_ADC_MIXER 0x24 56*cf885929SSimon Glass #define RT5677_STO3_ADC_MIXER 0x25 57*cf885929SSimon Glass #define RT5677_STO2_ADC_MIXER 0x26 58*cf885929SSimon Glass #define RT5677_STO1_ADC_MIXER 0x27 59*cf885929SSimon Glass #define RT5677_MONO_ADC_MIXER 0x28 60*cf885929SSimon Glass #define RT5677_ADC_IF_DSP_DAC1_MIXER 0x29 61*cf885929SSimon Glass #define RT5677_STO1_DAC_MIXER 0x2a 62*cf885929SSimon Glass #define RT5677_MONO_DAC_MIXER 0x2b 63*cf885929SSimon Glass #define RT5677_DD1_MIXER 0x2c 64*cf885929SSimon Glass #define RT5677_DD2_MIXER 0x2d 65*cf885929SSimon Glass #define RT5677_IF3_DATA 0x2f 66*cf885929SSimon Glass #define RT5677_IF4_DATA 0x30 67*cf885929SSimon Glass /* Mixer - PDM */ 68*cf885929SSimon Glass #define RT5677_PDM_OUT_CTRL 0x31 69*cf885929SSimon Glass #define RT5677_PDM_DATA_CTRL1 0x32 70*cf885929SSimon Glass #define RT5677_PDM_DATA_CTRL2 0x33 71*cf885929SSimon Glass #define RT5677_PDM1_DATA_CTRL2 0x34 72*cf885929SSimon Glass #define RT5677_PDM1_DATA_CTRL3 0x35 73*cf885929SSimon Glass #define RT5677_PDM1_DATA_CTRL4 0x36 74*cf885929SSimon Glass #define RT5677_PDM2_DATA_CTRL2 0x37 75*cf885929SSimon Glass #define RT5677_PDM2_DATA_CTRL3 0x38 76*cf885929SSimon Glass #define RT5677_PDM2_DATA_CTRL4 0x39 77*cf885929SSimon Glass /* TDM */ 78*cf885929SSimon Glass #define RT5677_TDM1_CTRL1 0x3b 79*cf885929SSimon Glass #define RT5677_TDM1_CTRL2 0x3c 80*cf885929SSimon Glass #define RT5677_TDM1_CTRL3 0x3d 81*cf885929SSimon Glass #define RT5677_TDM1_CTRL4 0x3e 82*cf885929SSimon Glass #define RT5677_TDM1_CTRL5 0x3f 83*cf885929SSimon Glass #define RT5677_TDM2_CTRL1 0x40 84*cf885929SSimon Glass #define RT5677_TDM2_CTRL2 0x41 85*cf885929SSimon Glass #define RT5677_TDM2_CTRL3 0x42 86*cf885929SSimon Glass #define RT5677_TDM2_CTRL4 0x43 87*cf885929SSimon Glass #define RT5677_TDM2_CTRL5 0x44 88*cf885929SSimon Glass /* I2C_MASTER_CTRL */ 89*cf885929SSimon Glass #define RT5677_I2C_MASTER_CTRL1 0x47 90*cf885929SSimon Glass #define RT5677_I2C_MASTER_CTRL2 0x48 91*cf885929SSimon Glass #define RT5677_I2C_MASTER_CTRL3 0x49 92*cf885929SSimon Glass #define RT5677_I2C_MASTER_CTRL4 0x4a 93*cf885929SSimon Glass #define RT5677_I2C_MASTER_CTRL5 0x4b 94*cf885929SSimon Glass #define RT5677_I2C_MASTER_CTRL6 0x4c 95*cf885929SSimon Glass #define RT5677_I2C_MASTER_CTRL7 0x4d 96*cf885929SSimon Glass #define RT5677_I2C_MASTER_CTRL8 0x4e 97*cf885929SSimon Glass /* DMIC */ 98*cf885929SSimon Glass #define RT5677_DMIC_CTRL1 0x50 99*cf885929SSimon Glass #define RT5677_DMIC_CTRL2 0x51 100*cf885929SSimon Glass /* Haptic Generator */ 101*cf885929SSimon Glass #define RT5677_HAP_GENE_CTRL1 0x56 102*cf885929SSimon Glass #define RT5677_HAP_GENE_CTRL2 0x57 103*cf885929SSimon Glass #define RT5677_HAP_GENE_CTRL3 0x58 104*cf885929SSimon Glass #define RT5677_HAP_GENE_CTRL4 0x59 105*cf885929SSimon Glass #define RT5677_HAP_GENE_CTRL5 0x5a 106*cf885929SSimon Glass #define RT5677_HAP_GENE_CTRL6 0x5b 107*cf885929SSimon Glass #define RT5677_HAP_GENE_CTRL7 0x5c 108*cf885929SSimon Glass #define RT5677_HAP_GENE_CTRL8 0x5d 109*cf885929SSimon Glass #define RT5677_HAP_GENE_CTRL9 0x5e 110*cf885929SSimon Glass #define RT5677_HAP_GENE_CTRL10 0x5f 111*cf885929SSimon Glass /* Power */ 112*cf885929SSimon Glass #define RT5677_PWR_DIG1 0x61 113*cf885929SSimon Glass #define RT5677_PWR_DIG2 0x62 114*cf885929SSimon Glass #define RT5677_PWR_ANLG1 0x63 115*cf885929SSimon Glass #define RT5677_PWR_ANLG2 0x64 116*cf885929SSimon Glass #define RT5677_PWR_DSP1 0x65 117*cf885929SSimon Glass #define RT5677_PWR_DSP_ST 0x66 118*cf885929SSimon Glass #define RT5677_PWR_DSP2 0x67 119*cf885929SSimon Glass #define RT5677_ADC_DAC_HPF_CTRL1 0x68 120*cf885929SSimon Glass /* Private Register Control */ 121*cf885929SSimon Glass #define RT5677_PRIV_INDEX 0x6a 122*cf885929SSimon Glass #define RT5677_PRIV_DATA 0x6c 123*cf885929SSimon Glass /* Format - ADC/DAC */ 124*cf885929SSimon Glass #define RT5677_I2S4_SDP 0x6f 125*cf885929SSimon Glass #define RT5677_I2S1_SDP 0x70 126*cf885929SSimon Glass #define RT5677_I2S2_SDP 0x71 127*cf885929SSimon Glass #define RT5677_I2S3_SDP 0x72 128*cf885929SSimon Glass #define RT5677_CLK_TREE_CTRL1 0x73 129*cf885929SSimon Glass #define RT5677_CLK_TREE_CTRL2 0x74 130*cf885929SSimon Glass #define RT5677_CLK_TREE_CTRL3 0x75 131*cf885929SSimon Glass /* Function - Analog */ 132*cf885929SSimon Glass #define RT5677_PLL1_CTRL1 0x7a 133*cf885929SSimon Glass #define RT5677_PLL1_CTRL2 0x7b 134*cf885929SSimon Glass #define RT5677_PLL2_CTRL1 0x7c 135*cf885929SSimon Glass #define RT5677_PLL2_CTRL2 0x7d 136*cf885929SSimon Glass #define RT5677_GLB_CLK1 0x80 137*cf885929SSimon Glass #define RT5677_GLB_CLK2 0x81 138*cf885929SSimon Glass #define RT5677_ASRC_1 0x83 139*cf885929SSimon Glass #define RT5677_ASRC_2 0x84 140*cf885929SSimon Glass #define RT5677_ASRC_3 0x85 141*cf885929SSimon Glass #define RT5677_ASRC_4 0x86 142*cf885929SSimon Glass #define RT5677_ASRC_5 0x87 143*cf885929SSimon Glass #define RT5677_ASRC_6 0x88 144*cf885929SSimon Glass #define RT5677_ASRC_7 0x89 145*cf885929SSimon Glass #define RT5677_ASRC_8 0x8a 146*cf885929SSimon Glass #define RT5677_ASRC_9 0x8b 147*cf885929SSimon Glass #define RT5677_ASRC_10 0x8c 148*cf885929SSimon Glass #define RT5677_ASRC_11 0x8d 149*cf885929SSimon Glass #define RT5677_ASRC_12 0x8e 150*cf885929SSimon Glass #define RT5677_ASRC_13 0x8f 151*cf885929SSimon Glass #define RT5677_ASRC_14 0x90 152*cf885929SSimon Glass #define RT5677_ASRC_15 0x91 153*cf885929SSimon Glass #define RT5677_ASRC_16 0x92 154*cf885929SSimon Glass #define RT5677_ASRC_17 0x93 155*cf885929SSimon Glass #define RT5677_ASRC_18 0x94 156*cf885929SSimon Glass #define RT5677_ASRC_19 0x95 157*cf885929SSimon Glass #define RT5677_ASRC_20 0x97 158*cf885929SSimon Glass #define RT5677_ASRC_21 0x98 159*cf885929SSimon Glass #define RT5677_ASRC_22 0x99 160*cf885929SSimon Glass #define RT5677_ASRC_23 0x9a 161*cf885929SSimon Glass #define RT5677_VAD_CTRL1 0x9c 162*cf885929SSimon Glass #define RT5677_VAD_CTRL2 0x9d 163*cf885929SSimon Glass #define RT5677_VAD_CTRL3 0x9e 164*cf885929SSimon Glass #define RT5677_VAD_CTRL4 0x9f 165*cf885929SSimon Glass #define RT5677_VAD_CTRL5 0xa0 166*cf885929SSimon Glass /* Function - Digital */ 167*cf885929SSimon Glass #define RT5677_DSP_INB_CTRL1 0xa3 168*cf885929SSimon Glass #define RT5677_DSP_INB_CTRL2 0xa4 169*cf885929SSimon Glass #define RT5677_DSP_IN_OUTB_CTRL 0xa5 170*cf885929SSimon Glass #define RT5677_DSP_OUTB0_1_DIG_VOL 0xa6 171*cf885929SSimon Glass #define RT5677_DSP_OUTB2_3_DIG_VOL 0xa7 172*cf885929SSimon Glass #define RT5677_DSP_OUTB4_5_DIG_VOL 0xa8 173*cf885929SSimon Glass #define RT5677_DSP_OUTB6_7_DIG_VOL 0xa9 174*cf885929SSimon Glass #define RT5677_ADC_EQ_CTRL1 0xae 175*cf885929SSimon Glass #define RT5677_ADC_EQ_CTRL2 0xaf 176*cf885929SSimon Glass #define RT5677_EQ_CTRL1 0xb0 177*cf885929SSimon Glass #define RT5677_EQ_CTRL2 0xb1 178*cf885929SSimon Glass #define RT5677_EQ_CTRL3 0xb2 179*cf885929SSimon Glass #define RT5677_SOFT_VOL_ZERO_CROSS1 0xb3 180*cf885929SSimon Glass #define RT5677_JD_CTRL1 0xb5 181*cf885929SSimon Glass #define RT5677_JD_CTRL2 0xb6 182*cf885929SSimon Glass #define RT5677_JD_CTRL3 0xb8 183*cf885929SSimon Glass #define RT5677_IRQ_CTRL1 0xbd 184*cf885929SSimon Glass #define RT5677_IRQ_CTRL2 0xbe 185*cf885929SSimon Glass #define RT5677_GPIO_ST 0xbf 186*cf885929SSimon Glass #define RT5677_GPIO_CTRL1 0xc0 187*cf885929SSimon Glass #define RT5677_GPIO_CTRL2 0xc1 188*cf885929SSimon Glass #define RT5677_GPIO_CTRL3 0xc2 189*cf885929SSimon Glass #define RT5677_STO1_ADC_HI_FILTER1 0xc5 190*cf885929SSimon Glass #define RT5677_STO1_ADC_HI_FILTER2 0xc6 191*cf885929SSimon Glass #define RT5677_MONO_ADC_HI_FILTER1 0xc7 192*cf885929SSimon Glass #define RT5677_MONO_ADC_HI_FILTER2 0xc8 193*cf885929SSimon Glass #define RT5677_STO2_ADC_HI_FILTER1 0xc9 194*cf885929SSimon Glass #define RT5677_STO2_ADC_HI_FILTER2 0xca 195*cf885929SSimon Glass #define RT5677_STO3_ADC_HI_FILTER1 0xcb 196*cf885929SSimon Glass #define RT5677_STO3_ADC_HI_FILTER2 0xcc 197*cf885929SSimon Glass #define RT5677_STO4_ADC_HI_FILTER1 0xcd 198*cf885929SSimon Glass #define RT5677_STO4_ADC_HI_FILTER2 0xce 199*cf885929SSimon Glass #define RT5677_MB_DRC_CTRL1 0xd0 200*cf885929SSimon Glass #define RT5677_DRC1_CTRL1 0xd2 201*cf885929SSimon Glass #define RT5677_DRC1_CTRL2 0xd3 202*cf885929SSimon Glass #define RT5677_DRC1_CTRL3 0xd4 203*cf885929SSimon Glass #define RT5677_DRC1_CTRL4 0xd5 204*cf885929SSimon Glass #define RT5677_DRC1_CTRL5 0xd6 205*cf885929SSimon Glass #define RT5677_DRC1_CTRL6 0xd7 206*cf885929SSimon Glass #define RT5677_DRC2_CTRL1 0xd8 207*cf885929SSimon Glass #define RT5677_DRC2_CTRL2 0xd9 208*cf885929SSimon Glass #define RT5677_DRC2_CTRL3 0xda 209*cf885929SSimon Glass #define RT5677_DRC2_CTRL4 0xdb 210*cf885929SSimon Glass #define RT5677_DRC2_CTRL5 0xdc 211*cf885929SSimon Glass #define RT5677_DRC2_CTRL6 0xdd 212*cf885929SSimon Glass #define RT5677_DRC1_HL_CTRL1 0xde 213*cf885929SSimon Glass #define RT5677_DRC1_HL_CTRL2 0xdf 214*cf885929SSimon Glass #define RT5677_DRC2_HL_CTRL1 0xe0 215*cf885929SSimon Glass #define RT5677_DRC2_HL_CTRL2 0xe1 216*cf885929SSimon Glass #define RT5677_DSP_INB1_SRC_CTRL1 0xe3 217*cf885929SSimon Glass #define RT5677_DSP_INB1_SRC_CTRL2 0xe4 218*cf885929SSimon Glass #define RT5677_DSP_INB1_SRC_CTRL3 0xe5 219*cf885929SSimon Glass #define RT5677_DSP_INB1_SRC_CTRL4 0xe6 220*cf885929SSimon Glass #define RT5677_DSP_INB2_SRC_CTRL1 0xe7 221*cf885929SSimon Glass #define RT5677_DSP_INB2_SRC_CTRL2 0xe8 222*cf885929SSimon Glass #define RT5677_DSP_INB2_SRC_CTRL3 0xe9 223*cf885929SSimon Glass #define RT5677_DSP_INB2_SRC_CTRL4 0xea 224*cf885929SSimon Glass #define RT5677_DSP_INB3_SRC_CTRL1 0xeb 225*cf885929SSimon Glass #define RT5677_DSP_INB3_SRC_CTRL2 0xec 226*cf885929SSimon Glass #define RT5677_DSP_INB3_SRC_CTRL3 0xed 227*cf885929SSimon Glass #define RT5677_DSP_INB3_SRC_CTRL4 0xee 228*cf885929SSimon Glass #define RT5677_DSP_OUTB1_SRC_CTRL1 0xef 229*cf885929SSimon Glass #define RT5677_DSP_OUTB1_SRC_CTRL2 0xf0 230*cf885929SSimon Glass #define RT5677_DSP_OUTB1_SRC_CTRL3 0xf1 231*cf885929SSimon Glass #define RT5677_DSP_OUTB1_SRC_CTRL4 0xf2 232*cf885929SSimon Glass #define RT5677_DSP_OUTB2_SRC_CTRL1 0xf3 233*cf885929SSimon Glass #define RT5677_DSP_OUTB2_SRC_CTRL2 0xf4 234*cf885929SSimon Glass #define RT5677_DSP_OUTB2_SRC_CTRL3 0xf5 235*cf885929SSimon Glass #define RT5677_DSP_OUTB2_SRC_CTRL4 0xf6 236*cf885929SSimon Glass 237*cf885929SSimon Glass /* Virtual DSP Mixer Control */ 238*cf885929SSimon Glass #define RT5677_DSP_OUTB_0123_MIXER_CTRL 0xf7 239*cf885929SSimon Glass #define RT5677_DSP_OUTB_45_MIXER_CTRL 0xf8 240*cf885929SSimon Glass #define RT5677_DSP_OUTB_67_MIXER_CTRL 0xf9 241*cf885929SSimon Glass 242*cf885929SSimon Glass /* General Control */ 243*cf885929SSimon Glass #define RT5677_DIG_MISC 0xfa 244*cf885929SSimon Glass #define RT5677_GEN_CTRL1 0xfb 245*cf885929SSimon Glass #define RT5677_GEN_CTRL2 0xfc 246*cf885929SSimon Glass 247*cf885929SSimon Glass /* DSP Mode I2C Control*/ 248*cf885929SSimon Glass #define RT5677_DSP_I2C_OP_CODE 0x00 249*cf885929SSimon Glass #define RT5677_DSP_I2C_ADDR_LSB 0x01 250*cf885929SSimon Glass #define RT5677_DSP_I2C_ADDR_MSB 0x02 251*cf885929SSimon Glass #define RT5677_DSP_I2C_DATA_LSB 0x03 252*cf885929SSimon Glass #define RT5677_DSP_I2C_DATA_MSB 0x04 253*cf885929SSimon Glass 254*cf885929SSimon Glass /* Index of Codec Private Register definition */ 255*cf885929SSimon Glass #define RT5677_PR_DRC1_CTRL_1 0x01 256*cf885929SSimon Glass #define RT5677_PR_DRC1_CTRL_2 0x02 257*cf885929SSimon Glass #define RT5677_PR_DRC1_CTRL_3 0x03 258*cf885929SSimon Glass #define RT5677_PR_DRC1_CTRL_4 0x04 259*cf885929SSimon Glass #define RT5677_PR_DRC1_CTRL_5 0x05 260*cf885929SSimon Glass #define RT5677_PR_DRC1_CTRL_6 0x06 261*cf885929SSimon Glass #define RT5677_PR_DRC1_CTRL_7 0x07 262*cf885929SSimon Glass #define RT5677_PR_DRC2_CTRL_1 0x08 263*cf885929SSimon Glass #define RT5677_PR_DRC2_CTRL_2 0x09 264*cf885929SSimon Glass #define RT5677_PR_DRC2_CTRL_3 0x0a 265*cf885929SSimon Glass #define RT5677_PR_DRC2_CTRL_4 0x0b 266*cf885929SSimon Glass #define RT5677_PR_DRC2_CTRL_5 0x0c 267*cf885929SSimon Glass #define RT5677_PR_DRC2_CTRL_6 0x0d 268*cf885929SSimon Glass #define RT5677_PR_DRC2_CTRL_7 0x0e 269*cf885929SSimon Glass #define RT5677_BIAS_CUR1 0x10 270*cf885929SSimon Glass #define RT5677_BIAS_CUR2 0x12 271*cf885929SSimon Glass #define RT5677_BIAS_CUR3 0x13 272*cf885929SSimon Glass #define RT5677_BIAS_CUR4 0x14 273*cf885929SSimon Glass #define RT5677_BIAS_CUR5 0x15 274*cf885929SSimon Glass #define RT5677_VREF_LOUT_CTRL 0x17 275*cf885929SSimon Glass #define RT5677_DIG_VOL_CTRL1 0x1a 276*cf885929SSimon Glass #define RT5677_DIG_VOL_CTRL2 0x1b 277*cf885929SSimon Glass #define RT5677_ANA_ADC_GAIN_CTRL 0x1e 278*cf885929SSimon Glass #define RT5677_VAD_SRAM_TEST1 0x20 279*cf885929SSimon Glass #define RT5677_VAD_SRAM_TEST2 0x21 280*cf885929SSimon Glass #define RT5677_VAD_SRAM_TEST3 0x22 281*cf885929SSimon Glass #define RT5677_VAD_SRAM_TEST4 0x23 282*cf885929SSimon Glass #define RT5677_PAD_DRV_CTRL 0x26 283*cf885929SSimon Glass #define RT5677_DIG_IN_PIN_ST_CTRL1 0x29 284*cf885929SSimon Glass #define RT5677_DIG_IN_PIN_ST_CTRL2 0x2a 285*cf885929SSimon Glass #define RT5677_DIG_IN_PIN_ST_CTRL3 0x2b 286*cf885929SSimon Glass #define RT5677_PLL1_INT 0x38 287*cf885929SSimon Glass #define RT5677_PLL2_INT 0x39 288*cf885929SSimon Glass #define RT5677_TEST_CTRL1 0x3a 289*cf885929SSimon Glass #define RT5677_TEST_CTRL2 0x3b 290*cf885929SSimon Glass #define RT5677_TEST_CTRL3 0x3c 291*cf885929SSimon Glass #define RT5677_CHOP_DAC_ADC 0x3d 292*cf885929SSimon Glass #define RT5677_SOFT_DEPOP_DAC_CLK_CTRL 0x3e 293*cf885929SSimon Glass #define RT5677_CROSS_OVER_FILTER1 0x90 294*cf885929SSimon Glass #define RT5677_CROSS_OVER_FILTER2 0x91 295*cf885929SSimon Glass #define RT5677_CROSS_OVER_FILTER3 0x92 296*cf885929SSimon Glass #define RT5677_CROSS_OVER_FILTER4 0x93 297*cf885929SSimon Glass #define RT5677_CROSS_OVER_FILTER5 0x94 298*cf885929SSimon Glass #define RT5677_CROSS_OVER_FILTER6 0x95 299*cf885929SSimon Glass #define RT5677_CROSS_OVER_FILTER7 0x96 300*cf885929SSimon Glass #define RT5677_CROSS_OVER_FILTER8 0x97 301*cf885929SSimon Glass #define RT5677_CROSS_OVER_FILTER9 0x98 302*cf885929SSimon Glass #define RT5677_CROSS_OVER_FILTER10 0x99 303*cf885929SSimon Glass 304*cf885929SSimon Glass /* global definition */ 305*cf885929SSimon Glass #define RT5677_L_MUTE (0x1 << 15) 306*cf885929SSimon Glass #define RT5677_L_MUTE_SFT 15 307*cf885929SSimon Glass #define RT5677_VOL_L_MUTE (0x1 << 14) 308*cf885929SSimon Glass #define RT5677_VOL_L_SFT 14 309*cf885929SSimon Glass #define RT5677_R_MUTE (0x1 << 7) 310*cf885929SSimon Glass #define RT5677_R_MUTE_SFT 7 311*cf885929SSimon Glass #define RT5677_VOL_R_MUTE (0x1 << 6) 312*cf885929SSimon Glass #define RT5677_VOL_R_SFT 6 313*cf885929SSimon Glass #define RT5677_L_VOL_MASK (0x3f << 8) 314*cf885929SSimon Glass #define RT5677_L_VOL_SFT 8 315*cf885929SSimon Glass #define RT5677_R_VOL_MASK (0x3f) 316*cf885929SSimon Glass #define RT5677_R_VOL_SFT 0 317*cf885929SSimon Glass 318*cf885929SSimon Glass /* LOUT1 Control (0x01) */ 319*cf885929SSimon Glass #define RT5677_LOUT1_L_MUTE (0x1 << 15) 320*cf885929SSimon Glass #define RT5677_LOUT1_L_MUTE_SFT (15) 321*cf885929SSimon Glass #define RT5677_LOUT1_L_DF (0x1 << 14) 322*cf885929SSimon Glass #define RT5677_LOUT1_L_DF_SFT (14) 323*cf885929SSimon Glass #define RT5677_LOUT2_L_MUTE (0x1 << 13) 324*cf885929SSimon Glass #define RT5677_LOUT2_L_MUTE_SFT (13) 325*cf885929SSimon Glass #define RT5677_LOUT2_L_DF (0x1 << 12) 326*cf885929SSimon Glass #define RT5677_LOUT2_L_DF_SFT (12) 327*cf885929SSimon Glass #define RT5677_LOUT3_L_MUTE (0x1 << 11) 328*cf885929SSimon Glass #define RT5677_LOUT3_L_MUTE_SFT (11) 329*cf885929SSimon Glass #define RT5677_LOUT3_L_DF (0x1 << 10) 330*cf885929SSimon Glass #define RT5677_LOUT3_L_DF_SFT (10) 331*cf885929SSimon Glass #define RT5677_LOUT1_ENH_DRV (0x1 << 9) 332*cf885929SSimon Glass #define RT5677_LOUT1_ENH_DRV_SFT (9) 333*cf885929SSimon Glass #define RT5677_LOUT2_ENH_DRV (0x1 << 8) 334*cf885929SSimon Glass #define RT5677_LOUT2_ENH_DRV_SFT (8) 335*cf885929SSimon Glass #define RT5677_LOUT3_ENH_DRV (0x1 << 7) 336*cf885929SSimon Glass #define RT5677_LOUT3_ENH_DRV_SFT (7) 337*cf885929SSimon Glass 338*cf885929SSimon Glass /* IN1 Control (0x03) */ 339*cf885929SSimon Glass #define RT5677_BST_MASK1 (0xf << 12) 340*cf885929SSimon Glass #define RT5677_BST_SFT1 12 341*cf885929SSimon Glass #define RT5677_BST_MASK2 (0xf << 8) 342*cf885929SSimon Glass #define RT5677_BST_SFT2 8 343*cf885929SSimon Glass #define RT5677_IN_DF1 (0x1 << 7) 344*cf885929SSimon Glass #define RT5677_IN_DF1_SFT 7 345*cf885929SSimon Glass #define RT5677_IN_DF2 (0x1 << 6) 346*cf885929SSimon Glass #define RT5677_IN_DF2_SFT 6 347*cf885929SSimon Glass 348*cf885929SSimon Glass /* Micbias Control (0x04) */ 349*cf885929SSimon Glass #define RT5677_MICBIAS1_OUTVOLT_MASK (0x1 << 15) 350*cf885929SSimon Glass #define RT5677_MICBIAS1_OUTVOLT_SFT (15) 351*cf885929SSimon Glass #define RT5677_MICBIAS1_OUTVOLT_2_7V (0x0 << 15) 352*cf885929SSimon Glass #define RT5677_MICBIAS1_OUTVOLT_2_25V (0x1 << 15) 353*cf885929SSimon Glass #define RT5677_MICBIAS1_CTRL_VDD_MASK (0x1 << 14) 354*cf885929SSimon Glass #define RT5677_MICBIAS1_CTRL_VDD_SFT (14) 355*cf885929SSimon Glass #define RT5677_MICBIAS1_CTRL_VDD_1_8V (0x0 << 14) 356*cf885929SSimon Glass #define RT5677_MICBIAS1_CTRL_VDD_3_3V (0x1 << 14) 357*cf885929SSimon Glass #define RT5677_MICBIAS1_OVCD_MASK (0x1 << 11) 358*cf885929SSimon Glass #define RT5677_MICBIAS1_OVCD_SHIFT (11) 359*cf885929SSimon Glass #define RT5677_MICBIAS1_OVCD_DIS (0x0 << 11) 360*cf885929SSimon Glass #define RT5677_MICBIAS1_OVCD_EN (0x1 << 11) 361*cf885929SSimon Glass #define RT5677_MICBIAS1_OVTH_MASK (0x3 << 9) 362*cf885929SSimon Glass #define RT5677_MICBIAS1_OVTH_SFT 9 363*cf885929SSimon Glass #define RT5677_MICBIAS1_OVTH_640UA (0x0 << 9) 364*cf885929SSimon Glass #define RT5677_MICBIAS1_OVTH_1280UA (0x1 << 9) 365*cf885929SSimon Glass #define RT5677_MICBIAS1_OVTH_1920UA (0x2 << 9) 366*cf885929SSimon Glass 367*cf885929SSimon Glass /* SLIMbus Parameter (0x07) */ 368*cf885929SSimon Glass 369*cf885929SSimon Glass /* SLIMbus Rx (0x08) */ 370*cf885929SSimon Glass #define RT5677_SLB_ADC4_MASK (0x3 << 6) 371*cf885929SSimon Glass #define RT5677_SLB_ADC4_SFT 6 372*cf885929SSimon Glass #define RT5677_SLB_ADC3_MASK (0x3 << 4) 373*cf885929SSimon Glass #define RT5677_SLB_ADC3_SFT 4 374*cf885929SSimon Glass #define RT5677_SLB_ADC2_MASK (0x3 << 2) 375*cf885929SSimon Glass #define RT5677_SLB_ADC2_SFT 2 376*cf885929SSimon Glass #define RT5677_SLB_ADC1_MASK (0x3 << 0) 377*cf885929SSimon Glass #define RT5677_SLB_ADC1_SFT 0 378*cf885929SSimon Glass 379*cf885929SSimon Glass /* SLIMBus control (0x09) */ 380*cf885929SSimon Glass 381*cf885929SSimon Glass /* Sidetone Control (0x13) */ 382*cf885929SSimon Glass #define RT5677_ST_HPF_SEL_MASK (0x7 << 13) 383*cf885929SSimon Glass #define RT5677_ST_HPF_SEL_SFT 13 384*cf885929SSimon Glass #define RT5677_ST_HPF_PATH (0x1 << 12) 385*cf885929SSimon Glass #define RT5677_ST_HPF_PATH_SFT 12 386*cf885929SSimon Glass #define RT5677_ST_SEL_MASK (0x7 << 9) 387*cf885929SSimon Glass #define RT5677_ST_SEL_SFT 9 388*cf885929SSimon Glass #define RT5677_ST_EN (0x1 << 6) 389*cf885929SSimon Glass #define RT5677_ST_EN_SFT 6 390*cf885929SSimon Glass 391*cf885929SSimon Glass /* Analog DAC1/2/3 Source Control (0x15) */ 392*cf885929SSimon Glass #define RT5677_ANA_DAC3_SRC_SEL_MASK (0x3 << 4) 393*cf885929SSimon Glass #define RT5677_ANA_DAC3_SRC_SEL_SFT 4 394*cf885929SSimon Glass #define RT5677_ANA_DAC1_2_SRC_SEL_MASK (0x3 << 0) 395*cf885929SSimon Glass #define RT5677_ANA_DAC1_2_SRC_SEL_SFT 0 396*cf885929SSimon Glass 397*cf885929SSimon Glass /* IF/DSP to DAC3/4 Mixer Control (0x16) */ 398*cf885929SSimon Glass #define RT5677_M_DAC4_L_VOL (0x1 << 15) 399*cf885929SSimon Glass #define RT5677_M_DAC4_L_VOL_SFT 15 400*cf885929SSimon Glass #define RT5677_SEL_DAC4_L_SRC_MASK (0x7 << 12) 401*cf885929SSimon Glass #define RT5677_SEL_DAC4_L_SRC_SFT 12 402*cf885929SSimon Glass #define RT5677_M_DAC4_R_VOL (0x1 << 11) 403*cf885929SSimon Glass #define RT5677_M_DAC4_R_VOL_SFT 11 404*cf885929SSimon Glass #define RT5677_SEL_DAC4_R_SRC_MASK (0x7 << 8) 405*cf885929SSimon Glass #define RT5677_SEL_DAC4_R_SRC_SFT 8 406*cf885929SSimon Glass #define RT5677_M_DAC3_L_VOL (0x1 << 7) 407*cf885929SSimon Glass #define RT5677_M_DAC3_L_VOL_SFT 7 408*cf885929SSimon Glass #define RT5677_SEL_DAC3_L_SRC_MASK (0x7 << 4) 409*cf885929SSimon Glass #define RT5677_SEL_DAC3_L_SRC_SFT 4 410*cf885929SSimon Glass #define RT5677_M_DAC3_R_VOL (0x1 << 3) 411*cf885929SSimon Glass #define RT5677_M_DAC3_R_VOL_SFT 3 412*cf885929SSimon Glass #define RT5677_SEL_DAC3_R_SRC_MASK (0x7 << 0) 413*cf885929SSimon Glass #define RT5677_SEL_DAC3_R_SRC_SFT 0 414*cf885929SSimon Glass 415*cf885929SSimon Glass /* DAC4 Digital Volume (0x17) */ 416*cf885929SSimon Glass #define RT5677_DAC4_L_VOL_MASK (0xff << 8) 417*cf885929SSimon Glass #define RT5677_DAC4_L_VOL_SFT 8 418*cf885929SSimon Glass #define RT5677_DAC4_R_VOL_MASK (0xff) 419*cf885929SSimon Glass #define RT5677_DAC4_R_VOL_SFT 0 420*cf885929SSimon Glass 421*cf885929SSimon Glass /* DAC3 Digital Volume (0x18) */ 422*cf885929SSimon Glass #define RT5677_DAC3_L_VOL_MASK (0xff << 8) 423*cf885929SSimon Glass #define RT5677_DAC3_L_VOL_SFT 8 424*cf885929SSimon Glass #define RT5677_DAC3_R_VOL_MASK (0xff) 425*cf885929SSimon Glass #define RT5677_DAC3_R_VOL_SFT 0 426*cf885929SSimon Glass 427*cf885929SSimon Glass /* DAC3 Digital Volume (0x19) */ 428*cf885929SSimon Glass #define RT5677_DAC1_L_VOL_MASK (0xff << 8) 429*cf885929SSimon Glass #define RT5677_DAC1_L_VOL_SFT 8 430*cf885929SSimon Glass #define RT5677_DAC1_R_VOL_MASK (0xff) 431*cf885929SSimon Glass #define RT5677_DAC1_R_VOL_SFT 0 432*cf885929SSimon Glass 433*cf885929SSimon Glass /* DAC2 Digital Volume (0x1a) */ 434*cf885929SSimon Glass #define RT5677_DAC2_L_VOL_MASK (0xff << 8) 435*cf885929SSimon Glass #define RT5677_DAC2_L_VOL_SFT 8 436*cf885929SSimon Glass #define RT5677_DAC2_R_VOL_MASK (0xff) 437*cf885929SSimon Glass #define RT5677_DAC2_R_VOL_SFT 0 438*cf885929SSimon Glass 439*cf885929SSimon Glass /* IF/DSP to DAC2 Mixer Control (0x1b) */ 440*cf885929SSimon Glass #define RT5677_M_DAC2_L_VOL (0x1 << 7) 441*cf885929SSimon Glass #define RT5677_M_DAC2_L_VOL_SFT 7 442*cf885929SSimon Glass #define RT5677_SEL_DAC2_L_SRC_MASK (0x7 << 4) 443*cf885929SSimon Glass #define RT5677_SEL_DAC2_L_SRC_SFT 4 444*cf885929SSimon Glass #define RT5677_M_DAC2_R_VOL (0x1 << 3) 445*cf885929SSimon Glass #define RT5677_M_DAC2_R_VOL_SFT 3 446*cf885929SSimon Glass #define RT5677_SEL_DAC2_R_SRC_MASK (0x7 << 0) 447*cf885929SSimon Glass #define RT5677_SEL_DAC2_R_SRC_SFT 0 448*cf885929SSimon Glass 449*cf885929SSimon Glass /* Stereo1 ADC Digital Volume Control (0x1c) */ 450*cf885929SSimon Glass #define RT5677_STO1_ADC_L_VOL_MASK (0x7f << 8) 451*cf885929SSimon Glass #define RT5677_STO1_ADC_L_VOL_SFT 8 452*cf885929SSimon Glass #define RT5677_STO1_ADC_R_VOL_MASK (0x7f) 453*cf885929SSimon Glass #define RT5677_STO1_ADC_R_VOL_SFT 0 454*cf885929SSimon Glass 455*cf885929SSimon Glass /* Mono ADC Digital Volume Control (0x1d) */ 456*cf885929SSimon Glass #define RT5677_MONO_ADC_L_VOL_MASK (0x7f << 8) 457*cf885929SSimon Glass #define RT5677_MONO_ADC_L_VOL_SFT 8 458*cf885929SSimon Glass #define RT5677_MONO_ADC_R_VOL_MASK (0x7f) 459*cf885929SSimon Glass #define RT5677_MONO_ADC_R_VOL_SFT 0 460*cf885929SSimon Glass 461*cf885929SSimon Glass /* Stereo 1/2 ADC Boost Gain Control (0x1e) */ 462*cf885929SSimon Glass #define RT5677_STO1_ADC_L_BST_MASK (0x3 << 14) 463*cf885929SSimon Glass #define RT5677_STO1_ADC_L_BST_SFT 14 464*cf885929SSimon Glass #define RT5677_STO1_ADC_R_BST_MASK (0x3 << 12) 465*cf885929SSimon Glass #define RT5677_STO1_ADC_R_BST_SFT 12 466*cf885929SSimon Glass #define RT5677_STO1_ADC_COMP_MASK (0x3 << 10) 467*cf885929SSimon Glass #define RT5677_STO1_ADC_COMP_SFT 10 468*cf885929SSimon Glass #define RT5677_STO2_ADC_L_BST_MASK (0x3 << 8) 469*cf885929SSimon Glass #define RT5677_STO2_ADC_L_BST_SFT 8 470*cf885929SSimon Glass #define RT5677_STO2_ADC_R_BST_MASK (0x3 << 6) 471*cf885929SSimon Glass #define RT5677_STO2_ADC_R_BST_SFT 6 472*cf885929SSimon Glass #define RT5677_STO2_ADC_COMP_MASK (0x3 << 4) 473*cf885929SSimon Glass #define RT5677_STO2_ADC_COMP_SFT 4 474*cf885929SSimon Glass 475*cf885929SSimon Glass /* Stereo2 ADC Digital Volume Control (0x1f) */ 476*cf885929SSimon Glass #define RT5677_STO2_ADC_L_VOL_MASK (0x7f << 8) 477*cf885929SSimon Glass #define RT5677_STO2_ADC_L_VOL_SFT 8 478*cf885929SSimon Glass #define RT5677_STO2_ADC_R_VOL_MASK (0x7f) 479*cf885929SSimon Glass #define RT5677_STO2_ADC_R_VOL_SFT 0 480*cf885929SSimon Glass 481*cf885929SSimon Glass /* ADC Boost Gain Control 2 (0x20) */ 482*cf885929SSimon Glass #define RT5677_MONO_ADC_L_BST_MASK (0x3 << 14) 483*cf885929SSimon Glass #define RT5677_MONO_ADC_L_BST_SFT 14 484*cf885929SSimon Glass #define RT5677_MONO_ADC_R_BST_MASK (0x3 << 12) 485*cf885929SSimon Glass #define RT5677_MONO_ADC_R_BST_SFT 12 486*cf885929SSimon Glass #define RT5677_MONO_ADC_COMP_MASK (0x3 << 10) 487*cf885929SSimon Glass #define RT5677_MONO_ADC_COMP_SFT 10 488*cf885929SSimon Glass 489*cf885929SSimon Glass /* Stereo 3/4 ADC Boost Gain Control (0x21) */ 490*cf885929SSimon Glass #define RT5677_STO3_ADC_L_BST_MASK (0x3 << 14) 491*cf885929SSimon Glass #define RT5677_STO3_ADC_L_BST_SFT 14 492*cf885929SSimon Glass #define RT5677_STO3_ADC_R_BST_MASK (0x3 << 12) 493*cf885929SSimon Glass #define RT5677_STO3_ADC_R_BST_SFT 12 494*cf885929SSimon Glass #define RT5677_STO3_ADC_COMP_MASK (0x3 << 10) 495*cf885929SSimon Glass #define RT5677_STO3_ADC_COMP_SFT 10 496*cf885929SSimon Glass #define RT5677_STO4_ADC_L_BST_MASK (0x3 << 8) 497*cf885929SSimon Glass #define RT5677_STO4_ADC_L_BST_SFT 8 498*cf885929SSimon Glass #define RT5677_STO4_ADC_R_BST_MASK (0x3 << 6) 499*cf885929SSimon Glass #define RT5677_STO4_ADC_R_BST_SFT 6 500*cf885929SSimon Glass #define RT5677_STO4_ADC_COMP_MASK (0x3 << 4) 501*cf885929SSimon Glass #define RT5677_STO4_ADC_COMP_SFT 4 502*cf885929SSimon Glass 503*cf885929SSimon Glass /* Stereo3 ADC Digital Volume Control (0x22) */ 504*cf885929SSimon Glass #define RT5677_STO3_ADC_L_VOL_MASK (0x7f << 8) 505*cf885929SSimon Glass #define RT5677_STO3_ADC_L_VOL_SFT 8 506*cf885929SSimon Glass #define RT5677_STO3_ADC_R_VOL_MASK (0x7f) 507*cf885929SSimon Glass #define RT5677_STO3_ADC_R_VOL_SFT 0 508*cf885929SSimon Glass 509*cf885929SSimon Glass /* Stereo4 ADC Digital Volume Control (0x23) */ 510*cf885929SSimon Glass #define RT5677_STO4_ADC_L_VOL_MASK (0x7f << 8) 511*cf885929SSimon Glass #define RT5677_STO4_ADC_L_VOL_SFT 8 512*cf885929SSimon Glass #define RT5677_STO4_ADC_R_VOL_MASK (0x7f) 513*cf885929SSimon Glass #define RT5677_STO4_ADC_R_VOL_SFT 0 514*cf885929SSimon Glass 515*cf885929SSimon Glass /* Stereo4 ADC Mixer control (0x24) */ 516*cf885929SSimon Glass #define RT5677_M_STO4_ADC_L2 (0x1 << 15) 517*cf885929SSimon Glass #define RT5677_M_STO4_ADC_L2_SFT 15 518*cf885929SSimon Glass #define RT5677_M_STO4_ADC_L1 (0x1 << 14) 519*cf885929SSimon Glass #define RT5677_M_STO4_ADC_L1_SFT 14 520*cf885929SSimon Glass #define RT5677_SEL_STO4_ADC1_MASK (0x3 << 12) 521*cf885929SSimon Glass #define RT5677_SEL_STO4_ADC1_SFT 12 522*cf885929SSimon Glass #define RT5677_SEL_STO4_ADC2_MASK (0x3 << 10) 523*cf885929SSimon Glass #define RT5677_SEL_STO4_ADC2_SFT 10 524*cf885929SSimon Glass #define RT5677_SEL_STO4_DMIC_MASK (0x3 << 8) 525*cf885929SSimon Glass #define RT5677_SEL_STO4_DMIC_SFT 8 526*cf885929SSimon Glass #define RT5677_M_STO4_ADC_R1 (0x1 << 7) 527*cf885929SSimon Glass #define RT5677_M_STO4_ADC_R1_SFT 7 528*cf885929SSimon Glass #define RT5677_M_STO4_ADC_R2 (0x1 << 6) 529*cf885929SSimon Glass #define RT5677_M_STO4_ADC_R2_SFT 6 530*cf885929SSimon Glass 531*cf885929SSimon Glass /* Stereo3 ADC Mixer control (0x25) */ 532*cf885929SSimon Glass #define RT5677_M_STO3_ADC_L2 (0x1 << 15) 533*cf885929SSimon Glass #define RT5677_M_STO3_ADC_L2_SFT 15 534*cf885929SSimon Glass #define RT5677_M_STO3_ADC_L1 (0x1 << 14) 535*cf885929SSimon Glass #define RT5677_M_STO3_ADC_L1_SFT 14 536*cf885929SSimon Glass #define RT5677_SEL_STO3_ADC1_MASK (0x3 << 12) 537*cf885929SSimon Glass #define RT5677_SEL_STO3_ADC1_SFT 12 538*cf885929SSimon Glass #define RT5677_SEL_STO3_ADC2_MASK (0x3 << 10) 539*cf885929SSimon Glass #define RT5677_SEL_STO3_ADC2_SFT 10 540*cf885929SSimon Glass #define RT5677_SEL_STO3_DMIC_MASK (0x3 << 8) 541*cf885929SSimon Glass #define RT5677_SEL_STO3_DMIC_SFT 8 542*cf885929SSimon Glass #define RT5677_M_STO3_ADC_R1 (0x1 << 7) 543*cf885929SSimon Glass #define RT5677_M_STO3_ADC_R1_SFT 7 544*cf885929SSimon Glass #define RT5677_M_STO3_ADC_R2 (0x1 << 6) 545*cf885929SSimon Glass #define RT5677_M_STO3_ADC_R2_SFT 6 546*cf885929SSimon Glass 547*cf885929SSimon Glass /* Stereo2 ADC Mixer Control (0x26) */ 548*cf885929SSimon Glass #define RT5677_M_STO2_ADC_L2 (0x1 << 15) 549*cf885929SSimon Glass #define RT5677_M_STO2_ADC_L2_SFT 15 550*cf885929SSimon Glass #define RT5677_M_STO2_ADC_L1 (0x1 << 14) 551*cf885929SSimon Glass #define RT5677_M_STO2_ADC_L1_SFT 14 552*cf885929SSimon Glass #define RT5677_SEL_STO2_ADC1_MASK (0x3 << 12) 553*cf885929SSimon Glass #define RT5677_SEL_STO2_ADC1_SFT 12 554*cf885929SSimon Glass #define RT5677_SEL_STO2_ADC2_MASK (0x3 << 10) 555*cf885929SSimon Glass #define RT5677_SEL_STO2_ADC2_SFT 10 556*cf885929SSimon Glass #define RT5677_SEL_STO2_DMIC_MASK (0x3 << 8) 557*cf885929SSimon Glass #define RT5677_SEL_STO2_DMIC_SFT 8 558*cf885929SSimon Glass #define RT5677_M_STO2_ADC_R1 (0x1 << 7) 559*cf885929SSimon Glass #define RT5677_M_STO2_ADC_R1_SFT 7 560*cf885929SSimon Glass #define RT5677_M_STO2_ADC_R2 (0x1 << 6) 561*cf885929SSimon Glass #define RT5677_M_STO2_ADC_R2_SFT 6 562*cf885929SSimon Glass #define RT5677_SEL_STO2_LR_MIX_MASK (0x1 << 0) 563*cf885929SSimon Glass #define RT5677_SEL_STO2_LR_MIX_SFT 0 564*cf885929SSimon Glass #define RT5677_SEL_STO2_LR_MIX_L (0x0 << 0) 565*cf885929SSimon Glass #define RT5677_SEL_STO2_LR_MIX_LR (0x1 << 0) 566*cf885929SSimon Glass 567*cf885929SSimon Glass /* Stereo1 ADC Mixer control (0x27) */ 568*cf885929SSimon Glass #define RT5677_M_STO1_ADC_L2 (0x1 << 15) 569*cf885929SSimon Glass #define RT5677_M_STO1_ADC_L2_SFT 15 570*cf885929SSimon Glass #define RT5677_M_STO1_ADC_L1 (0x1 << 14) 571*cf885929SSimon Glass #define RT5677_M_STO1_ADC_L1_SFT 14 572*cf885929SSimon Glass #define RT5677_SEL_STO1_ADC1_MASK (0x3 << 12) 573*cf885929SSimon Glass #define RT5677_SEL_STO1_ADC1_SFT 12 574*cf885929SSimon Glass #define RT5677_SEL_STO1_ADC2_MASK (0x3 << 10) 575*cf885929SSimon Glass #define RT5677_SEL_STO1_ADC2_SFT 10 576*cf885929SSimon Glass #define RT5677_SEL_STO1_DMIC_MASK (0x3 << 8) 577*cf885929SSimon Glass #define RT5677_SEL_STO1_DMIC_SFT 8 578*cf885929SSimon Glass #define RT5677_M_STO1_ADC_R1 (0x1 << 7) 579*cf885929SSimon Glass #define RT5677_M_STO1_ADC_R1_SFT 7 580*cf885929SSimon Glass #define RT5677_M_STO1_ADC_R2 (0x1 << 6) 581*cf885929SSimon Glass #define RT5677_M_STO1_ADC_R2_SFT 6 582*cf885929SSimon Glass 583*cf885929SSimon Glass /* Mono ADC Mixer control (0x28) */ 584*cf885929SSimon Glass #define RT5677_M_MONO_ADC_L2 (0x1 << 15) 585*cf885929SSimon Glass #define RT5677_M_MONO_ADC_L2_SFT 15 586*cf885929SSimon Glass #define RT5677_M_MONO_ADC_L1 (0x1 << 14) 587*cf885929SSimon Glass #define RT5677_M_MONO_ADC_L1_SFT 14 588*cf885929SSimon Glass #define RT5677_SEL_MONO_ADC_L1_MASK (0x3 << 12) 589*cf885929SSimon Glass #define RT5677_SEL_MONO_ADC_L1_SFT 12 590*cf885929SSimon Glass #define RT5677_SEL_MONO_ADC_L2_MASK (0x3 << 10) 591*cf885929SSimon Glass #define RT5677_SEL_MONO_ADC_L2_SFT 10 592*cf885929SSimon Glass #define RT5677_SEL_MONO_DMIC_L_MASK (0x3 << 8) 593*cf885929SSimon Glass #define RT5677_SEL_MONO_DMIC_L_SFT 8 594*cf885929SSimon Glass #define RT5677_M_MONO_ADC_R1 (0x1 << 7) 595*cf885929SSimon Glass #define RT5677_M_MONO_ADC_R1_SFT 7 596*cf885929SSimon Glass #define RT5677_M_MONO_ADC_R2 (0x1 << 6) 597*cf885929SSimon Glass #define RT5677_M_MONO_ADC_R2_SFT 6 598*cf885929SSimon Glass #define RT5677_SEL_MONO_ADC_R1_MASK (0x3 << 4) 599*cf885929SSimon Glass #define RT5677_SEL_MONO_ADC_R1_SFT 4 600*cf885929SSimon Glass #define RT5677_SEL_MONO_ADC_R2_MASK (0x3 << 2) 601*cf885929SSimon Glass #define RT5677_SEL_MONO_ADC_R2_SFT 2 602*cf885929SSimon Glass #define RT5677_SEL_MONO_DMIC_R_MASK (0x3 << 0) 603*cf885929SSimon Glass #define RT5677_SEL_MONO_DMIC_R_SFT 0 604*cf885929SSimon Glass 605*cf885929SSimon Glass /* ADC/IF/DSP to DAC1 Mixer control (0x29) */ 606*cf885929SSimon Glass #define RT5677_M_ADDA_MIXER1_L (0x1 << 15) 607*cf885929SSimon Glass #define RT5677_M_ADDA_MIXER1_L_SFT 15 608*cf885929SSimon Glass #define RT5677_M_DAC1_L (0x1 << 14) 609*cf885929SSimon Glass #define RT5677_M_DAC1_L_SFT 14 610*cf885929SSimon Glass #define RT5677_DAC1_L_SEL_MASK (0x7 << 8) 611*cf885929SSimon Glass #define RT5677_DAC1_L_SEL_SFT 8 612*cf885929SSimon Glass #define RT5677_M_ADDA_MIXER1_R (0x1 << 7) 613*cf885929SSimon Glass #define RT5677_M_ADDA_MIXER1_R_SFT 7 614*cf885929SSimon Glass #define RT5677_M_DAC1_R (0x1 << 6) 615*cf885929SSimon Glass #define RT5677_M_DAC1_R_SFT 6 616*cf885929SSimon Glass #define RT5677_ADDA1_SEL_MASK (0x3 << 0) 617*cf885929SSimon Glass #define RT5677_ADDA1_SEL_SFT 0 618*cf885929SSimon Glass 619*cf885929SSimon Glass /* Stereo1 DAC Mixer L/R Control (0x2a) */ 620*cf885929SSimon Glass #define RT5677_M_ST_DAC1_L (0x1 << 15) 621*cf885929SSimon Glass #define RT5677_M_ST_DAC1_L_SFT 15 622*cf885929SSimon Glass #define RT5677_M_DAC1_L_STO_L (0x1 << 13) 623*cf885929SSimon Glass #define RT5677_M_DAC1_L_STO_L_SFT 13 624*cf885929SSimon Glass #define RT5677_DAC1_L_STO_L_VOL_MASK (0x1 << 12) 625*cf885929SSimon Glass #define RT5677_DAC1_L_STO_L_VOL_SFT 12 626*cf885929SSimon Glass #define RT5677_M_DAC2_L_STO_L (0x1 << 11) 627*cf885929SSimon Glass #define RT5677_M_DAC2_L_STO_L_SFT 11 628*cf885929SSimon Glass #define RT5677_DAC2_L_STO_L_VOL_MASK (0x1 << 10) 629*cf885929SSimon Glass #define RT5677_DAC2_L_STO_L_VOL_SFT 10 630*cf885929SSimon Glass #define RT5677_M_DAC1_R_STO_L (0x1 << 9) 631*cf885929SSimon Glass #define RT5677_M_DAC1_R_STO_L_SFT 9 632*cf885929SSimon Glass #define RT5677_DAC1_R_STO_L_VOL_MASK (0x1 << 8) 633*cf885929SSimon Glass #define RT5677_DAC1_R_STO_L_VOL_SFT 8 634*cf885929SSimon Glass #define RT5677_M_ST_DAC1_R (0x1 << 7) 635*cf885929SSimon Glass #define RT5677_M_ST_DAC1_R_SFT 7 636*cf885929SSimon Glass #define RT5677_M_DAC1_R_STO_R (0x1 << 5) 637*cf885929SSimon Glass #define RT5677_M_DAC1_R_STO_R_SFT 5 638*cf885929SSimon Glass #define RT5677_DAC1_R_STO_R_VOL_MASK (0x1 << 4) 639*cf885929SSimon Glass #define RT5677_DAC1_R_STO_R_VOL_SFT 4 640*cf885929SSimon Glass #define RT5677_M_DAC2_R_STO_R (0x1 << 3) 641*cf885929SSimon Glass #define RT5677_M_DAC2_R_STO_R_SFT 3 642*cf885929SSimon Glass #define RT5677_DAC2_R_STO_R_VOL_MASK (0x1 << 2) 643*cf885929SSimon Glass #define RT5677_DAC2_R_STO_R_VOL_SFT 2 644*cf885929SSimon Glass #define RT5677_M_DAC1_L_STO_R (0x1 << 1) 645*cf885929SSimon Glass #define RT5677_M_DAC1_L_STO_R_SFT 1 646*cf885929SSimon Glass #define RT5677_DAC1_L_STO_R_VOL_MASK (0x1 << 0) 647*cf885929SSimon Glass #define RT5677_DAC1_L_STO_R_VOL_SFT 0 648*cf885929SSimon Glass 649*cf885929SSimon Glass /* Mono DAC Mixer L/R Control (0x2b) */ 650*cf885929SSimon Glass #define RT5677_M_ST_DAC2_L (0x1 << 15) 651*cf885929SSimon Glass #define RT5677_M_ST_DAC2_L_SFT 15 652*cf885929SSimon Glass #define RT5677_M_DAC2_L_MONO_L (0x1 << 13) 653*cf885929SSimon Glass #define RT5677_M_DAC2_L_MONO_L_SFT 13 654*cf885929SSimon Glass #define RT5677_DAC2_L_MONO_L_VOL_MASK (0x1 << 12) 655*cf885929SSimon Glass #define RT5677_DAC2_L_MONO_L_VOL_SFT 12 656*cf885929SSimon Glass #define RT5677_M_DAC2_R_MONO_L (0x1 << 11) 657*cf885929SSimon Glass #define RT5677_M_DAC2_R_MONO_L_SFT 11 658*cf885929SSimon Glass #define RT5677_DAC2_R_MONO_L_VOL_MASK (0x1 << 10) 659*cf885929SSimon Glass #define RT5677_DAC2_R_MONO_L_VOL_SFT 10 660*cf885929SSimon Glass #define RT5677_M_DAC1_L_MONO_L (0x1 << 9) 661*cf885929SSimon Glass #define RT5677_M_DAC1_L_MONO_L_SFT 9 662*cf885929SSimon Glass #define RT5677_DAC1_L_MONO_L_VOL_MASK (0x1 << 8) 663*cf885929SSimon Glass #define RT5677_DAC1_L_MONO_L_VOL_SFT 8 664*cf885929SSimon Glass #define RT5677_M_ST_DAC2_R (0x1 << 7) 665*cf885929SSimon Glass #define RT5677_M_ST_DAC2_R_SFT 7 666*cf885929SSimon Glass #define RT5677_M_DAC2_R_MONO_R (0x1 << 5) 667*cf885929SSimon Glass #define RT5677_M_DAC2_R_MONO_R_SFT 5 668*cf885929SSimon Glass #define RT5677_DAC2_R_MONO_R_VOL_MASK (0x1 << 4) 669*cf885929SSimon Glass #define RT5677_DAC2_R_MONO_R_VOL_SFT 4 670*cf885929SSimon Glass #define RT5677_M_DAC1_R_MONO_R (0x1 << 3) 671*cf885929SSimon Glass #define RT5677_M_DAC1_R_MONO_R_SFT 3 672*cf885929SSimon Glass #define RT5677_DAC1_R_MONO_R_VOL_MASK (0x1 << 2) 673*cf885929SSimon Glass #define RT5677_DAC1_R_MONO_R_VOL_SFT 2 674*cf885929SSimon Glass #define RT5677_M_DAC2_L_MONO_R (0x1 << 1) 675*cf885929SSimon Glass #define RT5677_M_DAC2_L_MONO_R_SFT 1 676*cf885929SSimon Glass #define RT5677_DAC2_L_MONO_R_VOL_MASK (0x1 << 0) 677*cf885929SSimon Glass #define RT5677_DAC2_L_MONO_R_VOL_SFT 0 678*cf885929SSimon Glass 679*cf885929SSimon Glass /* DD Mixer 1 Control (0x2c) */ 680*cf885929SSimon Glass #define RT5677_M_STO_L_DD1_L (0x1 << 15) 681*cf885929SSimon Glass #define RT5677_M_STO_L_DD1_L_SFT 15 682*cf885929SSimon Glass #define RT5677_STO_L_DD1_L_VOL_MASK (0x1 << 14) 683*cf885929SSimon Glass #define RT5677_STO_L_DD1_L_VOL_SFT 14 684*cf885929SSimon Glass #define RT5677_M_MONO_L_DD1_L (0x1 << 13) 685*cf885929SSimon Glass #define RT5677_M_MONO_L_DD1_L_SFT 13 686*cf885929SSimon Glass #define RT5677_MONO_L_DD1_L_VOL_MASK (0x1 << 12) 687*cf885929SSimon Glass #define RT5677_MONO_L_DD1_L_VOL_SFT 12 688*cf885929SSimon Glass #define RT5677_M_DAC3_L_DD1_L (0x1 << 11) 689*cf885929SSimon Glass #define RT5677_M_DAC3_L_DD1_L_SFT 11 690*cf885929SSimon Glass #define RT5677_DAC3_L_DD1_L_VOL_MASK (0x1 << 10) 691*cf885929SSimon Glass #define RT5677_DAC3_L_DD1_L_VOL_SFT 10 692*cf885929SSimon Glass #define RT5677_M_DAC3_R_DD1_L (0x1 << 9) 693*cf885929SSimon Glass #define RT5677_M_DAC3_R_DD1_L_SFT 9 694*cf885929SSimon Glass #define RT5677_DAC3_R_DD1_L_VOL_MASK (0x1 << 8) 695*cf885929SSimon Glass #define RT5677_DAC3_R_DD1_L_VOL_SFT 8 696*cf885929SSimon Glass #define RT5677_M_STO_R_DD1_R (0x1 << 7) 697*cf885929SSimon Glass #define RT5677_M_STO_R_DD1_R_SFT 7 698*cf885929SSimon Glass #define RT5677_STO_R_DD1_R_VOL_MASK (0x1 << 6) 699*cf885929SSimon Glass #define RT5677_STO_R_DD1_R_VOL_SFT 6 700*cf885929SSimon Glass #define RT5677_M_MONO_R_DD1_R (0x1 << 5) 701*cf885929SSimon Glass #define RT5677_M_MONO_R_DD1_R_SFT 5 702*cf885929SSimon Glass #define RT5677_MONO_R_DD1_R_VOL_MASK (0x1 << 4) 703*cf885929SSimon Glass #define RT5677_MONO_R_DD1_R_VOL_SFT 4 704*cf885929SSimon Glass #define RT5677_M_DAC3_R_DD1_R (0x1 << 3) 705*cf885929SSimon Glass #define RT5677_M_DAC3_R_DD1_R_SFT 3 706*cf885929SSimon Glass #define RT5677_DAC3_R_DD1_R_VOL_MASK (0x1 << 2) 707*cf885929SSimon Glass #define RT5677_DAC3_R_DD1_R_VOL_SFT 2 708*cf885929SSimon Glass #define RT5677_M_DAC3_L_DD1_R (0x1 << 1) 709*cf885929SSimon Glass #define RT5677_M_DAC3_L_DD1_R_SFT 1 710*cf885929SSimon Glass #define RT5677_DAC3_L_DD1_R_VOL_MASK (0x1 << 0) 711*cf885929SSimon Glass #define RT5677_DAC3_L_DD1_R_VOL_SFT 0 712*cf885929SSimon Glass 713*cf885929SSimon Glass /* DD Mixer 2 Control (0x2d) */ 714*cf885929SSimon Glass #define RT5677_M_STO_L_DD2_L (0x1 << 15) 715*cf885929SSimon Glass #define RT5677_M_STO_L_DD2_L_SFT 15 716*cf885929SSimon Glass #define RT5677_STO_L_DD2_L_VOL_MASK (0x1 << 14) 717*cf885929SSimon Glass #define RT5677_STO_L_DD2_L_VOL_SFT 14 718*cf885929SSimon Glass #define RT5677_M_MONO_L_DD2_L (0x1 << 13) 719*cf885929SSimon Glass #define RT5677_M_MONO_L_DD2_L_SFT 13 720*cf885929SSimon Glass #define RT5677_MONO_L_DD2_L_VOL_MASK (0x1 << 12) 721*cf885929SSimon Glass #define RT5677_MONO_L_DD2_L_VOL_SFT 12 722*cf885929SSimon Glass #define RT5677_M_DAC4_L_DD2_L (0x1 << 11) 723*cf885929SSimon Glass #define RT5677_M_DAC4_L_DD2_L_SFT 11 724*cf885929SSimon Glass #define RT5677_DAC4_L_DD2_L_VOL_MASK (0x1 << 10) 725*cf885929SSimon Glass #define RT5677_DAC4_L_DD2_L_VOL_SFT 10 726*cf885929SSimon Glass #define RT5677_M_DAC4_R_DD2_L (0x1 << 9) 727*cf885929SSimon Glass #define RT5677_M_DAC4_R_DD2_L_SFT 9 728*cf885929SSimon Glass #define RT5677_DAC4_R_DD2_L_VOL_MASK (0x1 << 8) 729*cf885929SSimon Glass #define RT5677_DAC4_R_DD2_L_VOL_SFT 8 730*cf885929SSimon Glass #define RT5677_M_STO_R_DD2_R (0x1 << 7) 731*cf885929SSimon Glass #define RT5677_M_STO_R_DD2_R_SFT 7 732*cf885929SSimon Glass #define RT5677_STO_R_DD2_R_VOL_MASK (0x1 << 6) 733*cf885929SSimon Glass #define RT5677_STO_R_DD2_R_VOL_SFT 6 734*cf885929SSimon Glass #define RT5677_M_MONO_R_DD2_R (0x1 << 5) 735*cf885929SSimon Glass #define RT5677_M_MONO_R_DD2_R_SFT 5 736*cf885929SSimon Glass #define RT5677_MONO_R_DD2_R_VOL_MASK (0x1 << 4) 737*cf885929SSimon Glass #define RT5677_MONO_R_DD2_R_VOL_SFT 4 738*cf885929SSimon Glass #define RT5677_M_DAC4_R_DD2_R (0x1 << 3) 739*cf885929SSimon Glass #define RT5677_M_DAC4_R_DD2_R_SFT 3 740*cf885929SSimon Glass #define RT5677_DAC4_R_DD2_R_VOL_MASK (0x1 << 2) 741*cf885929SSimon Glass #define RT5677_DAC4_R_DD2_R_VOL_SFT 2 742*cf885929SSimon Glass #define RT5677_M_DAC4_L_DD2_R (0x1 << 1) 743*cf885929SSimon Glass #define RT5677_M_DAC4_L_DD2_R_SFT 1 744*cf885929SSimon Glass #define RT5677_DAC4_L_DD2_R_VOL_MASK (0x1 << 0) 745*cf885929SSimon Glass #define RT5677_DAC4_L_DD2_R_VOL_SFT 0 746*cf885929SSimon Glass 747*cf885929SSimon Glass /* IF3 data control (0x2f) */ 748*cf885929SSimon Glass #define RT5677_IF3_DAC_SEL_MASK (0x3 << 6) 749*cf885929SSimon Glass #define RT5677_IF3_DAC_SEL_SFT 6 750*cf885929SSimon Glass #define RT5677_IF3_ADC_SEL_MASK (0x3 << 4) 751*cf885929SSimon Glass #define RT5677_IF3_ADC_SEL_SFT 4 752*cf885929SSimon Glass #define RT5677_IF3_ADC_IN_MASK (0xf << 0) 753*cf885929SSimon Glass #define RT5677_IF3_ADC_IN_SFT 0 754*cf885929SSimon Glass 755*cf885929SSimon Glass /* IF4 data control (0x30) */ 756*cf885929SSimon Glass #define RT5677_IF4_ADC_IN_MASK (0xf << 4) 757*cf885929SSimon Glass #define RT5677_IF4_ADC_IN_SFT 4 758*cf885929SSimon Glass #define RT5677_IF4_DAC_SEL_MASK (0x3 << 2) 759*cf885929SSimon Glass #define RT5677_IF4_DAC_SEL_SFT 2 760*cf885929SSimon Glass #define RT5677_IF4_ADC_SEL_MASK (0x3 << 0) 761*cf885929SSimon Glass #define RT5677_IF4_ADC_SEL_SFT 0 762*cf885929SSimon Glass 763*cf885929SSimon Glass /* PDM Output Control (0x31) */ 764*cf885929SSimon Glass #define RT5677_M_PDM1_L (0x1 << 15) 765*cf885929SSimon Glass #define RT5677_M_PDM1_L_SFT 15 766*cf885929SSimon Glass #define RT5677_SEL_PDM1_L_MASK (0x3 << 12) 767*cf885929SSimon Glass #define RT5677_SEL_PDM1_L_SFT 12 768*cf885929SSimon Glass #define RT5677_M_PDM1_R (0x1 << 11) 769*cf885929SSimon Glass #define RT5677_M_PDM1_R_SFT 11 770*cf885929SSimon Glass #define RT5677_SEL_PDM1_R_MASK (0x3 << 8) 771*cf885929SSimon Glass #define RT5677_SEL_PDM1_R_SFT 8 772*cf885929SSimon Glass #define RT5677_M_PDM2_L (0x1 << 7) 773*cf885929SSimon Glass #define RT5677_M_PDM2_L_SFT 7 774*cf885929SSimon Glass #define RT5677_SEL_PDM2_L_MASK (0x3 << 4) 775*cf885929SSimon Glass #define RT5677_SEL_PDM2_L_SFT 4 776*cf885929SSimon Glass #define RT5677_M_PDM2_R (0x1 << 3) 777*cf885929SSimon Glass #define RT5677_M_PDM2_R_SFT 3 778*cf885929SSimon Glass #define RT5677_SEL_PDM2_R_MASK (0x3 << 0) 779*cf885929SSimon Glass #define RT5677_SEL_PDM2_R_SFT 0 780*cf885929SSimon Glass 781*cf885929SSimon Glass /* PDM I2C / Data Control 1 (0x32) */ 782*cf885929SSimon Glass #define RT5677_PDM2_PW_DOWN (0x1 << 7) 783*cf885929SSimon Glass #define RT5677_PDM1_PW_DOWN (0x1 << 6) 784*cf885929SSimon Glass #define RT5677_PDM2_BUSY (0x1 << 5) 785*cf885929SSimon Glass #define RT5677_PDM1_BUSY (0x1 << 4) 786*cf885929SSimon Glass #define RT5677_PDM_PATTERN (0x1 << 3) 787*cf885929SSimon Glass #define RT5677_PDM_GAIN (0x1 << 2) 788*cf885929SSimon Glass #define RT5677_PDM_DIV_MASK (0x3 << 0) 789*cf885929SSimon Glass 790*cf885929SSimon Glass /* PDM I2C / Data Control 2 (0x33) */ 791*cf885929SSimon Glass #define RT5677_PDM1_I2C_ID (0xf << 12) 792*cf885929SSimon Glass #define RT5677_PDM1_EXE (0x1 << 11) 793*cf885929SSimon Glass #define RT5677_PDM1_I2C_CMD (0x1 << 10) 794*cf885929SSimon Glass #define RT5677_PDM1_I2C_EXE (0x1 << 9) 795*cf885929SSimon Glass #define RT5677_PDM1_I2C_BUSY (0x1 << 8) 796*cf885929SSimon Glass #define RT5677_PDM2_I2C_ID (0xf << 4) 797*cf885929SSimon Glass #define RT5677_PDM2_EXE (0x1 << 3) 798*cf885929SSimon Glass #define RT5677_PDM2_I2C_CMD (0x1 << 2) 799*cf885929SSimon Glass #define RT5677_PDM2_I2C_EXE (0x1 << 1) 800*cf885929SSimon Glass #define RT5677_PDM2_I2C_BUSY (0x1 << 0) 801*cf885929SSimon Glass 802*cf885929SSimon Glass /* MX3C TDM1 control 1 (0x3c) */ 803*cf885929SSimon Glass #define RT5677_IF1_ADC4_MASK (0x3 << 10) 804*cf885929SSimon Glass #define RT5677_IF1_ADC4_SFT 10 805*cf885929SSimon Glass #define RT5677_IF1_ADC3_MASK (0x3 << 8) 806*cf885929SSimon Glass #define RT5677_IF1_ADC3_SFT 8 807*cf885929SSimon Glass #define RT5677_IF1_ADC2_MASK (0x3 << 6) 808*cf885929SSimon Glass #define RT5677_IF1_ADC2_SFT 6 809*cf885929SSimon Glass #define RT5677_IF1_ADC1_MASK (0x3 << 4) 810*cf885929SSimon Glass #define RT5677_IF1_ADC1_SFT 4 811*cf885929SSimon Glass 812*cf885929SSimon Glass /* MX41 TDM2 control 1 (0x41) */ 813*cf885929SSimon Glass #define RT5677_IF2_ADC4_MASK (0x3 << 10) 814*cf885929SSimon Glass #define RT5677_IF2_ADC4_SFT 10 815*cf885929SSimon Glass #define RT5677_IF2_ADC3_MASK (0x3 << 8) 816*cf885929SSimon Glass #define RT5677_IF2_ADC3_SFT 8 817*cf885929SSimon Glass #define RT5677_IF2_ADC2_MASK (0x3 << 6) 818*cf885929SSimon Glass #define RT5677_IF2_ADC2_SFT 6 819*cf885929SSimon Glass #define RT5677_IF2_ADC1_MASK (0x3 << 4) 820*cf885929SSimon Glass #define RT5677_IF2_ADC1_SFT 4 821*cf885929SSimon Glass 822*cf885929SSimon Glass /* Digital Microphone Control 1 (0x50) */ 823*cf885929SSimon Glass #define RT5677_DMIC_1_EN_MASK (0x1 << 15) 824*cf885929SSimon Glass #define RT5677_DMIC_1_EN_SFT 15 825*cf885929SSimon Glass #define RT5677_DMIC_1_DIS (0x0 << 15) 826*cf885929SSimon Glass #define RT5677_DMIC_1_EN (0x1 << 15) 827*cf885929SSimon Glass #define RT5677_DMIC_2_EN_MASK (0x1 << 14) 828*cf885929SSimon Glass #define RT5677_DMIC_2_EN_SFT 14 829*cf885929SSimon Glass #define RT5677_DMIC_2_DIS (0x0 << 14) 830*cf885929SSimon Glass #define RT5677_DMIC_2_EN (0x1 << 14) 831*cf885929SSimon Glass #define RT5677_DMIC_L_STO1_LH_MASK (0x1 << 13) 832*cf885929SSimon Glass #define RT5677_DMIC_L_STO1_LH_SFT 13 833*cf885929SSimon Glass #define RT5677_DMIC_L_STO1_LH_FALLING (0x0 << 13) 834*cf885929SSimon Glass #define RT5677_DMIC_L_STO1_LH_RISING (0x1 << 13) 835*cf885929SSimon Glass #define RT5677_DMIC_R_STO1_LH_MASK (0x1 << 12) 836*cf885929SSimon Glass #define RT5677_DMIC_R_STO1_LH_SFT 12 837*cf885929SSimon Glass #define RT5677_DMIC_R_STO1_LH_FALLING (0x0 << 12) 838*cf885929SSimon Glass #define RT5677_DMIC_R_STO1_LH_RISING (0x1 << 12) 839*cf885929SSimon Glass #define RT5677_DMIC_L_STO3_LH_MASK (0x1 << 11) 840*cf885929SSimon Glass #define RT5677_DMIC_L_STO3_LH_SFT 11 841*cf885929SSimon Glass #define RT5677_DMIC_L_STO3_LH_FALLING (0x0 << 11) 842*cf885929SSimon Glass #define RT5677_DMIC_L_STO3_LH_RISING (0x1 << 11) 843*cf885929SSimon Glass #define RT5677_DMIC_R_STO3_LH_MASK (0x1 << 10) 844*cf885929SSimon Glass #define RT5677_DMIC_R_STO3_LH_SFT 10 845*cf885929SSimon Glass #define RT5677_DMIC_R_STO3_LH_FALLING (0x0 << 10) 846*cf885929SSimon Glass #define RT5677_DMIC_R_STO3_LH_RISING (0x1 << 10) 847*cf885929SSimon Glass #define RT5677_DMIC_L_STO2_LH_MASK (0x1 << 9) 848*cf885929SSimon Glass #define RT5677_DMIC_L_STO2_LH_SFT 9 849*cf885929SSimon Glass #define RT5677_DMIC_L_STO2_LH_FALLING (0x0 << 9) 850*cf885929SSimon Glass #define RT5677_DMIC_L_STO2_LH_RISING (0x1 << 9) 851*cf885929SSimon Glass #define RT5677_DMIC_R_STO2_LH_MASK (0x1 << 8) 852*cf885929SSimon Glass #define RT5677_DMIC_R_STO2_LH_SFT 8 853*cf885929SSimon Glass #define RT5677_DMIC_R_STO2_LH_FALLING (0x0 << 8) 854*cf885929SSimon Glass #define RT5677_DMIC_R_STO2_LH_RISING (0x1 << 8) 855*cf885929SSimon Glass #define RT5677_DMIC_CLK_MASK (0x7 << 5) 856*cf885929SSimon Glass #define RT5677_DMIC_CLK_SFT 5 857*cf885929SSimon Glass #define RT5677_DMIC_3_EN_MASK (0x1 << 4) 858*cf885929SSimon Glass #define RT5677_DMIC_3_EN_SFT 4 859*cf885929SSimon Glass #define RT5677_DMIC_3_DIS (0x0 << 4) 860*cf885929SSimon Glass #define RT5677_DMIC_3_EN (0x1 << 4) 861*cf885929SSimon Glass #define RT5677_DMIC_R_MONO_LH_MASK (0x1 << 2) 862*cf885929SSimon Glass #define RT5677_DMIC_R_MONO_LH_SFT 2 863*cf885929SSimon Glass #define RT5677_DMIC_R_MONO_LH_FALLING (0x0 << 2) 864*cf885929SSimon Glass #define RT5677_DMIC_R_MONO_LH_RISING (0x1 << 2) 865*cf885929SSimon Glass #define RT5677_DMIC_L_STO4_LH_MASK (0x1 << 1) 866*cf885929SSimon Glass #define RT5677_DMIC_L_STO4_LH_SFT 1 867*cf885929SSimon Glass #define RT5677_DMIC_L_STO4_LH_FALLING (0x0 << 1) 868*cf885929SSimon Glass #define RT5677_DMIC_L_STO4_LH_RISING (0x1 << 1) 869*cf885929SSimon Glass #define RT5677_DMIC_R_STO4_LH_MASK (0x1 << 0) 870*cf885929SSimon Glass #define RT5677_DMIC_R_STO4_LH_SFT 0 871*cf885929SSimon Glass #define RT5677_DMIC_R_STO4_LH_FALLING (0x0 << 0) 872*cf885929SSimon Glass #define RT5677_DMIC_R_STO4_LH_RISING (0x1 << 0) 873*cf885929SSimon Glass 874*cf885929SSimon Glass /* Digital Microphone Control 2 (0x51) */ 875*cf885929SSimon Glass #define RT5677_DMIC_4_EN_MASK (0x1 << 15) 876*cf885929SSimon Glass #define RT5677_DMIC_4_EN_SFT 15 877*cf885929SSimon Glass #define RT5677_DMIC_4_DIS (0x0 << 15) 878*cf885929SSimon Glass #define RT5677_DMIC_4_EN (0x1 << 15) 879*cf885929SSimon Glass #define RT5677_DMIC_4L_LH_MASK (0x1 << 7) 880*cf885929SSimon Glass #define RT5677_DMIC_4L_LH_SFT 7 881*cf885929SSimon Glass #define RT5677_DMIC_4L_LH_FALLING (0x0 << 7) 882*cf885929SSimon Glass #define RT5677_DMIC_4L_LH_RISING (0x1 << 7) 883*cf885929SSimon Glass #define RT5677_DMIC_4R_LH_MASK (0x1 << 6) 884*cf885929SSimon Glass #define RT5677_DMIC_4R_LH_SFT 6 885*cf885929SSimon Glass #define RT5677_DMIC_4R_LH_FALLING (0x0 << 6) 886*cf885929SSimon Glass #define RT5677_DMIC_4R_LH_RISING (0x1 << 6) 887*cf885929SSimon Glass #define RT5677_DMIC_3L_LH_MASK (0x1 << 5) 888*cf885929SSimon Glass #define RT5677_DMIC_3L_LH_SFT 5 889*cf885929SSimon Glass #define RT5677_DMIC_3L_LH_FALLING (0x0 << 5) 890*cf885929SSimon Glass #define RT5677_DMIC_3L_LH_RISING (0x1 << 5) 891*cf885929SSimon Glass #define RT5677_DMIC_3R_LH_MASK (0x1 << 4) 892*cf885929SSimon Glass #define RT5677_DMIC_3R_LH_SFT 4 893*cf885929SSimon Glass #define RT5677_DMIC_3R_LH_FALLING (0x0 << 4) 894*cf885929SSimon Glass #define RT5677_DMIC_3R_LH_RISING (0x1 << 4) 895*cf885929SSimon Glass #define RT5677_DMIC_2L_LH_MASK (0x1 << 3) 896*cf885929SSimon Glass #define RT5677_DMIC_2L_LH_SFT 3 897*cf885929SSimon Glass #define RT5677_DMIC_2L_LH_FALLING (0x0 << 3) 898*cf885929SSimon Glass #define RT5677_DMIC_2L_LH_RISING (0x1 << 3) 899*cf885929SSimon Glass #define RT5677_DMIC_2R_LH_MASK (0x1 << 2) 900*cf885929SSimon Glass #define RT5677_DMIC_2R_LH_SFT 2 901*cf885929SSimon Glass #define RT5677_DMIC_2R_LH_FALLING (0x0 << 2) 902*cf885929SSimon Glass #define RT5677_DMIC_2R_LH_RISING (0x1 << 2) 903*cf885929SSimon Glass #define RT5677_DMIC_1L_LH_MASK (0x1 << 1) 904*cf885929SSimon Glass #define RT5677_DMIC_1L_LH_SFT 1 905*cf885929SSimon Glass #define RT5677_DMIC_1L_LH_FALLING (0x0 << 1) 906*cf885929SSimon Glass #define RT5677_DMIC_1L_LH_RISING (0x1 << 1) 907*cf885929SSimon Glass #define RT5677_DMIC_1R_LH_MASK (0x1 << 0) 908*cf885929SSimon Glass #define RT5677_DMIC_1R_LH_SFT 0 909*cf885929SSimon Glass #define RT5677_DMIC_1R_LH_FALLING (0x0 << 0) 910*cf885929SSimon Glass #define RT5677_DMIC_1R_LH_RISING (0x1 << 0) 911*cf885929SSimon Glass 912*cf885929SSimon Glass /* Power Management for Digital 1 (0x61) */ 913*cf885929SSimon Glass #define RT5677_PWR_I2S1 (0x1 << 15) 914*cf885929SSimon Glass #define RT5677_PWR_I2S1_BIT 15 915*cf885929SSimon Glass #define RT5677_PWR_I2S2 (0x1 << 14) 916*cf885929SSimon Glass #define RT5677_PWR_I2S2_BIT 14 917*cf885929SSimon Glass #define RT5677_PWR_I2S3 (0x1 << 13) 918*cf885929SSimon Glass #define RT5677_PWR_I2S3_BIT 13 919*cf885929SSimon Glass #define RT5677_PWR_DAC1 (0x1 << 12) 920*cf885929SSimon Glass #define RT5677_PWR_DAC1_BIT 12 921*cf885929SSimon Glass #define RT5677_PWR_DAC2 (0x1 << 11) 922*cf885929SSimon Glass #define RT5677_PWR_DAC2_BIT 11 923*cf885929SSimon Glass #define RT5677_PWR_I2S4 (0x1 << 10) 924*cf885929SSimon Glass #define RT5677_PWR_I2S4_BIT 10 925*cf885929SSimon Glass #define RT5677_PWR_SLB (0x1 << 9) 926*cf885929SSimon Glass #define RT5677_PWR_SLB_BIT 9 927*cf885929SSimon Glass #define RT5677_PWR_DAC3 (0x1 << 7) 928*cf885929SSimon Glass #define RT5677_PWR_DAC3_BIT 7 929*cf885929SSimon Glass #define RT5677_PWR_ADCFED2 (0x1 << 4) 930*cf885929SSimon Glass #define RT5677_PWR_ADCFED2_BIT 4 931*cf885929SSimon Glass #define RT5677_PWR_ADCFED1 (0x1 << 3) 932*cf885929SSimon Glass #define RT5677_PWR_ADCFED1_BIT 3 933*cf885929SSimon Glass #define RT5677_PWR_ADC_L (0x1 << 2) 934*cf885929SSimon Glass #define RT5677_PWR_ADC_L_BIT 2 935*cf885929SSimon Glass #define RT5677_PWR_ADC_R (0x1 << 1) 936*cf885929SSimon Glass #define RT5677_PWR_ADC_R_BIT 1 937*cf885929SSimon Glass #define RT5677_PWR_I2C_MASTER (0x1 << 0) 938*cf885929SSimon Glass #define RT5677_PWR_I2C_MASTER_BIT 0 939*cf885929SSimon Glass 940*cf885929SSimon Glass /* Power Management for Digital 2 (0x62) */ 941*cf885929SSimon Glass #define RT5677_PWR_ADC_S1F (0x1 << 15) 942*cf885929SSimon Glass #define RT5677_PWR_ADC_S1F_BIT 15 943*cf885929SSimon Glass #define RT5677_PWR_ADC_MF_L (0x1 << 14) 944*cf885929SSimon Glass #define RT5677_PWR_ADC_MF_L_BIT 14 945*cf885929SSimon Glass #define RT5677_PWR_ADC_MF_R (0x1 << 13) 946*cf885929SSimon Glass #define RT5677_PWR_ADC_MF_R_BIT 13 947*cf885929SSimon Glass #define RT5677_PWR_DAC_S1F (0x1 << 12) 948*cf885929SSimon Glass #define RT5677_PWR_DAC_S1F_BIT 12 949*cf885929SSimon Glass #define RT5677_PWR_DAC_M2F_L (0x1 << 11) 950*cf885929SSimon Glass #define RT5677_PWR_DAC_M2F_L_BIT 11 951*cf885929SSimon Glass #define RT5677_PWR_DAC_M2F_R (0x1 << 10) 952*cf885929SSimon Glass #define RT5677_PWR_DAC_M2F_R_BIT 10 953*cf885929SSimon Glass #define RT5677_PWR_DAC_M3F_L (0x1 << 9) 954*cf885929SSimon Glass #define RT5677_PWR_DAC_M3F_L_BIT 9 955*cf885929SSimon Glass #define RT5677_PWR_DAC_M3F_R (0x1 << 8) 956*cf885929SSimon Glass #define RT5677_PWR_DAC_M3F_R_BIT 8 957*cf885929SSimon Glass #define RT5677_PWR_DAC_M4F_L (0x1 << 7) 958*cf885929SSimon Glass #define RT5677_PWR_DAC_M4F_L_BIT 7 959*cf885929SSimon Glass #define RT5677_PWR_DAC_M4F_R (0x1 << 6) 960*cf885929SSimon Glass #define RT5677_PWR_DAC_M4F_R_BIT 6 961*cf885929SSimon Glass #define RT5677_PWR_ADC_S2F (0x1 << 5) 962*cf885929SSimon Glass #define RT5677_PWR_ADC_S2F_BIT 5 963*cf885929SSimon Glass #define RT5677_PWR_ADC_S3F (0x1 << 4) 964*cf885929SSimon Glass #define RT5677_PWR_ADC_S3F_BIT 4 965*cf885929SSimon Glass #define RT5677_PWR_ADC_S4F (0x1 << 3) 966*cf885929SSimon Glass #define RT5677_PWR_ADC_S4F_BIT 3 967*cf885929SSimon Glass #define RT5677_PWR_PDM1 (0x1 << 2) 968*cf885929SSimon Glass #define RT5677_PWR_PDM1_BIT 2 969*cf885929SSimon Glass #define RT5677_PWR_PDM2 (0x1 << 1) 970*cf885929SSimon Glass #define RT5677_PWR_PDM2_BIT 1 971*cf885929SSimon Glass 972*cf885929SSimon Glass /* Power Management for Analog 1 (0x63) */ 973*cf885929SSimon Glass #define RT5677_PWR_VREF1 (0x1 << 15) 974*cf885929SSimon Glass #define RT5677_PWR_VREF1_BIT 15 975*cf885929SSimon Glass #define RT5677_PWR_FV1 (0x1 << 14) 976*cf885929SSimon Glass #define RT5677_PWR_FV1_BIT 14 977*cf885929SSimon Glass #define RT5677_PWR_MB (0x1 << 13) 978*cf885929SSimon Glass #define RT5677_PWR_MB_BIT 13 979*cf885929SSimon Glass #define RT5677_PWR_LO1 (0x1 << 12) 980*cf885929SSimon Glass #define RT5677_PWR_LO1_BIT 12 981*cf885929SSimon Glass #define RT5677_PWR_BG (0x1 << 11) 982*cf885929SSimon Glass #define RT5677_PWR_BG_BIT 11 983*cf885929SSimon Glass #define RT5677_PWR_LO2 (0x1 << 10) 984*cf885929SSimon Glass #define RT5677_PWR_LO2_BIT 10 985*cf885929SSimon Glass #define RT5677_PWR_LO3 (0x1 << 9) 986*cf885929SSimon Glass #define RT5677_PWR_LO3_BIT 9 987*cf885929SSimon Glass #define RT5677_PWR_VREF2 (0x1 << 8) 988*cf885929SSimon Glass #define RT5677_PWR_VREF2_BIT 8 989*cf885929SSimon Glass #define RT5677_PWR_FV2 (0x1 << 7) 990*cf885929SSimon Glass #define RT5677_PWR_FV2_BIT 7 991*cf885929SSimon Glass #define RT5677_LDO2_SEL_MASK (0x7 << 4) 992*cf885929SSimon Glass #define RT5677_LDO2_SEL_SFT 4 993*cf885929SSimon Glass #define RT5677_LDO1_SEL_MASK (0x7 << 0) 994*cf885929SSimon Glass #define RT5677_LDO1_SEL_SFT 0 995*cf885929SSimon Glass 996*cf885929SSimon Glass /* Power Management for Analog 2 (0x64) */ 997*cf885929SSimon Glass #define RT5677_PWR_BST1 (0x1 << 15) 998*cf885929SSimon Glass #define RT5677_PWR_BST1_BIT 15 999*cf885929SSimon Glass #define RT5677_PWR_BST2 (0x1 << 14) 1000*cf885929SSimon Glass #define RT5677_PWR_BST2_BIT 14 1001*cf885929SSimon Glass #define RT5677_PWR_CLK_MB1 (0x1 << 13) 1002*cf885929SSimon Glass #define RT5677_PWR_CLK_MB1_BIT 13 1003*cf885929SSimon Glass #define RT5677_PWR_SLIM (0x1 << 12) 1004*cf885929SSimon Glass #define RT5677_PWR_SLIM_BIT 12 1005*cf885929SSimon Glass #define RT5677_PWR_MB1 (0x1 << 11) 1006*cf885929SSimon Glass #define RT5677_PWR_MB1_BIT 11 1007*cf885929SSimon Glass #define RT5677_PWR_PP_MB1 (0x1 << 10) 1008*cf885929SSimon Glass #define RT5677_PWR_PP_MB1_BIT 10 1009*cf885929SSimon Glass #define RT5677_PWR_PLL1 (0x1 << 9) 1010*cf885929SSimon Glass #define RT5677_PWR_PLL1_BIT 9 1011*cf885929SSimon Glass #define RT5677_PWR_PLL2 (0x1 << 8) 1012*cf885929SSimon Glass #define RT5677_PWR_PLL2_BIT 8 1013*cf885929SSimon Glass #define RT5677_PWR_CORE (0x1 << 7) 1014*cf885929SSimon Glass #define RT5677_PWR_CORE_BIT 7 1015*cf885929SSimon Glass #define RT5677_PWR_CLK_MB (0x1 << 6) 1016*cf885929SSimon Glass #define RT5677_PWR_CLK_MB_BIT 6 1017*cf885929SSimon Glass #define RT5677_PWR_BST1_P (0x1 << 5) 1018*cf885929SSimon Glass #define RT5677_PWR_BST1_P_BIT 5 1019*cf885929SSimon Glass #define RT5677_PWR_BST2_P (0x1 << 4) 1020*cf885929SSimon Glass #define RT5677_PWR_BST2_P_BIT 4 1021*cf885929SSimon Glass #define RT5677_PWR_IPTV (0x1 << 3) 1022*cf885929SSimon Glass #define RT5677_PWR_IPTV_BIT 3 1023*cf885929SSimon Glass #define RT5677_PWR_25M_CLK (0x1 << 1) 1024*cf885929SSimon Glass #define RT5677_PWR_25M_CLK_BIT 1 1025*cf885929SSimon Glass #define RT5677_PWR_LDO1 (0x1 << 0) 1026*cf885929SSimon Glass #define RT5677_PWR_LDO1_BIT 0 1027*cf885929SSimon Glass 1028*cf885929SSimon Glass /* Power Management for DSP (0x65) */ 1029*cf885929SSimon Glass #define RT5677_PWR_SR7 (0x1 << 10) 1030*cf885929SSimon Glass #define RT5677_PWR_SR7_BIT 10 1031*cf885929SSimon Glass #define RT5677_PWR_SR6 (0x1 << 9) 1032*cf885929SSimon Glass #define RT5677_PWR_SR6_BIT 9 1033*cf885929SSimon Glass #define RT5677_PWR_SR5 (0x1 << 8) 1034*cf885929SSimon Glass #define RT5677_PWR_SR5_BIT 8 1035*cf885929SSimon Glass #define RT5677_PWR_SR4 (0x1 << 7) 1036*cf885929SSimon Glass #define RT5677_PWR_SR4_BIT 7 1037*cf885929SSimon Glass #define RT5677_PWR_SR3 (0x1 << 6) 1038*cf885929SSimon Glass #define RT5677_PWR_SR3_BIT 6 1039*cf885929SSimon Glass #define RT5677_PWR_SR2 (0x1 << 5) 1040*cf885929SSimon Glass #define RT5677_PWR_SR2_BIT 5 1041*cf885929SSimon Glass #define RT5677_PWR_SR1 (0x1 << 4) 1042*cf885929SSimon Glass #define RT5677_PWR_SR1_BIT 4 1043*cf885929SSimon Glass #define RT5677_PWR_SR0 (0x1 << 3) 1044*cf885929SSimon Glass #define RT5677_PWR_SR0_BIT 3 1045*cf885929SSimon Glass #define RT5677_PWR_MLT (0x1 << 2) 1046*cf885929SSimon Glass #define RT5677_PWR_MLT_BIT 2 1047*cf885929SSimon Glass #define RT5677_PWR_DSP (0x1 << 1) 1048*cf885929SSimon Glass #define RT5677_PWR_DSP_BIT 1 1049*cf885929SSimon Glass #define RT5677_PWR_DSP_CPU (0x1 << 0) 1050*cf885929SSimon Glass #define RT5677_PWR_DSP_CPU_BIT 0 1051*cf885929SSimon Glass 1052*cf885929SSimon Glass /* Power Status for DSP (0x66) */ 1053*cf885929SSimon Glass #define RT5677_PWR_SR7_RDY (0x1 << 9) 1054*cf885929SSimon Glass #define RT5677_PWR_SR7_RDY_BIT 9 1055*cf885929SSimon Glass #define RT5677_PWR_SR6_RDY (0x1 << 8) 1056*cf885929SSimon Glass #define RT5677_PWR_SR6_RDY_BIT 8 1057*cf885929SSimon Glass #define RT5677_PWR_SR5_RDY (0x1 << 7) 1058*cf885929SSimon Glass #define RT5677_PWR_SR5_RDY_BIT 7 1059*cf885929SSimon Glass #define RT5677_PWR_SR4_RDY (0x1 << 6) 1060*cf885929SSimon Glass #define RT5677_PWR_SR4_RDY_BIT 6 1061*cf885929SSimon Glass #define RT5677_PWR_SR3_RDY (0x1 << 5) 1062*cf885929SSimon Glass #define RT5677_PWR_SR3_RDY_BIT 5 1063*cf885929SSimon Glass #define RT5677_PWR_SR2_RDY (0x1 << 4) 1064*cf885929SSimon Glass #define RT5677_PWR_SR2_RDY_BIT 4 1065*cf885929SSimon Glass #define RT5677_PWR_SR1_RDY (0x1 << 3) 1066*cf885929SSimon Glass #define RT5677_PWR_SR1_RDY_BIT 3 1067*cf885929SSimon Glass #define RT5677_PWR_SR0_RDY (0x1 << 2) 1068*cf885929SSimon Glass #define RT5677_PWR_SR0_RDY_BIT 2 1069*cf885929SSimon Glass #define RT5677_PWR_MLT_RDY (0x1 << 1) 1070*cf885929SSimon Glass #define RT5677_PWR_MLT_RDY_BIT 1 1071*cf885929SSimon Glass #define RT5677_PWR_DSP_RDY (0x1 << 0) 1072*cf885929SSimon Glass #define RT5677_PWR_DSP_RDY_BIT 0 1073*cf885929SSimon Glass 1074*cf885929SSimon Glass /* Power Management for DSP (0x67) */ 1075*cf885929SSimon Glass #define RT5677_PWR_SLIM_ISO (0x1 << 11) 1076*cf885929SSimon Glass #define RT5677_PWR_SLIM_ISO_BIT 11 1077*cf885929SSimon Glass #define RT5677_PWR_CORE_ISO (0x1 << 10) 1078*cf885929SSimon Glass #define RT5677_PWR_CORE_ISO_BIT 10 1079*cf885929SSimon Glass #define RT5677_PWR_DSP_ISO (0x1 << 9) 1080*cf885929SSimon Glass #define RT5677_PWR_DSP_ISO_BIT 9 1081*cf885929SSimon Glass #define RT5677_PWR_SR7_ISO (0x1 << 8) 1082*cf885929SSimon Glass #define RT5677_PWR_SR7_ISO_BIT 8 1083*cf885929SSimon Glass #define RT5677_PWR_SR6_ISO (0x1 << 7) 1084*cf885929SSimon Glass #define RT5677_PWR_SR6_ISO_BIT 7 1085*cf885929SSimon Glass #define RT5677_PWR_SR5_ISO (0x1 << 6) 1086*cf885929SSimon Glass #define RT5677_PWR_SR5_ISO_BIT 6 1087*cf885929SSimon Glass #define RT5677_PWR_SR4_ISO (0x1 << 5) 1088*cf885929SSimon Glass #define RT5677_PWR_SR4_ISO_BIT 5 1089*cf885929SSimon Glass #define RT5677_PWR_SR3_ISO (0x1 << 4) 1090*cf885929SSimon Glass #define RT5677_PWR_SR3_ISO_BIT 4 1091*cf885929SSimon Glass #define RT5677_PWR_SR2_ISO (0x1 << 3) 1092*cf885929SSimon Glass #define RT5677_PWR_SR2_ISO_BIT 3 1093*cf885929SSimon Glass #define RT5677_PWR_SR1_ISO (0x1 << 2) 1094*cf885929SSimon Glass #define RT5677_PWR_SR1_ISO_BIT 2 1095*cf885929SSimon Glass #define RT5677_PWR_SR0_ISO (0x1 << 1) 1096*cf885929SSimon Glass #define RT5677_PWR_SR0_ISO_BIT 1 1097*cf885929SSimon Glass #define RT5677_PWR_MLT_ISO (0x1 << 0) 1098*cf885929SSimon Glass #define RT5677_PWR_MLT_ISO_BIT 0 1099*cf885929SSimon Glass 1100*cf885929SSimon Glass /* I2S1/2/3/4 Audio Serial Data Port Control (0x6f 0x70 0x71 0x72) */ 1101*cf885929SSimon Glass #define RT5677_I2S_MS_MASK (0x1 << 15) 1102*cf885929SSimon Glass #define RT5677_I2S_MS_SFT 15 1103*cf885929SSimon Glass #define RT5677_I2S_MS_M (0x0 << 15) 1104*cf885929SSimon Glass #define RT5677_I2S_MS_S (0x1 << 15) 1105*cf885929SSimon Glass #define RT5677_I2S_O_CP_MASK (0x3 << 10) 1106*cf885929SSimon Glass #define RT5677_I2S_O_CP_SFT 10 1107*cf885929SSimon Glass #define RT5677_I2S_O_CP_OFF (0x0 << 10) 1108*cf885929SSimon Glass #define RT5677_I2S_O_CP_U_LAW (0x1 << 10) 1109*cf885929SSimon Glass #define RT5677_I2S_O_CP_A_LAW (0x2 << 10) 1110*cf885929SSimon Glass #define RT5677_I2S_I_CP_MASK (0x3 << 8) 1111*cf885929SSimon Glass #define RT5677_I2S_I_CP_SFT 8 1112*cf885929SSimon Glass #define RT5677_I2S_I_CP_OFF (0x0 << 8) 1113*cf885929SSimon Glass #define RT5677_I2S_I_CP_U_LAW (0x1 << 8) 1114*cf885929SSimon Glass #define RT5677_I2S_I_CP_A_LAW (0x2 << 8) 1115*cf885929SSimon Glass #define RT5677_I2S_BP_MASK (0x1 << 7) 1116*cf885929SSimon Glass #define RT5677_I2S_BP_SFT 7 1117*cf885929SSimon Glass #define RT5677_I2S_BP_NOR (0x0 << 7) 1118*cf885929SSimon Glass #define RT5677_I2S_BP_INV (0x1 << 7) 1119*cf885929SSimon Glass #define RT5677_I2S_DL_MASK (0x3 << 2) 1120*cf885929SSimon Glass #define RT5677_I2S_DL_SFT 2 1121*cf885929SSimon Glass #define RT5677_I2S_DL_16 (0x0 << 2) 1122*cf885929SSimon Glass #define RT5677_I2S_DL_20 (0x1 << 2) 1123*cf885929SSimon Glass #define RT5677_I2S_DL_24 (0x2 << 2) 1124*cf885929SSimon Glass #define RT5677_I2S_DL_8 (0x3 << 2) 1125*cf885929SSimon Glass #define RT5677_I2S_DF_MASK (0x3 << 0) 1126*cf885929SSimon Glass #define RT5677_I2S_DF_SFT 0 1127*cf885929SSimon Glass #define RT5677_I2S_DF_I2S (0x0 << 0) 1128*cf885929SSimon Glass #define RT5677_I2S_DF_LEFT (0x1 << 0) 1129*cf885929SSimon Glass #define RT5677_I2S_DF_PCM_A (0x2 << 0) 1130*cf885929SSimon Glass #define RT5677_I2S_DF_PCM_B (0x3 << 0) 1131*cf885929SSimon Glass 1132*cf885929SSimon Glass /* Clock Tree Control 1 (0x73) */ 1133*cf885929SSimon Glass #define RT5677_I2S_PD1_MASK (0x7 << 12) 1134*cf885929SSimon Glass #define RT5677_I2S_PD1_SFT 12 1135*cf885929SSimon Glass #define RT5677_I2S_PD1_1 (0x0 << 12) 1136*cf885929SSimon Glass #define RT5677_I2S_PD1_2 (0x1 << 12) 1137*cf885929SSimon Glass #define RT5677_I2S_PD1_3 (0x2 << 12) 1138*cf885929SSimon Glass #define RT5677_I2S_PD1_4 (0x3 << 12) 1139*cf885929SSimon Glass #define RT5677_I2S_PD1_6 (0x4 << 12) 1140*cf885929SSimon Glass #define RT5677_I2S_PD1_8 (0x5 << 12) 1141*cf885929SSimon Glass #define RT5677_I2S_PD1_12 (0x6 << 12) 1142*cf885929SSimon Glass #define RT5677_I2S_PD1_16 (0x7 << 12) 1143*cf885929SSimon Glass #define RT5677_I2S_BCLK_MS2_MASK (0x1 << 11) 1144*cf885929SSimon Glass #define RT5677_I2S_BCLK_MS2_SFT 11 1145*cf885929SSimon Glass #define RT5677_I2S_BCLK_MS2_32 (0x0 << 11) 1146*cf885929SSimon Glass #define RT5677_I2S_BCLK_MS2_64 (0x1 << 11) 1147*cf885929SSimon Glass #define RT5677_I2S_PD2_MASK (0x7 << 8) 1148*cf885929SSimon Glass #define RT5677_I2S_PD2_SFT 8 1149*cf885929SSimon Glass #define RT5677_I2S_PD2_1 (0x0 << 8) 1150*cf885929SSimon Glass #define RT5677_I2S_PD2_2 (0x1 << 8) 1151*cf885929SSimon Glass #define RT5677_I2S_PD2_3 (0x2 << 8) 1152*cf885929SSimon Glass #define RT5677_I2S_PD2_4 (0x3 << 8) 1153*cf885929SSimon Glass #define RT5677_I2S_PD2_6 (0x4 << 8) 1154*cf885929SSimon Glass #define RT5677_I2S_PD2_8 (0x5 << 8) 1155*cf885929SSimon Glass #define RT5677_I2S_PD2_12 (0x6 << 8) 1156*cf885929SSimon Glass #define RT5677_I2S_PD2_16 (0x7 << 8) 1157*cf885929SSimon Glass #define RT5677_I2S_BCLK_MS3_MASK (0x1 << 7) 1158*cf885929SSimon Glass #define RT5677_I2S_BCLK_MS3_SFT 7 1159*cf885929SSimon Glass #define RT5677_I2S_BCLK_MS3_32 (0x0 << 7) 1160*cf885929SSimon Glass #define RT5677_I2S_BCLK_MS3_64 (0x1 << 7) 1161*cf885929SSimon Glass #define RT5677_I2S_PD3_MASK (0x7 << 4) 1162*cf885929SSimon Glass #define RT5677_I2S_PD3_SFT 4 1163*cf885929SSimon Glass #define RT5677_I2S_PD3_1 (0x0 << 4) 1164*cf885929SSimon Glass #define RT5677_I2S_PD3_2 (0x1 << 4) 1165*cf885929SSimon Glass #define RT5677_I2S_PD3_3 (0x2 << 4) 1166*cf885929SSimon Glass #define RT5677_I2S_PD3_4 (0x3 << 4) 1167*cf885929SSimon Glass #define RT5677_I2S_PD3_6 (0x4 << 4) 1168*cf885929SSimon Glass #define RT5677_I2S_PD3_8 (0x5 << 4) 1169*cf885929SSimon Glass #define RT5677_I2S_PD3_12 (0x6 << 4) 1170*cf885929SSimon Glass #define RT5677_I2S_PD3_16 (0x7 << 4) 1171*cf885929SSimon Glass #define RT5677_I2S_BCLK_MS4_MASK (0x1 << 3) 1172*cf885929SSimon Glass #define RT5677_I2S_BCLK_MS4_SFT 3 1173*cf885929SSimon Glass #define RT5677_I2S_BCLK_MS4_32 (0x0 << 3) 1174*cf885929SSimon Glass #define RT5677_I2S_BCLK_MS4_64 (0x1 << 3) 1175*cf885929SSimon Glass #define RT5677_I2S_PD4_MASK (0x7 << 0) 1176*cf885929SSimon Glass #define RT5677_I2S_PD4_SFT 0 1177*cf885929SSimon Glass #define RT5677_I2S_PD4_1 (0x0 << 0) 1178*cf885929SSimon Glass #define RT5677_I2S_PD4_2 (0x1 << 0) 1179*cf885929SSimon Glass #define RT5677_I2S_PD4_3 (0x2 << 0) 1180*cf885929SSimon Glass #define RT5677_I2S_PD4_4 (0x3 << 0) 1181*cf885929SSimon Glass #define RT5677_I2S_PD4_6 (0x4 << 0) 1182*cf885929SSimon Glass #define RT5677_I2S_PD4_8 (0x5 << 0) 1183*cf885929SSimon Glass #define RT5677_I2S_PD4_12 (0x6 << 0) 1184*cf885929SSimon Glass #define RT5677_I2S_PD4_16 (0x7 << 0) 1185*cf885929SSimon Glass 1186*cf885929SSimon Glass /* Clock Tree Control 2 (0x74) */ 1187*cf885929SSimon Glass #define RT5677_I2S_PD5_MASK (0x7 << 12) 1188*cf885929SSimon Glass #define RT5677_I2S_PD5_SFT 12 1189*cf885929SSimon Glass #define RT5677_I2S_PD5_1 (0x0 << 12) 1190*cf885929SSimon Glass #define RT5677_I2S_PD5_2 (0x1 << 12) 1191*cf885929SSimon Glass #define RT5677_I2S_PD5_3 (0x2 << 12) 1192*cf885929SSimon Glass #define RT5677_I2S_PD5_4 (0x3 << 12) 1193*cf885929SSimon Glass #define RT5677_I2S_PD5_6 (0x4 << 12) 1194*cf885929SSimon Glass #define RT5677_I2S_PD5_8 (0x5 << 12) 1195*cf885929SSimon Glass #define RT5677_I2S_PD5_12 (0x6 << 12) 1196*cf885929SSimon Glass #define RT5677_I2S_PD5_16 (0x7 << 12) 1197*cf885929SSimon Glass #define RT5677_I2S_PD6_MASK (0x7 << 8) 1198*cf885929SSimon Glass #define RT5677_I2S_PD6_SFT 8 1199*cf885929SSimon Glass #define RT5677_I2S_PD6_1 (0x0 << 8) 1200*cf885929SSimon Glass #define RT5677_I2S_PD6_2 (0x1 << 8) 1201*cf885929SSimon Glass #define RT5677_I2S_PD6_3 (0x2 << 8) 1202*cf885929SSimon Glass #define RT5677_I2S_PD6_4 (0x3 << 8) 1203*cf885929SSimon Glass #define RT5677_I2S_PD6_6 (0x4 << 8) 1204*cf885929SSimon Glass #define RT5677_I2S_PD6_8 (0x5 << 8) 1205*cf885929SSimon Glass #define RT5677_I2S_PD6_12 (0x6 << 8) 1206*cf885929SSimon Glass #define RT5677_I2S_PD6_16 (0x7 << 8) 1207*cf885929SSimon Glass #define RT5677_I2S_PD7_MASK (0x7 << 4) 1208*cf885929SSimon Glass #define RT5677_I2S_PD7_SFT 4 1209*cf885929SSimon Glass #define RT5677_I2S_PD7_1 (0x0 << 4) 1210*cf885929SSimon Glass #define RT5677_I2S_PD7_2 (0x1 << 4) 1211*cf885929SSimon Glass #define RT5677_I2S_PD7_3 (0x2 << 4) 1212*cf885929SSimon Glass #define RT5677_I2S_PD7_4 (0x3 << 4) 1213*cf885929SSimon Glass #define RT5677_I2S_PD7_6 (0x4 << 4) 1214*cf885929SSimon Glass #define RT5677_I2S_PD7_8 (0x5 << 4) 1215*cf885929SSimon Glass #define RT5677_I2S_PD7_12 (0x6 << 4) 1216*cf885929SSimon Glass #define RT5677_I2S_PD7_16 (0x7 << 4) 1217*cf885929SSimon Glass #define RT5677_I2S_PD8_MASK (0x7 << 0) 1218*cf885929SSimon Glass #define RT5677_I2S_PD8_SFT 0 1219*cf885929SSimon Glass #define RT5677_I2S_PD8_1 (0x0 << 0) 1220*cf885929SSimon Glass #define RT5677_I2S_PD8_2 (0x1 << 0) 1221*cf885929SSimon Glass #define RT5677_I2S_PD8_3 (0x2 << 0) 1222*cf885929SSimon Glass #define RT5677_I2S_PD8_4 (0x3 << 0) 1223*cf885929SSimon Glass #define RT5677_I2S_PD8_6 (0x4 << 0) 1224*cf885929SSimon Glass #define RT5677_I2S_PD8_8 (0x5 << 0) 1225*cf885929SSimon Glass #define RT5677_I2S_PD8_12 (0x6 << 0) 1226*cf885929SSimon Glass #define RT5677_I2S_PD8_16 (0x7 << 0) 1227*cf885929SSimon Glass 1228*cf885929SSimon Glass /* Clock Tree Control 3 (0x75) */ 1229*cf885929SSimon Glass #define RT5677_DSP_ASRC_O_MASK (0x3 << 6) 1230*cf885929SSimon Glass #define RT5677_DSP_ASRC_O_SFT 6 1231*cf885929SSimon Glass #define RT5677_DSP_ASRC_O_1_0 (0x0 << 6) 1232*cf885929SSimon Glass #define RT5677_DSP_ASRC_O_1_5 (0x1 << 6) 1233*cf885929SSimon Glass #define RT5677_DSP_ASRC_O_2_0 (0x2 << 6) 1234*cf885929SSimon Glass #define RT5677_DSP_ASRC_O_3_0 (0x3 << 6) 1235*cf885929SSimon Glass #define RT5677_DSP_ASRC_I_MASK (0x3 << 4) 1236*cf885929SSimon Glass #define RT5677_DSP_ASRC_I_SFT 4 1237*cf885929SSimon Glass #define RT5677_DSP_ASRC_I_1_0 (0x0 << 4) 1238*cf885929SSimon Glass #define RT5677_DSP_ASRC_I_1_5 (0x1 << 4) 1239*cf885929SSimon Glass #define RT5677_DSP_ASRC_I_2_0 (0x2 << 4) 1240*cf885929SSimon Glass #define RT5677_DSP_ASRC_I_3_0 (0x3 << 4) 1241*cf885929SSimon Glass #define RT5677_DSP_BUS_PD_MASK (0x7 << 0) 1242*cf885929SSimon Glass #define RT5677_DSP_BUS_PD_SFT 0 1243*cf885929SSimon Glass #define RT5677_DSP_BUS_PD_1 (0x0 << 0) 1244*cf885929SSimon Glass #define RT5677_DSP_BUS_PD_2 (0x1 << 0) 1245*cf885929SSimon Glass #define RT5677_DSP_BUS_PD_3 (0x2 << 0) 1246*cf885929SSimon Glass #define RT5677_DSP_BUS_PD_4 (0x3 << 0) 1247*cf885929SSimon Glass #define RT5677_DSP_BUS_PD_6 (0x4 << 0) 1248*cf885929SSimon Glass #define RT5677_DSP_BUS_PD_8 (0x5 << 0) 1249*cf885929SSimon Glass #define RT5677_DSP_BUS_PD_12 (0x6 << 0) 1250*cf885929SSimon Glass #define RT5677_DSP_BUS_PD_16 (0x7 << 0) 1251*cf885929SSimon Glass 1252*cf885929SSimon Glass #define RT5677_PLL_INP_MAX 40000000 1253*cf885929SSimon Glass #define RT5677_PLL_INP_MIN 2048000 1254*cf885929SSimon Glass /* PLL M/N/K Code Control 1 (0x7a 0x7c) */ 1255*cf885929SSimon Glass #define RT5677_PLL_N_MAX 0x1ff 1256*cf885929SSimon Glass #define RT5677_PLL_N_MASK (RT5677_PLL_N_MAX << 7) 1257*cf885929SSimon Glass #define RT5677_PLL_N_SFT 7 1258*cf885929SSimon Glass #define RT5677_PLL_K_BP (0x1 << 5) 1259*cf885929SSimon Glass #define RT5677_PLL_K_BP_SFT 5 1260*cf885929SSimon Glass #define RT5677_PLL_K_MAX 0x1f 1261*cf885929SSimon Glass #define RT5677_PLL_K_MASK (RT5677_PLL_K_MAX) 1262*cf885929SSimon Glass #define RT5677_PLL_K_SFT 0 1263*cf885929SSimon Glass 1264*cf885929SSimon Glass /* PLL M/N/K Code Control 2 (0x7b 0x7d) */ 1265*cf885929SSimon Glass #define RT5677_PLL_M_MAX 0xf 1266*cf885929SSimon Glass #define RT5677_PLL_M_MASK (RT5677_PLL_M_MAX << 12) 1267*cf885929SSimon Glass #define RT5677_PLL_M_SFT 12 1268*cf885929SSimon Glass #define RT5677_PLL_M_BP (0x1 << 11) 1269*cf885929SSimon Glass #define RT5677_PLL_M_BP_SFT 11 1270*cf885929SSimon Glass 1271*cf885929SSimon Glass /* Global Clock Control 1 (0x80) */ 1272*cf885929SSimon Glass #define RT5677_SCLK_SRC_MASK (0x3 << 14) 1273*cf885929SSimon Glass #define RT5677_SCLK_SRC_SFT 14 1274*cf885929SSimon Glass #define RT5677_SCLK_SRC_MCLK (0x0 << 14) 1275*cf885929SSimon Glass #define RT5677_SCLK_SRC_PLL1 (0x1 << 14) 1276*cf885929SSimon Glass #define RT5677_SCLK_SRC_RCCLK (0x2 << 14) /* 25MHz */ 1277*cf885929SSimon Glass #define RT5677_SCLK_SRC_SLIM (0x3 << 14) 1278*cf885929SSimon Glass #define RT5677_PLL1_SRC_MASK (0x7 << 11) 1279*cf885929SSimon Glass #define RT5677_PLL1_SRC_SFT 11 1280*cf885929SSimon Glass #define RT5677_PLL1_SRC_MCLK (0x0 << 11) 1281*cf885929SSimon Glass #define RT5677_PLL1_SRC_BCLK1 (0x1 << 11) 1282*cf885929SSimon Glass #define RT5677_PLL1_SRC_BCLK2 (0x2 << 11) 1283*cf885929SSimon Glass #define RT5677_PLL1_SRC_BCLK3 (0x3 << 11) 1284*cf885929SSimon Glass #define RT5677_PLL1_SRC_BCLK4 (0x4 << 11) 1285*cf885929SSimon Glass #define RT5677_PLL1_SRC_RCCLK (0x5 << 11) 1286*cf885929SSimon Glass #define RT5677_PLL1_SRC_SLIM (0x6 << 11) 1287*cf885929SSimon Glass #define RT5677_MCLK_SRC_MASK (0x1 << 10) 1288*cf885929SSimon Glass #define RT5677_MCLK_SRC_SFT 10 1289*cf885929SSimon Glass #define RT5677_MCLK1_SRC (0x0 << 10) 1290*cf885929SSimon Glass #define RT5677_MCLK2_SRC (0x1 << 10) 1291*cf885929SSimon Glass #define RT5677_PLL1_PD_MASK (0x1 << 8) 1292*cf885929SSimon Glass #define RT5677_PLL1_PD_SFT 8 1293*cf885929SSimon Glass #define RT5677_PLL1_PD_1 (0x0 << 8) 1294*cf885929SSimon Glass #define RT5677_PLL1_PD_2 (0x1 << 8) 1295*cf885929SSimon Glass #define RT5671_DAC_OSR_MASK (0x3 << 6) 1296*cf885929SSimon Glass #define RT5671_DAC_OSR_SFT 6 1297*cf885929SSimon Glass #define RT5671_DAC_OSR_128 (0x0 << 6) 1298*cf885929SSimon Glass #define RT5671_DAC_OSR_64 (0x1 << 6) 1299*cf885929SSimon Glass #define RT5671_DAC_OSR_32 (0x2 << 6) 1300*cf885929SSimon Glass #define RT5671_ADC_OSR_MASK (0x3 << 4) 1301*cf885929SSimon Glass #define RT5671_ADC_OSR_SFT 4 1302*cf885929SSimon Glass #define RT5671_ADC_OSR_128 (0x0 << 4) 1303*cf885929SSimon Glass #define RT5671_ADC_OSR_64 (0x1 << 4) 1304*cf885929SSimon Glass #define RT5671_ADC_OSR_32 (0x2 << 4) 1305*cf885929SSimon Glass 1306*cf885929SSimon Glass /* Global Clock Control 2 (0x81) */ 1307*cf885929SSimon Glass #define RT5677_PLL2_PR_SRC_MASK (0x1 << 15) 1308*cf885929SSimon Glass #define RT5677_PLL2_PR_SRC_SFT 15 1309*cf885929SSimon Glass #define RT5677_PLL2_PR_SRC_MCLK1 (0x0 << 15) 1310*cf885929SSimon Glass #define RT5677_PLL2_PR_SRC_MCLK2 (0x1 << 15) 1311*cf885929SSimon Glass #define RT5677_PLL2_SRC_MASK (0x7 << 12) 1312*cf885929SSimon Glass #define RT5677_PLL2_SRC_SFT 12 1313*cf885929SSimon Glass #define RT5677_PLL2_SRC_MCLK (0x0 << 12) 1314*cf885929SSimon Glass #define RT5677_PLL2_SRC_BCLK1 (0x1 << 12) 1315*cf885929SSimon Glass #define RT5677_PLL2_SRC_BCLK2 (0x2 << 12) 1316*cf885929SSimon Glass #define RT5677_PLL2_SRC_BCLK3 (0x3 << 12) 1317*cf885929SSimon Glass #define RT5677_PLL2_SRC_BCLK4 (0x4 << 12) 1318*cf885929SSimon Glass #define RT5677_PLL2_SRC_RCCLK (0x5 << 12) 1319*cf885929SSimon Glass #define RT5677_PLL2_SRC_SLIM (0x6 << 12) 1320*cf885929SSimon Glass #define RT5671_DSP_ASRC_O_SRC (0x3 << 10) 1321*cf885929SSimon Glass #define RT5671_DSP_ASRC_O_SRC_SFT 10 1322*cf885929SSimon Glass #define RT5671_DSP_ASRC_O_MCLK (0x0 << 10) 1323*cf885929SSimon Glass #define RT5671_DSP_ASRC_O_PLL1 (0x1 << 10) 1324*cf885929SSimon Glass #define RT5671_DSP_ASRC_O_SLIM (0x2 << 10) 1325*cf885929SSimon Glass #define RT5671_DSP_ASRC_O_RCCLK (0x3 << 10) 1326*cf885929SSimon Glass #define RT5671_DSP_ASRC_I_SRC (0x3 << 8) 1327*cf885929SSimon Glass #define RT5671_DSP_ASRC_I_SRC_SFT 8 1328*cf885929SSimon Glass #define RT5671_DSP_ASRC_I_MCLK (0x0 << 8) 1329*cf885929SSimon Glass #define RT5671_DSP_ASRC_I_PLL1 (0x1 << 8) 1330*cf885929SSimon Glass #define RT5671_DSP_ASRC_I_SLIM (0x2 << 8) 1331*cf885929SSimon Glass #define RT5671_DSP_ASRC_I_RCCLK (0x3 << 8) 1332*cf885929SSimon Glass #define RT5677_DSP_CLK_SRC_MASK (0x1 << 7) 1333*cf885929SSimon Glass #define RT5677_DSP_CLK_SRC_SFT 7 1334*cf885929SSimon Glass #define RT5677_DSP_CLK_SRC_PLL2 (0x0 << 7) 1335*cf885929SSimon Glass #define RT5677_DSP_CLK_SRC_BYPASS (0x1 << 7) 1336*cf885929SSimon Glass 1337*cf885929SSimon Glass /* VAD Function Control 4 (0x9f) */ 1338*cf885929SSimon Glass #define RT5677_VAD_SRC_MASK (0x7 << 8) 1339*cf885929SSimon Glass #define RT5677_VAD_SRC_SFT 8 1340*cf885929SSimon Glass 1341*cf885929SSimon Glass /* DSP InBound Control (0xa3) */ 1342*cf885929SSimon Glass #define RT5677_IB01_SRC_MASK (0x7 << 12) 1343*cf885929SSimon Glass #define RT5677_IB01_SRC_SFT 12 1344*cf885929SSimon Glass #define RT5677_IB23_SRC_MASK (0x7 << 8) 1345*cf885929SSimon Glass #define RT5677_IB23_SRC_SFT 8 1346*cf885929SSimon Glass #define RT5677_IB45_SRC_MASK (0x7 << 4) 1347*cf885929SSimon Glass #define RT5677_IB45_SRC_SFT 4 1348*cf885929SSimon Glass #define RT5677_IB6_SRC_MASK (0x7 << 0) 1349*cf885929SSimon Glass #define RT5677_IB6_SRC_SFT 0 1350*cf885929SSimon Glass 1351*cf885929SSimon Glass /* DSP InBound Control (0xa4) */ 1352*cf885929SSimon Glass #define RT5677_IB7_SRC_MASK (0x7 << 12) 1353*cf885929SSimon Glass #define RT5677_IB7_SRC_SFT 12 1354*cf885929SSimon Glass #define RT5677_IB8_SRC_MASK (0x7 << 8) 1355*cf885929SSimon Glass #define RT5677_IB8_SRC_SFT 8 1356*cf885929SSimon Glass #define RT5677_IB9_SRC_MASK (0x7 << 4) 1357*cf885929SSimon Glass #define RT5677_IB9_SRC_SFT 4 1358*cf885929SSimon Glass 1359*cf885929SSimon Glass /* DSP In/OutBound Control (0xa5) */ 1360*cf885929SSimon Glass #define RT5677_SEL_SRC_OB23 (0x1 << 4) 1361*cf885929SSimon Glass #define RT5677_SEL_SRC_OB23_SFT 4 1362*cf885929SSimon Glass #define RT5677_SEL_SRC_OB01 (0x1 << 3) 1363*cf885929SSimon Glass #define RT5677_SEL_SRC_OB01_SFT 3 1364*cf885929SSimon Glass #define RT5677_SEL_SRC_IB45 (0x1 << 2) 1365*cf885929SSimon Glass #define RT5677_SEL_SRC_IB45_SFT 2 1366*cf885929SSimon Glass #define RT5677_SEL_SRC_IB23 (0x1 << 1) 1367*cf885929SSimon Glass #define RT5677_SEL_SRC_IB23_SFT 1 1368*cf885929SSimon Glass #define RT5677_SEL_SRC_IB01 (0x1 << 0) 1369*cf885929SSimon Glass #define RT5677_SEL_SRC_IB01_SFT 0 1370*cf885929SSimon Glass 1371*cf885929SSimon Glass /* Virtual DSP Mixer Control (0xf7 0xf8 0xf9) */ 1372*cf885929SSimon Glass #define RT5677_DSP_IB_01_H (0x1 << 15) 1373*cf885929SSimon Glass #define RT5677_DSP_IB_01_H_SFT 15 1374*cf885929SSimon Glass #define RT5677_DSP_IB_23_H (0x1 << 14) 1375*cf885929SSimon Glass #define RT5677_DSP_IB_23_H_SFT 14 1376*cf885929SSimon Glass #define RT5677_DSP_IB_45_H (0x1 << 13) 1377*cf885929SSimon Glass #define RT5677_DSP_IB_45_H_SFT 13 1378*cf885929SSimon Glass #define RT5677_DSP_IB_6_H (0x1 << 12) 1379*cf885929SSimon Glass #define RT5677_DSP_IB_6_H_SFT 12 1380*cf885929SSimon Glass #define RT5677_DSP_IB_7_H (0x1 << 11) 1381*cf885929SSimon Glass #define RT5677_DSP_IB_7_H_SFT 11 1382*cf885929SSimon Glass #define RT5677_DSP_IB_8_H (0x1 << 10) 1383*cf885929SSimon Glass #define RT5677_DSP_IB_8_H_SFT 10 1384*cf885929SSimon Glass #define RT5677_DSP_IB_9_H (0x1 << 9) 1385*cf885929SSimon Glass #define RT5677_DSP_IB_9_H_SFT 9 1386*cf885929SSimon Glass #define RT5677_DSP_IB_01_L (0x1 << 7) 1387*cf885929SSimon Glass #define RT5677_DSP_IB_01_L_SFT 7 1388*cf885929SSimon Glass #define RT5677_DSP_IB_23_L (0x1 << 6) 1389*cf885929SSimon Glass #define RT5677_DSP_IB_23_L_SFT 6 1390*cf885929SSimon Glass #define RT5677_DSP_IB_45_L (0x1 << 5) 1391*cf885929SSimon Glass #define RT5677_DSP_IB_45_L_SFT 5 1392*cf885929SSimon Glass #define RT5677_DSP_IB_6_L (0x1 << 4) 1393*cf885929SSimon Glass #define RT5677_DSP_IB_6_L_SFT 4 1394*cf885929SSimon Glass #define RT5677_DSP_IB_7_L (0x1 << 3) 1395*cf885929SSimon Glass #define RT5677_DSP_IB_7_L_SFT 3 1396*cf885929SSimon Glass #define RT5677_DSP_IB_8_L (0x1 << 2) 1397*cf885929SSimon Glass #define RT5677_DSP_IB_8_L_SFT 2 1398*cf885929SSimon Glass #define RT5677_DSP_IB_9_L (0x1 << 1) 1399*cf885929SSimon Glass #define RT5677_DSP_IB_9_L_SFT 1 1400*cf885929SSimon Glass 1401*cf885929SSimon Glass #define RT5677_SW_RESET 0x10EC 1402*cf885929SSimon Glass 1403*cf885929SSimon Glass /* System Clock Source */ 1404*cf885929SSimon Glass enum { 1405*cf885929SSimon Glass RT5677_SCLK_S_MCLK, 1406*cf885929SSimon Glass RT5677_SCLK_S_PLL1, 1407*cf885929SSimon Glass RT5677_SCLK_S_RCCLK, 1408*cf885929SSimon Glass }; 1409*cf885929SSimon Glass 1410*cf885929SSimon Glass /* PLL1 Source */ 1411*cf885929SSimon Glass enum { 1412*cf885929SSimon Glass RT5677_PLL1_S_MCLK, 1413*cf885929SSimon Glass RT5677_PLL1_S_BCLK1, 1414*cf885929SSimon Glass RT5677_PLL1_S_BCLK2, 1415*cf885929SSimon Glass RT5677_PLL1_S_BCLK3, 1416*cf885929SSimon Glass RT5677_PLL1_S_BCLK4, 1417*cf885929SSimon Glass }; 1418*cf885929SSimon Glass 1419*cf885929SSimon Glass enum { 1420*cf885929SSimon Glass RT5677_AIF1, 1421*cf885929SSimon Glass RT5677_AIF2, 1422*cf885929SSimon Glass RT5677_AIF3, 1423*cf885929SSimon Glass RT5677_AIF4, 1424*cf885929SSimon Glass RT5677_AIF5, 1425*cf885929SSimon Glass RT5677_AIFS, 1426*cf885929SSimon Glass }; 1427*cf885929SSimon Glass 1428*cf885929SSimon Glass #endif /* __DRIVERS_SOUND_RT5677_H__ */ 1429