Go to the documentation of this file.
26 #ifndef __TEGRA20_SPDIF_H__
27 #define __TEGRA20_SPDIF_H__
33 #define TEGRA20_SPDIF_CTRL 0x0
34 #define TEGRA20_SPDIF_STATUS 0x4
35 #define TEGRA20_SPDIF_STROBE_CTRL 0x8
36 #define TEGRA20_SPDIF_DATA_FIFO_CSR 0x0C
37 #define TEGRA20_SPDIF_DATA_OUT 0x40
38 #define TEGRA20_SPDIF_DATA_IN 0x80
39 #define TEGRA20_SPDIF_CH_STA_RX_A 0x100
40 #define TEGRA20_SPDIF_CH_STA_RX_B 0x104
41 #define TEGRA20_SPDIF_CH_STA_RX_C 0x108
42 #define TEGRA20_SPDIF_CH_STA_RX_D 0x10C
43 #define TEGRA20_SPDIF_CH_STA_RX_E 0x110
44 #define TEGRA20_SPDIF_CH_STA_RX_F 0x114
45 #define TEGRA20_SPDIF_CH_STA_TX_A 0x140
46 #define TEGRA20_SPDIF_CH_STA_TX_B 0x144
47 #define TEGRA20_SPDIF_CH_STA_TX_C 0x148
48 #define TEGRA20_SPDIF_CH_STA_TX_D 0x14C
49 #define TEGRA20_SPDIF_CH_STA_TX_E 0x150
50 #define TEGRA20_SPDIF_CH_STA_TX_F 0x154
51 #define TEGRA20_SPDIF_USR_STA_RX_A 0x180
52 #define TEGRA20_SPDIF_USR_DAT_TX_A 0x1C0
57 #define TEGRA20_SPDIF_CTRL_CAP_LC (1 << 30)
60 #define TEGRA20_SPDIF_CTRL_RX_EN (1 << 29)
63 #define TEGRA20_SPDIF_CTRL_TX_EN (1 << 28)
66 #define TEGRA20_SPDIF_CTRL_TC_EN (1 << 27)
69 #define TEGRA20_SPDIF_CTRL_TU_EN (1 << 26)
72 #define TEGRA20_SPDIF_CTRL_IE_TXE (1 << 25)
75 #define TEGRA20_SPDIF_CTRL_IE_RXE (1 << 24)
78 #define TEGRA20_SPDIF_CTRL_IE_P (1 << 23)
81 #define TEGRA20_SPDIF_CTRL_IE_B (1 << 22)
84 #define TEGRA20_SPDIF_CTRL_IE_C (1 << 21)
87 #define TEGRA20_SPDIF_CTRL_IE_U (1 << 20)
90 #define TEGRA20_SPDIF_CTRL_QE_RU (1 << 19)
93 #define TEGRA20_SPDIF_CTRL_QE_TU (1 << 18)
96 #define TEGRA20_SPDIF_CTRL_QE_RX (1 << 17)
99 #define TEGRA20_SPDIF_CTRL_QE_TX (1 << 16)
102 #define TEGRA20_SPDIF_CTRL_LBK_EN (1 << 15)
110 #define TEGRA20_SPDIF_CTRL_PACK (1 << 14)
118 #define TEGRA20_SPDIF_BIT_MODE_16BIT 0
119 #define TEGRA20_SPDIF_BIT_MODE_20BIT 1
120 #define TEGRA20_SPDIF_BIT_MODE_24BIT 2
121 #define TEGRA20_SPDIF_BIT_MODE_RAW 3
123 #define TEGRA20_SPDIF_CTRL_BIT_MODE_SHIFT 12
124 #define TEGRA20_SPDIF_CTRL_BIT_MODE_MASK (3 << TEGRA20_SPDIF_CTRL_BIT_MODE_SHIFT)
125 #define TEGRA20_SPDIF_CTRL_BIT_MODE_16BIT (TEGRA20_SPDIF_BIT_MODE_16BIT << TEGRA20_SPDIF_CTRL_BIT_MODE_SHIFT)
126 #define TEGRA20_SPDIF_CTRL_BIT_MODE_20BIT (TEGRA20_SPDIF_BIT_MODE_20BIT << TEGRA20_SPDIF_CTRL_BIT_MODE_SHIFT)
127 #define TEGRA20_SPDIF_CTRL_BIT_MODE_24BIT (TEGRA20_SPDIF_BIT_MODE_24BIT << TEGRA20_SPDIF_CTRL_BIT_MODE_SHIFT)
128 #define TEGRA20_SPDIF_CTRL_BIT_MODE_RAW (TEGRA20_SPDIF_BIT_MODE_RAW << TEGRA20_SPDIF_CTRL_BIT_MODE_SHIFT)
145 #define TEGRA20_SPDIF_STATUS_RX_BSY (1 << 29)
153 #define TEGRA20_SPDIF_STATUS_TX_BSY (1 << 28)
163 #define TEGRA20_SPDIF_STATUS_TC_BSY (1 << 27)
172 #define TEGRA20_SPDIF_STATUS_TU_BSY (1 << 26)
175 #define TEGRA20_SPDIF_STATUS_TX_ERR (1 << 25)
178 #define TEGRA20_SPDIF_STATUS_RX_ERR (1 << 24)
181 #define TEGRA20_SPDIF_STATUS_IS_P (1 << 23)
184 #define TEGRA20_SPDIF_STATUS_IS_B (1 << 22)
191 #define TEGRA20_SPDIF_STATUS_IS_C (1 << 21)
194 #define TEGRA20_SPDIF_STATUS_IS_U (1 << 20)
200 #define TEGRA20_SPDIF_STATUS_QS_RU (1 << 19)
206 #define TEGRA20_SPDIF_STATUS_QS_TU (1 << 18)
212 #define TEGRA20_SPDIF_STATUS_QS_RX (1 << 17)
218 #define TEGRA20_SPDIF_STATUS_QS_TX (1 << 16)
226 #define TEGRA20_SPDIF_STROBE_CTRL_PERIOD_SHIFT 16
227 #define TEGRA20_SPDIF_STROBE_CTRL_PERIOD_MASK (0xff << TEGRA20_SPDIF_STROBE_CTRL_PERIOD_SHIFT)
230 #define TEGRA20_SPDIF_STROBE_CTRL_STROBE (1 << 15)
236 #define TEGRA20_SPDIF_STROBE_CTRL_DATA_STROBES_SHIFT 8
237 #define TEGRA20_SPDIF_STROBE_CTRL_DATA_STROBES_MASK (0x1f << TEGRA20_SPDIF_STROBE_CTRL_DATA_STROBES_SHIFT)
243 #define TEGRA20_SPDIF_STROBE_CTRL_CLOCK_PERIOD_SHIFT 0
244 #define TEGRA20_SPDIF_STROBE_CTRL_CLOCK_PERIOD_MASK (0x3f << TEGRA20_SPDIF_STROBE_CTRL_CLOCK_PERIOD_SHIFT)
249 #define TEGRA20_SPDIF_DATA_FIFO_CSR_RU_CLR (1 << 31)
251 #define TEGRA20_SPDIF_FIFO_ATN_LVL_U_ONE_SLOT 0
252 #define TEGRA20_SPDIF_FIFO_ATN_LVL_U_TWO_SLOTS 1
253 #define TEGRA20_SPDIF_FIFO_ATN_LVL_U_THREE_SLOTS 2
254 #define TEGRA20_SPDIF_FIFO_ATN_LVL_U_FOUR_SLOTS 3
257 #define TEGRA20_SPDIF_DATA_FIFO_CSR_RU_ATN_LVL_SHIFT 29
258 #define TEGRA20_SPDIF_DATA_FIFO_CSR_RU_ATN_LVL_MASK \
259 (0x3 << TEGRA20_SPDIF_DATA_FIFO_CSR_RU_ATN_LVL_SHIFT)
260 #define TEGRA20_SPDIF_DATA_FIFO_CSR_RU_ATN_LVL_RU1_WORD_FULL \
261 (TEGRA20_SPDIF_FIFO_ATN_LVL_U_ONE_SLOT << TEGRA20_SPDIF_DATA_FIFO_CSR_RU_ATN_LVL_SHIFT)
262 #define TEGRA20_SPDIF_DATA_FIFO_CSR_RU_ATN_LVL_RU2_WORD_FULL \
263 (TEGRA20_SPDIF_FIFO_ATN_LVL_U_TWO_SLOTS << TEGRA20_SPDIF_DATA_FIFO_CSR_RU_ATN_LVL_SHIFT)
264 #define TEGRA20_SPDIF_DATA_FIFO_CSR_RU_ATN_LVL_RU3_WORD_FULL \
265 (TEGRA20_SPDIF_FIFO_ATN_LVL_U_THREE_SLOTS << TEGRA20_SPDIF_DATA_FIFO_CSR_RU_ATN_LVL_SHIFT)
266 #define TEGRA20_SPDIF_DATA_FIFO_CSR_RU_ATN_LVL_RU4_WORD_FULL \
267 (TEGRA20_SPDIF_FIFO_ATN_LVL_U_FOUR_SLOTS << TEGRA20_SPDIF_DATA_FIFO_CSR_RU_ATN_LVL_SHIFT)
270 #define TEGRA20_SPDIF_DATA_FIFO_CSR_RU_FULL_COUNT_SHIFT 24
271 #define TEGRA20_SPDIF_DATA_FIFO_CSR_RU_FULL_COUNT_MASK (0x1f << TEGRA20_SPDIF_DATA_FIFO_CSR_RU_FULL_COUNT_SHIFT)
274 #define TEGRA20_SPDIF_DATA_FIFO_CSR_TU_CLR (1 << 23)
277 #define TEGRA20_SPDIF_DATA_FIFO_CSR_TU_ATN_LVL_SHIFT 21
278 #define TEGRA20_SPDIF_DATA_FIFO_CSR_TU_ATN_LVL_MASK \
279 (0x3 << TEGRA20_SPDIF_DATA_FIFO_CSR_TU_ATN_LVL_SHIFT)
280 #define TEGRA20_SPDIF_DATA_FIFO_CSR_TU_ATN_LVL_TU1_WORD_FULL \
281 (TEGRA20_SPDIF_FIFO_ATN_LVL_U_ONE_SLOT << TEGRA20_SPDIF_DATA_FIFO_CSR_TU_ATN_LVL_SHIFT)
282 #define TEGRA20_SPDIF_DATA_FIFO_CSR_TU_ATN_LVL_TU2_WORD_FULL \
283 (TEGRA20_SPDIF_FIFO_ATN_LVL_U_TWO_SLOTS << TEGRA20_SPDIF_DATA_FIFO_CSR_TU_ATN_LVL_SHIFT)
284 #define TEGRA20_SPDIF_DATA_FIFO_CSR_TU_ATN_LVL_TU3_WORD_FULL \
285 (TEGRA20_SPDIF_FIFO_ATN_LVL_U_THREE_SLOTS << TEGRA20_SPDIF_DATA_FIFO_CSR_TU_ATN_LVL_SHIFT)
286 #define TEGRA20_SPDIF_DATA_FIFO_CSR_TU_ATN_LVL_TU4_WORD_FULL \
287 (TEGRA20_SPDIF_FIFO_ATN_LVL_U_FOUR_SLOTS << TEGRA20_SPDIF_DATA_FIFO_CSR_TU_ATN_LVL_SHIFT)
290 #define TEGRA20_SPDIF_DATA_FIFO_CSR_TU_EMPTY_COUNT_SHIFT 16
291 #define TEGRA20_SPDIF_DATA_FIFO_CSR_TU_EMPTY_COUNT_MASK (0x1f << SPDIF_DATA_FIFO_CSR_TU_EMPTY_COUNT_SHIFT)
294 #define TEGRA20_SPDIF_DATA_FIFO_CSR_RX_CLR (1 << 15)
296 #define TEGRA20_SPDIF_FIFO_ATN_LVL_D_ONE_SLOT 0
297 #define TEGRA20_SPDIF_FIFO_ATN_LVL_D_FOUR_SLOTS 1
298 #define TEGRA20_SPDIF_FIFO_ATN_LVL_D_EIGHT_SLOTS 2
299 #define TEGRA20_SPDIF_FIFO_ATN_LVL_D_TWELVE_SLOTS 3
302 #define TEGRA20_SPDIF_DATA_FIFO_CSR_RX_ATN_LVL_SHIFT 13
303 #define TEGRA20_SPDIF_DATA_FIFO_CSR_RX_ATN_LVL_MASK \
304 (0x3 << TEGRA20_SPDIF_DATA_FIFO_CSR_RX_ATN_LVL_SHIFT)
305 #define TEGRA20_SPDIF_DATA_FIFO_CSR_RX_ATN_LVL_RU1_WORD_FULL \
306 (TEGRA20_SPDIF_FIFO_ATN_LVL_D_ONE_SLOT << TEGRA20_SPDIF_DATA_FIFO_CSR_RX_ATN_LVL_SHIFT)
307 #define TEGRA20_SPDIF_DATA_FIFO_CSR_RX_ATN_LVL_RU4_WORD_FULL \
308 (TEGRA20_SPDIF_FIFO_ATN_LVL_D_FOUR_SLOTS << TEGRA20_SPDIF_DATA_FIFO_CSR_RX_ATN_LVL_SHIFT)
309 #define TEGRA20_SPDIF_DATA_FIFO_CSR_RX_ATN_LVL_RU8_WORD_FULL \
310 (TEGRA20_SPDIF_FIFO_ATN_LVL_D_EIGHT_SLOTS << TEGRA20_SPDIF_DATA_FIFO_CSR_RX_ATN_LVL_SHIFT)
311 #define TEGRA20_SPDIF_DATA_FIFO_CSR_RX_ATN_LVL_RU12_WORD_FULL \
312 (TEGRA20_SPDIF_FIFO_ATN_LVL_D_TWELVE_SLOTS << TEGRA20_SPDIF_DATA_FIFO_CSR_RX_ATN_LVL_SHIFT)
315 #define TEGRA20_SPDIF_DATA_FIFO_CSR_RX_FULL_COUNT_SHIFT 8
316 #define TEGRA20_SPDIF_DATA_FIFO_CSR_RX_FULL_COUNT_MASK (0x1f << TEGRA20_SPDIF_DATA_FIFO_CSR_RX_FULL_COUNT_SHIFT)
319 #define TEGRA20_SPDIF_DATA_FIFO_CSR_TX_CLR (1 << 7)
322 #define TEGRA20_SPDIF_DATA_FIFO_CSR_TX_ATN_LVL_SHIFT 5
323 #define TEGRA20_SPDIF_DATA_FIFO_CSR_TX_ATN_LVL_MASK \
324 (0x3 << TEGRA20_SPDIF_DATA_FIFO_CSR_TX_ATN_LVL_SHIFT)
325 #define TEGRA20_SPDIF_DATA_FIFO_CSR_TX_ATN_LVL_TU1_WORD_FULL \
326 (TEGRA20_SPDIF_FIFO_ATN_LVL_D_ONE_SLOT << TEGRA20_SPDIF_DATA_FIFO_CSR_TX_ATN_LVL_SHIFT)
327 #define TEGRA20_SPDIF_DATA_FIFO_CSR_TX_ATN_LVL_TU4_WORD_FULL \
328 (TEGRA20_SPDIF_FIFO_ATN_LVL_D_FOUR_SLOTS << TEGRA20_SPDIF_DATA_FIFO_CSR_TX_ATN_LVL_SHIFT)
329 #define TEGRA20_SPDIF_DATA_FIFO_CSR_TX_ATN_LVL_TU8_WORD_FULL \
330 (TEGRA20_SPDIF_FIFO_ATN_LVL_D_EIGHT_SLOTS << TEGRA20_SPDIF_DATA_FIFO_CSR_TX_ATN_LVL_SHIFT)
331 #define TEGRA20_SPDIF_DATA_FIFO_CSR_TX_ATN_LVL_TU12_WORD_FULL \
332 (TEGRA20_SPDIF_FIFO_ATN_LVL_D_TWELVE_SLOTS << TEGRA20_SPDIF_DATA_FIFO_CSR_TX_ATN_LVL_SHIFT)
335 #define TEGRA20_SPDIF_DATA_FIFO_CSR_TX_EMPTY_COUNT_SHIFT 0
336 #define TEGRA20_SPDIF_DATA_FIFO_CSR_TX_EMPTY_COUNT_MASK (0x1f << SPDIF_DATA_FIFO_CSR_TX_EMPTY_COUNT_SHIFT)
349 #define TEGRA20_SPDIF_DATA_OUT_DATA_16_SHIFT 0
350 #define TEGRA20_SPDIF_DATA_OUT_DATA_16_MASK (0xffff << TEGRA20_SPDIF_DATA_OUT_DATA_16_SHIFT)
352 #define TEGRA20_SPDIF_DATA_OUT_DATA_20_SHIFT 0
353 #define TEGRA20_SPDIF_DATA_OUT_DATA_20_MASK (0xfffff << TEGRA20_SPDIF_DATA_OUT_DATA_20_SHIFT)
355 #define TEGRA20_SPDIF_DATA_OUT_DATA_24_SHIFT 0
356 #define TEGRA20_SPDIF_DATA_OUT_DATA_24_MASK (0xffffff << TEGRA20_SPDIF_DATA_OUT_DATA_24_SHIFT)
358 #define TEGRA20_SPDIF_DATA_OUT_DATA_RAW_P (1 << 31)
359 #define TEGRA20_SPDIF_DATA_OUT_DATA_RAW_C (1 << 30)
360 #define TEGRA20_SPDIF_DATA_OUT_DATA_RAW_U (1 << 29)
361 #define TEGRA20_SPDIF_DATA_OUT_DATA_RAW_V (1 << 28)
363 #define TEGRA20_SPDIF_DATA_OUT_DATA_RAW_DATA_SHIFT 8
364 #define TEGRA20_SPDIF_DATA_OUT_DATA_RAW_DATA_MASK (0xfffff << TEGRA20_SPDIF_DATA_OUT_DATA_RAW_DATA_SHIFT)
366 #define TEGRA20_SPDIF_DATA_OUT_DATA_RAW_AUX_SHIFT 4
367 #define TEGRA20_SPDIF_DATA_OUT_DATA_RAW_AUX_MASK (0xf << TEGRA20_SPDIF_DATA_OUT_DATA_RAW_AUX_SHIFT)
369 #define TEGRA20_SPDIF_DATA_OUT_DATA_RAW_PREAMBLE_SHIFT 0
370 #define TEGRA20_SPDIF_DATA_OUT_DATA_RAW_PREAMBLE_MASK (0xf << TEGRA20_SPDIF_DATA_OUT_DATA_RAW_PREAMBLE_SHIFT)
372 #define TEGRA20_SPDIF_DATA_OUT_DATA_16_PACKED_RIGHT_SHIFT 16
373 #define TEGRA20_SPDIF_DATA_OUT_DATA_16_PACKED_RIGHT_MASK (0xffff << TEGRA20_SPDIF_DATA_OUT_DATA_16_PACKED_RIGHT_SHIFT)
375 #define TEGRA20_SPDIF_DATA_OUT_DATA_16_PACKED_LEFT_SHIFT 0
376 #define TEGRA20_SPDIF_DATA_OUT_DATA_16_PACKED_LEFT_MASK (0xffff << TEGRA20_SPDIF_DATA_OUT_DATA_16_PACKED_LEFT_SHIFT)
391 #define TEGRA20_SPDIF_DATA_IN_DATA_P (1 << 31)
392 #define TEGRA20_SPDIF_DATA_IN_DATA_C (1 << 30)
393 #define TEGRA20_SPDIF_DATA_IN_DATA_U (1 << 29)
394 #define TEGRA20_SPDIF_DATA_IN_DATA_V (1 << 28)
396 #define TEGRA20_SPDIF_DATA_IN_DATA_PREAMBLE_SHIFT 24
397 #define TEGRA20_SPDIF_DATA_IN_DATA_PREAMBLE_MASK (0xf << TEGRA20_SPDIF_DATA_IN_DATA_PREAMBLE_SHIFT)
399 #define TEGRA20_SPDIF_DATA_IN_DATA_16_SHIFT 0
400 #define TEGRA20_SPDIF_DATA_IN_DATA_16_MASK (0xffff << TEGRA20_SPDIF_DATA_IN_DATA_16_SHIFT)
402 #define TEGRA20_SPDIF_DATA_IN_DATA_20_SHIFT 0
403 #define TEGRA20_SPDIF_DATA_IN_DATA_20_MASK (0xfffff << TEGRA20_SPDIF_DATA_IN_DATA_20_SHIFT)
405 #define TEGRA20_SPDIF_DATA_IN_DATA_24_SHIFT 0
406 #define TEGRA20_SPDIF_DATA_IN_DATA_24_MASK (0xffffff << TEGRA20_SPDIF_DATA_IN_DATA_24_SHIFT)
408 #define TEGRA20_SPDIF_DATA_IN_DATA_RAW_DATA_SHIFT 8
409 #define TEGRA20_SPDIF_DATA_IN_DATA_RAW_DATA_MASK (0xfffff << TEGRA20_SPDIF_DATA_IN_DATA_RAW_DATA_SHIFT)
411 #define TEGRA20_SPDIF_DATA_IN_DATA_RAW_AUX_SHIFT 4
412 #define TEGRA20_SPDIF_DATA_IN_DATA_RAW_AUX_MASK (0xf << TEGRA20_SPDIF_DATA_IN_DATA_RAW_AUX_SHIFT)
414 #define TEGRA20_SPDIF_DATA_IN_DATA_RAW_PREAMBLE_SHIFT 0
415 #define TEGRA20_SPDIF_DATA_IN_DATA_RAW_PREAMBLE_MASK (0xf << TEGRA20_SPDIF_DATA_IN_DATA_RAW_PREAMBLE_SHIFT)
417 #define TEGRA20_SPDIF_DATA_IN_DATA_16_PACKED_RIGHT_SHIFT 16
418 #define TEGRA20_SPDIF_DATA_IN_DATA_16_PACKED_RIGHT_MASK (0xffff << TEGRA20_SPDIF_DATA_IN_DATA_16_PACKED_RIGHT_SHIFT)
420 #define TEGRA20_SPDIF_DATA_IN_DATA_16_PACKED_LEFT_SHIFT 0
421 #define TEGRA20_SPDIF_DATA_IN_DATA_16_PACKED_LEFT_MASK (0xffff << TEGRA20_SPDIF_DATA_IN_DATA_16_PACKED_LEFT_SHIFT)