saa7146.h 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. /*****************************************************************************
  2. *
  3. * Copyright (C) 2008 Cedric Bregardis <cedric.bregardis@free.fr> and
  4. * Jean-Christian Hassler <jhassler@free.fr>
  5. *
  6. * This file is part of the Audiowerk2 ALSA driver
  7. *
  8. * The Audiowerk2 ALSA driver is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; version 2.
  11. *
  12. * The Audiowerk2 ALSA driver is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with the Audiowerk2 ALSA driver; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
  20. * USA.
  21. *
  22. *****************************************************************************/
  23. /* SAA7146 registers */
  24. #define PCI_BT_A 0x4C
  25. #define IICTFR 0x8C
  26. #define IICSTA 0x90
  27. #define BaseA1_in 0x94
  28. #define ProtA1_in 0x98
  29. #define PageA1_in 0x9C
  30. #define BaseA1_out 0xA0
  31. #define ProtA1_out 0xA4
  32. #define PageA1_out 0xA8
  33. #define BaseA2_in 0xAC
  34. #define ProtA2_in 0xB0
  35. #define PageA2_in 0xB4
  36. #define BaseA2_out 0xB8
  37. #define ProtA2_out 0xBC
  38. #define PageA2_out 0xC0
  39. #define IER 0xDC
  40. #define GPIO_CTRL 0xE0
  41. #define ACON1 0xF4
  42. #define ACON2 0xF8
  43. #define MC1 0xFC
  44. #define MC2 0x100
  45. #define ISR 0x10C
  46. #define PSR 0x110
  47. #define SSR 0x114
  48. #define PCI_ADP1 0x12C
  49. #define PCI_ADP2 0x130
  50. #define PCI_ADP3 0x134
  51. #define PCI_ADP4 0x138
  52. #define LEVEL_REP 0x140
  53. #define FB_BUFFER1 0x144
  54. #define FB_BUFFER2 0x148
  55. #define TSL1 0x180
  56. #define TSL2 0x1C0
  57. #define ME (1UL << 11)
  58. #define LIMIT (1UL << 4)
  59. #define PV (1UL << 3)
  60. /* PSR/ISR/IER */
  61. #define PPEF (1UL << 31)
  62. #define PABO (1UL << 30)
  63. #define IIC_S (1UL << 17)
  64. #define IIC_E (1UL << 16)
  65. #define A2_in (1UL << 15)
  66. #define A2_out (1UL << 14)
  67. #define A1_in (1UL << 13)
  68. #define A1_out (1UL << 12)
  69. #define AFOU (1UL << 11)
  70. #define PIN3 (1UL << 6)
  71. #define PIN2 (1UL << 5)
  72. #define PIN1 (1UL << 4)
  73. #define PIN0 (1UL << 3)
  74. #define ECS (1UL << 2)
  75. #define EC3S (1UL << 1)
  76. #define EC0S (1UL << 0)
  77. /* SSR */
  78. #define PRQ (1UL << 31)
  79. #define PMA (1UL << 30)
  80. #define IIC_EA (1UL << 21)
  81. #define IIC_EW (1UL << 20)
  82. #define IIC_ER (1UL << 19)
  83. #define IIC_EL (1UL << 18)
  84. #define IIC_EF (1UL << 17)
  85. #define AF2_in (1UL << 10)
  86. #define AF2_out (1UL << 9)
  87. #define AF1_in (1UL << 8)
  88. #define AF1_out (1UL << 7)
  89. #define EC5S (1UL << 3)
  90. #define EC4S (1UL << 2)
  91. #define EC2S (1UL << 1)
  92. #define EC1S (1UL << 0)
  93. /* PCI_BT_A */
  94. #define BurstA1_in (1UL << 26)
  95. #define ThreshA1_in (1UL << 24)
  96. #define BurstA1_out (1UL << 18)
  97. #define ThreshA1_out (1UL << 16)
  98. #define BurstA2_in (1UL << 10)
  99. #define ThreshA2_in (1UL << 8)
  100. #define BurstA2_out (1UL << 2)
  101. #define ThreshA2_out (1UL << 0)
  102. /* MC1 */
  103. #define MRST_N (1UL << 15)
  104. #define EAP (1UL << 9)
  105. #define EI2C (1UL << 8)
  106. #define TR_E_A2_OUT (1UL << 3)
  107. #define TR_E_A2_IN (1UL << 2)
  108. #define TR_E_A1_OUT (1UL << 1)
  109. #define TR_E_A1_IN (1UL << 0)
  110. /* MC2 */
  111. #define UPLD_IIC (1UL << 0)
  112. /* ACON1 */
  113. #define AUDIO_MODE (1UL << 29)
  114. #define MAXLEVEL (1UL << 22)
  115. #define A1_SWAP (1UL << 21)
  116. #define A2_SWAP (1UL << 20)
  117. #define WS0_CTRL (1UL << 18)
  118. #define WS0_SYNC (1UL << 16)
  119. #define WS1_CTRL (1UL << 14)
  120. #define WS1_SYNC (1UL << 12)
  121. #define WS2_CTRL (1UL << 10)
  122. #define WS2_SYNC (1UL << 8)
  123. #define WS3_CTRL (1UL << 6)
  124. #define WS3_SYNC (1UL << 4)
  125. #define WS4_CTRL (1UL << 2)
  126. #define WS4_SYNC (1UL << 0)
  127. /* ACON2 */
  128. #define A1_CLKSRC (1UL << 27)
  129. #define A2_CLKSRC (1UL << 22)
  130. #define INVERT_BCLK1 (1UL << 21)
  131. #define INVERT_BCLK2 (1UL << 20)
  132. #define BCLK1_OEN (1UL << 19)
  133. #define BCLK2_OEN (1UL << 18)
  134. /* IICSTA */
  135. #define IICCC (1UL << 8)
  136. #define ABORT (1UL << 7)
  137. #define SPERR (1UL << 6)
  138. #define APERR (1UL << 5)
  139. #define DTERR (1UL << 4)
  140. #define DRERR (1UL << 3)
  141. #define AL (1UL << 2)
  142. #define ERR (1UL << 1)
  143. #define BUSY (1UL << 0)
  144. /* IICTFR */
  145. #define BYTE2 (1UL << 24)
  146. #define BYTE1 (1UL << 16)
  147. #define BYTE0 (1UL << 8)
  148. #define ATRR2 (1UL << 6)
  149. #define ATRR1 (1UL << 4)
  150. #define ATRR0 (1UL << 2)
  151. #define ERR (1UL << 1)
  152. #define BUSY (1UL << 0)
  153. #define START 3
  154. #define CONT 2
  155. #define STOP 1
  156. #define NOP 0