vxpocket.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * Driver for Digigram VXpocket soundcards
  4. *
  5. * Copyright (c) 2002 by Takashi Iwai <tiwai@suse.de>
  6. */
  7. #ifndef __VXPOCKET_H
  8. #define __VXPOCKET_H
  9. #include <sound/vx_core.h>
  10. #include <pcmcia/cistpl.h>
  11. #include <pcmcia/ds.h>
  12. struct snd_vxpocket {
  13. struct vx_core core;
  14. unsigned long port;
  15. int mic_level; /* analog mic level (or boost) */
  16. unsigned int regCDSP; /* current CDSP register */
  17. unsigned int regDIALOG; /* current DIALOG register */
  18. int index; /* card index */
  19. /* pcmcia stuff */
  20. struct pcmcia_device *p_dev;
  21. };
  22. #define to_vxpocket(x) container_of(x, struct snd_vxpocket, core)
  23. extern const struct snd_vx_ops snd_vxpocket_ops;
  24. void vx_set_mic_boost(struct vx_core *chip, int boost);
  25. void vx_set_mic_level(struct vx_core *chip, int level);
  26. int vxp_add_mic_controls(struct vx_core *chip);
  27. /* Constants used to access the CDSP register (0x08). */
  28. #define CDSP_MAGIC 0xA7 /* magic value (for read) */
  29. /* for write */
  30. #define VXP_CDSP_CLOCKIN_SEL_MASK 0x80 /* 0 (internal), 1 (AES/EBU) */
  31. #define VXP_CDSP_DATAIN_SEL_MASK 0x40 /* 0 (analog), 1 (UER) */
  32. #define VXP_CDSP_SMPTE_SEL_MASK 0x20
  33. #define VXP_CDSP_RESERVED_MASK 0x10
  34. #define VXP_CDSP_MIC_SEL_MASK 0x08
  35. #define VXP_CDSP_VALID_IRQ_MASK 0x04
  36. #define VXP_CDSP_CODEC_RESET_MASK 0x02
  37. #define VXP_CDSP_DSP_RESET_MASK 0x01
  38. /* VXPOCKET 240/440 */
  39. #define P24_CDSP_MICS_SEL_MASK 0x18
  40. #define P24_CDSP_MIC20_SEL_MASK 0x10
  41. #define P24_CDSP_MIC38_SEL_MASK 0x08
  42. /* Constants used to access the MEMIRQ register (0x0C). */
  43. #define P44_MEMIRQ_MASTER_SLAVE_SEL_MASK 0x08
  44. #define P44_MEMIRQ_SYNCED_ALONE_SEL_MASK 0x04
  45. #define P44_MEMIRQ_WCLK_OUT_IN_SEL_MASK 0x02 /* Not used */
  46. #define P44_MEMIRQ_WCLK_UER_SEL_MASK 0x01 /* Not used */
  47. /* Micro levels (0x0C) */
  48. /* Constants used to access the DIALOG register (0x0D). */
  49. #define VXP_DLG_XILINX_REPROG_MASK 0x80 /* W */
  50. #define VXP_DLG_DATA_XICOR_MASK 0x80 /* R */
  51. #define VXP_DLG_RESERVED4_0_MASK 0x40
  52. #define VXP_DLG_RESERVED2_0_MASK 0x20
  53. #define VXP_DLG_RESERVED1_0_MASK 0x10
  54. #define VXP_DLG_DMAWRITE_SEL_MASK 0x08 /* W */
  55. #define VXP_DLG_DMAREAD_SEL_MASK 0x04 /* W */
  56. #define VXP_DLG_MEMIRQ_MASK 0x02 /* R */
  57. #define VXP_DLG_DMA16_SEL_MASK 0x02 /* W */
  58. #define VXP_DLG_ACK_MEMIRQ_MASK 0x01 /* R/W */
  59. #endif /* __VXPOCKET_H */