Changeset 348

Show
Ignore:
Timestamp:
04/21/08 02:52:19 (7 months ago)
Author:
gentux2
Message:

alsa-resync1 branch merged to ALSA 1.0.4

Location:
GPL/branches/alsa-resync1/alsa-kernel
Files:
52 modified

Legend:

Unmodified
Added
Removed
  • GPL/branches/alsa-resync1/alsa-kernel/core/init.c

    r281 r348  
    8686                strlcpy(card->id, xid, sizeof(card->id)); 
    8787        } 
     88        err = 0; 
    8889        write_lock(&snd_card_rwlock); 
    8990        if (idx < 0) { 
     
    101102        } else if (idx < snd_ecards_limit) { 
    102103                if (snd_cards_lock & (1 << idx)) 
    103                         idx = -1;       /* invalid */ 
     104                        err = -ENODEV;  /* invalid */ 
    104105        } else if (idx < SNDRV_CARDS) 
    105106                snd_ecards_limit = idx + 1; /* increase the limit */ 
    106107        else 
    107                 idx = -1; 
    108         if (idx < 0) { 
     108                err = -ENODEV; 
     109        if (idx < 0 || err < 0) { 
    109110                write_unlock(&snd_card_rwlock); 
    110                 if (idx >= snd_ecards_limit) 
    111                         snd_printk(KERN_ERR "card %i is out of range (0-%i)\n", idx, snd_ecards_limit-1); 
     111                snd_printk(KERN_ERR "cannot find the slot for index %d (range 0-%i)\n", idx, snd_ecards_limit - 1); 
    112112                goto __error; 
    113113        } 
  • GPL/branches/alsa-resync1/alsa-kernel/core/memalloc.c

    r206 r348  
    2727#include <linux/proc_fs.h> 
    2828#include <sound/memalloc.h> 
     29#ifdef CONFIG_SBUS 
     30#include <asm/sbus.h> 
     31#endif 
    2932 
    3033 
     
    6568#ifdef CONFIG_PCI 
    6669#if defined(__i386__) || defined(__ppc__) || defined(__x86_64__) 
    67 #define HACK_PCI_ALLOC_CONSISTENT 
    68  
    69 /* 
    70  * A hack to allocate large buffers via pci_alloc_consistent() 
    71  * 
    72  * since pci_alloc_consistent always tries GFP_DMA when the requested 
     70 
     71/* 
     72 * A hack to allocate large buffers via dma_alloc_coherent() 
     73 * 
     74 * since dma_alloc_coherent always tries GFP_DMA when the requested 
    7375 * pci memory region is below 32bit, it happens quite often that even 
    7476 * 2 order of pages cannot be allocated. 
     
    7880 * with the requested region, then realloate with the original dma_mask 
    7981 * again. 
    80  */ 
    81  
    82 static void *snd_pci_hack_alloc_consistent(struct pci_dev *hwdev, size_t size, 
    83                                     dma_addr_t *dma_handle) 
     82 * 
     83 * Really, we want to move this type of thing into dma_alloc_coherent() 
     84 * so dma_mask doesn't have to be messed with. 
     85 */ 
     86 
     87static void *snd_dma_hack_alloc_coherent(struct device *dev, size_t size, 
     88                                         dma_addr_t *dma_handle, int flags) 
    8489{ 
    8590        void *ret; 
    86         u64 dma_mask, cdma_mask; 
    87         unsigned long mask; 
    88  
    89         if (hwdev == NULL) 
    90                 return pci_alloc_consistent(hwdev, size, dma_handle); 
    91         dma_mask = hwdev->dma_mask; 
    92         cdma_mask = hwdev->consistent_dma_mask; 
    93         mask = (unsigned long)dma_mask && (unsigned long)cdma_mask; 
    94         hwdev->dma_mask = 0xffffffff; /* do without masking */ 
    95         hwdev->consistent_dma_mask = 0xffffffff; /* do without masking */ 
    96         ret = pci_alloc_consistent(hwdev, size, dma_handle); 
    97         hwdev->dma_mask = dma_mask; /* restore */ 
    98         hwdev->consistent_dma_mask = cdma_mask; /* restore */ 
     91        u64 dma_mask; 
     92 
     93        if (dev == NULL || !dev->dma_mask) 
     94                return dma_alloc_coherent(dev, size, dma_handle, flags); 
     95        dma_mask = *dev->dma_mask; 
     96        *dev->dma_mask = 0xffffffff;    /* do without masking */ 
     97        ret = dma_alloc_coherent(dev, size, dma_handle, flags); 
     98        *dev->dma_mask = dma_mask;      /* restore */ 
    9999        if (ret) { 
    100100                /* obtained address is out of range? */ 
    101                 if (((unsigned long)*dma_handle + size - 1) & ~mask) { 
     101                if (((unsigned long)*dma_handle + size - 1) & ~dma_mask) { 
    102102                        /* reallocate with the proper mask */ 
    103                         pci_free_consistent(hwdev, size, ret, *dma_handle); 
    104                         ret = pci_alloc_consistent(hwdev, size, dma_handle); 
     103                        dma_free_coherent(dev, size, ret, *dma_handle); 
     104                        ret = dma_alloc_coherent(dev, size, dma_handle, flags); 
    105105                } 
    106106        } else { 
    107107                /* wish to success now with the proper mask... */ 
    108                 if (mask != 0xffffffffUL) 
    109                         ret = pci_alloc_consistent(hwdev, size, dma_handle); 
     108                if (dma_mask != 0xffffffffUL) 
     109                        ret = dma_alloc_coherent(dev, size, dma_handle, flags); 
    110110        } 
    111111        return ret; 
    112112} 
    113113 
    114 /* redefine pci_alloc_consistent for some architectures */ 
    115 #undef pci_alloc_consistent 
    116 #define pci_alloc_consistent snd_pci_hack_alloc_consistent 
     114/* redefine dma_alloc_coherent for some architectures */ 
     115#undef dma_alloc_coherent 
     116#define dma_alloc_coherent snd_dma_hack_alloc_coherent 
    117117 
    118118#endif /* arch */ 
     
    395395 * Returns the pointer of the buffer, or NULL if no enoguh memory. 
    396396 */ 
    397 void *snd_malloc_pages(unsigned long size, unsigned int dma_flags) 
     397void *snd_malloc_pages(size_t size, unsigned int dma_flags) 
    398398{ 
    399399    int pg; 
     
    416416 * Releases the buffer allocated via snd_malloc_pages(). 
    417417 */ 
    418 void snd_free_pages(void *ptr, unsigned long size) 
     418void snd_free_pages(void *ptr, size_t size) 
    419419{ 
    420420    int pg; 
     
    721721        {0 }, /* terminator */ 
    722722}; 
     723 
     724/* 
     725 * compose a snd_dma_device struct for the PCI device 
     726 */ 
     727static inline void snd_dma_device_pci(struct snd_dma_device *dev, struct pci_dev *pci, unsigned int id) 
     728{ 
     729        memset(dev, 0, sizeof(*dev)); 
     730        dev->type = SNDRV_DMA_TYPE_DEV; 
     731        dev->dev = snd_dma_pci_data(pci); 
     732        dev->id = id; 
     733} 
    723734 
    724735static void __init preallocate_cards(void) 
     
    846857 */ 
    847858EXPORT_SYMBOL(snd_dma_alloc_pages); 
     859EXPORT_SYMBOL(snd_dma_alloc_pages_fallback); 
    848860EXPORT_SYMBOL(snd_dma_free_pages); 
     861 
    849862EXPORT_SYMBOL(snd_dma_get_reserved); 
    850863EXPORT_SYMBOL(snd_dma_free_reserved); 
     
    854867EXPORT_SYMBOL(snd_malloc_pages_fallback); 
    855868EXPORT_SYMBOL(snd_free_pages); 
    856 #if defined(CONFIG_ISA) && ! defined(CONFIG_PCI) 
    857 EXPORT_SYMBOL(snd_malloc_isa_pages); 
    858 EXPORT_SYMBOL(snd_malloc_isa_pages_fallback); 
    859 #endif 
    860 #ifdef CONFIG_PCI 
    861 EXPORT_SYMBOL(snd_malloc_pci_pages); 
    862 EXPORT_SYMBOL(snd_malloc_pci_pages_fallback); 
    863 EXPORT_SYMBOL(snd_malloc_pci_page); 
    864 EXPORT_SYMBOL(snd_free_pci_pages); 
    865 EXPORT_SYMBOL(snd_malloc_sgbuf_pages); 
    866 EXPORT_SYMBOL(snd_free_sgbuf_pages); 
    867 #endif 
    868 #ifdef CONFIG_SBUS 
    869 EXPORT_SYMBOL(snd_malloc_sbus_pages); 
    870 EXPORT_SYMBOL(snd_malloc_sbus_pages_fallback); 
    871 EXPORT_SYMBOL(snd_free_sbus_pages); 
    872 #endif 
    873  
  • GPL/branches/alsa-resync1/alsa-kernel/core/pcm.c

    r300 r348  
    406406    char line[64]; 
    407407    if (!snd_info_get_line(buffer, line, sizeof(line))) 
    408         pstr->xrun_debug = !!simple_strtoul(line, NULL, 10); 
     408                pstr->xrun_debug = simple_strtoul(line, NULL, 10); 
    409409} 
    410410#endif 
  • GPL/branches/alsa-resync1/alsa-kernel/core/pcm_lib.c

    r290 r348  
    188188                                   substream->pcm->device, 
    189189                                   substream->stream ? 'c' : 'p'); 
     190                        if (substream->pstr->xrun_debug > 1) 
    190191                        dump_stack(); 
    191192                } 
     
    219220        if ((snd_pcm_uframes_t)delta < runtime->buffer_size / 2) { 
    220221#ifdef CONFIG_SND_DEBUG 
    221             if (runtime->periods > 1) 
     222                        if (runtime->periods > 1 && substream->pstr->xrun_debug) { 
    222223                snd_printd(KERN_ERR "Unexpected hw_pointer value [1] (stream = %i, delta: -%ld, max jitter = %ld): wrong interrupt acknowledge?\n", substream->stream, (long) delta, runtime->buffer_size / 2); 
     224                                if (substream->pstr->xrun_debug > 1) 
     225                                        dump_stack(); 
     226                        } 
    223227#endif 
    224228            return 0; 
     
    261265        if ((snd_pcm_uframes_t)delta < runtime->buffer_size / 2) { 
    262266#ifdef CONFIG_SND_DEBUG 
    263             if (runtime->periods > 2) 
     267                        if (runtime->periods > 2 && substream->pstr->xrun_debug) { 
    264268                snd_printd(KERN_ERR "Unexpected hw_pointer value [2] (stream = %i, delta: -%ld, max jitter = %ld): wrong interrupt acknowledge?\n", substream->stream, (long) delta, runtime->buffer_size / 2); 
     269                                if (substream->pstr->xrun_debug > 1) 
     270                                        dump_stack(); 
     271                        } 
    265272#endif 
    266273            return 0; 
     
    26892696EXPORT_SYMBOL(snd_pcm_lib_preallocate_pages); 
    26902697EXPORT_SYMBOL(snd_pcm_lib_preallocate_pages_for_all); 
     2698EXPORT_SYMBOL(snd_pcm_sgbuf_ops_page); 
    26912699EXPORT_SYMBOL(snd_pcm_lib_malloc_pages); 
    26922700EXPORT_SYMBOL(snd_pcm_lib_free_pages); 
    2693 #ifdef CONFIG_ISA 
    2694 EXPORT_SYMBOL(snd_pcm_lib_preallocate_isa_pages); 
    2695 EXPORT_SYMBOL(snd_pcm_lib_preallocate_isa_pages_for_all); 
    2696 #endif 
    2697 #ifdef CONFIG_PCI 
    2698 EXPORT_SYMBOL(snd_pcm_lib_preallocate_pci_pages); 
    2699 EXPORT_SYMBOL(snd_pcm_lib_preallocate_pci_pages_for_all); 
    2700 EXPORT_SYMBOL(snd_pcm_lib_preallocate_sg_pages); 
    2701 EXPORT_SYMBOL(snd_pcm_lib_preallocate_sg_pages_for_all); 
    2702 EXPORT_SYMBOL(snd_pcm_sgbuf_ops_page); 
    2703 #endif 
    2704 #ifdef CONFIG_SBUS 
    2705 EXPORT_SYMBOL(snd_pcm_lib_preallocate_sbus_pages); 
    2706 EXPORT_SYMBOL(snd_pcm_lib_preallocate_sbus_pages_for_all); 
    2707 #endif 
  • GPL/branches/alsa-resync1/alsa-kernel/core/sgbuf.c

    r206 r348  
    2020 */ 
    2121 
     22#include <linux/config.h> 
     23#include <linux/slab.h> 
     24#include <linux/mm.h> 
     25#include <linux/vmalloc.h> 
    2226#ifdef TARGET_OS2 
    23 #include <sound/driver.h> 
    24 #include <sound/core.h> 
    2527#include <sound/info.h> 
    2628#endif /* TARGET_OS2 */ 
     
    3133#define sgbuf_align_table(tbl)  ((((tbl) + SGBUF_TBL_ALIGN - 1) / SGBUF_TBL_ALIGN) * SGBUF_TBL_ALIGN) 
    3234 
    33 /* 
    34  * shrink to the given pages. 
    35  * free the unused pages 
    36  */ 
    37 static void sgbuf_shrink(struct snd_sg_buf *sgbuf, int pages) 
     35int snd_free_sgbuf_pages(struct snd_dma_buffer *dmab) 
    3836{ 
    39         snd_assert(sgbuf, return); 
    40         if (! sgbuf->table) 
    41                 return; 
    42         while (sgbuf->pages > pages) { 
    43                 sgbuf->pages--; 
    44                 snd_free_pci_pages(sgbuf->pci, PAGE_SIZE, 
    45                                    sgbuf->table[sgbuf->pages].buf, 
    46                                    sgbuf->table[sgbuf->pages].addr); 
    47         } 
     37        struct snd_sg_buf *sgbuf = dmab->private_data; 
     38        struct snd_dma_buffer tmpb; 
     39        int i; 
     40 
     41        if (! sgbuf) 
     42                return -EINVAL; 
     43 
     44        for (i = 0; i < sgbuf->pages; i++) { 
     45                tmpb.area = sgbuf->table[i].buf; 
     46                tmpb.addr = sgbuf->table[i].addr; 
     47                tmpb.bytes = PAGE_SIZE; 
     48                snd_dma_free_pages(&tmpb); 
     49        } 
     50#ifndef TARGET_OS2 
     51        if (dmab->area) 
     52                vunmap(dmab->area); 
     53#endif 
     54        dmab->area = NULL; 
     55 
     56        if (sgbuf->table) 
     57                kfree(sgbuf->table); 
     58        if (sgbuf->page_table) 
     59                kfree(sgbuf->page_table); 
     60        kfree(sgbuf); 
     61        dmab->private_data = NULL; 
     62         
     63        return 0; 
    4864} 
    4965 
    50 /** 
    51  * snd_malloc_sgbuf_pages - allocate the pages for the PCI SG buffer 
    52  * @pci: the pci device pointer 
    53  * @size: the requested buffer size in bytes 
    54  * @dmab: the buffer record to store 
    55  * 
    56  * Initializes the SG-buffer table and allocates the buffer pages 
    57  * for the given size. 
    58  * The pages are mapped to the virtually continuous memory. 
    59  * 
    60  * This function is usually called from the middle-level functions such as 
    61  * snd_pcm_lib_malloc_pages(). 
    62  * 
    63  * Returns the mapped virtual address of the buffer if allocation was 
    64  * successful, or NULL at error. 
    65  */ 
    66 void *snd_malloc_sgbuf_pages(struct pci_dev *pci, 
    67                              size_t size, 
    68                              struct snd_dma_buffer *dmab, 
     66void *snd_malloc_sgbuf_pages(const struct snd_dma_device *dev, 
     67                             size_t size, struct snd_dma_buffer *dmab, 
    6968                             size_t *res_size) 
    7069{ 
    7170        struct snd_sg_buf *sgbuf; 
    72         unsigned int pages; 
    73         void *ptr; 
    74         dma_addr_t addr; 
     71        unsigned int i, pages; 
     72        struct snd_dma_buffer tmpb; 
    7573 
    7674#ifdef DEBUG 
     
    8987        } 
    9088        memset(sgbuf, 0, sizeof(*sgbuf)); 
    91         sgbuf->pci = pci; 
     89        sgbuf->dev = *dev; 
     90        sgbuf->dev.type = SNDRV_DMA_TYPE_DEV; 
    9291        pages = snd_sgbuf_aligned_pages(size); 
    9392        sgbuf->tblsize = sgbuf_align_table(pages); 
     
    9897            dprintf(("snd_malloc_sgbuf_pages failed: error allocating sgbuf->table")); 
    9998#endif 
    100             return NULL; 
     99                goto _failed; 
    101100        } 
    102101        memset(sgbuf->table, 0, sizeof(*sgbuf->table) * sgbuf->tblsize); 
     
    107106            dprintf(("snd_malloc_sgbuf_pages failed: error allocating sgbuf->page_table")); 
    108107#endif 
    109             return NULL; 
     108                goto _failed; 
    110109        } 
    111110        memset(sgbuf->page_table, 0, sizeof(*sgbuf->page_table) * sgbuf->tblsize); 
     
    114113            dprintf(("allocating %d pages",pages)); 
    115114#endif 
    116             ptr = snd_malloc_pci_pages(sgbuf->pci, size, &addr); 
    117             if (! ptr) 
    118                 goto _failed; 
    119115 
    120116            /* allocate each page */ 
    121             while (sgbuf->pages < pages) { 
    122                 mem_map_t *page; 
    123  
    124                 sgbuf->table[sgbuf->pages].buf = (char*)ptr + PAGE_SIZE*sgbuf->pages; 
    125                 sgbuf->table[sgbuf->pages].addr = addr + PAGE_SIZE*sgbuf->pages; 
    126                 page = (mem_map_t *)virt_to_page((int)sgbuf->table[sgbuf->pages].buf); 
    127                 sgbuf->page_table[sgbuf->pages] = page; 
    128                 SetPageReserved(page); 
     117        for (i = 0; i < pages; i++) { 
     118                if (snd_dma_alloc_pages(SNDRV_DMA_TYPE_DEV,sgbuf->dev.dev, PAGE_SIZE, &tmpb) < 0) { 
     119                        if (res_size == NULL) 
     120                                goto _failed; 
     121                        *res_size = size = sgbuf->pages * PAGE_SIZE; 
     122                        break; 
     123                } 
     124                sgbuf->table[i].buf = tmpb.area; 
     125                sgbuf->table[i].addr = tmpb.addr; 
     126                sgbuf->page_table[i] = virt_to_page(tmpb.area); 
    129127                sgbuf->pages++; 
    130128            } 
    131129 
    132             memset(ptr,0,size); 
    133  
    134             dmab->area = ptr; 
    135130            sgbuf->size = size; 
     131#ifndef TARGET_OS2 
     132        dmab->area = vmap(sgbuf->page_table, sgbuf->pages, VM_MAP, PAGE_KERNEL); 
     133#else 
     134        dmab->area = NULL; 
     135#endif 
     136        if (! dmab->area) 
     137                goto _failed; 
    136138            return dmab->area; 
    137139 
     
    144146        return NULL; 
    145147} 
    146  
    147  
    148 /** 
    149  * snd_free_sgbuf_pages - free the sg buffer 
    150  * @dmab: buffer record 
    151  * 
    152  * Releases the pages and the SG-buffer table. 
    153  * 
    154  * This function is called usually from the middle-level function 
    155  * such as snd_pcm_lib_free_pages(). 
    156  * 
    157  * Returns zero if successful, or a negative error code on failure. 
    158  */ 
    159 int snd_free_sgbuf_pages(struct snd_dma_buffer *dmab) 
    160 { 
    161         struct snd_sg_buf *sgbuf = dmab->private_data; 
    162  
    163         sgbuf_shrink(sgbuf, 0); 
    164         if (sgbuf->table) 
    165                 kfree(sgbuf->table); 
    166         sgbuf->table = NULL; 
    167         if (sgbuf->page_table) 
    168                 kfree(sgbuf->page_table); 
    169         kfree(sgbuf); 
    170         dmab->private_data = NULL; 
    171          
    172         return 0; 
    173 } 
    174  
    175  
  • GPL/branches/alsa-resync1/alsa-kernel/drivers/dummy.c

    r277 r348  
    358358    if (dpcm == NULL) 
    359359        return -ENOMEM; 
    360     if ((runtime->dma_area = snd_malloc_pages_fallback(MAX_BUFFER_SIZE, GFP_KERNEL, (unsigned long *) &runtime->dma_bytes)) == NULL) { 
     360    if ((runtime->dma_area = snd_malloc_pages_fallback(MAX_BUFFER_SIZE, GFP_KERNEL, &runtime->dma_bytes)) == NULL) { 
    361361        kfree(dpcm); 
    362362        return -ENOMEM; 
     
    393393    if (dpcm == NULL) 
    394394        return -ENOMEM; 
    395     if ((runtime->dma_area = snd_malloc_pages_fallback(MAX_BUFFER_SIZE, GFP_KERNEL, (unsigned long *) &runtime->dma_bytes)) == NULL) { 
     395    if ((runtime->dma_area = snd_malloc_pages_fallback(MAX_BUFFER_SIZE, GFP_KERNEL, &runtime->dma_bytes)) == NULL) { 
    396396        kfree(dpcm); 
    397397        return -ENOMEM; 
  • GPL/branches/alsa-resync1/alsa-kernel/drivers/mpu401/mpu401.c

    r212 r348  
    22 *  Driver for generic MPU-401 boards (UART mode only) 
    33 *  Copyright (c) by Jaroslav Kysela <perex@suse.cz> 
     4 * 
     5 *  ACPI PnP Copyright (c) 2004 by Clemens Ladisch <clemens@ladisch.de> 
     6 *  based on 8250_acpi.c 
     7 *  Copyright (c) 2002-2003 Matthew Wilcox for Hewlett-Packard 
     8 *  Copyright (C) 2004 Hewlett-Packard Co 
     9 *       Bjorn Helgaas <bjorn.helgaas@hp.com> 
    410 * 
    511 * 
     
    2228#include <sound/driver.h> 
    2329#include <linux/init.h> 
    24 #include <linux/wait.h> 
    25 #include <linux/sched.h> 
    26 #include <linux/slab.h> 
     30#ifdef CONFIG_ACPI_BUS 
     31#include <acpi/acpi_bus.h> 
     32#endif 
    2733#include <sound/core.h> 
    2834#include <sound/mpu401.h> 
    2935#define SNDRV_GET_ID 
    3036#include <sound/initval.h> 
    31 #include <linux/delay.h> 
     37 
     38#ifdef CONFIG_ACPI_BUS 
     39#define USE_ACPI_PNP 
     40#endif 
    3241 
    3342MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>"); 
     
    3948static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;       /* ID for this card */ 
    4049static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE;  /* Enable this card */ 
     50#ifdef USE_ACPI_PNP 
     51static int acpipnp[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = 1 }; 
     52#endif 
    4153static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;     /* MPU-401 port number */ 
    4254static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;        /* MPU-401 IRQ */ 
     
    5466MODULE_PARM_DESC(enable, "Enable MPU-401 device."); 
    5567MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC); 
     68#ifdef USE_ACPI_PNP 
     69MODULE_PARM(acpipnp, "1-" __MODULE_STRING(SNDRV_CARDS) "i"); 
     70MODULE_PARM_DESC(acpipnp, "ACPI PnP detection for MPU-401 device."); 
     71MODULE_PARM_SYNTAX(acpipnp, SNDRV_ENABLED "," SNDRV_BOOLEAN_TRUE_DESC); 
     72#endif 
    5673MODULE_PARM(port, "1-" __MODULE_STRING(SNDRV_CARDS) "l"); 
    5774MODULE_PARM_DESC(port, "Port # for MPU-401 device."); 
     
    6683#endif 
    6784 
    68 static snd_card_t *snd_mpu401_cards[SNDRV_CARDS] = SNDRV_DEFAULT_PTR; 
    69  
    70 static int __init snd_card_mpu401_probe(int dev) 
     85#ifndef CONFIG_ACPI_BUS 
     86struct acpi_device; 
     87#endif 
     88 
     89static snd_card_t *snd_mpu401_legacy_cards[SNDRV_CARDS] = SNDRV_DEFAULT_PTR; 
     90static int cards; 
     91 
     92#ifdef USE_ACPI_PNP 
     93 
     94static int acpi_driver_registered; 
     95 
     96struct mpu401_resources { 
     97        unsigned long port; 
     98        int irq; 
     99}; 
     100 
     101static acpi_status __devinit snd_mpu401_acpi_resource(struct acpi_resource *res, 
     102                                                      void *data) 
     103{ 
     104        struct mpu401_resources *resources = (struct mpu401_resources *)data; 
     105 
     106        if (res->id == ACPI_RSTYPE_IRQ) { 
     107