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

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

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-or-later */
  2 #ifndef __SOUND_INITVAL_H
  3 #define __SOUND_INITVAL_H
  4 
  5 /*
  6  *  Init values for soundcard modules
  7  *  Copyright (c) by Jaroslav Kysela <perex@perex.cz>
  8  */
  9 
 10 #define SNDRV_AUTO_PORT         1
 11 #define SNDRV_AUTO_IRQ          0xffff
 12 #define SNDRV_AUTO_DMA          0xffff
 13 #define SNDRV_AUTO_DMA_SIZE     (0x7fffffff)
 14 
 15 #define SNDRV_DEFAULT_IDX1      (-1)
 16 #define SNDRV_DEFAULT_STR1      NULL
 17 #define SNDRV_DEFAULT_ENABLE1   1
 18 #define SNDRV_DEFAULT_PORT1     SNDRV_AUTO_PORT
 19 #define SNDRV_DEFAULT_IRQ1      SNDRV_AUTO_IRQ
 20 #define SNDRV_DEFAULT_DMA1      SNDRV_AUTO_DMA
 21 #define SNDRV_DEFAULT_DMA_SIZE1 SNDRV_AUTO_DMA_SIZE
 22 #define SNDRV_DEFAULT_PTR1      SNDRV_DEFAULT_STR1
 23 
 24 #define SNDRV_DEFAULT_IDX       { [0 ... (SNDRV_CARDS-1)] = -1 }
 25 #define SNDRV_DEFAULT_STR       { [0 ... (SNDRV_CARDS-1)] = NULL }
 26 #define SNDRV_DEFAULT_ENABLE    { 1, [1 ... (SNDRV_CARDS-1)] = 0 }
 27 #define SNDRV_DEFAULT_ENABLE_PNP { [0 ... (SNDRV_CARDS-1)] = 1 }
 28 #ifdef CONFIG_PNP
 29 #define SNDRV_DEFAULT_ENABLE_ISAPNP SNDRV_DEFAULT_ENABLE_PNP
 30 #else
 31 #define SNDRV_DEFAULT_ENABLE_ISAPNP SNDRV_DEFAULT_ENABLE
 32 #endif
 33 #define SNDRV_DEFAULT_PORT      { [0 ... (SNDRV_CARDS-1)] = SNDRV_AUTO_PORT }
 34 #define SNDRV_DEFAULT_IRQ       { [0 ... (SNDRV_CARDS-1)] = SNDRV_AUTO_IRQ }
 35 #define SNDRV_DEFAULT_DMA       { [0 ... (SNDRV_CARDS-1)] = SNDRV_AUTO_DMA }
 36 #define SNDRV_DEFAULT_DMA_SIZE  { [0 ... (SNDRV_CARDS-1)] = SNDRV_AUTO_DMA_SIZE }
 37 #define SNDRV_DEFAULT_PTR       SNDRV_DEFAULT_STR
 38 
 39 #ifdef SNDRV_LEGACY_FIND_FREE_IOPORT
 40 static long snd_legacy_find_free_ioport(const long *port_table, long size)
 41 {
 42         while (*port_table != -1) {
 43                 if (request_region(*port_table, size, "ALSA test")) {
 44                         release_region(*port_table, size);
 45                         return *port_table;
 46                 }
 47                 port_table++;
 48         }
 49         return -1;
 50 }
 51 #endif
 52 
 53 #ifdef SNDRV_LEGACY_FIND_FREE_IRQ
 54 #include <linux/interrupt.h>
 55 
 56 static irqreturn_t snd_legacy_empty_irq_handler(int irq, void *dev_id)
 57 {
 58         return IRQ_HANDLED;
 59 }
 60 
 61 static int snd_legacy_find_free_irq(const int *irq_table)
 62 {
 63         while (*irq_table != -1) {
 64                 if (!request_irq(*irq_table, snd_legacy_empty_irq_handler,
 65                                  IRQF_PROBE_SHARED, "ALSA Test IRQ",
 66                                  (void *) irq_table)) {
 67                         free_irq(*irq_table, (void *) irq_table);
 68                         return *irq_table;
 69                 }
 70                 irq_table++;
 71         }
 72         return -1;
 73 }
 74 #endif
 75 
 76 #ifdef SNDRV_LEGACY_FIND_FREE_DMA
 77 static int snd_legacy_find_free_dma(const int *dma_table)
 78 {
 79         while (*dma_table != -1) {
 80                 if (!request_dma(*dma_table, "ALSA Test DMA")) {
 81                         free_dma(*dma_table);
 82                         return *dma_table;
 83                 }
 84                 dma_table++;
 85         }
 86         return -1;
 87 }
 88 #endif
 89 
 90 #endif /* __SOUND_INITVAL_H */
 91 

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

kernel.org | git.kernel.org | LWN.net | Project Home | 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.

sflogo.php