saa7146.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*****************************************************************************
  3. *
  4. * Copyright (C) 2008 Cedric Bregardis <[email protected]> and
  5. * Jean-Christian Hassler <[email protected]>
  6. *
  7. * This file is part of the Audiowerk2 ALSA driver
  8. *
  9. *****************************************************************************/
  10. /* SAA7146 registers */
  11. #define PCI_BT_A 0x4C
  12. #define IICTFR 0x8C
  13. #define IICSTA 0x90
  14. #define BaseA1_in 0x94
  15. #define ProtA1_in 0x98
  16. #define PageA1_in 0x9C
  17. #define BaseA1_out 0xA0
  18. #define ProtA1_out 0xA4
  19. #define PageA1_out 0xA8
  20. #define BaseA2_in 0xAC
  21. #define ProtA2_in 0xB0
  22. #define PageA2_in 0xB4
  23. #define BaseA2_out 0xB8
  24. #define ProtA2_out 0xBC
  25. #define PageA2_out 0xC0
  26. #define IER 0xDC
  27. #define GPIO_CTRL 0xE0
  28. #define ACON1 0xF4
  29. #define ACON2 0xF8
  30. #define MC1 0xFC
  31. #define MC2 0x100
  32. #define ISR 0x10C
  33. #define PSR 0x110
  34. #define SSR 0x114
  35. #define PCI_ADP1 0x12C
  36. #define PCI_ADP2 0x130
  37. #define PCI_ADP3 0x134
  38. #define PCI_ADP4 0x138
  39. #define LEVEL_REP 0x140
  40. #define FB_BUFFER1 0x144
  41. #define FB_BUFFER2 0x148
  42. #define TSL1 0x180
  43. #define TSL2 0x1C0
  44. #define ME (1UL << 11)
  45. #define LIMIT (1UL << 4)
  46. #define PV (1UL << 3)
  47. /* PSR/ISR/IER */
  48. #define PPEF (1UL << 31)
  49. #define PABO (1UL << 30)
  50. #define IIC_S (1UL << 17)
  51. #define IIC_E (1UL << 16)
  52. #define A2_in (1UL << 15)
  53. #define A2_out (1UL << 14)
  54. #define A1_in (1UL << 13)
  55. #define A1_out (1UL << 12)
  56. #define AFOU (1UL << 11)
  57. #define PIN3 (1UL << 6)
  58. #define PIN2 (1UL << 5)
  59. #define PIN1 (1UL << 4)
  60. #define PIN0 (1UL << 3)
  61. #define ECS (1UL << 2)
  62. #define EC3S (1UL << 1)
  63. #define EC0S (1UL << 0)
  64. /* SSR */
  65. #define PRQ (1UL << 31)
  66. #define PMA (1UL << 30)
  67. #define IIC_EA (1UL << 21)
  68. #define IIC_EW (1UL << 20)
  69. #define IIC_ER (1UL << 19)
  70. #define IIC_EL (1UL << 18)
  71. #define IIC_EF (1UL << 17)
  72. #define AF2_in (1UL << 10)
  73. #define AF2_out (1UL << 9)
  74. #define AF1_in (1UL << 8)
  75. #define AF1_out (1UL << 7)
  76. #define EC5S (1UL << 3)
  77. #define EC4S (1UL << 2)
  78. #define EC2S (1UL << 1)
  79. #define EC1S (1UL << 0)
  80. /* PCI_BT_A */
  81. #define BurstA1_in (1UL << 26)
  82. #define ThreshA1_in (1UL << 24)
  83. #define BurstA1_out (1UL << 18)
  84. #define ThreshA1_out (1UL << 16)
  85. #define BurstA2_in (1UL << 10)
  86. #define ThreshA2_in (1UL << 8)
  87. #define BurstA2_out (1UL << 2)
  88. #define ThreshA2_out (1UL << 0)
  89. /* MC1 */
  90. #define MRST_N (1UL << 15)
  91. #define EAP (1UL << 9)
  92. #define EI2C (1UL << 8)
  93. #define TR_E_A2_OUT (1UL << 3)
  94. #define TR_E_A2_IN (1UL << 2)
  95. #define TR_E_A1_OUT (1UL << 1)
  96. #define TR_E_A1_IN (1UL << 0)
  97. /* MC2 */
  98. #define UPLD_IIC (1UL << 0)
  99. /* ACON1 */
  100. #define AUDIO_MODE (1UL << 29)
  101. #define MAXLEVEL (1UL << 22)
  102. #define A1_SWAP (1UL << 21)
  103. #define A2_SWAP (1UL << 20)
  104. #define WS0_CTRL (1UL << 18)
  105. #define WS0_SYNC (1UL << 16)
  106. #define WS1_CTRL (1UL << 14)
  107. #define WS1_SYNC (1UL << 12)
  108. #define WS2_CTRL (1UL << 10)
  109. #define WS2_SYNC (1UL << 8)
  110. #define WS3_CTRL (1UL << 6)
  111. #define WS3_SYNC (1UL << 4)
  112. #define WS4_CTRL (1UL << 2)
  113. #define WS4_SYNC (1UL << 0)
  114. /* ACON2 */
  115. #define A1_CLKSRC (1UL << 27)
  116. #define A2_CLKSRC (1UL << 22)
  117. #define INVERT_BCLK1 (1UL << 21)
  118. #define INVERT_BCLK2 (1UL << 20)
  119. #define BCLK1_OEN (1UL << 19)
  120. #define BCLK2_OEN (1UL << 18)
  121. /* IICSTA */
  122. #define IICCC (1UL << 8)
  123. #define ABORT (1UL << 7)
  124. #define SPERR (1UL << 6)
  125. #define APERR (1UL << 5)
  126. #define DTERR (1UL << 4)
  127. #define DRERR (1UL << 3)
  128. #define AL (1UL << 2)
  129. #define ERR (1UL << 1)
  130. #define BUSY (1UL << 0)
  131. /* IICTFR */
  132. #define BYTE2 (1UL << 24)
  133. #define BYTE1 (1UL << 16)
  134. #define BYTE0 (1UL << 8)
  135. #define ATRR2 (1UL << 6)
  136. #define ATRR1 (1UL << 4)
  137. #define ATRR0 (1UL << 2)
  138. #define ERR (1UL << 1)
  139. #define BUSY (1UL << 0)
  140. #define START 3
  141. #define CONT 2
  142. #define STOP 1
  143. #define NOP 0