mt2701-reg.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * mt2701-reg.h -- Mediatek 2701 audio driver reg definition
  4. *
  5. * Copyright (c) 2016 MediaTek Inc.
  6. * Author: Garlic Tseng <garlic.tseng@mediatek.com>
  7. */
  8. #ifndef _MT2701_REG_H_
  9. #define _MT2701_REG_H_
  10. #define AUDIO_TOP_CON0 0x0000
  11. #define AUDIO_TOP_CON4 0x0010
  12. #define AUDIO_TOP_CON5 0x0014
  13. #define AFE_DAIBT_CON0 0x001c
  14. #define AFE_MRGIF_CON 0x003c
  15. #define ASMI_TIMING_CON1 0x0100
  16. #define ASMO_TIMING_CON1 0x0104
  17. #define PWR1_ASM_CON1 0x0108
  18. #define ASYS_TOP_CON 0x0600
  19. #define ASYS_I2SIN1_CON 0x0604
  20. #define ASYS_I2SIN2_CON 0x0608
  21. #define ASYS_I2SIN3_CON 0x060c
  22. #define ASYS_I2SIN4_CON 0x0610
  23. #define ASYS_I2SIN5_CON 0x0614
  24. #define ASYS_I2SO1_CON 0x061C
  25. #define ASYS_I2SO2_CON 0x0620
  26. #define ASYS_I2SO3_CON 0x0624
  27. #define ASYS_I2SO4_CON 0x0628
  28. #define ASYS_I2SO5_CON 0x062c
  29. #define PWR2_TOP_CON 0x0634
  30. #define AFE_CONN0 0x06c0
  31. #define AFE_CONN1 0x06c4
  32. #define AFE_CONN2 0x06c8
  33. #define AFE_CONN3 0x06cc
  34. #define AFE_CONN14 0x06f8
  35. #define AFE_CONN15 0x06fc
  36. #define AFE_CONN16 0x0700
  37. #define AFE_CONN17 0x0704
  38. #define AFE_CONN18 0x0708
  39. #define AFE_CONN19 0x070c
  40. #define AFE_CONN20 0x0710
  41. #define AFE_CONN21 0x0714
  42. #define AFE_CONN22 0x0718
  43. #define AFE_CONN23 0x071c
  44. #define AFE_CONN24 0x0720
  45. #define AFE_CONN41 0x0764
  46. #define ASYS_IRQ1_CON 0x0780
  47. #define ASYS_IRQ2_CON 0x0784
  48. #define ASYS_IRQ3_CON 0x0788
  49. #define ASYS_IRQ_CLR 0x07c0
  50. #define ASYS_IRQ_STATUS 0x07c4
  51. #define PWR2_ASM_CON1 0x1070
  52. #define AFE_DAC_CON0 0x1200
  53. #define AFE_DAC_CON1 0x1204
  54. #define AFE_DAC_CON2 0x1208
  55. #define AFE_DAC_CON3 0x120c
  56. #define AFE_DAC_CON4 0x1210
  57. #define AFE_MEMIF_HD_CON1 0x121c
  58. #define AFE_MEMIF_PBUF_SIZE 0x1238
  59. #define AFE_MEMIF_HD_CON0 0x123c
  60. #define AFE_DL1_BASE 0x1240
  61. #define AFE_DL1_CUR 0x1244
  62. #define AFE_DL2_BASE 0x1250
  63. #define AFE_DL2_CUR 0x1254
  64. #define AFE_DL3_BASE 0x1260
  65. #define AFE_DL3_CUR 0x1264
  66. #define AFE_DL4_BASE 0x1270
  67. #define AFE_DL4_CUR 0x1274
  68. #define AFE_DL5_BASE 0x1280
  69. #define AFE_DL5_CUR 0x1284
  70. #define AFE_DLMCH_BASE 0x12a0
  71. #define AFE_DLMCH_CUR 0x12a4
  72. #define AFE_ARB1_BASE 0x12b0
  73. #define AFE_ARB1_CUR 0x12b4
  74. #define AFE_VUL_BASE 0x1300
  75. #define AFE_VUL_CUR 0x130c
  76. #define AFE_UL2_BASE 0x1310
  77. #define AFE_UL2_END 0x1318
  78. #define AFE_UL2_CUR 0x131c
  79. #define AFE_UL3_BASE 0x1320
  80. #define AFE_UL3_END 0x1328
  81. #define AFE_UL3_CUR 0x132c
  82. #define AFE_UL4_BASE 0x1330
  83. #define AFE_UL4_END 0x1338
  84. #define AFE_UL4_CUR 0x133c
  85. #define AFE_UL5_BASE 0x1340
  86. #define AFE_UL5_END 0x1348
  87. #define AFE_UL5_CUR 0x134c
  88. #define AFE_DAI_BASE 0x1370
  89. #define AFE_DAI_CUR 0x137c
  90. /* AFE_DAIBT_CON0 (0x001c) */
  91. #define AFE_DAIBT_CON0_DAIBT_EN (0x1 << 0)
  92. #define AFE_DAIBT_CON0_BT_FUNC_EN (0x1 << 1)
  93. #define AFE_DAIBT_CON0_BT_FUNC_RDY (0x1 << 3)
  94. #define AFE_DAIBT_CON0_BT_WIDE_MODE_EN (0x1 << 9)
  95. #define AFE_DAIBT_CON0_MRG_USE (0x1 << 12)
  96. /* PWR1_ASM_CON1 (0x0108) */
  97. #define PWR1_ASM_CON1_INIT_VAL (0x492)
  98. /* AFE_MRGIF_CON (0x003c) */
  99. #define AFE_MRGIF_CON_MRG_EN (0x1 << 0)
  100. #define AFE_MRGIF_CON_MRG_I2S_EN (0x1 << 16)
  101. #define AFE_MRGIF_CON_I2S_MODE_MASK (0xf << 20)
  102. #define AFE_MRGIF_CON_I2S_MODE_32K (0x4 << 20)
  103. /* ASYS_TOP_CON (0x0600) */
  104. #define ASYS_TOP_CON_ASYS_TIMING_ON (0x3 << 0)
  105. /* PWR2_ASM_CON1 (0x1070) */
  106. #define PWR2_ASM_CON1_INIT_VAL (0x492492)
  107. /* AFE_DAC_CON0 (0x1200) */
  108. #define AFE_DAC_CON0_AFE_ON (0x1 << 0)
  109. /* AFE_MEMIF_PBUF_SIZE (0x1238) */
  110. #define AFE_MEMIF_PBUF_SIZE_DLM_MASK (0x1 << 29)
  111. #define AFE_MEMIF_PBUF_SIZE_PAIR_INTERLEAVE (0x0 << 29)
  112. #define AFE_MEMIF_PBUF_SIZE_FULL_INTERLEAVE (0x1 << 29)
  113. #define DLMCH_BIT_WIDTH_MASK (0x1 << 28)
  114. #define AFE_MEMIF_PBUF_SIZE_DLM_CH_MASK (0xf << 24)
  115. #define AFE_MEMIF_PBUF_SIZE_DLM_CH(x) ((x) << 24)
  116. #define AFE_MEMIF_PBUF_SIZE_DLM_BYTE_MASK (0x3 << 12)
  117. #define AFE_MEMIF_PBUF_SIZE_DLM_32BYTES (0x1 << 12)
  118. /* I2S in/out register bit control */
  119. #define ASYS_I2S_CON_FS (0x1f << 8)
  120. #define ASYS_I2S_CON_FS_SET(x) ((x) << 8)
  121. #define ASYS_I2S_CON_RESET (0x1 << 30)
  122. #define ASYS_I2S_CON_I2S_EN (0x1 << 0)
  123. #define ASYS_I2S_CON_ONE_HEART_MODE (0x1 << 16)
  124. #define ASYS_I2S_CON_I2S_COUPLE_MODE (0x1 << 17)
  125. /* 0:EIAJ 1:I2S */
  126. #define ASYS_I2S_CON_I2S_MODE (0x1 << 3)
  127. #define ASYS_I2S_CON_WIDE_MODE (0x1 << 1)
  128. #define ASYS_I2S_CON_WIDE_MODE_SET(x) ((x) << 1)
  129. #define ASYS_I2S_IN_PHASE_FIX (0x1 << 31)
  130. #endif