~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/sound/initval.h

Version: ~ [ linux-5.3-rc5 ] ~ [ linux-5.2.9 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.67 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.139 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.189 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.189 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.72 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 #ifndef __SOUND_INITVAL_H
  2 #define __SOUND_INITVAL_H
  3 
  4 /*
  5  *  Init values for soundcard modules
  6  *  Copyright (c) by Jaroslav Kysela <perex@perex.cz>
  7  *
  8  *   This program is free software; you can redistribute it and/or modify
  9  *   it under the terms of the GNU General Public License as published by
 10  *   the Free Software Foundation; either version 2 of the License, or
 11  *   (at your option) any later version.
 12  *
 13  *   This program is distributed in the hope that it will be useful,
 14  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 15  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 16  *   GNU General Public License for more details.
 17  *
 18  *   You should have received a copy of the GNU General Public License
 19  *   along with this program; if not, write to the Free Software
 20  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 21  *
 22  */
 23 
 24 #define SNDRV_AUTO_PORT         1
 25 #define SNDRV_AUTO_IRQ          0xffff
 26 #define SNDRV_AUTO_DMA          0xffff
 27 #define SNDRV_AUTO_DMA_SIZE     (0x7fffffff)
 28 
 29 #define SNDRV_DEFAULT_IDX1      (-1)
 30 #define SNDRV_DEFAULT_STR1      NULL
 31 #define SNDRV_DEFAULT_ENABLE1   1
 32 #define SNDRV_DEFAULT_PORT1     SNDRV_AUTO_PORT
 33 #define SNDRV_DEFAULT_IRQ1      SNDRV_AUTO_IRQ
 34 #define SNDRV_DEFAULT_DMA1      SNDRV_AUTO_DMA
 35 #define SNDRV_DEFAULT_DMA_SIZE1 SNDRV_AUTO_DMA_SIZE
 36 #define SNDRV_DEFAULT_PTR1      SNDRV_DEFAULT_STR1
 37 
 38 #define SNDRV_DEFAULT_IDX       { [0 ... (SNDRV_CARDS-1)] = -1 }
 39 #define SNDRV_DEFAULT_STR       { [0 ... (SNDRV_CARDS-1)] = NULL }
 40 #define SNDRV_DEFAULT_ENABLE    { 1, [1 ... (SNDRV_CARDS-1)] = 0 }
 41 #define SNDRV_DEFAULT_ENABLE_PNP { [0 ... (SNDRV_CARDS-1)] = 1 }
 42 #ifdef CONFIG_PNP
 43 #define SNDRV_DEFAULT_ENABLE_ISAPNP SNDRV_DEFAULT_ENABLE_PNP
 44 #else
 45 #define SNDRV_DEFAULT_ENABLE_ISAPNP SNDRV_DEFAULT_ENABLE
 46 #endif
 47 #define SNDRV_DEFAULT_PORT      { [0 ... (SNDRV_CARDS-1)] = SNDRV_AUTO_PORT }
 48 #define SNDRV_DEFAULT_IRQ       { [0 ... (SNDRV_CARDS-1)] = SNDRV_AUTO_IRQ }
 49 #define SNDRV_DEFAULT_DMA       { [0 ... (SNDRV_CARDS-1)] = SNDRV_AUTO_DMA }
 50 #define SNDRV_DEFAULT_DMA_SIZE  { [0 ... (SNDRV_CARDS-1)] = SNDRV_AUTO_DMA_SIZE }
 51 #define SNDRV_DEFAULT_PTR       SNDRV_DEFAULT_STR
 52 
 53 #ifdef SNDRV_LEGACY_FIND_FREE_IOPORT
 54 static long snd_legacy_find_free_ioport(long *port_table, long size)
 55 {
 56         while (*port_table != -1) {
 57                 if (request_region(*port_table, size, "ALSA test")) {
 58                         release_region(*port_table, size);
 59                         return *port_table;
 60                 }
 61                 port_table++;
 62         }
 63         return -1;
 64 }
 65 #endif
 66 
 67 #ifdef SNDRV_LEGACY_FIND_FREE_IRQ
 68 #include <linux/interrupt.h>
 69 
 70 static irqreturn_t snd_legacy_empty_irq_handler(int irq, void *dev_id)
 71 {
 72         return IRQ_HANDLED;
 73 }
 74 
 75 static int snd_legacy_find_free_irq(int *irq_table)
 76 {
 77         while (*irq_table != -1) {
 78                 if (!request_irq(*irq_table, snd_legacy_empty_irq_handler,
 79                                  IRQF_PROBE_SHARED, "ALSA Test IRQ",
 80                                  (void *) irq_table)) {
 81                         free_irq(*irq_table, (void *) irq_table);
 82                         return *irq_table;
 83                 }
 84                 irq_table++;
 85         }
 86         return -1;
 87 }
 88 #endif
 89 
 90 #ifdef SNDRV_LEGACY_FIND_FREE_DMA
 91 static int snd_legacy_find_free_dma(int *dma_table)
 92 {
 93         while (*dma_table != -1) {
 94                 if (!request_dma(*dma_table, "ALSA Test DMA")) {
 95                         free_dma(*dma_table);
 96                         return *dma_table;
 97                 }
 98                 dma_table++;
 99         }
100         return -1;
101 }
102 #endif
103 
104 #endif /* __SOUND_INITVAL_H */
105 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp