aio-reg.h 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Socionext UniPhier AIO ALSA driver.
  4. *
  5. * Copyright (c) 2016-2018 Socionext Inc.
  6. */
  7. #ifndef SND_UNIPHIER_AIO_REG_H__
  8. #define SND_UNIPHIER_AIO_REG_H__
  9. #include <linux/bitops.h>
  10. /* soc-glue */
  11. #define SG_AOUTEN 0x1c04
  12. /* SW view */
  13. #define A2CHNMAPCTR0(n) (0x00000 + 0x40 * (n))
  14. #define A2RBNMAPCTR0(n) (0x01000 + 0x40 * (n))
  15. #define A2IPORTNMAPCTR0(n) (0x02000 + 0x40 * (n))
  16. #define A2IPORTNMAPCTR1(n) (0x02004 + 0x40 * (n))
  17. #define A2IIFNMAPCTR0(n) (0x03000 + 0x40 * (n))
  18. #define A2OPORTNMAPCTR0(n) (0x04000 + 0x40 * (n))
  19. #define A2OPORTNMAPCTR1(n) (0x04004 + 0x40 * (n))
  20. #define A2OPORTNMAPCTR2(n) (0x04008 + 0x40 * (n))
  21. #define A2OIFNMAPCTR0(n) (0x05000 + 0x40 * (n))
  22. #define A2ATNMAPCTR0(n) (0x06000 + 0x40 * (n))
  23. #define MAPCTR0_EN 0x80000000
  24. /* CTL */
  25. #define A2APLLCTR0 0x07000
  26. #define A2APLLCTR0_APLLXPOW_MASK GENMASK(3, 0)
  27. #define A2APLLCTR0_APLLXPOW_PWOFF (0x0 << 0)
  28. #define A2APLLCTR0_APLLXPOW_PWON (0xf << 0)
  29. #define A2APLLCTR1 0x07004
  30. #define A2APLLCTR1_APLLX_MASK 0x00010101
  31. #define A2APLLCTR1_APLLX_36MHZ 0x00000000
  32. #define A2APLLCTR1_APLLX_33MHZ 0x00000001
  33. #define A2EXMCLKSEL0 0x07030
  34. #define A2EXMCLKSEL0_EXMCLK_MASK GENMASK(2, 0)
  35. #define A2EXMCLKSEL0_EXMCLK_OUTPUT (0x0 << 0)
  36. #define A2EXMCLKSEL0_EXMCLK_INPUT (0x7 << 0)
  37. #define A2SSIFSW 0x07050
  38. #define A2CH22_2CTR 0x07054
  39. #define A2AIOINPUTSEL 0x070e0
  40. #define A2AIOINPUTSEL_RXSEL_PCMI1_MASK GENMASK(2, 0)
  41. #define A2AIOINPUTSEL_RXSEL_PCMI1_HDMIRX1 (0x2 << 0)
  42. #define A2AIOINPUTSEL_RXSEL_PCMI2_MASK GENMASK(6, 4)
  43. #define A2AIOINPUTSEL_RXSEL_PCMI2_SIF (0x7 << 4)
  44. #define A2AIOINPUTSEL_RXSEL_PCMI3_MASK GENMASK(10, 8)
  45. #define A2AIOINPUTSEL_RXSEL_PCMI3_EVEA (0x1 << 8)
  46. #define A2AIOINPUTSEL_RXSEL_IECI1_MASK GENMASK(14, 12)
  47. #define A2AIOINPUTSEL_RXSEL_IECI1_HDMIRX1 (0x2 << 12)
  48. #define A2AIOINPUTSEL_RXSEL_MASK (A2AIOINPUTSEL_RXSEL_PCMI1_MASK | \
  49. A2AIOINPUTSEL_RXSEL_PCMI2_MASK | \
  50. A2AIOINPUTSEL_RXSEL_PCMI3_MASK | \
  51. A2AIOINPUTSEL_RXSEL_IECI1_HDMIRX1)
  52. /* INTC */
  53. #define INTCHIM(m) (0x9028 + 0x80 * (m))
  54. #define INTRBIM(m) (0x9030 + 0x80 * (m))
  55. #define INTCHID(m) (0xa028 + 0x80 * (m))
  56. #define INTRBID(m) (0xa030 + 0x80 * (m))
  57. /* AIN(PCMINN) */
  58. #define IPORTMXCTR1(n) (0x22000 + 0x400 * (n))
  59. #define IPORTMXCTR1_LRSEL_MASK GENMASK(11, 10)
  60. #define IPORTMXCTR1_LRSEL_RIGHT (0x0 << 10)
  61. #define IPORTMXCTR1_LRSEL_LEFT (0x1 << 10)
  62. #define IPORTMXCTR1_LRSEL_I2S (0x2 << 10)
  63. #define IPORTMXCTR1_OUTBITSEL_MASK (0x800003U << 8)
  64. #define IPORTMXCTR1_OUTBITSEL_32 (0x800000U << 8)
  65. #define IPORTMXCTR1_OUTBITSEL_24 (0x000000U << 8)
  66. #define IPORTMXCTR1_OUTBITSEL_20 (0x000001U << 8)
  67. #define IPORTMXCTR1_OUTBITSEL_16 (0x000002U << 8)
  68. #define IPORTMXCTR1_CHSEL_MASK GENMASK(6, 4)
  69. #define IPORTMXCTR1_CHSEL_ALL (0x0 << 4)
  70. #define IPORTMXCTR1_CHSEL_D0_D2 (0x1 << 4)
  71. #define IPORTMXCTR1_CHSEL_D0 (0x2 << 4)
  72. #define IPORTMXCTR1_CHSEL_D1 (0x3 << 4)
  73. #define IPORTMXCTR1_CHSEL_D2 (0x4 << 4)
  74. #define IPORTMXCTR1_CHSEL_DMIX (0x5 << 4)
  75. #define IPORTMXCTR1_FSSEL_MASK GENMASK(3, 0)
  76. #define IPORTMXCTR1_FSSEL_48 (0x0 << 0)
  77. #define IPORTMXCTR1_FSSEL_96 (0x1 << 0)
  78. #define IPORTMXCTR1_FSSEL_192 (0x2 << 0)
  79. #define IPORTMXCTR1_FSSEL_32 (0x3 << 0)
  80. #define IPORTMXCTR1_FSSEL_44_1 (0x4 << 0)
  81. #define IPORTMXCTR1_FSSEL_88_2 (0x5 << 0)
  82. #define IPORTMXCTR1_FSSEL_176_4 (0x6 << 0)
  83. #define IPORTMXCTR1_FSSEL_16 (0x8 << 0)
  84. #define IPORTMXCTR1_FSSEL_22_05 (0x9 << 0)
  85. #define IPORTMXCTR1_FSSEL_24 (0xa << 0)
  86. #define IPORTMXCTR1_FSSEL_8 (0xb << 0)
  87. #define IPORTMXCTR1_FSSEL_11_025 (0xc << 0)
  88. #define IPORTMXCTR1_FSSEL_12 (0xd << 0)
  89. #define IPORTMXCTR2(n) (0x22004 + 0x400 * (n))
  90. #define IPORTMXCTR2_ACLKSEL_MASK GENMASK(19, 16)
  91. #define IPORTMXCTR2_ACLKSEL_A1 (0x0 << 16)
  92. #define IPORTMXCTR2_ACLKSEL_F1 (0x1 << 16)
  93. #define IPORTMXCTR2_ACLKSEL_A2 (0x2 << 16)
  94. #define IPORTMXCTR2_ACLKSEL_F2 (0x3 << 16)
  95. #define IPORTMXCTR2_ACLKSEL_A2PLL (0x4 << 16)
  96. #define IPORTMXCTR2_ACLKSEL_RX1 (0x5 << 16)
  97. #define IPORTMXCTR2_ACLKSEL_RX2 (0x6 << 16)
  98. #define IPORTMXCTR2_MSSEL_MASK BIT(15)
  99. #define IPORTMXCTR2_MSSEL_SLAVE (0x0 << 15)
  100. #define IPORTMXCTR2_MSSEL_MASTER (0x1 << 15)
  101. #define IPORTMXCTR2_EXTLSIFSSEL_MASK BIT(14)
  102. #define IPORTMXCTR2_EXTLSIFSSEL_36 (0x0 << 14)
  103. #define IPORTMXCTR2_EXTLSIFSSEL_24 (0x1 << 14)
  104. #define IPORTMXCTR2_DACCKSEL_MASK GENMASK(9, 8)
  105. #define IPORTMXCTR2_DACCKSEL_1_2 (0x0 << 8)
  106. #define IPORTMXCTR2_DACCKSEL_1_3 (0x1 << 8)
  107. #define IPORTMXCTR2_DACCKSEL_1_1 (0x2 << 8)
  108. #define IPORTMXCTR2_DACCKSEL_2_3 (0x3 << 8)
  109. #define IPORTMXCTR2_REQEN_MASK BIT(0)
  110. #define IPORTMXCTR2_REQEN_DISABLE (0x0 << 0)
  111. #define IPORTMXCTR2_REQEN_ENABLE (0x1 << 0)
  112. #define IPORTMXCNTCTR(n) (0x22010 + 0x400 * (n))
  113. #define IPORTMXCOUNTER(n) (0x22014 + 0x400 * (n))
  114. #define IPORTMXCNTMONI(n) (0x22018 + 0x400 * (n))
  115. #define IPORTMXACLKSEL0EX(n) (0x22020 + 0x400 * (n))
  116. #define IPORTMXACLKSEL0EX_ACLKSEL0EX_MASK GENMASK(3, 0)
  117. #define IPORTMXACLKSEL0EX_ACLKSEL0EX_INTERNAL (0x0 << 0)
  118. #define IPORTMXACLKSEL0EX_ACLKSEL0EX_EXTERNAL (0xf << 0)
  119. #define IPORTMXEXNOE(n) (0x22070 + 0x400 * (n))
  120. #define IPORTMXEXNOE_PCMINOE_MASK BIT(0)
  121. #define IPORTMXEXNOE_PCMINOE_OUTPUT (0x0 << 0)
  122. #define IPORTMXEXNOE_PCMINOE_INPUT (0x1 << 0)
  123. #define IPORTMXMASK(n) (0x22078 + 0x400 * (n))
  124. #define IPORTMXMASK_IUXCKMSK_MASK GENMASK(18, 16)
  125. #define IPORTMXMASK_IUXCKMSK_ON (0x0 << 16)
  126. #define IPORTMXMASK_IUXCKMSK_OFF (0x7 << 16)
  127. #define IPORTMXMASK_XCKMSK_MASK GENMASK(2, 0)
  128. #define IPORTMXMASK_XCKMSK_ON (0x0 << 0)
  129. #define IPORTMXMASK_XCKMSK_OFF (0x7 << 0)
  130. #define IPORTMXRSTCTR(n) (0x2207c + 0x400 * (n))
  131. #define IPORTMXRSTCTR_RSTPI_MASK BIT(7)
  132. #define IPORTMXRSTCTR_RSTPI_RELEASE (0x0 << 7)
  133. #define IPORTMXRSTCTR_RSTPI_RESET (0x1 << 7)
  134. /* AIN(PBinMX) */
  135. #define PBINMXCTR(n) (0x20200 + 0x40 * (n))
  136. #define PBINMXCTR_NCONNECT_MASK BIT(15)
  137. #define PBINMXCTR_NCONNECT_CONNECT (0x0 << 15)
  138. #define PBINMXCTR_NCONNECT_DISCONNECT (0x1 << 15)
  139. #define PBINMXCTR_INOUTSEL_MASK BIT(14)
  140. #define PBINMXCTR_INOUTSEL_IN (0x0 << 14)
  141. #define PBINMXCTR_INOUTSEL_OUT (0x1 << 14)
  142. #define PBINMXCTR_PBINSEL_SHIFT (8)
  143. #define PBINMXCTR_ENDIAN_MASK GENMASK(5, 4)
  144. #define PBINMXCTR_ENDIAN_3210 (0x0 << 4)
  145. #define PBINMXCTR_ENDIAN_0123 (0x1 << 4)
  146. #define PBINMXCTR_ENDIAN_1032 (0x2 << 4)
  147. #define PBINMXCTR_ENDIAN_2301 (0x3 << 4)
  148. #define PBINMXCTR_MEMFMT_MASK GENMASK(3, 0)
  149. #define PBINMXCTR_MEMFMT_D0 (0x0 << 0)
  150. #define PBINMXCTR_MEMFMT_5_1CH_DMIX (0x1 << 0)
  151. #define PBINMXCTR_MEMFMT_6CH (0x2 << 0)
  152. #define PBINMXCTR_MEMFMT_4CH (0x3 << 0)
  153. #define PBINMXCTR_MEMFMT_DMIX (0x4 << 0)
  154. #define PBINMXCTR_MEMFMT_1CH (0x5 << 0)
  155. #define PBINMXCTR_MEMFMT_16LR (0x6 << 0)
  156. #define PBINMXCTR_MEMFMT_7_1CH (0x7 << 0)
  157. #define PBINMXCTR_MEMFMT_7_1CH_DMIX (0x8 << 0)
  158. #define PBINMXCTR_MEMFMT_STREAM (0xf << 0)
  159. #define PBINMXPAUSECTR0(n) (0x20204 + 0x40 * (n))
  160. #define PBINMXPAUSECTR1(n) (0x20208 + 0x40 * (n))
  161. /* AOUT */
  162. #define AOUTFADECTR0 0x40020
  163. #define AOUTENCTR0 0x40040
  164. #define AOUTENCTR1 0x40044
  165. #define AOUTENCTR2 0x40048
  166. #define AOUTRSTCTR0 0x40060
  167. #define AOUTRSTCTR1 0x40064
  168. #define AOUTRSTCTR2 0x40068
  169. #define AOUTSRCRSTCTR0 0x400c0
  170. #define AOUTSRCRSTCTR1 0x400c4
  171. #define AOUTSRCRSTCTR2 0x400c8
  172. /* AOUT PCMOUT has 5 slots, slot0-3: D0-3, slot4: DMIX */
  173. #define OPORT_SLOT_MAX 5
  174. /* AOUT(PCMOUTN) */
  175. #define OPORTMXCTR1(n) (0x42000 + 0x400 * (n))
  176. #define OPORTMXCTR1_I2SLRSEL_MASK (0x11 << 10)
  177. #define OPORTMXCTR1_I2SLRSEL_RIGHT (0x00 << 10)
  178. #define OPORTMXCTR1_I2SLRSEL_LEFT (0x01 << 10)
  179. #define OPORTMXCTR1_I2SLRSEL_I2S (0x11 << 10)
  180. #define OPORTMXCTR1_OUTBITSEL_MASK (0x800003U << 8)
  181. #define OPORTMXCTR1_OUTBITSEL_32 (0x800000U << 8)
  182. #define OPORTMXCTR1_OUTBITSEL_24 (0x000000U << 8)
  183. #define OPORTMXCTR1_OUTBITSEL_20 (0x000001U << 8)
  184. #define OPORTMXCTR1_OUTBITSEL_16 (0x000002U << 8)
  185. #define OPORTMXCTR1_FSSEL_MASK GENMASK(3, 0)
  186. #define OPORTMXCTR1_FSSEL_48 (0x0 << 0)
  187. #define OPORTMXCTR1_FSSEL_96 (0x1 << 0)
  188. #define OPORTMXCTR1_FSSEL_192 (0x2 << 0)
  189. #define OPORTMXCTR1_FSSEL_32 (0x3 << 0)
  190. #define OPORTMXCTR1_FSSEL_44_1 (0x4 << 0)
  191. #define OPORTMXCTR1_FSSEL_88_2 (0x5 << 0)
  192. #define OPORTMXCTR1_FSSEL_176_4 (0x6 << 0)
  193. #define OPORTMXCTR1_FSSEL_16 (0x8 << 0)
  194. #define OPORTMXCTR1_FSSEL_22_05 (0x9 << 0)
  195. #define OPORTMXCTR1_FSSEL_24 (0xa << 0)
  196. #define OPORTMXCTR1_FSSEL_8 (0xb << 0)
  197. #define OPORTMXCTR1_FSSEL_11_025 (0xc << 0)
  198. #define OPORTMXCTR1_FSSEL_12 (0xd << 0)
  199. #define OPORTMXCTR2(n) (0x42004 + 0x400 * (n))
  200. #define OPORTMXCTR2_ACLKSEL_MASK GENMASK(19, 16)
  201. #define OPORTMXCTR2_ACLKSEL_A1 (0x0 << 16)
  202. #define OPORTMXCTR2_ACLKSEL_F1 (0x1 << 16)
  203. #define OPORTMXCTR2_ACLKSEL_A2 (0x2 << 16)
  204. #define OPORTMXCTR2_ACLKSEL_F2 (0x3 << 16)
  205. #define OPORTMXCTR2_ACLKSEL_A2PLL (0x4 << 16)
  206. #define OPORTMXCTR2_ACLKSEL_RX1 (0x5 << 16)
  207. #define OPORTMXCTR2_ACLKSEL_RX2 (0x6 << 16)
  208. #define OPORTMXCTR2_MSSEL_MASK BIT(15)
  209. #define OPORTMXCTR2_MSSEL_SLAVE (0x0 << 15)
  210. #define OPORTMXCTR2_MSSEL_MASTER (0x1 << 15)
  211. #define OPORTMXCTR2_EXTLSIFSSEL_MASK BIT(14)
  212. #define OPORTMXCTR2_EXTLSIFSSEL_36 (0x0 << 14)
  213. #define OPORTMXCTR2_EXTLSIFSSEL_24 (0x1 << 14)
  214. #define OPORTMXCTR2_DACCKSEL_MASK GENMASK(9, 8)
  215. #define OPORTMXCTR2_DACCKSEL_1_2 (0x0 << 8)
  216. #define OPORTMXCTR2_DACCKSEL_1_3 (0x1 << 8)
  217. #define OPORTMXCTR2_DACCKSEL_1_1 (0x2 << 8)
  218. #define OPORTMXCTR2_DACCKSEL_2_3 (0x3 << 8)
  219. #define OPORTMXCTR3(n) (0x42008 + 0x400 * (n))
  220. #define OPORTMXCTR3_IECTHUR_MASK BIT(19)
  221. #define OPORTMXCTR3_IECTHUR_IECOUT (0x0 << 19)
  222. #define OPORTMXCTR3_IECTHUR_IECIN (0x1 << 19)
  223. #define OPORTMXCTR3_SRCSEL_MASK GENMASK(18, 16)
  224. #define OPORTMXCTR3_SRCSEL_PCM (0x0 << 16)
  225. #define OPORTMXCTR3_SRCSEL_STREAM (0x1 << 16)
  226. #define OPORTMXCTR3_SRCSEL_CDDTS (0x2 << 16)
  227. #define OPORTMXCTR3_VALID_MASK BIT(12)
  228. #define OPORTMXCTR3_VALID_PCM (0x0 << 12)
  229. #define OPORTMXCTR3_VALID_STREAM (0x1 << 12)
  230. #define OPORTMXCTR3_PMSEL_MASK BIT(3)
  231. #define OPORTMXCTR3_PMSEL_MUTE (0x0 << 3)
  232. #define OPORTMXCTR3_PMSEL_PAUSE (0x1 << 3)
  233. #define OPORTMXCTR3_PMSW_MASK BIT(2)
  234. #define OPORTMXCTR3_PMSW_MUTE_OFF (0x0 << 2)
  235. #define OPORTMXCTR3_PMSW_MUTE_ON (0x1 << 2)
  236. #define OPORTMXSRC1CTR(n) (0x4200c + 0x400 * (n))
  237. #define OPORTMXSRC1CTR_FSIIPNUM_SHIFT (24)
  238. #define OPORTMXSRC1CTR_THMODE_MASK BIT(23)
  239. #define OPORTMXSRC1CTR_THMODE_SRC (0x0 << 23)
  240. #define OPORTMXSRC1CTR_THMODE_BYPASS (0x1 << 23)
  241. #define OPORTMXSRC1CTR_LOCK_MASK BIT(16)
  242. #define OPORTMXSRC1CTR_LOCK_UNLOCK (0x0 << 16)
  243. #define OPORTMXSRC1CTR_LOCK_LOCK (0x1 << 16)
  244. #define OPORTMXSRC1CTR_SRCPATH_MASK BIT(15)
  245. #define OPORTMXSRC1CTR_SRCPATH_BYPASS (0x0 << 15)
  246. #define OPORTMXSRC1CTR_SRCPATH_CALC (0x1 << 15)
  247. #define OPORTMXSRC1CTR_SYNC_MASK BIT(14)
  248. #define OPORTMXSRC1CTR_SYNC_ASYNC (0x0 << 14)
  249. #define OPORTMXSRC1CTR_SYNC_SYNC (0x1 << 14)
  250. #define OPORTMXSRC1CTR_FSOCK_MASK GENMASK(11, 10)
  251. #define OPORTMXSRC1CTR_FSOCK_44_1 (0x0 << 10)
  252. #define OPORTMXSRC1CTR_FSOCK_48 (0x1 << 10)
  253. #define OPORTMXSRC1CTR_FSOCK_32 (0x2 << 10)
  254. #define OPORTMXSRC1CTR_FSICK_MASK GENMASK(9, 8)
  255. #define OPORTMXSRC1CTR_FSICK_44_1 (0x0 << 8)
  256. #define OPORTMXSRC1CTR_FSICK_48 (0x1 << 8)
  257. #define OPORTMXSRC1CTR_FSICK_32 (0x2 << 8)
  258. #define OPORTMXSRC1CTR_FSIIPSEL_MASK GENMASK(5, 4)
  259. #define OPORTMXSRC1CTR_FSIIPSEL_INNER (0x0 << 4)
  260. #define OPORTMXSRC1CTR_FSIIPSEL_OUTER (0x1 << 4)
  261. #define OPORTMXSRC1CTR_FSISEL_MASK GENMASK(3, 0)
  262. #define OPORTMXSRC1CTR_FSISEL_ACLK (0x0 << 0)
  263. #define OPORTMXSRC1CTR_FSISEL_DD (0x1 << 0)
  264. #define OPORTMXDSDMUTEDAT(n) (0x42020 + 0x400 * (n))
  265. #define OPORTMXDXDFREQMODE(n) (0x42024 + 0x400 * (n))
  266. #define OPORTMXDSDSEL(n) (0x42028 + 0x400 * (n))
  267. #define OPORTMXDSDPORT(n) (0x4202c + 0x400 * (n))
  268. #define OPORTMXACLKSEL0EX(n) (0x42030 + 0x400 * (n))
  269. #define OPORTMXPATH(n) (0x42040 + 0x400 * (n))
  270. #define OPORTMXSYNC(n) (0x42044 + 0x400 * (n))
  271. #define OPORTMXREPET(n) (0x42050 + 0x400 * (n))
  272. #define OPORTMXREPET_STRLENGTH_AC3 SBF_(IEC61937_FRM_STR_AC3, 16)
  273. #define OPORTMXREPET_STRLENGTH_MPA SBF_(IEC61937_FRM_STR_MPA, 16)
  274. #define OPORTMXREPET_STRLENGTH_MP3 SBF_(IEC61937_FRM_STR_MP3, 16)
  275. #define OPORTMXREPET_STRLENGTH_DTS1 SBF_(IEC61937_FRM_STR_DTS1, 16)
  276. #define OPORTMXREPET_STRLENGTH_DTS2 SBF_(IEC61937_FRM_STR_DTS2, 16)
  277. #define OPORTMXREPET_STRLENGTH_DTS3 SBF_(IEC61937_FRM_STR_DTS3, 16)
  278. #define OPORTMXREPET_STRLENGTH_AAC SBF_(IEC61937_FRM_STR_AAC, 16)
  279. #define OPORTMXREPET_PMLENGTH_AC3 SBF_(IEC61937_FRM_PAU_AC3, 0)
  280. #define OPORTMXREPET_PMLENGTH_MPA SBF_(IEC61937_FRM_PAU_MPA, 0)
  281. #define OPORTMXREPET_PMLENGTH_MP3 SBF_(IEC61937_FRM_PAU_MP3, 0)
  282. #define OPORTMXREPET_PMLENGTH_DTS1 SBF_(IEC61937_FRM_PAU_DTS1, 0)
  283. #define OPORTMXREPET_PMLENGTH_DTS2 SBF_(IEC61937_FRM_PAU_DTS2, 0)
  284. #define OPORTMXREPET_PMLENGTH_DTS3 SBF_(IEC61937_FRM_PAU_DTS3, 0)
  285. #define OPORTMXREPET_PMLENGTH_AAC SBF_(IEC61937_FRM_PAU_AAC, 0)
  286. #define OPORTMXPAUDAT(n) (0x42054 + 0x400 * (n))
  287. #define OPORTMXPAUDAT_PAUSEPC_CMN (IEC61937_PC_PAUSE << 16)
  288. #define OPORTMXPAUDAT_PAUSEPD_AC3 (IEC61937_FRM_PAU_AC3 * 4)
  289. #define OPORTMXPAUDAT_PAUSEPD_MPA (IEC61937_FRM_PAU_MPA * 4)
  290. #define OPORTMXPAUDAT_PAUSEPD_MP3 (IEC61937_FRM_PAU_MP3 * 4)
  291. #define OPORTMXPAUDAT_PAUSEPD_DTS1 (IEC61937_FRM_PAU_DTS1 * 4)
  292. #define OPORTMXPAUDAT_PAUSEPD_DTS2 (IEC61937_FRM_PAU_DTS2 * 4)
  293. #define OPORTMXPAUDAT_PAUSEPD_DTS3 (IEC61937_FRM_PAU_DTS3 * 4)
  294. #define OPORTMXPAUDAT_PAUSEPD_AAC (IEC61937_FRM_PAU_AAC * 4)
  295. #define OPORTMXRATE_I(n) (0x420e4 + 0x400 * (n))
  296. #define OPORTMXRATE_I_EQU_MASK BIT(31)
  297. #define OPORTMXRATE_I_EQU_NOTEQUAL (0x0 << 31)
  298. #define OPORTMXRATE_I_EQU_EQUAL (0x1 << 31)
  299. #define OPORTMXRATE_I_SRCBPMD_MASK BIT(29)
  300. #define OPORTMXRATE_I_SRCBPMD_BYPASS (0x0 << 29)
  301. #define OPORTMXRATE_I_SRCBPMD_SRC (0x1 << 29)
  302. #define OPORTMXRATE_I_LRCKSTP_MASK BIT(24)
  303. #define OPORTMXRATE_I_LRCKSTP_START (0x0 << 24)
  304. #define OPORTMXRATE_I_LRCKSTP_STOP (0x1 << 24)
  305. #define OPORTMXRATE_I_ACLKSRC_MASK GENMASK(15, 12)
  306. #define OPORTMXRATE_I_ACLKSRC_APLL (0x0 << 12)
  307. #define OPORTMXRATE_I_ACLKSRC_USB (0x1 << 12)
  308. #define OPORTMXRATE_I_ACLKSRC_HSC (0x3 << 12)
  309. /* if OPORTMXRATE_I_ACLKSRC_APLL */
  310. #define OPORTMXRATE_I_ACLKSEL_MASK GENMASK(11, 8)
  311. #define OPORTMXRATE_I_ACLKSEL_APLLA1 (0x0 << 8)
  312. #define OPORTMXRATE_I_ACLKSEL_APLLF1 (0x1 << 8)
  313. #define OPORTMXRATE_I_ACLKSEL_APLLA2 (0x2 << 8)
  314. #define OPORTMXRATE_I_ACLKSEL_APLLF2 (0x3 << 8)
  315. #define OPORTMXRATE_I_ACLKSEL_APLL (0x4 << 8)
  316. #define OPORTMXRATE_I_ACLKSEL_HDMI1 (0x5 << 8)
  317. #define OPORTMXRATE_I_ACLKSEL_HDMI2 (0x6 << 8)
  318. #define OPORTMXRATE_I_ACLKSEL_AI1ADCCK (0xc << 8)
  319. #define OPORTMXRATE_I_ACLKSEL_AI2ADCCK (0xd << 8)
  320. #define OPORTMXRATE_I_ACLKSEL_AI3ADCCK (0xe << 8)
  321. #define OPORTMXRATE_I_MCKSEL_MASK GENMASK(7, 4)
  322. #define OPORTMXRATE_I_MCKSEL_36 (0x0 << 4)
  323. #define OPORTMXRATE_I_MCKSEL_33 (0x1 << 4)
  324. #define OPORTMXRATE_I_MCKSEL_HSC27 (0xb << 4)
  325. #define OPORTMXRATE_I_FSSEL_MASK GENMASK(3, 0)
  326. #define OPORTMXRATE_I_FSSEL_48 (0x0 << 0)
  327. #define OPORTMXRATE_I_FSSEL_96 (0x1 << 0)
  328. #define OPORTMXRATE_I_FSSEL_192 (0x2 << 0)
  329. #define OPORTMXRATE_I_FSSEL_32 (0x3 << 0)
  330. #define OPORTMXRATE_I_FSSEL_44_1 (0x4 << 0)
  331. #define OPORTMXRATE_I_FSSEL_88_2 (0x5 << 0)
  332. #define OPORTMXRATE_I_FSSEL_176_4 (0x6 << 0)
  333. #define OPORTMXRATE_I_FSSEL_16 (0x8 << 0)
  334. #define OPORTMXRATE_I_FSSEL_22_05 (0x9 << 0)
  335. #define OPORTMXRATE_I_FSSEL_24 (0xa << 0)
  336. #define OPORTMXRATE_I_FSSEL_8 (0xb << 0)
  337. #define OPORTMXRATE_I_FSSEL_11_025 (0xc << 0)
  338. #define OPORTMXRATE_I_FSSEL_12 (0xd << 0)
  339. #define OPORTMXEXNOE(n) (0x420f0 + 0x400 * (n))
  340. #define OPORTMXMASK(n) (0x420f8 + 0x400 * (n))
  341. #define OPORTMXMASK_IUDXMSK_MASK GENMASK(28, 24)
  342. #define OPORTMXMASK_IUDXMSK_ON (0x00 << 24)
  343. #define OPORTMXMASK_IUDXMSK_OFF (0x1f << 24)
  344. #define OPORTMXMASK_IUXCKMSK_MASK GENMASK(18, 16)
  345. #define OPORTMXMASK_IUXCKMSK_ON (0x0 << 16)
  346. #define OPORTMXMASK_IUXCKMSK_OFF (0x7 << 16)
  347. #define OPORTMXMASK_DXMSK_MASK GENMASK(12, 8)
  348. #define OPORTMXMASK_DXMSK_ON (0x00 << 8)
  349. #define OPORTMXMASK_DXMSK_OFF (0x1f << 8)
  350. #define OPORTMXMASK_XCKMSK_MASK GENMASK(2, 0)
  351. #define OPORTMXMASK_XCKMSK_ON (0x0 << 0)
  352. #define OPORTMXMASK_XCKMSK_OFF (0x7 << 0)
  353. #define OPORTMXDEBUG(n) (0x420fc + 0x400 * (n))
  354. #define OPORTMXTYVOLPARA1(n, m) (0x42100 + 0x400 * (n) + 0x20 * (m))
  355. #define OPORTMXTYVOLPARA1_SLOPEU_MASK GENMASK(31, 16)
  356. #define OPORTMXTYVOLPARA2(n, m) (0x42104 + 0x400 * (n) + 0x20 * (m))
  357. #define OPORTMXTYVOLPARA2_FADE_MASK GENMASK(17, 16)
  358. #define OPORTMXTYVOLPARA2_FADE_NOOP (0x0 << 16)
  359. #define OPORTMXTYVOLPARA2_FADE_FADEOUT (0x1 << 16)
  360. #define OPORTMXTYVOLPARA2_FADE_FADEIN (0x2 << 16)
  361. #define OPORTMXTYVOLPARA2_TARGET_MASK GENMASK(15, 0)
  362. #define OPORTMXTYVOLGAINSTATUS(n, m) (0x42108 + 0x400 * (n) + 0x20 * (m))
  363. #define OPORTMXTYVOLGAINSTATUS_CUR_MASK GENMASK(15, 0)
  364. #define OPORTMXTYSLOTCTR(n, m) (0x42114 + 0x400 * (n) + 0x20 * (m))
  365. #define OPORTMXTYSLOTCTR_MODE BIT(15)
  366. #define OPORTMXTYSLOTCTR_SLOTSEL_MASK GENMASK(11, 8)
  367. #define OPORTMXTYSLOTCTR_SLOTSEL_SLOT0 (0x8 << 8)
  368. #define OPORTMXTYSLOTCTR_SLOTSEL_SLOT1 (0x9 << 8)
  369. #define OPORTMXTYSLOTCTR_SLOTSEL_SLOT2 (0xa << 8)
  370. #define OPORTMXTYSLOTCTR_SLOTSEL_SLOT3 (0xb << 8)
  371. #define OPORTMXTYSLOTCTR_SLOTSEL_SLOT4 (0xc << 8)
  372. #define OPORTMXT0SLOTCTR_MUTEOFF_MASK BIT(1)
  373. #define OPORTMXT0SLOTCTR_MUTEOFF_MUTE (0x0 << 1)
  374. #define OPORTMXT0SLOTCTR_MUTEOFF_UNMUTE (0x1 << 1)
  375. #define OPORTMXTYRSTCTR(n, m) (0x4211c + 0x400 * (n) + 0x20 * (m))
  376. #define OPORTMXT0RSTCTR_RST_MASK BIT(1)
  377. #define OPORTMXT0RSTCTR_RST_OFF (0x0 << 1)
  378. #define OPORTMXT0RSTCTR_RST_ON (0x1 << 1)
  379. #define SBF_(frame, shift) (((frame) * 2 - 1) << shift)
  380. /* AOUT(PBoutMX) */
  381. #define PBOUTMXCTR0(n) (0x40200 + 0x40 * (n))
  382. #define PBOUTMXCTR0_ENDIAN_MASK GENMASK(5, 4)
  383. #define PBOUTMXCTR0_ENDIAN_3210 (0x0 << 4)
  384. #define PBOUTMXCTR0_ENDIAN_0123 (0x1 << 4)
  385. #define PBOUTMXCTR0_ENDIAN_1032 (0x2 << 4)
  386. #define PBOUTMXCTR0_ENDIAN_2301 (0x3 << 4)
  387. #define PBOUTMXCTR0_MEMFMT_MASK GENMASK(3, 0)
  388. #define PBOUTMXCTR0_MEMFMT_10CH (0x0 << 0)
  389. #define PBOUTMXCTR0_MEMFMT_8CH (0x1 << 0)
  390. #define PBOUTMXCTR0_MEMFMT_6CH (0x2 << 0)
  391. #define PBOUTMXCTR0_MEMFMT_4CH (0x3 << 0)
  392. #define PBOUTMXCTR0_MEMFMT_2CH (0x4 << 0)
  393. #define PBOUTMXCTR0_MEMFMT_STREAM (0x5 << 0)
  394. #define PBOUTMXCTR0_MEMFMT_1CH (0x6 << 0)
  395. #define PBOUTMXCTR1(n) (0x40204 + 0x40 * (n))
  396. #define PBOUTMXINTCTR(n) (0x40208 + 0x40 * (n))
  397. /* A2D(subsystem) */
  398. #define CDA2D_STRT0 0x10000
  399. #define CDA2D_STRT0_STOP_MASK BIT(31)
  400. #define CDA2D_STRT0_STOP_START (0x0 << 31)
  401. #define CDA2D_STRT0_STOP_STOP (0x1 << 31)
  402. #define CDA2D_STAT0 0x10020
  403. #define CDA2D_TEST 0x100a0
  404. #define CDA2D_TEST_DDR_MODE_MASK GENMASK(3, 2)
  405. #define CDA2D_TEST_DDR_MODE_EXTON0 (0x0 << 2)
  406. #define CDA2D_TEST_DDR_MODE_EXTOFF1 (0x3 << 2)
  407. #define CDA2D_STRTADRSLOAD 0x100b0
  408. #define CDA2D_CHMXCTRL1(n) (0x12000 + 0x80 * (n))
  409. #define CDA2D_CHMXCTRL1_INDSIZE_MASK BIT(0)
  410. #define CDA2D_CHMXCTRL1_INDSIZE_FINITE (0x0 << 0)
  411. #define CDA2D_CHMXCTRL1_INDSIZE_INFINITE (0x1 << 0)
  412. #define CDA2D_CHMXCTRL2(n) (0x12004 + 0x80 * (n))
  413. #define CDA2D_CHMXSRCAMODE(n) (0x12020 + 0x80 * (n))
  414. #define CDA2D_CHMXDSTAMODE(n) (0x12024 + 0x80 * (n))
  415. #define CDA2D_CHMXAMODE_ENDIAN_MASK GENMASK(17, 16)
  416. #define CDA2D_CHMXAMODE_ENDIAN_3210 (0x0 << 16)
  417. #define CDA2D_CHMXAMODE_ENDIAN_0123 (0x1 << 16)
  418. #define CDA2D_CHMXAMODE_ENDIAN_1032 (0x2 << 16)
  419. #define CDA2D_CHMXAMODE_ENDIAN_2301 (0x3 << 16)
  420. #define CDA2D_CHMXAMODE_RSSEL_SHIFT (8)
  421. #define CDA2D_CHMXAMODE_AUPDT_MASK GENMASK(5, 4)
  422. #define CDA2D_CHMXAMODE_AUPDT_INC (0x0 << 4)
  423. #define CDA2D_CHMXAMODE_AUPDT_FIX (0x2 << 4)
  424. #define CDA2D_CHMXAMODE_TYPE_MASK GENMASK(3, 2)
  425. #define CDA2D_CHMXAMODE_TYPE_NORMAL (0x0 << 2)
  426. #define CDA2D_CHMXAMODE_TYPE_RING (0x1 << 2)
  427. #define CDA2D_CHMXSRCSTRTADRS(n) (0x12030 + 0x80 * (n))
  428. #define CDA2D_CHMXSRCSTRTADRSU(n) (0x12034 + 0x80 * (n))
  429. #define CDA2D_CHMXDSTSTRTADRS(n) (0x12038 + 0x80 * (n))
  430. #define CDA2D_CHMXDSTSTRTADRSU(n) (0x1203c + 0x80 * (n))
  431. /* A2D(ring buffer) */
  432. #define CDA2D_RBFLUSH0 0x10040
  433. #define CDA2D_RBADRSLOAD 0x100b4
  434. #define CDA2D_RDPTRLOAD 0x100b8
  435. #define CDA2D_RDPTRLOAD_LSFLAG_LOAD (0x0 << 31)
  436. #define CDA2D_RDPTRLOAD_LSFLAG_STORE (0x1 << 31)
  437. #define CDA2D_WRPTRLOAD 0x100bc
  438. #define CDA2D_WRPTRLOAD_LSFLAG_LOAD (0x0 << 31)
  439. #define CDA2D_WRPTRLOAD_LSFLAG_STORE (0x1 << 31)
  440. #define CDA2D_RBMXBGNADRS(n) (0x14000 + 0x80 * (n))
  441. #define CDA2D_RBMXBGNADRSU(n) (0x14004 + 0x80 * (n))
  442. #define CDA2D_RBMXENDADRS(n) (0x14008 + 0x80 * (n))
  443. #define CDA2D_RBMXENDADRSU(n) (0x1400c + 0x80 * (n))
  444. #define CDA2D_RBMXBTH(n) (0x14038 + 0x80 * (n))
  445. #define CDA2D_RBMXRTH(n) (0x1403c + 0x80 * (n))
  446. #define CDA2D_RBMXRDPTR(n) (0x14020 + 0x80 * (n))
  447. #define CDA2D_RBMXRDPTRU(n) (0x14024 + 0x80 * (n))
  448. #define CDA2D_RBMXWRPTR(n) (0x14028 + 0x80 * (n))
  449. #define CDA2D_RBMXWRPTRU(n) (0x1402c + 0x80 * (n))
  450. #define CDA2D_RBMXPTRU_PTRU_MASK GENMASK(1, 0)
  451. #define CDA2D_RBMXCNFG(n) (0x14030 + 0x80 * (n))
  452. #define CDA2D_RBMXIR(n) (0x14014 + 0x80 * (n))
  453. #define CDA2D_RBMXIE(n) (0x14018 + 0x80 * (n))
  454. #define CDA2D_RBMXID(n) (0x1401c + 0x80 * (n))
  455. #define CDA2D_RBMXIX_SPACE BIT(3)
  456. #define CDA2D_RBMXIX_REMAIN BIT(4)
  457. #endif /* SND_UNIPHIER_AIO_REG_H__ */