vx222.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. /*
  2. * Driver for Digigram VX222 PCI soundcards
  3. *
  4. * Copyright (c) 2002 by Takashi Iwai <tiwai@suse.de>
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  19. */
  20. #ifndef __VX222_H
  21. #define __VX222_H
  22. #include <sound/vx_core.h>
  23. struct snd_vx222 {
  24. struct vx_core core;
  25. /* h/w config; for PLX and for DSP */
  26. struct pci_dev *pci;
  27. unsigned long port[2];
  28. unsigned int regCDSP; /* current CDSP register */
  29. unsigned int regCFG; /* current CFG register */
  30. unsigned int regSELMIC; /* current SELMIC reg. (for VX222 Mic) */
  31. int input_level[2]; /* input level for vx222 mic */
  32. int mic_level; /* mic level for vx222 mic */
  33. };
  34. /* we use a lookup table with 148 values, see vx_mixer.c */
  35. #define VX2_AKM_LEVEL_MAX 0x93
  36. extern struct snd_vx_ops vx222_ops;
  37. extern struct snd_vx_ops vx222_old_ops;
  38. /* Offset of registers with base equal to portDSP. */
  39. #define VX_RESET_DMA_REGISTER_OFFSET 0x00000008
  40. /* Constants used to access the INTCSR register. */
  41. #define VX_INTCSR_VALUE 0x00000001
  42. #define VX_PCI_INTERRUPT_MASK 0x00000040
  43. /* Constants used to access the CDSP register (0x20). */
  44. #define VX_CDSP_TEST1_MASK 0x00000080
  45. #define VX_CDSP_TOR1_MASK 0x00000040
  46. #define VX_CDSP_TOR2_MASK 0x00000020
  47. #define VX_CDSP_RESERVED0_0_MASK 0x00000010
  48. #define VX_CDSP_CODEC_RESET_MASK 0x00000008
  49. #define VX_CDSP_VALID_IRQ_MASK 0x00000004
  50. #define VX_CDSP_TEST0_MASK 0x00000002
  51. #define VX_CDSP_DSP_RESET_MASK 0x00000001
  52. #define VX_CDSP_GPIO_OUT_MASK 0x00000060
  53. #define VX_GPIO_OUT_BIT_OFFSET 5 // transform output to bit 0 and 1
  54. /* Constants used to access the CFG register (0x24). */
  55. #define VX_CFG_SYNCDSP_MASK 0x00000080
  56. #define VX_CFG_RESERVED0_0_MASK 0x00000040
  57. #define VX_CFG_RESERVED1_0_MASK 0x00000020
  58. #define VX_CFG_RESERVED2_0_MASK 0x00000010
  59. #define VX_CFG_DATAIN_SEL_MASK 0x00000008 // 0 (ana), 1 (UER)
  60. #define VX_CFG_RESERVED3_0_MASK 0x00000004
  61. #define VX_CFG_RESERVED4_0_MASK 0x00000002
  62. #define VX_CFG_CLOCKIN_SEL_MASK 0x00000001 // 0 (internal), 1 (AES/EBU)
  63. /* Constants used to access the STATUS register (0x30). */
  64. #define VX_STATUS_DATA_XICOR_MASK 0x00000080
  65. #define VX_STATUS_VAL_TEST1_MASK 0x00000040
  66. #define VX_STATUS_VAL_TEST0_MASK 0x00000020
  67. #define VX_STATUS_RESERVED0_MASK 0x00000010
  68. #define VX_STATUS_VAL_TOR1_MASK 0x00000008
  69. #define VX_STATUS_VAL_TOR0_MASK 0x00000004
  70. #define VX_STATUS_LEVEL_IN_MASK 0x00000002 // 6 dBu (0), 22 dBu (1)
  71. #define VX_STATUS_MEMIRQ_MASK 0x00000001
  72. #define VX_STATUS_GPIO_IN_MASK 0x0000000C
  73. #define VX_GPIO_IN_BIT_OFFSET 0 // leave input as bit 2 and 3
  74. /* Constants used to access the MICRO INPUT SELECT register (0x40). */
  75. #define MICRO_SELECT_INPUT_NORM 0x00
  76. #define MICRO_SELECT_INPUT_MUTE 0x01
  77. #define MICRO_SELECT_INPUT_LIMIT 0x02
  78. #define MICRO_SELECT_INPUT_MASK 0x03
  79. #define MICRO_SELECT_PREAMPLI_G_0 0x00
  80. #define MICRO_SELECT_PREAMPLI_G_1 0x04
  81. #define MICRO_SELECT_PREAMPLI_G_2 0x08
  82. #define MICRO_SELECT_PREAMPLI_G_3 0x0C
  83. #define MICRO_SELECT_PREAMPLI_MASK 0x0C
  84. #define MICRO_SELECT_PREAMPLI_OFFSET 2
  85. #define MICRO_SELECT_RAISE_COMPR 0x10
  86. #define MICRO_SELECT_NOISE_T_52DB 0x00
  87. #define MICRO_SELECT_NOISE_T_42DB 0x20
  88. #define MICRO_SELECT_NOISE_T_32DB 0x40
  89. #define MICRO_SELECT_NOISE_T_MASK 0x60
  90. #define MICRO_SELECT_PHANTOM_ALIM 0x80
  91. #endif /* __VX222_H */