Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

169 lines
6.5 KiB

  1. /********************************************************************************
  2. ** Copyright (c) 1998-2000 Microsoft Corporation. All Rights Reserved.
  3. **
  4. ** Portions Copyright (c) 1998-1999 Intel Corporation
  5. **
  6. ********************************************************************************/
  7. #ifndef _AC97REG_H_
  8. #define _AC97REG_H_
  9. // We use enum types cause the compiler can check variable passing if it is
  10. // an enum (otherwise you could pass any value). That doesn't save us from
  11. // doing reasonable run time checks in that range.
  12. enum AC97Register
  13. {
  14. AC97REG_RESET = 0,
  15. AC97REG_MASTER_VOLUME,
  16. AC97REG_HPHONE_VOLUME,
  17. AC97REG_MMONO_VOLUME,
  18. AC97REG_MASTER_TONE,
  19. AC97REG_BEEP_VOLUME,
  20. AC97REG_PHONE_VOLUME,
  21. AC97REG_MIC_VOLUME,
  22. AC97REG_LINE_IN_VOLUME,
  23. AC97REG_CD_VOLUME,
  24. AC97REG_VIDEO_VOLUME,
  25. AC97REG_AUX_VOLUME,
  26. AC97REG_PCM_OUT_VOLUME,
  27. AC97REG_RECORD_SELECT,
  28. AC97REG_RECORD_GAIN,
  29. AC97REG_RECORD_GAIN_MIC,
  30. AC97REG_GENERAL,
  31. AC97REG_3D_CONTROL,
  32. AC97REG_RESERVED,
  33. AC97REG_POWERDOWN,
  34. // AC97-2.0 registers
  35. AC97REG_EXT_AUDIO_ID,
  36. AC97REG_EXT_AUDIO_CTRL,
  37. AC97REG_FRONT_SAMPLERATE,
  38. AC97REG_SURROUND_SAMPLERATE,
  39. AC97REG_LFE_SAMPLERATE,
  40. AC97REG_RECORD_SAMPLERATE,
  41. AC97REG_MIC_SAMPLERATE,
  42. AC97REG_CENTER_LFE_VOLUME,
  43. AC97REG_SURROUND_VOLUME,
  44. AC97REG_RESERVED2,
  45. // Modem registers from 0x3C to 0x58 (next 15 enums)
  46. // Vendor Reserved = 0x5A-0x7A (next 16 enums)
  47. // Vendor IDs
  48. AC97REG_VENDOR_ID1 = 0x3E, // thats register address 0x7C
  49. AC97REG_VENDOR_ID2,
  50. // Defines an invalid register. Likewise, this is the highest
  51. // possible value that can be used.
  52. AC97REG_INVALID
  53. };
  54. #if (DBG)
  55. // Note: This array only has the first 29 registers defined.
  56. // There are many more.
  57. const PCHAR RegStrings[] =
  58. {
  59. "REG_RESET",
  60. "REG_MASTER_VOLUME",
  61. "REG_HPHONE_VOLUME",
  62. "REG_MMONO_VOLUME",
  63. "REG_MASTER_TONE",
  64. "REG_BEEP_VOLUME",
  65. "REG_PHONE_VOLUME",
  66. "REG_MIC_VOLUME",
  67. "REG_LINEIN_VOLUME",
  68. "REG_CD_VOLUME",
  69. "REG_VIDEO_VOLUME",
  70. "REG_AUX_VOLUME",
  71. "REG_PCMOUT_VOLUME",
  72. "REG_RECORD_SELECT",
  73. "REG_RECORD_GAIN",
  74. "REG_RECORD_GAIN_MIC",
  75. "REG_GENERAL",
  76. "REG_3D_CONTROL",
  77. "REG_RESERVED",
  78. "REG_POWERDOWN",
  79. "REG_EXT_AUDIO_ID",
  80. "REG_EXT_AUDIO_CTRL",
  81. "REG_FRONT_SAMPLERATE",
  82. "REG_SURROUND_SAMPLERATE",
  83. "REG_LFE_SAMPLERATE",
  84. "REG_RECORD_SAMPLERATE",
  85. "REG_MIC_SAMPLERATE",
  86. "REG_CENTER_LFE_VOLUME",
  87. "REG_SURROUND_VOLUME",
  88. "REG_RESERVED2"
  89. };
  90. #endif
  91. // This array maps the node controls to the AC97 registers.
  92. // E.g. if you mute the master volume control you should modify AC97
  93. // register AC97REG_MASTER_VOLUME
  94. typedef struct {
  95. AC97Register reg; // we would only need one byte, but enums are int
  96. WORD mask; // registers are 16 bit.
  97. } tMapNodeToReg;
  98. const tMapNodeToReg stMapNodeToReg[] =
  99. {
  100. // TODO: loopback
  101. {AC97REG_PCM_OUT_VOLUME, 0x1F1F}, // NODE_WAVEOUT_VOLUME
  102. {AC97REG_PCM_OUT_VOLUME, 0x8000}, // NODE_WAVEOUT_MUTE
  103. {AC97REG_GENERAL, 0x8000}, // NODE_VIRT_WAVEOUT_3D_BYPASS
  104. {AC97REG_BEEP_VOLUME, 0x001E}, // NODE_PCBEEP_VOLUME
  105. {AC97REG_BEEP_VOLUME, 0x8000}, // NODE_PCBEEP_MUTE
  106. {AC97REG_PHONE_VOLUME, 0x001F}, // NODE_PHONE_VOLUME
  107. {AC97REG_PHONE_VOLUME, 0x8000}, // NODE_PHONE_MUTE
  108. {AC97REG_GENERAL, 0x0100}, // NODE_MIC_SELECT
  109. {AC97REG_MIC_VOLUME, 0x0040}, // NODE_MIC_BOOST
  110. {AC97REG_MIC_VOLUME, 0x001F}, // NODE_MIC_VOLUME
  111. {AC97REG_MIC_VOLUME, 0x8000}, // NODE_MIC_MUTE
  112. {AC97REG_LINE_IN_VOLUME, 0x1F1F}, // NODE_LINEIN_VOLUME
  113. {AC97REG_LINE_IN_VOLUME, 0x8000}, // NODE_LINEIN_MUTE
  114. {AC97REG_CD_VOLUME, 0x1F1F}, // NODE_CD_VOLUME
  115. {AC97REG_CD_VOLUME, 0x8000}, // NODE_CD_MUTE
  116. {AC97REG_VIDEO_VOLUME, 0x1F1F}, // NODE_VIDEO_VOLUME
  117. {AC97REG_VIDEO_VOLUME, 0x8000}, // NODE_VIDEO_MUTE
  118. {AC97REG_AUX_VOLUME, 0x1F1F}, // NODE_AUX_VOLUME
  119. {AC97REG_AUX_VOLUME, 0x8000}, // NODE_AUX_MUTE
  120. {AC97REG_INVALID, 0x0000}, // NODE_MAIN_MIX doesn't has controls
  121. {AC97REG_3D_CONTROL, 0x0F00}, // NODE_VIRT_3D_CENTER
  122. {AC97REG_3D_CONTROL, 0x000F}, // NODE_VIRT_3D_DEPTH
  123. {AC97REG_GENERAL, 0x2000}, // NODE_VIRT_3D_ENABLE
  124. {AC97REG_INVALID, 0x0000}, // NODE_BEEP_MIX doesn't has controls
  125. {AC97REG_MASTER_TONE, 0x0F00}, // NODE_BASS
  126. {AC97REG_MASTER_TONE, 0x000F}, // NODE_TREBLE
  127. {AC97REG_GENERAL, 0x1000}, // NODE_LOUDNESS
  128. {AC97REG_GENERAL, 0x4000}, // NODE_SIMUL_STEREO
  129. {AC97REG_MASTER_VOLUME, 0x3F3F}, // NODE_MASTEROUT_VOLUME
  130. {AC97REG_MASTER_VOLUME, 0x8000}, // NODE_MASTEROUT_MUTE
  131. {AC97REG_HPHONE_VOLUME, 0x3F3F}, // NODE_HPHONE_VOLUME
  132. {AC97REG_HPHONE_VOLUME, 0x8000}, // NODE_HPHONE_MUTE
  133. {AC97REG_GENERAL, 0x0200}, // NODE_MONOOUT_SELECT
  134. {AC97REG_MMONO_VOLUME, 0x803F}, // NODE_VIRT_MONOOUT_VOLUME1
  135. {AC97REG_MMONO_VOLUME, 0x803F}, // NODE_VIRT_MONOOUT_VOLUME2
  136. {AC97REG_RECORD_SELECT, 0x0707}, // NODE_WAVEIN_SELECT
  137. {AC97REG_RECORD_GAIN, 0x0F0F}, // NODE_VIRT_MASTER_INPUT_VOLUME1
  138. {AC97REG_RECORD_GAIN, 0x0F0F}, // NODE_VIRT_MASTER_INPUT_VOLUME2
  139. {AC97REG_RECORD_GAIN, 0x0F0F}, // NODE_VIRT_MASTER_INPUT_VOLUME3
  140. {AC97REG_RECORD_GAIN, 0x0F0F}, // NODE_VIRT_MASTER_INPUT_VOLUME4
  141. {AC97REG_RECORD_GAIN, 0x0F0F}, // NODE_VIRT_MASTER_INPUT_VOLUME5
  142. {AC97REG_RECORD_GAIN, 0x0F0F}, // NODE_VIRT_MASTER_INPUT_VOLUME6
  143. {AC97REG_RECORD_GAIN, 0x0F0F}, // NODE_VIRT_MASTER_INPUT_VOLUME7
  144. {AC97REG_RECORD_GAIN, 0x0F0F}, // NODE_VIRT_MASTER_INPUT_VOLUME8
  145. {AC97REG_RECORD_GAIN_MIC, 0x000F}, // NODE_MICIN_VOLUME
  146. {AC97REG_RECORD_GAIN_MIC, 0x8000}, // NODE_MICIN_MUTE
  147. {AC97REG_SURROUND_VOLUME, 0x3F3F}, // NODE_SURROUND_VOLUME
  148. {AC97REG_SURROUND_VOLUME, 0x8080}, // NODE_SURROUND_MUTE
  149. {AC97REG_CENTER_LFE_VOLUME, 0x3F00},// NODE_CENTER_VOLUME
  150. {AC97REG_CENTER_LFE_VOLUME, 0x8000},// NODE_CENTER_MUTE
  151. {AC97REG_CENTER_LFE_VOLUME, 0x003F},// NODE_LFE_VOLUME
  152. {AC97REG_CENTER_LFE_VOLUME, 0x0080},// NODE_LFE_MUTE
  153. {AC97REG_MASTER_VOLUME, 0x3F3F}, // NODE_FRONT_VOLUME
  154. {AC97REG_MASTER_VOLUME, 0x8000}, // NODE_FRONT_MUTE
  155. {AC97REG_INVALID, 0x0000}, // NODE_VIRT_MASTERMONO_VOLUME doesn't have controls
  156. {AC97REG_INVALID, 0x0000} // NODE_VIRT_MASTERMONO_MUTE doesn't have controls
  157. };
  158. #endif //_AC97REG_H_