cardwi.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. **********************************************************************
  3. * cardwi.h -- header file for card wave input functions
  4. * Copyright 1999, 2000 Creative Labs, Inc.
  5. *
  6. **********************************************************************
  7. *
  8. * Date Author Summary of changes
  9. * ---- ------ ------------------
  10. * October 20, 1999 Bertrand Lee base code release
  11. *
  12. **********************************************************************
  13. *
  14. * This program is free software; you can redistribute it and/or
  15. * modify it under the terms of the GNU General Public License as
  16. * published by the Free Software Foundation; either version 2 of
  17. * the License, or (at your option) any later version.
  18. *
  19. * This program is distributed in the hope that it will be useful,
  20. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. * GNU General Public License for more details.
  23. *
  24. * You should have received a copy of the GNU General Public
  25. * License along with this program; if not, write to the Free
  26. * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
  27. * USA.
  28. *
  29. **********************************************************************
  30. */
  31. #ifndef _CARDWI_H
  32. #define _CARDWI_H
  33. #include "icardwav.h"
  34. #include "audio.h"
  35. #include "timer.h"
  36. struct wavein_buffer {
  37. u16 ossfragshift;
  38. u32 fragment_size;
  39. u32 numfrags;
  40. u32 hw_pos; /* hardware cursor position */
  41. u32 pos; /* software cursor position */
  42. u32 bytestocopy; /* bytes of recorded data available */
  43. u32 size;
  44. u32 pages;
  45. u32 sizereg;
  46. u32 sizeregval;
  47. u32 addrreg;
  48. u32 idxreg;
  49. u32 adcctl;
  50. void *addr;
  51. u8 cov;
  52. dma_addr_t dma_handle;
  53. };
  54. struct wiinst
  55. {
  56. u8 state;
  57. struct emu_timer timer;
  58. struct wave_format format;
  59. struct wavein_buffer buffer;
  60. wait_queue_head_t wait_queue;
  61. u8 mmapped;
  62. u32 total_recorded; /* total bytes read() from device */
  63. u32 blocks;
  64. spinlock_t lock;
  65. u8 recsrc;
  66. u16 fxwc;
  67. };
  68. #define WAVEIN_MAXBUFSIZE 65536
  69. #define WAVEIN_MINBUFSIZE 368
  70. #define WAVEIN_DEFAULTFRAGLEN 100
  71. #define WAVEIN_DEFAULTBUFLEN 1000
  72. #define WAVEIN_MINFRAGSHIFT 8
  73. #define WAVEIN_MINFRAGS 2
  74. int emu10k1_wavein_open(struct emu10k1_wavedevice *);
  75. void emu10k1_wavein_close(struct emu10k1_wavedevice *);
  76. void emu10k1_wavein_start(struct emu10k1_wavedevice *);
  77. void emu10k1_wavein_stop(struct emu10k1_wavedevice *);
  78. void emu10k1_wavein_getxfersize(struct wiinst *, u32 *);
  79. void emu10k1_wavein_xferdata(struct wiinst *, u8 __user *, u32 *);
  80. int emu10k1_wavein_setformat(struct emu10k1_wavedevice *, struct wave_format *);
  81. void emu10k1_wavein_update(struct emu10k1_card *, struct wiinst *);
  82. #endif /* _CARDWI_H */