1 #ifndef __TAS2563_
2 #define __TAS2563_
4 #define TAS2563_DRIVER_ID "1.0.0"
6 #define TAS2563_YRAM_BOOK1 140
8 #define TAS2563_YRAM1_PAGE 42
9 #define TAS2563_YRAM1_START_REG 88
10 #define TAS2563_YRAM1_END_REG 127
12 #define TAS2563_YRAM2_START_PAGE 43
13 #define TAS2563_YRAM2_END_PAGE 49
14 #define TAS2563_YRAM2_START_REG 8
15 #define TAS2563_YRAM2_END_REG 127
17 #define TAS2563_YRAM3_PAGE 50
18 #define TAS2563_YRAM3_START_REG 8
19 #define TAS2563_YRAM3_END_REG 27
21 /* should not include B0_P53_R44-R47 */
22 #define TAS2563_YRAM_BOOK2 0
23 #define TAS2563_YRAM4_START_PAGE 50
24 #define TAS2563_YRAM4_END_PAGE 60
25 #define TAS2563_YRAM4_START_REG 8
26 #define TAS2563_YRAM4_END_REG 127
28 #define TAS2563_YRAM5_PAGE 61
29 #define TAS2563_YRAM5_START_REG 8
30 #define TAS2563_YRAM5_END_REG 27
32 struct TYCRC {
33 unsigned char mnOffset;
34 unsigned char mnLen;
35 };
38 /* Book Control Register (available in page0 of each book) */
39 #define TAS2563_BOOKCTL_PAGE 0
40 #define TAS2563_BOOKCTL_REG 127
42 #define TAS2563_REG(book, page, reg) ((((unsigned int)book * 256 * 128) + \
43 ((unsigned int)page * 128)) + reg)
45 /* Page */
46 #define TAS2563_Page TAS2563_REG(0x0, 0x0, 0x00)
47 #define TAS2563_Page_Page_Mask (0xff << 0)
50 #define TAS2563_BOOK_ID(reg) (reg / (256 * 128))
52 #define TAS2563_PAGE_ID(reg) ((reg % (256 * 128)) / 128)
54 #define TAS2563_BOOK_REG(reg) (reg % (256 * 128))
56 #define TAS2563_PAGE_REG(reg) ((reg % (256 * 128)) % 128)
59 /* Software Reset */
60 #define TAS2563_SoftwareReset TAS2563_REG(0x0, 0X0, 0x01)
61 #define TAS2563_SoftwareReset_SoftwareReset_Mask (0x1 << 0),
62 #define TAS2563_SoftwareReset_SoftwareReset_DontReset (0x0 << 0)
63 #define TAS2563_SoftwareReset_SoftwareReset_Reset (0x1 << 0)
65 /* Power Control */
66 #define TAS2563_PowerControl TAS2563_REG(0x0, 0x0, 0x02)
67 #define TAS2563_PowerControl_ISNSPower_Mask (0x1 << 3)
68 #define TAS2563_PowerControl_ISNSPower_Active (0x0 << 3)
69 #define TAS2563_PowerControl_ISNSPower_PoweredDown (0x1 << 3)
70 #define TAS2563_PowerControl_VSNSPower_Mask (0x1 << 2)
71 #define TAS2563_PowerControl_VSNSPower_Active (0x0 << 2)
72 #define TAS2563_PowerControl_VSNSPower_PoweredDown (0x1 << 2)
73 #define TAS2563_PowerControl_OperationalMode10_Mask (0x3 << 0)
74 #define TAS2563_PowerControl_OperationalMode10_Active (0x0 << 0)
75 #define TAS2563_PowerControl_OperationalMode10_Mute (0x1 << 0)
76 #define TAS2563_PowerControl_OperationalMode10_Shutdown (0x2 << 0)
78 /* data format */
79 #define TAS2563_DATAFORMAT_SHIFT 2
80 #define TAS2563_DATAFORMAT_I2S 0x0
81 #define TAS2563_DATAFORMAT_DSP 0x1
82 #define TAS2563_DATAFORMAT_RIGHT_J 0x2
83 #define TAS2563_DATAFORMAT_LEFT_J 0x3
85 #define TAS2563_DAI_FMT_MASK (0x7 << TAS2563_DATAFORMAT_SHIFT)
87 /* Playback Configuration Reg0 */
88 #define TAS2563_PlaybackConfigurationReg0 TAS2563_REG(0x0, 0x0, 0x03)
89 #define TAS2563_PlaybackConfigurationReg0_PDMPinMapping_Mask (0x1 << 7)
90 #define TAS2563_PlaybackConfigurationReg0_PDMPinMapping_Pdm0 (0x0 << 7)
91 #define TAS2563_PlaybackConfigurationReg0_PDMPinMapping_Pdm1 (0x1 << 7)
92 #define TAS2563_PlaybackConfigurationReg0_PlaybackPDMSource_Mask (0x1 << 6)
93 #define TAS2563_PlaybackConfigurationReg0_PlaybackSource_Mask (0x1 << 5)
94 #define TAS2563_PlaybackConfigurationReg0_PlaybackSource_Pcm (0x0 << 5)
95 #define TAS2563_PlaybackConfigurationReg0_PlaybackSource_Pdm (0x1 << 5)
96 #define TAS2563_PlaybackConfigurationReg0_AmplifierLevel40_Mask (0x1f << 1)
98 /* Misc Configuration Reg0 */
99 #define TAS2563_MiscConfigurationReg0 TAS2563_REG(0x0, 0x0, 0x04)
100 #define TAS2563_MiscConfigurationReg0_DVCRampRate76_Mask (0x3 << 6)
101 #define TAS2563_MiscConfigurationReg0_DVCRampRate76_0_5dbPer1Sample (0x0 << 6)
102 #define TAS2563_MiscConfigurationReg0_DVCRampRate76_0_5dbPer4Sample (0x1 << 6)
103 #define TAS2563_MiscConfigurationReg0_DVCRampRate76_0_5dbPer8Sample (0x2 << 6)
104 #define TAS2563_MiscConfigurationReg0_DVCRampRate76_VolRampDisabled (0x3 << 6)
105 #define TAS2563_MiscConfigurationReg0_OCERetry_Mask (0x1 << 5)
106 #define TAS2563_MiscConfigurationReg0_OCERetry_DoNotRetry (0x0 << 5)
107 #define TAS2563_MiscConfigurationReg0_OCERetry_Retry (0x1 << 5)
108 #define TAS2563_MiscConfigurationReg0_OTERetry_Mask (0x1 << 4)
109 #define TAS2563_MiscConfigurationReg0_OTERetry_DoNotRetry (0x0 << 4)
110 #define TAS2563_MiscConfigurationReg0_OTERetry_Retry (0x1 << 4)
111 #define TAS2563_MiscConfigurationReg0_IRQZPull_Mask (0x1 << 3)
112 #define TAS2563_MiscConfigurationReg0_IRQZPull_Disabled (0x0 << 3)
113 #define TAS2563_MiscConfigurationReg0_IRQZPull_Enabled (0x1 << 3)
114 #define TAS2563_MiscConfigurationReg0_AMPSS_Mask (0x1 << 2)
115 #define TAS2563_MiscConfigurationReg0_AMPSS_Disabled (0x0 << 2)
116 #define TAS2563_MiscConfigurationReg0_AMPSS_Enabled (0x1 << 2)
119 /* TDM Configuration Reg0 */
120 #define TAS2563_TDMConfigurationReg0 TAS2563_REG(0x0, 0x0, 0x06)
121 #define TAS2563_TDMConfigurationReg0_SAMPRATERAMP_Mask (0x1 << 5)
122 #define TAS2563_TDMConfigurationReg0_SAMPRATERAMP_48KHz (0x0 << 5)
123 #define TAS2563_TDMConfigurationReg0_SAMPRATERAMP_44_1KHz (0x1 << 5)
124 #define TAS2563_TDMConfigurationReg0_DETECTSAMPRATE_Mask (0x1 << 4)
125 #define TAS2563_TDMConfigurationReg0_DETECTSAMPRATE_Disabled (0x1 << 4)
126 #define TAS2563_TDMConfigurationReg0_DETECTSAMPRATE_Enabled (0x0 << 4)
127 #define TAS2563_TDMConfigurationReg0_SAMPRATE31_Mask (0x7 << 1)
128 #define TAS2563_TDMConfigurationReg0_SAMPRATE31_44_1_48kHz (0x4 << 1)
129 #define TAS2563_TDMConfigurationReg0_SAMPRATE31_88_2_96kHz (0x5 << 1)
130 #define TAS2563_TDMConfigurationReg0_SAMPRATE31_176_4_192kHz (0x6 << 1)
131 #define TAS2563_TDMConfigurationReg0_FRAMESTART_Mask (0x1 << 0)
132 #define TAS2563_TDMConfigurationReg0_FRAMESTART_LowToHigh (0x0 << 0)
133 #define TAS2563_TDMConfigurationReg0_FRAMESTART_HighToLow (0x1 << 0)
135 /* TDM Configuration Reg1 */
136 #define TAS2563_TDMConfigurationReg1 TAS2563_REG(0x0, 0x0, 0x07)
137 #define TAS2563_TDMConfigurationReg1_RXJUSTIFY_Mask (0x1 << 6)
138 #define TAS2563_TDMConfigurationReg1_RXJUSTIFY_Left (0x0 << 6)
139 #define TAS2563_TDMConfigurationReg1_RXJUSTIFY_Right (0x1 << 6)
140 #define TAS2563_TDMConfigurationReg1_RXOFFSET51_Mask (0x1f << 1)
141 #define TAS2563_TDMConfigurationReg1_RXOFFSET51_Shift (1)
142 #define TAS2563_TDMConfigurationReg1_RXEDGE_Mask (0x1 << 0)
143 #define TAS2563_TDMConfigurationReg1_RXEDGE_Rising (0x0 << 0)
144 #define TAS2563_TDMConfigurationReg1_RXEDGE_Falling (0x1 << 0)
146 /* TDM Configuration Reg2 */
147 #define TAS2563_TDMConfigurationReg2 TAS2563_REG(0x0, 0x0, 0x08)
148 #define TAS2563_TDMConfigurationReg2_RXSCFG54_Mask (0x3 << 4)
149 #define TAS2563_TDMConfigurationReg2_RXSCFG54_Mono_I2C (0x0 << 4)
150 #define TAS2563_TDMConfigurationReg2_RXSCFG54_Mono_Left (0x1 << 4)
151 #define TAS2563_TDMConfigurationReg2_RXSCFG54_Mono_Right (0x2 << 4)
152 #define TAS2563_TDMConfigurationReg2_RXSCFG54_Stereo_DownMix (0x3 << 4)
153 #define TAS2563_TDMConfigurationReg2_RXWLEN32_Mask (0x3 << 2)
154 #define TAS2563_TDMConfigurationReg2_RXWLEN32_16Bits (0x0 << 2)
155 #define TAS2563_TDMConfigurationReg2_RXWLEN32_20Bits (0x1 << 2)
156 #define TAS2563_TDMConfigurationReg2_RXWLEN32_24Bits (0x2 << 2)
157 #define TAS2563_TDMConfigurationReg2_RXWLEN32_32Bits (0x3 << 2)
158 #define TAS2563_TDMConfigurationReg2_RXSLEN10_Mask (0x3 << 0)
159 #define TAS2563_TDMConfigurationReg2_RXSLEN10_16Bits (0x0 << 0)
160 #define TAS2563_TDMConfigurationReg2_RXSLEN10_24Bits (0x1 << 0)
161 #define TAS2563_TDMConfigurationReg2_RXSLEN10_32Bits (0x2 << 0)
163 /* TDM Configuration Reg3 */
164 #define TAS2563_TDMConfigurationReg3 TAS2563_REG(0x0, 0x0, 0x09)
165 #define TAS2563_TDMConfigurationReg3_RXSLOTRight74_Mask (0xf << 4)
166 #define TAS2563_TDMConfigurationReg3_RXSLOTRight74_Shift 4
167 #define TAS2563_TDMConfigurationReg3_RXSLOTLeft30_Mask (0xf << 0)
168 #define TAS2563_TDMConfigurationReg3_RXSLOTLeft30_Shift 0
170 /* TDM Configuration Reg4 */
171 #define TAS2563_TDMConfigurationReg4 TAS2563_REG(0x0, 0x0, 0x0a)
172 #define TAS2563_TDMConfigurationReg4_TXKEEPER_Mask (0x1 << 5)
173 #define TAS2563_TDMConfigurationReg4_TXKEEPER_Disable (0x0 << 5)
174 #define TAS2563_TDMConfigurationReg4_TXKEEPER_Enable (0x1 << 5)
175 #define TAS2563_TDMConfigurationReg4_TXFILL_Mask (0x1 << 4)
176 #define TAS2563_TDMConfigurationReg4_TXFILL_Transmit0 (0x0 << 4)
177 #define TAS2563_TDMConfigurationReg4_TXFILL_TransmitHiz (0x1 << 4)
178 #define TAS2563_TDMConfigurationReg4_TXOFFSET31_Mask (0x7 << 1)
179 #define TAS2563_TDMConfigurationReg4_TXEDGE_Mask (0x1 << 0)
180 #define TAS2563_TDMConfigurationReg4_TXEDGE_Rising (0x0 << 0)
181 #define TAS2563_TDMConfigurationReg4_TXEDGE_Falling (0x1 << 0)
183 /* TDM Configuration Reg5 */
184 #define TAS2563_TDMConfigurationReg5 TAS2563_REG(0x0, 0x0, 0x0b)
185 #define TAS2563_TDMConfigurationReg5_VSNSTX_Mask (0x1 << 6)
186 #define TAS2563_TDMConfigurationReg5_VSNSTX_Disable (0x0 << 6)
187 #define TAS2563_TDMConfigurationReg5_VSNSTX_Enable (0x1 << 6)
188 #define TAS2563_TDMConfigurationReg5_VSNSSLOT50_Mask (0x3f << 0)
190 /* TDM Configuration Reg6 */
191 #define TAS2563_TDMConfigurationReg6 TAS2563_REG(0x0, 0x0, 0xc)
192 #define TAS2563_TDMConfigurationReg6_ISNSTX_Mask (0x1 << 6)
193 #define TAS2563_TDMConfigurationReg6_ISNSTX_Disable (0x0 << 6)
194 #define TAS2563_TDMConfigurationReg6_ISNSTX_Enable (0x1 << 6)
195 #define TAS2563_TDMConfigurationReg6_ISNSSLOT50_Mask (0x3f << 0)
197 /* TDM Configuration Reg7 */
198 #define TAS2563_TDMConfigurationReg7 TAS2563_REG(0x0, 0x0, 0x0d)
199 #define TAS2563_TDMConfigurationReg7_PDMTX_Mask (0x1 << 6)
200 #define TAS2563_TDMConfigurationReg7_PDMTX_Disable (0x0 << 6)
201 #define TAS2563_TDMConfigurationReg7_PDMTX_Enable (0x1 << 6)
202 #define TAS2563_TDMConfigurationReg7_PDMSLOT50_Mask (0x3f << 0)
204 /* TDM Configuration Reg8 */
205 #define TAS2563_TDMConfigurationReg8 TAS2563_REG(0x0, 0x0, 0x0e)
206 #define TAS2563_TDMConfigurationReg8_VBATSLEN_Mask (0x1 << 7)
207 #define TAS2563_TDMConfigurationReg8_VBATSLEN_8Bits (0x0 << 7)
208 #define TAS2563_TDMConfigurationReg8_VBATSLEN_16Bits (0x1 << 7)
209 #define TAS2563_TDMConfigurationReg8_VBATTX_Mask (0x1 << 6)
210 #define TAS2563_TDMConfigurationReg8_VBATTX_Disable (0x0 << 6)
211 #define TAS2563_TDMConfigurationReg8_VBATTX_Enable (0x1 << 6)
212 #define TAS2563_TDMConfigurationReg8_VBATSLOT50_Mask (0x3f << 0)
214 /* TDM Configuration Reg9 */
215 #define TAS2563_TDMConfigurationReg9 TAS2563_REG(0x0, 0x0, 0xf)
216 #define TAS2563_TDMConfigurationReg9_TEMPTX_Mask (0x1 << 6)
217 #define TAS2563_TDMConfigurationReg9_TEMPTX_Disable (0x0 << 6)
218 #define TAS2563_TDMConfigurationReg9_TEMPTX_Enable (0x1 << 6)
219 #define TAS2563_TDMConfigurationReg9_TEMPSLOT50_Mask (0x3f << 0)
221 /* TDM Configuration Reg10 */
222 #define TAS2563_TDMConfigurationReg10 TAS2563_REG(0x0, 0x0, 0x10)
223 #define TAS2563_TDMConfigurationReg10_GAINTX_Mask (0x1 << 6)
224 #define TAS2563_TDMConfigurationReg10_GAINTX_Disable (0x0 << 6)
225 #define TAS2563_TDMConfigurationReg10_GAINTX_Enable (0x1 << 6)
226 #define TAS2563_TDMConfigurationReg10_GAINSLOT50_Mask (0x3f << 0)
228 /* Limiter Configuration Reg0 */
229 #define TAS2563_LimiterConfigurationReg0 TAS2563_REG(0x0, 0x0, 0x12)
230 #define TAS2563_LimiterConfigurationReg0_LIMATKST54_Mask (0x3 << 4)
231 #define TAS2563_LimiterConfigurationReg0_LIMATKST54_1 (0x2 << 4)
232 #define TAS2563_LimiterConfigurationReg0_LIMATKST54_2 (0x3 << 4)
233 #define TAS2563_LimiterConfigurationReg0_LIMATKST54_0_25 (0x0 << 4)
234 #define TAS2563_LimiterConfigurationReg0_LIMATKST54_0_5 (0x1 << 4)
235 #define TAS2563_LimiterConfigurationReg0_LIMATKRT31_Mask (0x7 << 1)
236 #define TAS2563_LimiterConfigurationReg0_LIMATKRT31_5 (0x0 << 1)
237 #define TAS2563_LimiterConfigurationReg0_LIMATKRT31_10 (0x1 << 1)
238 #define TAS2563_LimiterConfigurationReg0_LIMATKRT31_20 (0x2 << 1)
239 #define TAS2563_LimiterConfigurationReg0_LIMATKRT31_40 (0x3 << 1)
240 #define TAS2563_LimiterConfigurationReg0_LIMATKRT31_80 (0x4 << 1)
241 #define TAS2563_LimiterConfigurationReg0_LIMATKRT31_160 (0x5 << 1)
242 #define TAS2563_LimiterConfigurationReg0_LIMATKRT31_320 (0x6 << 1)
243 #define TAS2563_LimiterConfigurationReg0_LIMATKRT31_640 (0x7 << 1)
244 #define TAS2563_LimiterConfigurationReg0_LIMEN_Mask (0x1 << 0)
245 #define TAS2563_LimiterConfigurationReg0_LIMEN_Disabled (0x0 << 0)
246 #define TAS2563_LimiterConfigurationReg0_LIMEN_Enabled (0x1 << 0)
248 /* Limiter Configuration Reg1 */
249 #define TAS2563_LimiterConfigurationReg1 TAS2563_REG(0x0, 0x0, 0x13)
250 #define TAS2563_LimiterConfigurationReg1_LIMRLSST76_Mask (0x3 << 6)
251 #define TAS2563_LimiterConfigurationReg1_LIMRLSST76_1 (0x2 << 6)
252 #define TAS2563_LimiterConfigurationReg1_LIMRLSST76_2 (0x3 << 6)
253 #define TAS2563_LimiterConfigurationReg1_LIMRLSST76_0_25 (0x0 << 6)
254 #define TAS2563_LimiterConfigurationReg1_LIMRLSST76_0_5 (0x1 << 6)
255 #define TAS2563_LimiterConfigurationReg1_LIMRLSRT53_Mask (0x7 << 3)
256 #define TAS2563_LimiterConfigurationReg1_LIMRLSRT53_10 (0x0 << 3)
257 #define TAS2563_LimiterConfigurationReg1_LIMRLSRT53_50 (0x1 << 3)
258 #define TAS2563_LimiterConfigurationReg1_LIMRLSRT53_100 (0x2 << 3)
259 #define TAS2563_LimiterConfigurationReg1_LIMRLSRT53_250 (0x3 << 3)
260 #define TAS2563_LimiterConfigurationReg1_LIMRLSRT53_500 (0x4 << 3)
261 #define TAS2563_LimiterConfigurationReg1_LIMRLSRT53_750 (0x5 << 3)
262 #define TAS2563_LimiterConfigurationReg1_LIMRLSRT53_1000 (0x6 << 3)
263 #define TAS2563_LimiterConfigurationReg1_LIMRLSRT53_1500 (0x7 << 3)
264 #define TAS2563_LimiterConfigurationReg1_LIMHLDTM20_Mask (0x7 << 0)
265 #define TAS2563_LimiterConfigurationReg1_LIMHLDTM20_0 (0x0 << 0)
266 #define TAS2563_LimiterConfigurationReg1_LIMHLDTM20_10 (0x1 << 0)
267 #define TAS2563_LimiterConfigurationReg1_LIMHLDTM20_25 (0x2 << 0)
268 #define TAS2563_LimiterConfigurationReg1_LIMHLDTM20_50 (0x3 << 0)
269 #define TAS2563_LimiterConfigurationReg1_LIMHLDTM20_100 (0x4 << 0)
270 #define TAS2563_LimiterConfigurationReg1_LIMHLDTM20_250 (0x5 << 0)
271 #define TAS2563_LimiterConfigurationReg1_LIMHLDTM20_500 (0x6 << 0)
272 #define TAS2563_LimiterConfigurationReg1_LIMHLDTM20_1000 (0x7 << 0)
274 /* Brown Out Prevention Reg0 */
275 #define TAS2563_BrownOutPreventionReg0 TAS2563_REG(0x0, 0x0, 0x1B)
276 #define TAS2563_BrownOutPreventionReg0_LIMSLOPE54_Mask (0x3 << 4)
277 #define TAS2563_BrownOutPreventionReg0_LIMSLOPE54_1 (0x0 << 4)
278 #define TAS2563_BrownOutPreventionReg0_LIMSLOPE54_2 (0x2 << 4)
279 #define TAS2563_BrownOutPreventionReg0_LIMSLOPE54_4 (0x3 << 4)
280 #define TAS2563_BrownOutPreventionReg0_LIMSLOPE54_1_5 (0x1 << 4)
281 #define TAS2563_BrownOutPreventionReg0_BOPHLDCLR_Mask (0x1 << 3)
282 #define TAS2563_BrownOutPreventionReg0_BOPHLDCLR_DontClear (0x0 << 3)
283 #define TAS2563_BrownOutPreventionReg0_BOPHLDCLR_Clear (0x1 << 3)
284 #define TAS2563_BrownOutPreventionReg0_BOPINFHLD_Mask (0x1 << 2)
285 #define TAS2563_BrownOutPreventionReg0_BOPINFHLD_UseHoldTime (0x0 << 2)
286 #define TAS2563_BrownOutPreventionReg0_BOPINFHLD_HoldUntilCleared (0x1 << 2)
287 #define TAS2563_BrownOutPreventionReg0_BOPMUTE_Mask (0x1 << 1)
288 #define TAS2563_BrownOutPreventionReg0_BOPMUTE_DoNotMute (0x0 << 1)
289 #define TAS2563_BrownOutPreventionReg0_BOPMUTE_Mute (0x1 << 1)
290 #define TAS2563_BrownOutPreventionReg0_BOPEN_Mask (0x1 << 0)
291 #define TAS2563_BrownOutPreventionReg0_BOPEN_Disabled (0x0 << 0)
292 #define TAS2563_BrownOutPreventionReg0_BOPEN_Enabled (0x1 << 0)
294 /* Brown Out Prevention Reg1 */
295 #define TAS2563_BrownOutPreventionReg1 TAS2563_REG(0x0, 0x0, 0x1C)
296 #define TAS2563_BrownOutPreventionReg1_BOPTH70_Mask (0xff << 0)
298 /* Brown Out Prevention Reg2 */
299 #define TAS2563_BrownOutPreventionReg2 TAS2563_REG(0x0, 0x0, 0x1D)
300 #define TAS2563_BrownOutPreventionReg2_BOPATKRT75_Mask (0x7 << 5)
301 #define TAS2563_BrownOutPreventionReg2_BOPATKRT75_5 (0x0 << 5)
302 #define TAS2563_BrownOutPreventionReg2_BOPATKRT75_10 (0x1 << 5)
303 #define TAS2563_BrownOutPreventionReg2_BOPATKRT75_20 (0x2 << 5)
304 #define TAS2563_BrownOutPreventionReg2_BOPATKRT75_40 (0x3 << 5)
305 #define TAS2563_BrownOutPreventionReg2_BOPATKRT75_80 (0x4 << 5)
306 #define TAS2563_BrownOutPreventionReg2_BOPATKRT75_160 (0x5 << 5)
307 #define TAS2563_BrownOutPreventionReg2_BOPATKRT75_320 (0x6 << 5)
308 #define TAS2563_BrownOutPreventionReg2_BOPATKRT75_640 (0x7 << 5)
309 #define TAS2563_BrownOutPreventionReg2_BOPATKST43_Mask (0x3 << 3)
310 #define TAS2563_BrownOutPreventionReg2_BOPATKST43_1 (0x1 << 3)
311 #define TAS2563_BrownOutPreventionReg2_BOPATKST43_2 (0x3 << 3)
312 #define TAS2563_BrownOutPreventionReg2_BOPATKST43_0_5 (0x0 << 3)
313 #define TAS2563_BrownOutPreventionReg2_BOPATKST43_1_5 (0x2 << 3)
314 #define TAS2563_BrownOutPreventionReg2_BOPHLDTM20_Mask (0x7 << 0)
315 #define TAS2563_BrownOutPreventionReg2_BOPHLDTM20_0 (0x0 << 0)
316 #define TAS2563_BrownOutPreventionReg2_BOPHLDTM20_10 (0x1 << 0)
317 #define TAS2563_BrownOutPreventionReg2_BOPHLDTM20_25 (0x2 << 0)
318 #define TAS2563_BrownOutPreventionReg2_BOPHLDTM20_50 (0x3 << 0)
319 #define TAS2563_BrownOutPreventionReg2_BOPHLDTM20_100 (0x4 << 0)
320 #define TAS2563_BrownOutPreventionReg2_BOPHLDTM20_250 (0x5 << 0)
321 #define TAS2563_BrownOutPreventionReg2_BOPHLDTM20_500 (0x6 << 0)
322 #define TAS2563_BrownOutPreventionReg2_BOPHLDTM20_1000 (0x7 << 0)
324 /* ICLA Reg0 */
325 #define TAS2563_ICLAReg0 TAS2563_REG(0x0, 0x0, 0x1E)
326 #define TAS2563_ICLAReg0_ICLAUSEMAX_Mask (0x1 << 7)
327 #define TAS2563_ICLAReg0_ICLAUSEMAX_Min (0x0 << 7)
328 #define TAS2563_ICLAReg0_ICLAUSEMAX_Max (0x1 << 7)
329 #define TAS2563_ICLAReg0_ICLASLOT61_Mask (0x3f << 1)
330 #define TAS2563_ICLAReg0_ICLAEN_Mask (0x1 << 0)
331 #define TAS2563_ICLAReg0_ICLAEN_Disabled (0x0 << 0)
332 #define TAS2563_ICLAReg0_ICLAEN_Enabled (0x1 << 0)
334 /* ICLA Reg1 */
335 #define TAS2563_ICLAReg1 TAS2563_REG(0x0, 0x0, 0x1F)
336 #define TAS2563_ICLAReg1_ICLASEN_Mask (0xff << 0)
337 #define TAS2563_ICLAReg1_ICLASLOT_7_Disable (0x0 << 7)
338 #define TAS2563_ICLAReg1_ICLASLOT_7_Enable (0x1 << 7)
339 #define TAS2563_ICLAReg1_ICLASLOT_6_Disable (0x0 << 6)
340 #define TAS2563_ICLAReg1_ICLASLOT_6_Enable (0x1 << 6)
341 #define TAS2563_ICLAReg1_ICLASLOT_5_Disable (0x0 << 5)
342 #define TAS2563_ICLAReg1_ICLASLOT_5_Enable (0x1 << 5)
343 #define TAS2563_ICLAReg1_ICLASLOT_4_Disable (0x0 << 4)
344 #define TAS2563_ICLAReg1_ICLASLOT_4_Enable (0x1 << 4)
345 #define TAS2563_ICLAReg1_ICLASLOT_3_Disable (0x0 << 3)
346 #define TAS2563_ICLAReg1_ICLASLOT_3_Enable (0x1 << 3)
347 #define TAS2563_ICLAReg1_ICLASLOT_2_Disable (0x0 << 2)
348 #define TAS2563_ICLAReg1_ICLASLOT_2_Enable (0x1 << 2)
349 #define TAS2563_ICLAReg1_ICLASLOT_1_Disable (0x0 << 1)
350 #define TAS2563_ICLAReg1_ICLASLOT_1_Enable (0x1 << 1)
351 #define TAS2563_ICLAReg1_ICLASLOT_0_Disable (0x0 << 0)
352 #define TAS2563_ICLAReg1_ICLASLOT_0_Enable (0x1 << 0)
354 /* Interrupt Mask Reg0 */
355 #define TAS2563_InterruptMaskReg0 TAS2563_REG(0x0, 0x0, 0x1a)
356 #define TAS2563_InterruptMaskReg0_LIMMUTEINTMASK_Mask (0x1 << 7)
357 #define TAS2563_InterruptMaskReg0_LIMMUTEINTMASK_Unmask (0x0 << 7)
358 #define TAS2563_InterruptMaskReg0_LIMMUTEINTMASK_Disable (0x1 << 7)
359 #define TAS2563_InterruptMaskReg0_LIMINFHLDINTMASK_Mask (0x1 << 6)
360 #define TAS2563_InterruptMaskReg0_LIMINFHLDINTMASK_Unmask (0x0 << 6)
361 #define TAS2563_InterruptMaskReg0_LIMINFHLDINTMASK_Disable (0x1 << 6)
362 #define TAS2563_InterruptMaskReg0_LIMMAXATNINTMASK_Mask (0x1 << 5)
363 #define TAS2563_InterruptMaskReg0_LIMMAXATNINTMASK_Unmask (0x0 << 5)
364 #define TAS2563_InterruptMaskReg0_LIMMAXATNINTMASK_Disable (0x1 << 5)
365 #define TAS2563_InterruptMaskReg0_VBATLessthanINFINTMASK_Mask (0x1 << 4)
366 #define TAS2563_InterruptMaskReg0_VBATLessthanINFINTMASK_Unmask (0x0 << 4)
367 #define TAS2563_InterruptMaskReg0_VBATLessthanINFINTMASK_Disable (0x1 << 4)
368 #define TAS2563_InterruptMaskReg0_LIMActiveFlagINTMASK_Mask (0x1 << 3)
369 #define TAS2563_InterruptMaskReg0_LIMActiveFlagINTMASK_Unmask (0x0 << 3)
370 #define TAS2563_InterruptMaskReg0_LIMActiveFlagINTMASK_Disable (0x1 << 3)
371 #define TAS2563_InterruptMaskReg0_TDMClockErrorINTMASK_Mask (0x1 << 2)
372 #define TAS2563_InterruptMaskReg0_TDMClockErrorINTMASK_Unmask (0x0 << 2)
373 #define TAS2563_InterruptMaskReg0_TDMClockErrorINTMASK_Disable (0x1 << 2)
374 #define TAS2563_InterruptMaskReg0_OCEINTMASK_Mask (0x1 << 1)
375 #define TAS2563_InterruptMaskReg0_OCEINTMASK_Unmask (0x0 << 1)
376 #define TAS2563_InterruptMaskReg0_OCEINTMASK_Disable (0x1 << 1)
377 #define TAS2563_InterruptMaskReg0_OTEINTMASK_Mask (0x1 << 0)
378 #define TAS2563_InterruptMaskReg0_OTEINTMASK_Unmask (0x0 << 0)
379 #define TAS2563_InterruptMaskReg0_OTEINTMASK_Disable (0x1 << 0)
380 #define TAS2563_InterruptMaskReg0_Disable 0xff
382 /* Interrupt Mask Reg1 */
383 #define TAS2563_InterruptMaskReg1 TAS2563_REG(0x0, 0x0, 0x1b)
384 #define TAS2563_InterruptMaskReg1_PDMAUDDATAINVALIDINTMASK_Mask (0x1 << 7)
385 #define TAS2563_InterruptMaskReg1_PDMAUDDATAINVALIDINTMASK_Unmask (0x0 << 7)
386 #define TAS2563_InterruptMaskReg1_PDMAUDDATAINVALIDINTMASK_Disable (0x1 << 7)
387 #define TAS2563_InterruptMaskReg1_VBATOVLOINTMASK_Mask (0x1 << 3)
388 #define TAS2563_InterruptMaskReg1_VBATOVLOINTMASK_Unmask (0x0 << 3)
389 #define TAS2563_InterruptMaskReg1_VBATOVLOINTMASK_Disable (0x1 << 3)
390 #define TAS2563_InterruptMaskReg1_VBATUVLOINTMASK_Mask (0x1 << 2)
391 #define TAS2563_InterruptMaskReg1_VBATUVLOINTMASK_Unmask (0x0 << 2)
392 #define TAS2563_InterruptMaskReg1_VBATUVLOINTMASK_Disable (0x1 << 2)
393 #define TAS2563_InterruptMaskReg1_BrownOutFlagINTMASK_Mask (0x1 << 1)
394 #define TAS2563_InterruptMaskReg1_BrownOutFlagINTMASK_Unmask (0x0 << 1)
395 #define TAS2563_InterruptMaskReg1_BrownOutFlagINTMASK_Disable (0x1 << 1)
396 #define TAS2563_InterruptMaskReg1_PDMClockErrorINTMASK_Mask (0x1 << 0)
397 #define TAS2563_InterruptMaskReg1_PDMClockErrorINTMASK_Unmask (0x0 << 0)
398 #define TAS2563_InterruptMaskReg1_PDMClockErrorINTMASK_Disable (0x1 << 0)
399 #define TAS2563_InterruptMaskReg1_Disable 0xff
401 /* Live-Interrupt Reg0 */
402 #define TAS2563_LiveInterruptReg0 TAS2563_REG(0x0, 0x0, 0x1f)
403 #define TAS2563_LiveInterruptReg0_LIMMUTE_Mask (0x1 << 7)
404 #define TAS2563_LiveInterruptReg0_LIMMUTE_NoInterrupt (0x0 << 7)
405 #define TAS2563_LiveInterruptReg0_LIMMUTE_Interrupt (0x1 << 7)
406 #define TAS2563_LiveInterruptReg0_LIMINFHLD_Mask (0x1 << 6)
407 #define TAS2563_LiveInterruptReg0_LIMINFHLD_NoInterrupt (0x0 << 6)
408 #define TAS2563_LiveInterruptReg0_LIMINFHLD_Interrupt (0x1 << 6)
409 #define TAS2563_LiveInterruptReg0_LIMMAXATN_Mask (0x1 << 5)
410 #define TAS2563_LiveInterruptReg0_LIMMAXATN_NoInterrupt (0x0 << 5)
411 #define TAS2563_LiveInterruptReg0_LIMMAXATN_Interrupt (0x1 << 5)
412 #define TAS2563_LiveInterruptReg0_VBATLessthanINF_Mask (0x1 << 4)
413 #define TAS2563_LiveInterruptReg0_VBATLessthanINF_NoInterrupt (0x0 << 4)
414 #define TAS2563_LiveInterruptReg0_VBATLessthanINF_Interrupt (0x1 << 4)
415 #define TAS2563_LiveInterruptReg0_LIMActiveFlag_Mask (0x1 << 3)
416 #define TAS2563_LiveInterruptReg0_LIMActiveFlag_NoInterrupt (0x0 << 3)
417 #define TAS2563_LiveInterruptReg0_LIMActiveFlag_Interrupt (0x1 << 3)
418 #define TAS2563_LiveInterruptReg0_TDMClockError_Mask (0x1 << 2)
419 #define TAS2563_LiveInterruptReg0_TDMClockError_NoInterrupt (0x0 << 2)
420 #define TAS2563_LiveInterruptReg0_TDMClockError_Interrupt (0x1 << 2)
421 #define TAS2563_LiveInterruptReg0_OCEFlag_Mask (0x1 << 1)
422 #define TAS2563_LiveInterruptReg0_OCEFlag_NoInterrupt (0x0 << 1)
423 #define TAS2563_LiveInterruptReg0_OCEFlag_Interrupt (0x1 << 1)
424 #define TAS2563_LiveInterruptReg0_OTEFlag_Mask (0x1 << 0)
425 #define TAS2563_LiveInterruptReg0_OTEFlag_NoInterrupt (0x0 << 0)
426 #define TAS2563_LiveInterruptReg0_OTEFlag_Interrupt (0x1 << 0)
428 /* Live-Interrupt Reg1 */
429 #define TAS2563_LiveInterruptReg1 TAS2563_REG(0x0, 0x0, 0x20)
430 #define TAS2563_LiveInterruptReg1_PDMAUDDATAINVALID_Mask (0x1 << 7)
431 #define TAS2563_LiveInterruptReg1_PDMAUDDATAINVALID_NoInterrupt (0x0 << 7)
432 #define TAS2563_LiveInterruptReg1_PDMAUDDATAINVALID_Interrupt (0x1 << 7)
433 #define TAS2563_LiveInterruptReg1_VBATOVLO_Mask (0x1 << 3)
434 #define TAS2563_LiveInterruptReg1_VBATOVLO_NoInterrupt (0x0 << 3)
435 #define TAS2563_LiveInterruptReg1_VBATOVLO_Interrupt (0x1 << 3)
436 #define TAS2563_LiveInterruptReg1_VBATUVLO_Mask (0x1 << 2)
437 #define TAS2563_LiveInterruptReg1_VBATUVLO_NoInterrupt (0x0 << 2)
438 #define TAS2563_LiveInterruptReg1_VBATUVLO_Interrupt (0x1 << 2)
439 #define TAS2563_LiveInterruptReg1_BrownOutFlag_Mask (0x1 << 1)
440 #define TAS2563_LiveInterruptReg1_BrownOutFlag_NoInterrupt (0x0 << 1)
441 #define TAS2563_LiveInterruptReg1_BrownOutFlag_Interrupt (0x1 << 1)
442 #define TAS2563_LiveInterruptReg1_PDMClockError_Mask (0x1 << 0)
443 #define TAS2563_LiveInterruptReg1_PDMClockError_NoInterrupt (0x0 << 0)
444 #define TAS2563_LiveInterruptReg1_PDMClockError_Interrupt (0x1 << 0)
446 /* Latched-Interrupt Reg0 */
447 #define TAS2563_LatchedInterruptReg0 TAS2563_REG(0x0, 0x0, 0x24)
448 #define TAS2563_LatchedInterruptReg0_LIMMUTESticky_Mask (0x1 << 7)
449 #define TAS2563_LatchedInterruptReg0_LIMMUTESticky_NoInterrupt (0x0 << 7)
450 #define TAS2563_LatchedInterruptReg0_LIMMUTESticky_Interrupt (0x1 << 7)
451 #define TAS2563_LatchedInterruptReg0_LIMINFHLDSticky_Mask (0x1 << 6)
452 #define TAS2563_LatchedInterruptReg0_LIMINFHLDSticky_NoInterrupt (0x0 << 6)
453 #define TAS2563_LatchedInterruptReg0_LIMINFHLDSticky_Interrupt (0x1 << 6)
454 #define TAS2563_LatchedInterruptReg0_LIMMAXATNSticky_Mask (0x1 << 5)
455 #define TAS2563_LatchedInterruptReg0_LIMMAXATNSticky_NoInterrupt (0x0 << 5)
456 #define TAS2563_LatchedInterruptReg0_LIMMAXATNSticky_Interrupt (0x1 << 5)
457 #define TAS2563_LatchedInterruptReg0_VBATLessthanINFSticky_Mask (0x1 << 4)
458 #define TAS2563_LatchedInterruptReg0_VBATLessthanINFSticky_NoInterrupt \
459 (0x0 << 4)
460 #define TAS2563_LatchedInterruptReg0_VBATLessthanINFSticky_Interrupt (0x1 << 4)
461 #define TAS2563_LatchedInterruptReg0_LIMActiveFlagSticky_Mask (0x1 << 3)
462 #define TAS2563_LatchedInterruptReg0_LIMActiveFlagSticky_NoInterrupt (0x0 << 3)
463 #define TAS2563_LatchedInterruptReg0_LIMActiveFlagSticky_Interrupt (0x1 << 3)
464 #define TAS2563_LatchedInterruptReg0_TDMClockErrorSticky_Mask (0x1 << 2)
465 #define TAS2563_LatchedInterruptReg0_TDMClockErrorSticky_NoInterrupt (0x0 << 2)
466 #define TAS2563_LatchedInterruptReg0_TDMClockErrorSticky_Interrupt (0x1 << 2)
467 #define TAS2563_LatchedInterruptReg0_OCEFlagSticky_Mask (0x1 << 1)
468 #define TAS2563_LatchedInterruptReg0_OCEFlagSticky_NoInterrupt (0x0 << 1)
469 #define TAS2563_LatchedInterruptReg0_OCEFlagSticky_Interrupt (0x1 << 1)
470 #define TAS2563_LatchedInterruptReg0_OTEFlagSticky_Mask (0x1 << 0)
471 #define TAS2563_LatchedInterruptReg0_OTEFlagSticky_NoInterrupt (0x0 << 0)
472 #define TAS2563_LatchedInterruptReg0_OTEFlagSticky_Interrupt (0x1 << 0)
474 /* Latched-Interrupt Reg1 */
475 #define TAS2563_LatchedInterruptReg1 TAS2563_REG(0x0, 0x0, 0x25)
476 #define TAS2563_LatchedInterruptReg1_PDMAUDDATAINVALIDSticky_Mask (0x1 << 7)
477 #define TAS2563_LatchedInterruptReg1_PDMAUDDATAINVALIDSticky_NoInterrupt \
478 (0x0 << 7)
479 #define TAS2563_LatchedInterruptReg1_PDMAUDDATAINVALIDSticky_Interrupt \
480 (0x1 << 7)
481 #define TAS2563_LatchedInterruptReg1_VBATOVLOSticky_Mask (0x1 << 3)
482 #define TAS2563_LatchedInterruptReg1_VBATOVLOSticky_NoInterrupt (0x0 << 3)
483 #define TAS2563_LatchedInterruptReg1_VBATOVLOSticky_Interrupt (0x1 << 3)
484 #define TAS2563_LatchedInterruptReg1_VBATUVLOSticky_Mask (0x1 << 2)
485 #define TAS2563_LatchedInterruptReg1_VBATUVLOSticky_NoInterrupt (0x0 << 2)
486 #define TAS2563_LatchedInterruptReg1_VBATUVLOSticky_Interrupt (0x1 << 2)
487 #define TAS2563_LatchedInterruptReg1_BrownOutFlagSticky_Mask (0x1 << 1)
488 #define TAS2563_LatchedInterruptReg1_BrownOutFlagSticky_NoInterrupt (0x0 << 1)
489 #define TAS2563_LatchedInterruptReg1_BrownOutFlagSticky_Interrupt (0x1 << 1)
490 #define TAS2563_LatchedInterruptReg1_PDMClockErrorSticky_Mask (0x1 << 0)
491 #define TAS2563_LatchedInterruptReg1_PDMClockErrorSticky_NoInterrupt (0x0 << 0)
492 #define TAS2563_LatchedInterruptReg1_PDMClockErrorSticky_Interrupt (0x1 << 0)
494 /* VBAT MSB */
495 #define TAS2563_VBATMSB TAS2563_REG(0x0, 0x0, 0x27)
496 #define TAS2563_VBATMSB_VBATMSB70_Mask (0xff << 0)
498 /* VBAT LSB */
499 #define TAS2563_VBATLSB TAS2563_REG(0x0, 0x0, 0x28)
500 #define TAS2563_VBATLSB_VBATLSB74_Mask (0xf << 4)
502 /* TEMP MSB */
503 #define TAS2563_TEMPMSB TAS2563_REG(0x0, 0x0, 0x29)
504 #define TAS2563_TEMPMSB_TEMPMSB70_Mask (0xff << 0)
506 /* TEMP LSB */
507 #define TAS2563_TEMPLSB TAS2563_REG(0x0, 0x0, 0x2A)
508 #define TAS2563_TEMPLSB_TEMPLSB74_Mask (0xf << 4)
510 /* SDZ Config */
511 #define TAS2563_SDZCONFIG TAS2563_REG(0x0, 0x0, 0x2F)
512 #define TAS2563_SDZCONFIG_ICLANONZEROMIN_Mask (0x1 << 4)
513 #define TAS2563_SDZCONFIG_ICLANONZEROMIN_Disable (0x0 << 4)
514 #define TAS2563_SDZCONFIG_ICLANONZEROMIN_Enable (0x1 << 4)
515 #define TAS2563_SDZCONFIG_SDZMODECONF_Mask (0x3 << 2)
516 #define TAS2563_SDZCONFIG_SDZMODECONF_ForcedShutdownAfterTimeout (0x0 << 2)
517 #define TAS2563_SDZCONFIG_SDZMODECONF_ForceShutdown (0x1 << 2)
518 #define TAS2563_SDZCONFIG_SDZMODECONF_NormalShutdown (0x2 << 2)
519 #define TAS2563_SDZCONFIG_SDZMODETIMEOUT_Mask (0x3 << 0)
520 #define TAS2563_SDZCONFIG_SDZMODETIMEOUT_2ms (0x0 << 0)
521 #define TAS2563_SDZCONFIG_SDZMODETIMEOUT_4ms (0x1 << 0)
522 #define TAS2563_SDZCONFIG_SDZMODETIMEOUT_6ms (0x2 << 0)
523 #define TAS2563_SDZCONFIG_SDZMODETIMEOUT_23p8ms (0x3 << 0)
526 /* Interrupt Configuration */
527 #define TAS2563_InterruptConfiguration TAS2563_REG(0x0, 0x0, 0x30)
528 #define TAS2563_InterruptConfiguration_CLKHALT_Mask (0x1 << 6)
529 #define TAS2563_InterruptConfiguration_CLKHALT_Enable (0x0 << 6)
530 #define TAS2563_InterruptConfiguration_CLKHALT_Disable (0x1 << 6)
531 #define TAS2563_InterruptConfiguration_CLEARLATINT_Mask (0x1 << 2)
532 #define TAS2563_InterruptConfiguration_CLEARLATINT_NOCLEAR (0x0 << 2)
533 #define TAS2563_InterruptConfiguration_CLEARLATINT_CLEAR (0x1 << 2)
534 #define TAS2563_InterruptConfiguration_PININTConfig10_Mask (0x3 << 0)
535 #define TAS2563_InterruptConfiguration_PININTConfig10_AssertOnLiveInterrupts \
536 (0x0 << 0)
537 #define \
538 TAS2563_InterruptConfiguration_PININTConfig10_AssertOnLatchedInterrupts \
539 (0x1 << 0)
540 #define \
541 TAS2563_InterruptConfiguration_PININTConfig10_Assert2msOnLiveInterrupts \
542 (0x2 << 0)
543 #define \
544 TAS2563_InterruptConfiguration_PININTConfig10_Assert2msOnLatchedInterrupts \
545 (0x3 << 0)
547 /* Digital Input Pin Pull Down */
548 #define TAS2563_DigitalInputPinPullDown TAS2563_REG(0x0, 0x0, 0x31)
549 #define TAS2563_DigitalInputPinPullDown_WKPulldownSDOUT_Mask (0x1 << 7)
550 #define TAS2563_DigitalInputPinPullDown_WKPulldownSDOUT_Disabled (0x0 << 7)
551 #define TAS2563_DigitalInputPinPullDown_WKPulldownSDOUT_Enabled (0x1 << 7)
552 #define TAS2563_DigitalInputPinPullDown_WKPulldownSDIN_Mask (0x1 << 6)
553 #define TAS2563_DigitalInputPinPullDown_WKPulldownSDIN_Disabled (0x0 << 6)
554 #define TAS2563_DigitalInputPinPullDown_WKPulldownSDIN_Enabled (0x1 << 6)
555 #define TAS2563_DigitalInputPinPullDown_WKPulldownFSYNC_Mask (0x1 << 5)
556 #define TAS2563_DigitalInputPinPullDown_WKPulldownFSYNC_Disabled (0x0 << 5)
557 #define TAS2563_DigitalInputPinPullDown_WKPulldownFSYNC_Enabled (0x1 << 5)
558 #define TAS2563_DigitalInputPinPullDown_WKPulldownSBCLK_Mask (0x1 << 4)
559 #define TAS2563_DigitalInputPinPullDown_WKPulldownSBCLK_Disabled (0x0 << 4)
560 #define TAS2563_DigitalInputPinPullDown_WKPulldownSBCLK_Enabled (0x1 << 4)
561 #define TAS2563_DigitalInputPinPullDown_WKPulldownPDMD0_Mask (0x1 << 3)
562 #define TAS2563_DigitalInputPinPullDown_WKPulldownPDMD0_Disabled (0x0 << 3)
563 #define TAS2563_DigitalInputPinPullDown_WKPulldownPDMD0_Enabled (0x1 << 3)
564 #define TAS2563_DigitalInputPinPullDown_WKPulldownPDMD1_Mask (0x1 << 2)
565 #define TAS2563_DigitalInputPinPullDown_WKPulldownPDMD1_Disabled (0x0 << 2)
566 #define TAS2563_DigitalInputPinPullDown_WKPulldownPDMD1_Enabled (0x1 << 2)
567 #define TAS2563_DigitalInputPinPullDown_WKPulldownPDMCK0_Mask (0x1 << 1)
568 #define TAS2563_DigitalInputPinPullDown_WKPulldownPDMCK0_Disabled (0x0 << 1)
569 #define TAS2563_DigitalInputPinPullDown_WKPulldownPDMCK0_Enabled (0x1 << 1)
570 #define TAS2563_DigitalInputPinPullDown_WKPulldownPDMCK1_Mask (0x1 << 0)
571 #define TAS2563_DigitalInputPinPullDown_WKPulldownPDMCK1_Disabled (0x0 << 0)
572 #define TAS2563_DigitalInputPinPullDown_WKPulldownPDMCK1_Enabled (0x1 << 0)
574 /* Misc IRQ */
575 #define TAS2563_MiscIRQ TAS2563_REG(0x0, 0x0, 0x32)
576 #define TAS2563_MiscIRQ_IRQZREQD_Mask (0x1 << 7)
577 #define TAS2563_MiscIRQ_IRQZREQD_ActiveHigh (0x0 << 7)
578 #define TAS2563_MiscIRQ_IRQZREQD_ActiveLow (0x1 << 7)
579 #define TAS2563_MiscIRQ_IRQZBITBANG_Mask (0x1 << 0)
580 #define TAS2563_MiscIRQ_IRQZBITBANG_IRQZInputBuf0 (0x0 << 0)
581 #define TAS2563_MiscIRQ_IRQZBITBANG_IRQZInputBuf1 (0x1 << 0)
583 /* Boost Configuration */
584 #define TAS2563_BoostConfiguration TAS2563_REG(0x0, 0x0, 0x33)
585 #define TAS2563_BoostConfiguration_BoostMode_Mask (0x3 << 6)
586 #define TAS2563_BoostConfiguration_BoostMode_ClassH (0x0 << 6)
587 #define TAS2563_BoostConfiguration_BoostMode_ClassG (0x1 << 6)
588 #define TAS2563_BoostConfiguration_BoostMode_AlwaysOn (0x2 << 6)
589 #define TAS2563_BoostConfiguration_BoostMode_AlwaysOff (0x3 << 6)
591 /* Clock Configuration */
592 #define TAS2563_ClockConfiguration TAS2563_REG(0x0, 0x0, 0x38)
593 #define TAS2563_ClockConfiguration_SBCLKtoFS52_Mask (0xf << 2)
594 #define TAS2563_ClockConfiguration_SBCLKtoFS52_16 (0x0 << 2)
595 #define TAS2563_ClockConfiguration_SBCLKtoFS52_24 (0x1 << 2)
596 #define TAS2563_ClockConfiguration_SBCLKtoFS52_32 (0x2 << 2)
597 #define TAS2563_ClockConfiguration_SBCLKtoFS52_48 (0x3 << 2)
598 #define TAS2563_ClockConfiguration_SBCLKtoFS52_64 (0x4 << 2)
599 #define TAS2563_ClockConfiguration_SBCLKtoFS52_96 (0x5 << 2)
600 #define TAS2563_ClockConfiguration_SBCLKtoFS52_128 (0x6 << 2)
601 #define TAS2563_ClockConfiguration_SBCLKtoFS52_192 (0x7 << 2)
602 #define TAS2563_ClockConfiguration_SBCLKtoFS52_256 (0x8 << 2)
603 #define TAS2563_ClockConfiguration_SBCLKtoFS52_384 (0x9 << 2)
604 #define TAS2563_ClockConfiguration_SBCLKtoFS52_512 (0xa << 2)
605 #define TAS2563_ClockConfiguration_DISCLKRateDetect10_Mask (0x3 << 0)
606 #define TAS2563_ClockConfiguration_DISCLKRateDetect10_Disabled (0x1 << 0)
607 #define TAS2563_ClockConfiguration_DISCLKRateDetect10_Enabled (0x0 << 0)
610 #define TAS2563_BDIVSelection_BCLKMaster TAS2563_REG(0x0, 0x0, 0x3D)
611 #define TAS2563_BDIVSelection_BCLKMaster_ClockSource10_Mask (0x3 << 0)
612 #define TAS2563_BDIVSelection_BCLKMaster_ClockSource10_NDIV2Output (0x0 << 0)
613 #define TAS2563_BDIVSelection_BCLKMaster_ClockSource10_NDIV1Output (0x1 << 0)
614 #define TAS2563_BDIVSelection_BCLKMaster_ClockSource10_MCLKOutput (0x2 << 0)
615 #define TAS2563_BDIVSelection_BCLKMaster_ClockSource10_PDMCLK1PAD (0x3 << 0)
617 #define TAS2563_BDIVSelection_HOLDSARUPDATE TAS2563_REG(0x0, 0x0, 0x41)
618 #define TAS2563_BDIVSelection_HOLDSARUPDATE10_Mask (0x1 << 0)
619 #define TAS2563_BDIVSelection_HOLDSARUPDATE10_Disabled (0x0 << 0)
620 #define TAS2563_BDIVSelection_HOLDSARUPDATE10_Enabled (0x1 << 0)
623 /* TDM Clock detection monitor */
624 #define TAS2563_TDMClockdetectionmonitor TAS2563_REG(0x0, 0x0, 0x77)
625 #define TAS2563_TDMClockdetectionmonitor_SBCLKtoFSYNC63_Mask (0xf << 3)
626 #define TAS2563_TDMClockdetectionmonitor_SBCLKtoFSYNC63_16 (0x0 << 3)
627 #define TAS2563_TDMClockdetectionmonitor_SBCLKtoFSYNC63_24 (0x1 << 3)
628 #define TAS2563_TDMClockdetectionmonitor_SBCLKtoFSYNC63_32 (0x2 << 3)
629 #define TAS2563_TDMClockdetectionmonitor_SBCLKtoFSYNC63_48 (0x3 << 3)
630 #define TAS2563_TDMClockdetectionmonitor_SBCLKtoFSYNC63_64 (0x4 << 3)
631 #define TAS2563_TDMClockdetectionmonitor_SBCLKtoFSYNC63_96 (0x5 << 3)
632 #define TAS2563_TDMClockdetectionmonitor_SBCLKtoFSYNC63_128 (0x6 << 3)
633 #define TAS2563_TDMClockdetectionmonitor_SBCLKtoFSYNC63_192 (0x7 << 3)
634 #define TAS2563_TDMClockdetectionmonitor_SBCLKtoFSYNC63_256 (0x8 << 3)
635 #define TAS2563_TDMClockdetectionmonitor_SBCLKtoFSYNC63_384 (0x9 << 3)
636 #define TAS2563_TDMClockdetectionmonitor_SBCLKtoFSYNC63_512 (0xf << 3)
637 #define TAS2563_TDMClockdetectionmonitor_DetectedSampleRate20_Mask (0x7 << 0),
638 #define TAS2563_TDMClockdetectionmonitor_DetectedSampleRate20_8khz (0x0 << 0)
639 #define TAS2563_TDMClockdetectionmonitor_DetectedSampleRate20_16khz (0x1 << 0)
640 #define TAS2563_TDMClockdetectionmonitor_DetectedSampleRate20_32khz (0x2 << 0)
641 #define TAS2563_TDMClockdetectionmonitor_DetectedSampleRate20_48khz (0x3 << 0)
642 #define TAS2563_TDMClockdetectionmonitor_DetectedSampleRate20_96khz (0x4 << 0)
643 #define TAS2563_TDMClockdetectionmonitor_DetectedSampleRate20_192khz (0x5 << 0)
645 /* Revision and PG ID */
646 #define TAS2563_RevisionandPGID TAS2563_REG(0x0, 0x0, 0x7D)
647 #define TAS2563_RevisionandPGID_RevisionID74_Mask (0xf << 4)
648 #define TAS2563_RevisionandPGID_PGID30_Mask (0xf << 0)
650 /* I2C Checksum */
651 #define TAS2563_I2CChecksum TAS2563_REG(0x0, 0x0, 0x7E)
652 #define TAS2563_I2CChecksum_I2CChecksum70_Mask (0xff << 0)
654 #define TAS2563_CLKERR_Config TAS2563_REG(0x0, 0x1, 0x31)
655 #define TAS2563_CLKERR_Config_DMA5FILTER_Mask (0x1 << 1)
656 #define TAS2563_CLKERR_Config_DMA5FILTER_Enable (0x0 << 0)
657 #define TAS2563_CLKERR_Config_DMA5FILTER_Disable (0x1 << 1)
659 #define TAS2563_SA_COEFF_SWAP_REG TAS2563_REG(0, 0x35, 0x2c)
660 #define TAS2563_CALI_T_REG TAS2563_REG(0x8c, 0x30, 0x20)
661 #define TAS2563_CALI_R0_REG TAS2563_REG(0x8c, 0x2f, 0x40)
662 //////////////////////////////////////
664 /* ICN set */
665 #define TAS2563_ICN_REG TAS2563_REG(0, 2, 0x5c)
666 #define TAS2563_ICN_DELAY TAS2563_REG(0, 2, 0x64)
668 /* Book */
669 #define TAS2563_Book TAS2563_REG(0x0, 0x0, 0x7F)
670 #define TAS2563_Book_Mask (0xff << 0)
672 #define TAS2563_FW_NAME "tas2563_uCDSP.bin"
674 #define TAS2563_POWER_ACTIVE 0
675 #define TAS2563_POWER_MUTE 1
676 #define TAS2563_POWER_SHUTDOWN 2
678 #define TAS2563_APP_ROM1MODE 0
679 #define TAS2563_APP_ROM2MODE 1
680 #define TAS2563_APP_TUNINGMODE 2
681 #define TAS2563_APP_ROM1_96KHZ 3
682 #define TAS2563_APP_ROM2_96KHZ 4
683 #define TAS2563_APP_RAMMODE 5
685 #define TAS2563_RegisterCount 55
687 #define ERROR_NONE 0x0000000
688 #define ERROR_PLL_ABSENT 0x0000000
689 #define ERROR_DEVA_I2C_COMM 0x0000000
690 #define ERROR_DEVB_I2C_COMM 0x0000000
691 #define ERROR_PRAM_CRCCHK 0x0000000
692 #define ERROR_YRAM_CRCCHK 0x0000001
693 #define ERROR_OVER_CURRENT 0x0000002
694 #define ERROR_DIE_OVERTEMP 0x0000004
695 #define ERROR_OVER_VOLTAGE 0x0000008
696 #define ERROR_UNDER_VOLTAGE 0x0000010
697 #define ERROR_BROWNOUT 0x0000020
698 #define ERROR_CLASSD_PWR 0x0000040
699 #define ERROR_FAILSAFE 0x4000000
701 #define TAS2563_COEFFICIENT_TMAX 0x7fffffff
702 #define TAS2563_SAFE_GUARD_PATTERN 0x5a
703 #define LOW_TEMPERATURE_CHECK_PERIOD 5000 /* 5 second */
705 struct tas2563_register {
706 int book;
707 int page;
708 int reg;
709 };
711 struct tas2563_dai_cfg {
712 unsigned int dai_fmt;
713 unsigned int tdm_delay;
714 };
716 struct TBlock {
717 unsigned int mnType;
718 unsigned char mbPChkSumPresent;
719 unsigned char mnPChkSum;
720 unsigned char mbYChkSumPresent;
721 unsigned char mnYChkSum;
722 unsigned int mnCommands;
723 unsigned char *mpData;
724 };
726 struct TData {
727 char mpName[64];
728 char *mpDescription;
729 unsigned int mnBlocks;
730 struct TBlock *mpBlocks;
731 };
733 struct TProgram {
734 char mpName[64];
735 char *mpDescription;
736 unsigned char mnAppMode;
737 // unsigned short mnBoost;
738 unsigned char mnI2sMode;
739 unsigned char mnISnsPD;
740 unsigned char mnVSnsPD;
741 unsigned char mnPowerLDG;
742 struct TData mData;
743 };
745 struct TPLL {
746 char mpName[64];
747 char *mpDescription;
748 struct TBlock mBlock;
749 };
752 struct TConfiguration {
753 char mpName[64];
754 char *mpDescription;
755 unsigned int mnDevices;
756 unsigned int mnProgram;
757 // unsigned int mnPLL;
758 unsigned int mnSamplingRate;
759 unsigned char mnPLLSrc;
760 unsigned int mnPLLSrcRate;
761 unsigned int mnFsRate;
762 struct TData mData;
763 };
765 struct TCalibration {
766 char mpName[64];
767 char *mpDescription;
768 unsigned int mnProgram;
769 unsigned int mnConfiguration;
770 struct TData mData;
771 };
773 struct TFirmware {
774 unsigned int mnFWSize;
775 unsigned int mnChecksum;
776 unsigned int mnPPCVersion;
777 unsigned int mnFWVersion;
778 unsigned int mnDriverVersion;
779 unsigned int mnTimeStamp;
780 char mpDDCName[64];
781 char *mpDescription;
782 unsigned int mnDeviceFamily;
783 unsigned int mnDevice;
784 unsigned int mnPLLs;
785 struct TPLL *mpPLLs;
786 unsigned int mnPrograms;
787 struct TProgram *mpPrograms;
788 unsigned int mnConfigurations;
789 struct TConfiguration *mpConfigurations;
790 unsigned int mnCalibrations;
791 struct TCalibration *mpCalibrations;
792 };
794 struct tas2563_priv {
795 struct device *dev;
796 struct regmap *regmap;
797 void *codec;
798 struct mutex dev_lock;
799 struct delayed_work irq_work;
800 struct hrtimer mtimerwork;
801 int mnClkin;
802 int mnClkid;
803 int mnPowerState;
804 bool mbPowerUp;
805 int mnCurrentBook;
806 int mnCurrentPage;
807 struct TFirmware *mpFirmware;
808 struct TFirmware *mpCalFirmware;
809 int mnCurrentProgram;
810 int mnCurrentSampleRate;
811 int mnNewConfiguration;
812 int mnCurrentConfiguration;
813 int mnCurrentCalibration;
814 int mnLoad;
815 int mnASIFormat;
816 int mnResetGPIO;
817 int mnIRQGPIO;
818 int mnIRQ;
819 bool mbIRQEnable;
820 int mnSamplingRate;
821 int mnFrameSize;
822 int mnPLL;
823 int mnPPG;
824 int mnPGID;
825 int mnLeftSlot;
826 int mnRightSlot;
827 int mnSlot_width;
828 int mnVmon_slot_no;
829 int mnImon_slot_no;
830 int mnRestart;
831 int mnCh_size;
832 int mnDieTvReadCounter;
833 int mnPCMFormat;
834 int mnVBoostState;
835 bool mbLoadConfigurationPrePowerUp;
836 bool mbLoadCalibrationPostPowerUp;
837 bool mbCalibrationLoaded;
838 bool mbBypassTMax;
839 int (*read)(struct tas2563_priv *pTAS2563,
840 unsigned int reg, unsigned int *pValue);
841 int (*write)(struct tas2563_priv *pTAS2563,
842 unsigned int reg, unsigned int Value);
843 int (*bulk_read)(struct tas2563_priv *pTAS2563,
844 unsigned int reg, unsigned char *pData, unsigned int len);
845 int (*bulk_write)(struct tas2563_priv *pTAS2563,
846 unsigned int reg, unsigned char *pData, unsigned int len);
847 int (*update_bits)(struct tas2563_priv *pTAS2563,
848 unsigned int reg, unsigned int mask, unsigned int value);
849 void (*hw_reset)(struct tas2563_priv *pTAS2563);
850 void (*clearIRQ)(struct tas2563_priv *pTAS2563);
851 void (*enableIRQ)(struct tas2563_priv *pTAS2563, bool enable);
852 /* device is working, but system is suspended */
853 int (*runtime_suspend)(struct tas2563_priv *pTAS2563);
854 int (*runtime_resume)(struct tas2563_priv *pTAS2563);
855 int (*set_calibration)(struct tas2563_priv *pTAS2563,
856 int calibration);
857 int (*set_config)(struct tas2563_priv *pTAS2563, int config);
858 bool mbRuntimeSuspend;
860 unsigned int mnErrCode;
861 #ifdef CONFIG_TAS2563_CODEC
862 struct mutex codec_lock;
863 #endif
865 #ifdef CONFIG_TAS2563_MISC
866 int mnDBGCmd;
867 int mnCurrentReg;
868 struct mutex file_lock;
869 #endif
870 };
872 #endif /* __TAS2563_ */