sound_config.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. /* sound_config.h
  2. *
  3. * A driver for sound cards, misc. configuration parameters.
  4. */
  5. /*
  6. * Copyright (C) by Hannu Savolainen 1993-1997
  7. *
  8. * OSS/Free for Linux is distributed under the GNU GENERAL PUBLIC LICENSE (GPL)
  9. * Version 2 (June 1991). See the "COPYING" file distributed with this software
  10. * for more info.
  11. */
  12. #ifndef _SOUND_CONFIG_H_
  13. #define _SOUND_CONFIG_H_
  14. #include <linux/fs.h>
  15. #include <linux/sound.h>
  16. #include "os.h"
  17. #include "soundvers.h"
  18. #ifndef SND_DEFAULT_ENABLE
  19. #define SND_DEFAULT_ENABLE 1
  20. #endif
  21. #ifndef MAX_REALTIME_FACTOR
  22. #define MAX_REALTIME_FACTOR 4
  23. #endif
  24. /*
  25. * Use always 64k buffer size. There is no reason to use shorter.
  26. */
  27. #undef DSP_BUFFSIZE
  28. #define DSP_BUFFSIZE (64*1024)
  29. #ifndef DSP_BUFFCOUNT
  30. #define DSP_BUFFCOUNT 1 /* 1 is recommended. */
  31. #endif
  32. #define FM_MONO 0x388 /* This is the I/O address used by AdLib */
  33. #ifndef CONFIG_PAS_BASE
  34. #define CONFIG_PAS_BASE 0x388
  35. #endif
  36. /* SEQ_MAX_QUEUE is the maximum number of sequencer events buffered by the
  37. driver. (There is no need to alter this) */
  38. #define SEQ_MAX_QUEUE 1024
  39. #define SBFM_MAXINSTR (256) /* Size of the FM Instrument bank */
  40. /* 128 instruments for general MIDI setup and 16 unassigned */
  41. #define SND_NDEVS 256 /* Number of supported devices */
  42. #define DSP_DEFAULT_SPEED 8000
  43. #define MAX_AUDIO_DEV 5
  44. #define MAX_MIXER_DEV 5
  45. #define MAX_SYNTH_DEV 5
  46. #define MAX_MIDI_DEV 6
  47. #define MAX_TIMER_DEV 4
  48. struct address_info {
  49. int io_base;
  50. int irq;
  51. int dma;
  52. int dma2;
  53. int always_detect; /* 1=Trust me, it's there */
  54. char *name;
  55. int driver_use_1; /* Driver defined field 1 */
  56. int driver_use_2; /* Driver defined field 2 */
  57. int *osp; /* OS specific info */
  58. int card_subtype; /* Driver specific. Usually 0 */
  59. void *memptr; /* Module memory chainer */
  60. int slots[6]; /* To remember driver slot ids */
  61. };
  62. #define SYNTH_MAX_VOICES 32
  63. struct voice_alloc_info {
  64. int max_voice;
  65. int used_voices;
  66. int ptr; /* For device specific use */
  67. unsigned short map[SYNTH_MAX_VOICES]; /* (ch << 8) | (note+1) */
  68. int timestamp;
  69. int alloc_times[SYNTH_MAX_VOICES];
  70. };
  71. struct channel_info {
  72. int pgm_num;
  73. int bender_value;
  74. int bender_range;
  75. unsigned char controllers[128];
  76. };
  77. /*
  78. * Process wakeup reasons
  79. */
  80. #define WK_NONE 0x00
  81. #define WK_WAKEUP 0x01
  82. #define WK_TIMEOUT 0x02
  83. #define WK_SIGNAL 0x04
  84. #define WK_SLEEP 0x08
  85. #define WK_SELECT 0x10
  86. #define WK_ABORT 0x20
  87. #define OPEN_READ PCM_ENABLE_INPUT
  88. #define OPEN_WRITE PCM_ENABLE_OUTPUT
  89. #define OPEN_READWRITE (OPEN_READ|OPEN_WRITE)
  90. #if OPEN_READ == FMODE_READ && OPEN_WRITE == FMODE_WRITE
  91. static inline int translate_mode(struct file *file)
  92. {
  93. return file->f_mode;
  94. }
  95. #else
  96. static inline int translate_mode(struct file *file)
  97. {
  98. return ((file->f_mode & FMODE_READ) ? OPEN_READ : 0) |
  99. ((file->f_mode & FMODE_WRITE) ? OPEN_WRITE : 0);
  100. }
  101. #endif
  102. #include "sound_calls.h"
  103. #include "dev_table.h"
  104. #ifndef DEB
  105. #define DEB(x)
  106. #endif
  107. #ifndef DDB
  108. #define DDB(x) do {} while (0)
  109. #endif
  110. #ifndef MDB
  111. #ifdef MODULE
  112. #define MDB(x) x
  113. #else
  114. #define MDB(x)
  115. #endif
  116. #endif
  117. #define TIMER_ARMED 121234
  118. #define TIMER_NOT_ARMED 1
  119. #endif