aw2-saa7146.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  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. #ifndef AW2_SAA7146_H
  24. #define AW2_SAA7146_H
  25. #define NB_STREAM_PLAYBACK 2
  26. #define NB_STREAM_CAPTURE 1
  27. #define NUM_STREAM_PLAYBACK_ANA 0
  28. #define NUM_STREAM_PLAYBACK_DIG 1
  29. #define NUM_STREAM_CAPTURE_ANA 0
  30. typedef void (*snd_aw2_saa7146_it_cb) (void *);
  31. struct snd_aw2_saa7146_cb_param {
  32. snd_aw2_saa7146_it_cb p_it_callback;
  33. void *p_callback_param;
  34. };
  35. /* definition of the chip-specific record */
  36. struct snd_aw2_saa7146 {
  37. void __iomem *base_addr;
  38. };
  39. extern void snd_aw2_saa7146_setup(struct snd_aw2_saa7146 *chip,
  40. void __iomem *pci_base_addr);
  41. extern int snd_aw2_saa7146_free(struct snd_aw2_saa7146 *chip);
  42. extern void snd_aw2_saa7146_pcm_init_playback(struct snd_aw2_saa7146 *chip,
  43. int stream_number,
  44. unsigned long dma_addr,
  45. unsigned long period_size,
  46. unsigned long buffer_size);
  47. extern void snd_aw2_saa7146_pcm_init_capture(struct snd_aw2_saa7146 *chip,
  48. int stream_number,
  49. unsigned long dma_addr,
  50. unsigned long period_size,
  51. unsigned long buffer_size);
  52. extern void snd_aw2_saa7146_define_it_playback_callback(unsigned int
  53. stream_number,
  54. snd_aw2_saa7146_it_cb
  55. p_it_callback,
  56. void *p_callback_param);
  57. extern void snd_aw2_saa7146_define_it_capture_callback(unsigned int
  58. stream_number,
  59. snd_aw2_saa7146_it_cb
  60. p_it_callback,
  61. void *p_callback_param);
  62. extern void snd_aw2_saa7146_pcm_trigger_start_capture(struct snd_aw2_saa7146
  63. *chip, int stream_number);
  64. extern void snd_aw2_saa7146_pcm_trigger_stop_capture(struct snd_aw2_saa7146
  65. *chip, int stream_number);
  66. extern void snd_aw2_saa7146_pcm_trigger_start_playback(struct snd_aw2_saa7146
  67. *chip,
  68. int stream_number);
  69. extern void snd_aw2_saa7146_pcm_trigger_stop_playback(struct snd_aw2_saa7146
  70. *chip, int stream_number);
  71. extern irqreturn_t snd_aw2_saa7146_interrupt(int irq, void *dev_id);
  72. extern unsigned int snd_aw2_saa7146_get_hw_ptr_playback(struct snd_aw2_saa7146
  73. *chip,
  74. int stream_number,
  75. unsigned char
  76. *start_addr,
  77. unsigned int
  78. buffer_size);
  79. extern unsigned int snd_aw2_saa7146_get_hw_ptr_capture(struct snd_aw2_saa7146
  80. *chip,
  81. int stream_number,
  82. unsigned char
  83. *start_addr,
  84. unsigned int
  85. buffer_size);
  86. extern void snd_aw2_saa7146_use_digital_input(struct snd_aw2_saa7146 *chip,
  87. int use_digital);
  88. extern int snd_aw2_saa7146_is_using_digital_input(struct snd_aw2_saa7146
  89. *chip);
  90. #endif