1 /* 2 * sound/sb_card.c 3 * 4 * Detection routine for the SoundBlaster cards. 5 */ 6 /* 7 * Copyright by Hannu Savolainen 1993-1996 8 * 9 * Redistribution and use in source and binary forms, with or without 10 * modification, are permitted provided that the following conditions are 11 * met: 1. Redistributions of source code must retain the above copyright 12 * notice, this list of conditions and the following disclaimer. 2. 13 * Redistributions in binary form must reproduce the above copyright notice, 14 * this list of conditions and the following disclaimer in the documentation 15 * and/or other materials provided with the distribution. 16 * 17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY 18 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR 21 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 23 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 24 * 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 #include <linux/config.h> 30 31 32 #include "sound_config.h" 33 34 #if defined(CONFIG_SB) 35 36 #include "sb.h" 37 38 long 39 attach_sb_card (long mem_start, struct address_info *hw_config) /* */ 40 { 41 #if defined(CONFIG_AUDIO) || defined(CONFIG_MIDI) 42 if (!sb_dsp_detect (hw_config)) 43 return mem_start; 44 mem_start = sb_dsp_init (mem_start, hw_config); 45 request_region (hw_config->io_base, 16, "SoundBlaster"); 46 #endif 47 48 return mem_start; 49 } 50 51 int 52 probe_sb (struct address_info *hw_config) /* */ 53 { 54 if (check_region (hw_config->io_base, 16)) 55 { 56 printk ("\n\nsb_dsp.c: I/O port %x already in use\n\n", 57 hw_config->io_base); 58 return 0; 59 } 60 61 return sb_dsp_detect (hw_config); 62 } 63 64 void 65 unload_sb (struct address_info *hw_config) /* */ 66 { 67 release_region (hw_config->io_base, 16); 68 sb_dsp_unload (hw_config); 69 } 70 71 #endif