home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / KERNEL-S / V1.0 / LINUX-1.0 / LINUX-1 / linux / drivers / sound / sound_config.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-01-21  |  5.3 KB  |  234 lines

  1. /* sound_config.h
  2.  *
  3.  * A driver for Soundcards, misc configuration parameters.
  4.  *
  5.  * 
  6.  * Copyright by Hannu Savolainen 1993
  7.  *
  8.  * Redistribution and use in source and binary forms, with or without
  9.  * modification, are permitted provided that the following conditions
  10.  * are met:
  11.  * 1. Redistributions of source code must retain the above copyright
  12.  *    notice, this list of conditions and the following disclaimer.
  13.  * 2. Redistributions in binary form must reproduce the above copyright
  14.  *    notice, this list of conditions and the following disclaimer in the
  15.  *    documentation and/or other materials provided with the distribution.
  16.  *
  17.  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  18.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  19.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  20.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
  21.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  22.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  23.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  24.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  25.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  26.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  27.  * SUCH DAMAGE.
  28.  *
  29.  */
  30.  
  31. #include "local.h"
  32.  
  33.  
  34. #undef CONFIGURE_SOUNDCARD
  35. #undef DYNAMIC_BUFFER
  36.  
  37. #ifdef KERNEL_SOUNDCARD
  38. #define CONFIGURE_SOUNDCARD
  39. #define DYNAMIC_BUFFER
  40. #undef LOADABLE_SOUNDCARD
  41. #endif
  42.  
  43. #ifdef EXCLUDE_SEQUENCER
  44. #define EXCLUDE_MIDI
  45. #define EXCLUDE_YM3812
  46. #define EXCLUDE_OPL3
  47. #endif
  48.  
  49. #ifndef SND_DEFAULT_ENABLE
  50. #define SND_DEFAULT_ENABLE    1
  51. #endif
  52.  
  53. /** UWM - new MIDI stuff **/
  54.  
  55. #ifdef EXCLUDE_CHIP_MIDI
  56. #define EXCLUDE_PRO_MIDI
  57. #endif
  58.  
  59. /** UWM - stuff **/
  60.  
  61. #if defined(EXCLUDE_SEQUENCER) && defined(EXCLUDE_AUDIO)
  62. #undef CONFIGURE_SOUNDCARD
  63. #endif
  64.  
  65. #ifdef CONFIGURE_SOUNDCARD
  66.  
  67. /* ****** IO-address, DMA and IRQ settings ****
  68.  
  69. If your card has nonstandard I/O address or IRQ number, change defines
  70.    for the following settings in your kernel Makefile */
  71.  
  72. #ifndef SBC_BASE
  73. #define SBC_BASE    0x220    /* 0x220 is the factory default. */
  74. #endif
  75.  
  76. #ifndef SBC_IRQ
  77. #define SBC_IRQ        7    /* IQR7 is the factory default.     */
  78. #endif
  79.  
  80. #ifndef SBC_DMA
  81. #define SBC_DMA        1
  82. #endif
  83.  
  84. #ifndef SB16_DMA
  85. #define SB16_DMA    6
  86. #endif
  87.  
  88. #ifndef SB16MIDI_BASE
  89. #define SB16MIDI_BASE    0x300
  90. #endif
  91.  
  92. #ifndef PAS_BASE
  93. #define PAS_BASE    0x388
  94. #endif
  95.  
  96. #ifndef PAS_IRQ
  97. #define PAS_IRQ        5
  98. #endif
  99.  
  100. #ifndef PAS_DMA
  101. #define PAS_DMA        3
  102. #endif
  103.  
  104. #ifndef GUS_BASE
  105. #define GUS_BASE    0x220
  106. #endif
  107.  
  108. #ifndef GUS_IRQ
  109. #define GUS_IRQ        15
  110. #endif
  111.  
  112. #ifndef GUS_MIDI_IRQ
  113. #define GUS_MIDI_IRQ    GUS_IRQ
  114. #endif
  115.  
  116. #ifndef GUS_DMA
  117. #define GUS_DMA        6
  118. #endif
  119.  
  120. #ifndef MPU_BASE
  121. #define MPU_BASE    0x330
  122. #endif
  123.  
  124. #ifndef MPU_IRQ
  125. #define MPU_IRQ        6
  126. #endif
  127.  
  128. #ifndef MAX_REALTIME_FACTOR
  129. #define MAX_REALTIME_FACTOR    4
  130. #endif
  131.  
  132. /************* PCM DMA buffer sizes *******************/
  133.  
  134. /* If you are using high playback or recording speeds, the default buffersize
  135.    is too small. DSP_BUFFSIZE must be 64k or less.
  136.  
  137.    A rule of thumb is 64k for PAS16, 32k for PAS+, 16k for SB Pro and
  138.    4k for SB.
  139.  
  140.    If you change the DSP_BUFFSIZE, don't modify this file.
  141.    Use the make config command instead. */
  142.  
  143. #ifndef DSP_BUFFSIZE
  144. #define DSP_BUFFSIZE        (4096)
  145. #endif
  146.  
  147. #ifndef DSP_BUFFCOUNT
  148. #define DSP_BUFFCOUNT        2    /* 2 is recommended. */
  149. #endif
  150.  
  151. #define DMA_AUTOINIT        0x10
  152.  
  153. #define FM_MONO        0x388    /* This is the I/O address used by AdLib */
  154.  
  155. /* SEQ_MAX_QUEUE is the maximum number of sequencer events buffered by the
  156.    driver. (There is no need to alter this) */
  157. #define SEQ_MAX_QUEUE    1024
  158.  
  159. #define SBFM_MAXINSTR        (256)    /* Size of the FM Instrument
  160.                            bank                 */
  161. /* 128 instruments for general MIDI setup and 16 unassigned     */
  162.  
  163. #define SND_NDEVS    50    /* Number of supported devices */
  164. #define SND_DEV_CTL    0    /* Control port /dev/mixer */
  165. #define SND_DEV_SEQ    1    /* Sequencer output /dev/sequencer (FM
  166.                    synthesizer and MIDI output) */
  167. #define SND_DEV_MIDIN    2    /* MIDI input /dev/midin (not implemented
  168.                    yet) */
  169. #define SND_DEV_DSP    3    /* Digitized voice /dev/dsp */
  170. #define SND_DEV_AUDIO    4    /* Sparc compatible /dev/audio */
  171. #define SND_DEV_DSP16    5    /* Like /dev/dsp but 16 bits/sample */
  172. #define SND_DEV_STATUS    6    /* /dev/sndstatus */
  173.  
  174. /* UWM ... note add new MIDI devices here..  
  175.  *  Also do not forget to add table midi_supported[]
  176.  *  Minor numbers for on-chip midi devices start from 15.. and 
  177.  *  should be contiguous.. viz. 15,16,17....
  178.  * ERROR!!!!!!!!! NO NO. Minor numbers above 15 are reserved!!!!!! Hannu
  179.  *  Also note the max # of midi devices as MAX_MIDI_DEV
  180.  */ 
  181.  
  182. #define CMIDI_DEV_PRO  15      /* Chip midi device == /dev/pro_midi */
  183.  
  184. /*
  185.  *  Add other midis here...
  186.         .
  187.         .
  188.         .
  189.         .
  190.  */
  191.  
  192. #define DSP_DEFAULT_SPEED    8000
  193.  
  194. #define ON        1
  195. #define OFF        0
  196.  
  197. #define MAX_DSP_DEV    4
  198. #define MAX_MIXER_DEV    2
  199. #define MAX_SYNTH_DEV    3
  200. #define MAX_MIDI_DEV    4
  201.  
  202. struct fileinfo {
  203.              int mode;    /* Open mode */
  204.        };
  205.  
  206. struct address_info {
  207.     int io_base;
  208.     int irq;
  209.     int dma;
  210. };
  211.  
  212. /*
  213.  * Process wakeup reasons
  214.  */
  215. #define WK_NONE        0x00
  216. #define WK_WAKEUP    0x01
  217. #define WK_TIMEOUT    0x02
  218. #define WK_SIGNAL    0x04
  219. #define WK_SLEEP    0x08
  220.  
  221. #define OPEN_READ    1
  222. #define OPEN_WRITE    2
  223. #define OPEN_READWRITE    3
  224.  
  225. #include "os.h"
  226. #include "sound_calls.h"
  227. #include "dev_table.h"
  228.  
  229. #ifndef DEB
  230. #define DEB(x)
  231. #endif
  232.  
  233. #endif
  234.