0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef _RT1305_H_
0010 #define _RT1305_H_
0011
0012 #define RT1305_DEVICE_ID_NUM 0x6251
0013
0014 #define RT1305_RESET 0x00
0015 #define RT1305_CLK_1 0x04
0016 #define RT1305_CLK_2 0x05
0017 #define RT1305_CLK_3 0x06
0018 #define RT1305_DFLL_REG 0x07
0019 #define RT1305_CAL_EFUSE_CLOCK 0x08
0020 #define RT1305_PLL0_1 0x0a
0021 #define RT1305_PLL0_2 0x0b
0022 #define RT1305_PLL1_1 0x0c
0023 #define RT1305_PLL1_2 0x0d
0024 #define RT1305_MIXER_CTRL_1 0x10
0025 #define RT1305_MIXER_CTRL_2 0x11
0026 #define RT1305_DAC_SET_1 0x12
0027 #define RT1305_DAC_SET_2 0x14
0028 #define RT1305_ADC_SET_1 0x16
0029 #define RT1305_ADC_SET_2 0x17
0030 #define RT1305_ADC_SET_3 0x18
0031 #define RT1305_PATH_SET 0x20
0032 #define RT1305_SPDIF_IN_SET_1 0x22
0033 #define RT1305_SPDIF_IN_SET_2 0x24
0034 #define RT1305_SPDIF_IN_SET_3 0x26
0035 #define RT1305_SPDIF_OUT_SET_1 0x28
0036 #define RT1305_SPDIF_OUT_SET_2 0x2a
0037 #define RT1305_SPDIF_OUT_SET_3 0x2b
0038 #define RT1305_I2S_SET_1 0x2d
0039 #define RT1305_I2S_SET_2 0x2e
0040 #define RT1305_PBTL_MONO_MODE_SRC 0x2f
0041 #define RT1305_MANUALLY_I2C_DEVICE 0x32
0042 #define RT1305_POWER_STATUS 0x39
0043 #define RT1305_POWER_CTRL_1 0x3a
0044 #define RT1305_POWER_CTRL_2 0x3b
0045 #define RT1305_POWER_CTRL_3 0x3c
0046 #define RT1305_POWER_CTRL_4 0x3d
0047 #define RT1305_POWER_CTRL_5 0x3e
0048 #define RT1305_CLOCK_DETECT 0x3f
0049 #define RT1305_BIQUAD_SET_1 0x40
0050 #define RT1305_BIQUAD_SET_2 0x42
0051 #define RT1305_ADJUSTED_HPF_1 0x46
0052 #define RT1305_ADJUSTED_HPF_2 0x47
0053 #define RT1305_EQ_SET_1 0x4b
0054 #define RT1305_EQ_SET_2 0x4c
0055 #define RT1305_SPK_TEMP_PROTECTION_0 0x4f
0056 #define RT1305_SPK_TEMP_PROTECTION_1 0x50
0057 #define RT1305_SPK_TEMP_PROTECTION_2 0x51
0058 #define RT1305_SPK_TEMP_PROTECTION_3 0x52
0059 #define RT1305_SPK_DC_DETECT_1 0x53
0060 #define RT1305_SPK_DC_DETECT_2 0x54
0061 #define RT1305_LOUDNESS 0x58
0062 #define RT1305_THERMAL_FOLD_BACK_1 0x5e
0063 #define RT1305_THERMAL_FOLD_BACK_2 0x5f
0064 #define RT1305_SILENCE_DETECT 0x60
0065 #define RT1305_ALC_DRC_1 0x62
0066 #define RT1305_ALC_DRC_2 0x63
0067 #define RT1305_ALC_DRC_3 0x64
0068 #define RT1305_ALC_DRC_4 0x65
0069 #define RT1305_PRIV_INDEX 0x6a
0070 #define RT1305_PRIV_DATA 0x6c
0071 #define RT1305_SPK_EXCURSION_LIMITER_7 0x76
0072 #define RT1305_VERSION_ID 0x7a
0073 #define RT1305_VENDOR_ID 0x7c
0074 #define RT1305_DEVICE_ID 0x7e
0075 #define RT1305_EFUSE_1 0x80
0076 #define RT1305_EFUSE_2 0x81
0077 #define RT1305_EFUSE_3 0x82
0078 #define RT1305_DC_CALIB_1 0x90
0079 #define RT1305_DC_CALIB_2 0x91
0080 #define RT1305_DC_CALIB_3 0x92
0081 #define RT1305_DAC_OFFSET_1 0x93
0082 #define RT1305_DAC_OFFSET_2 0x94
0083 #define RT1305_DAC_OFFSET_3 0x95
0084 #define RT1305_DAC_OFFSET_4 0x96
0085 #define RT1305_DAC_OFFSET_5 0x97
0086 #define RT1305_DAC_OFFSET_6 0x98
0087 #define RT1305_DAC_OFFSET_7 0x99
0088 #define RT1305_DAC_OFFSET_8 0x9a
0089 #define RT1305_DAC_OFFSET_9 0x9b
0090 #define RT1305_DAC_OFFSET_10 0x9c
0091 #define RT1305_DAC_OFFSET_11 0x9d
0092 #define RT1305_DAC_OFFSET_12 0x9e
0093 #define RT1305_DAC_OFFSET_13 0x9f
0094 #define RT1305_DAC_OFFSET_14 0xa0
0095 #define RT1305_TRIM_1 0xb0
0096 #define RT1305_TRIM_2 0xb1
0097 #define RT1305_TUNE_INTERNAL_OSC 0xb2
0098 #define RT1305_BIQUAD1_H0_L_28_16 0xc0
0099 #define RT1305_BIQUAD3_A2_R_15_0 0xfb
0100 #define RT1305_MAX_REG 0xff
0101
0102
0103 #define RT1305_SEL_PLL_SRC_2_MASK (0x1 << 15)
0104 #define RT1305_SEL_PLL_SRC_2_SFT 15
0105 #define RT1305_SEL_PLL_SRC_2_MCLK (0x0 << 15)
0106 #define RT1305_SEL_PLL_SRC_2_RCCLK (0x1 << 15)
0107 #define RT1305_DIV_PLL_SRC_2_MASK (0x3 << 13)
0108 #define RT1305_DIV_PLL_SRC_2_SFT 13
0109 #define RT1305_SEL_PLL_SRC_1_MASK (0x3 << 10)
0110 #define RT1305_SEL_PLL_SRC_1_SFT 10
0111 #define RT1305_SEL_PLL_SRC_1_PLL2 (0x0 << 10)
0112 #define RT1305_SEL_PLL_SRC_1_BCLK (0x1 << 10)
0113 #define RT1305_SEL_PLL_SRC_1_DFLL (0x2 << 10)
0114 #define RT1305_SEL_FS_SYS_PRE_MASK (0x3 << 8)
0115 #define RT1305_SEL_FS_SYS_PRE_SFT 8
0116 #define RT1305_SEL_FS_SYS_PRE_MCLK (0x0 << 8)
0117 #define RT1305_SEL_FS_SYS_PRE_PLL (0x1 << 8)
0118 #define RT1305_SEL_FS_SYS_PRE_RCCLK (0x2 << 8)
0119 #define RT1305_DIV_FS_SYS_MASK (0x7 << 4)
0120 #define RT1305_DIV_FS_SYS_SFT 4
0121
0122
0123 #define RT1305_PLL_1_M_SFT 12
0124 #define RT1305_PLL_1_M_BYPASS_MASK (0x1 << 11)
0125 #define RT1305_PLL_1_M_BYPASS_SFT 11
0126 #define RT1305_PLL_1_M_BYPASS (0x1 << 11)
0127 #define RT1305_PLL_1_N_MASK (0x1ff << 0)
0128
0129
0130 #define RT1305_DVOL_MUTE_L_EN_SFT 15
0131 #define RT1305_DVOL_MUTE_R_EN_SFT 14
0132
0133
0134 #define RT1305_SEL_I2S_OUT_MODE_MASK (0x1 << 15)
0135 #define RT1305_SEL_I2S_OUT_MODE_SFT 15
0136 #define RT1305_SEL_I2S_OUT_MODE_S (0x0 << 15)
0137 #define RT1305_SEL_I2S_OUT_MODE_M (0x1 << 15)
0138
0139
0140 #define RT1305_I2S_DF_SEL_MASK (0x3 << 12)
0141 #define RT1305_I2S_DF_SEL_SFT 12
0142 #define RT1305_I2S_DF_SEL_I2S (0x0 << 12)
0143 #define RT1305_I2S_DF_SEL_LEFT (0x1 << 12)
0144 #define RT1305_I2S_DF_SEL_PCM_A (0x2 << 12)
0145 #define RT1305_I2S_DF_SEL_PCM_B (0x3 << 12)
0146 #define RT1305_I2S_DL_SEL_MASK (0x3 << 10)
0147 #define RT1305_I2S_DL_SEL_SFT 10
0148 #define RT1305_I2S_DL_SEL_16B (0x0 << 10)
0149 #define RT1305_I2S_DL_SEL_20B (0x1 << 10)
0150 #define RT1305_I2S_DL_SEL_24B (0x2 << 10)
0151 #define RT1305_I2S_DL_SEL_8B (0x3 << 10)
0152 #define RT1305_I2S_BCLK_MASK (0x1 << 9)
0153 #define RT1305_I2S_BCLK_SFT 9
0154 #define RT1305_I2S_BCLK_NORMAL (0x0 << 9)
0155 #define RT1305_I2S_BCLK_INV (0x1 << 9)
0156
0157
0158 #define RT1305_POW_PDB_JD_MASK (0x1 << 12)
0159 #define RT1305_POW_PDB_JD (0x1 << 12)
0160 #define RT1305_POW_PDB_JD_BIT 12
0161 #define RT1305_POW_PLL0_EN (0x1 << 11)
0162 #define RT1305_POW_PLL0_EN_BIT 11
0163 #define RT1305_POW_PLL1_EN (0x1 << 10)
0164 #define RT1305_POW_PLL1_EN_BIT 10
0165 #define RT1305_POW_PDB_JD_POLARITY (0x1 << 9)
0166 #define RT1305_POW_PDB_JD_POLARITY_BIT 9
0167 #define RT1305_POW_MBIAS_LV (0x1 << 8)
0168 #define RT1305_POW_MBIAS_LV_BIT 8
0169 #define RT1305_POW_BG_MBIAS_LV (0x1 << 7)
0170 #define RT1305_POW_BG_MBIAS_LV_BIT 7
0171 #define RT1305_POW_LDO2 (0x1 << 6)
0172 #define RT1305_POW_LDO2_BIT 6
0173 #define RT1305_POW_BG2 (0x1 << 5)
0174 #define RT1305_POW_BG2_BIT 5
0175 #define RT1305_POW_LDO2_IB2 (0x1 << 4)
0176 #define RT1305_POW_LDO2_IB2_BIT 4
0177 #define RT1305_POW_VREF (0x1 << 3)
0178 #define RT1305_POW_VREF_BIT 3
0179 #define RT1305_POW_VREF1 (0x1 << 2)
0180 #define RT1305_POW_VREF1_BIT 2
0181 #define RT1305_POW_VREF2 (0x1 << 1)
0182 #define RT1305_POW_VREF2_BIT 1
0183
0184
0185 #define RT1305_POW_DISC_VREF (1 << 15)
0186 #define RT1305_POW_DISC_VREF_BIT 15
0187 #define RT1305_POW_FASTB_VREF (1 << 14)
0188 #define RT1305_POW_FASTB_VREF_BIT 14
0189 #define RT1305_POW_ULTRA_FAST_VREF (1 << 13)
0190 #define RT1305_POW_ULTRA_FAST_VREF_BIT 13
0191 #define RT1305_POW_CKXEN_DAC (1 << 12)
0192 #define RT1305_POW_CKXEN_DAC_BIT 12
0193 #define RT1305_POW_EN_CKGEN_DAC (1 << 11)
0194 #define RT1305_POW_EN_CKGEN_DAC_BIT 11
0195 #define RT1305_POW_DAC1_L (1 << 10)
0196 #define RT1305_POW_DAC1_L_BIT 10
0197 #define RT1305_POW_DAC1_R (1 << 9)
0198 #define RT1305_POW_DAC1_R_BIT 9
0199 #define RT1305_POW_CLAMP (1 << 8)
0200 #define RT1305_POW_CLAMP_BIT 8
0201 #define RT1305_POW_BUFL (1 << 7)
0202 #define RT1305_POW_BUFL_BIT 7
0203 #define RT1305_POW_BUFR (1 << 6)
0204 #define RT1305_POW_BUFR_BIT 6
0205 #define RT1305_POW_EN_CKGEN_ADC (1 << 5)
0206 #define RT1305_POW_EN_CKGEN_ADC_BIT 5
0207 #define RT1305_POW_ADC3_L (1 << 4)
0208 #define RT1305_POW_ADC3_L_BIT 4
0209 #define RT1305_POW_ADC3_R (1 << 3)
0210 #define RT1305_POW_ADC3_R_BIT 3
0211 #define RT1305_POW_TRIOSC (1 << 2)
0212 #define RT1305_POW_TRIOSC_BIT 2
0213 #define RT1305_POR_AVDD1 (1 << 1)
0214 #define RT1305_POR_AVDD1_BIT 1
0215 #define RT1305_POR_AVDD2 (1 << 0)
0216 #define RT1305_POR_AVDD2_BIT 0
0217
0218
0219 #define RT1305_POW_VSENSE_RCH (1 << 15)
0220 #define RT1305_POW_VSENSE_RCH_BIT 15
0221 #define RT1305_POW_VSENSE_LCH (1 << 14)
0222 #define RT1305_POW_VSENSE_LCH_BIT 14
0223 #define RT1305_POW_ISENSE_RCH (1 << 13)
0224 #define RT1305_POW_ISENSE_RCH_BIT 13
0225 #define RT1305_POW_ISENSE_LCH (1 << 12)
0226 #define RT1305_POW_ISENSE_LCH_BIT 12
0227 #define RT1305_POW_POR_AVDD1 (1 << 11)
0228 #define RT1305_POW_POR_AVDD1_BIT 11
0229 #define RT1305_POW_POR_AVDD2 (1 << 10)
0230 #define RT1305_POW_POR_AVDD2_BIT 10
0231 #define RT1305_EN_K_HV (1 << 9)
0232 #define RT1305_EN_K_HV_BIT 9
0233 #define RT1305_EN_PRE_K_HV (1 << 8)
0234 #define RT1305_EN_PRE_K_HV_BIT 8
0235 #define RT1305_EN_EFUSE_1P8V (1 << 7)
0236 #define RT1305_EN_EFUSE_1P8V_BIT 7
0237 #define RT1305_EN_EFUSE_5V (1 << 6)
0238 #define RT1305_EN_EFUSE_5V_BIT 6
0239 #define RT1305_EN_VCM_6172 (1 << 5)
0240 #define RT1305_EN_VCM_6172_BIT 5
0241 #define RT1305_POR_EFUSE (1 << 4)
0242 #define RT1305_POR_EFUSE_BIT 4
0243
0244
0245 #define RT1305_SEL_CLK_DET_SRC_MASK (0x1 << 12)
0246 #define RT1305_SEL_CLK_DET_SRC_SFT 12
0247 #define RT1305_SEL_CLK_DET_SRC_MCLK (0x0 << 12)
0248 #define RT1305_SEL_CLK_DET_SRC_BCLK (0x1 << 12)
0249
0250
0251
0252 enum {
0253 RT1305_FS_SYS_PRE_S_MCLK,
0254 RT1305_FS_SYS_PRE_S_PLL1,
0255 RT1305_FS_SYS_PRE_S_RCCLK,
0256 };
0257
0258
0259 enum {
0260 RT1305_PLL1_S_BCLK,
0261 RT1305_PLL2_S_MCLK,
0262 RT1305_PLL2_S_RCCLK,
0263 };
0264
0265 enum {
0266 RT1305_AIF1,
0267 RT1305_AIFS
0268 };
0269
0270 #define R0_UPPER 0x2E8BA2
0271 #define R0_LOWER 0x666666
0272
0273 #endif