Changeset 348 for GPL/branches/alsa-resync1/alsa-kernel
- Timestamp:
- Apr 21, 2008, 2:52:19 AM (17 years ago)
- Location:
- GPL/branches/alsa-resync1/alsa-kernel
- Files:
-
- 52 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/branches/alsa-resync1/alsa-kernel/core/init.c
r281 r348 86 86 strlcpy(card->id, xid, sizeof(card->id)); 87 87 } 88 err = 0; 88 89 write_lock(&snd_card_rwlock); 89 90 if (idx < 0) { … … 101 102 } else if (idx < snd_ecards_limit) { 102 103 if (snd_cards_lock & (1 << idx)) 103 idx = -1; /* invalid */104 err = -ENODEV; /* invalid */ 104 105 } else if (idx < SNDRV_CARDS) 105 106 snd_ecards_limit = idx + 1; /* increase the limit */ 106 107 else 107 idx = -1;108 if (idx < 0 ) {108 err = -ENODEV; 109 if (idx < 0 || err < 0) { 109 110 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); 112 112 goto __error; 113 113 } -
GPL/branches/alsa-resync1/alsa-kernel/core/memalloc.c
r206 r348 27 27 #include <linux/proc_fs.h> 28 28 #include <sound/memalloc.h> 29 #ifdef CONFIG_SBUS 30 #include <asm/sbus.h> 31 #endif 29 32 30 33 … … 65 68 #ifdef CONFIG_PCI 66 69 #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 73 75 * pci memory region is below 32bit, it happens quite often that even 74 76 * 2 order of pages cannot be allocated. … … 78 80 * with the requested region, then realloate with the original dma_mask 79 81 * 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 87 static void *snd_dma_hack_alloc_coherent(struct device *dev, size_t size, 88 dma_addr_t *dma_handle, int flags) 84 89 { 85 90 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 */ 99 99 if (ret) { 100 100 /* 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) { 102 102 /* 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); 105 105 } 106 106 } else { 107 107 /* 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); 110 110 } 111 111 return ret; 112 112 } 113 113 114 /* redefine pci_alloc_consistent for some architectures */115 #undef pci_alloc_consistent116 #define pci_alloc_consistent snd_pci_hack_alloc_consistent114 /* redefine dma_alloc_coherent for some architectures */ 115 #undef dma_alloc_coherent 116 #define dma_alloc_coherent snd_dma_hack_alloc_coherent 117 117 118 118 #endif /* arch */ … … 395 395 * Returns the pointer of the buffer, or NULL if no enoguh memory. 396 396 */ 397 void *snd_malloc_pages( unsigned longsize, unsigned int dma_flags)397 void *snd_malloc_pages(size_t size, unsigned int dma_flags) 398 398 { 399 399 int pg; … … 416 416 * Releases the buffer allocated via snd_malloc_pages(). 417 417 */ 418 void snd_free_pages(void *ptr, unsigned longsize)418 void snd_free_pages(void *ptr, size_t size) 419 419 { 420 420 int pg; … … 721 721 {0 }, /* terminator */ 722 722 }; 723 724 /* 725 * compose a snd_dma_device struct for the PCI device 726 */ 727 static 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 } 723 734 724 735 static void __init preallocate_cards(void) … … 846 857 */ 847 858 EXPORT_SYMBOL(snd_dma_alloc_pages); 859 EXPORT_SYMBOL(snd_dma_alloc_pages_fallback); 848 860 EXPORT_SYMBOL(snd_dma_free_pages); 861 849 862 EXPORT_SYMBOL(snd_dma_get_reserved); 850 863 EXPORT_SYMBOL(snd_dma_free_reserved); … … 854 867 EXPORT_SYMBOL(snd_malloc_pages_fallback); 855 868 EXPORT_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 #endif860 #ifdef CONFIG_PCI861 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 #endif868 #ifdef CONFIG_SBUS869 EXPORT_SYMBOL(snd_malloc_sbus_pages);870 EXPORT_SYMBOL(snd_malloc_sbus_pages_fallback);871 EXPORT_SYMBOL(snd_free_sbus_pages);872 #endif873 -
GPL/branches/alsa-resync1/alsa-kernel/core/pcm.c
r300 r348 406 406 char line[64]; 407 407 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); 409 409 } 410 410 #endif -
GPL/branches/alsa-resync1/alsa-kernel/core/pcm_lib.c
r290 r348 188 188 substream->pcm->device, 189 189 substream->stream ? 'c' : 'p'); 190 if (substream->pstr->xrun_debug > 1) 190 191 dump_stack(); 191 192 } … … 219 220 if ((snd_pcm_uframes_t)delta < runtime->buffer_size / 2) { 220 221 #ifdef CONFIG_SND_DEBUG 221 if (runtime->periods > 1) 222 if (runtime->periods > 1 && substream->pstr->xrun_debug) { 222 223 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 } 223 227 #endif 224 228 return 0; … … 261 265 if ((snd_pcm_uframes_t)delta < runtime->buffer_size / 2) { 262 266 #ifdef CONFIG_SND_DEBUG 263 if (runtime->periods > 2) 267 if (runtime->periods > 2 && substream->pstr->xrun_debug) { 264 268 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 } 265 272 #endif 266 273 return 0; … … 2689 2696 EXPORT_SYMBOL(snd_pcm_lib_preallocate_pages); 2690 2697 EXPORT_SYMBOL(snd_pcm_lib_preallocate_pages_for_all); 2698 EXPORT_SYMBOL(snd_pcm_sgbuf_ops_page); 2691 2699 EXPORT_SYMBOL(snd_pcm_lib_malloc_pages); 2692 2700 EXPORT_SYMBOL(snd_pcm_lib_free_pages); 2693 #ifdef CONFIG_ISA2694 EXPORT_SYMBOL(snd_pcm_lib_preallocate_isa_pages);2695 EXPORT_SYMBOL(snd_pcm_lib_preallocate_isa_pages_for_all);2696 #endif2697 #ifdef CONFIG_PCI2698 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 #endif2704 #ifdef CONFIG_SBUS2705 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 20 20 */ 21 21 22 #include <linux/config.h> 23 #include <linux/slab.h> 24 #include <linux/mm.h> 25 #include <linux/vmalloc.h> 22 26 #ifdef TARGET_OS2 23 #include <sound/driver.h>24 #include <sound/core.h>25 27 #include <sound/info.h> 26 28 #endif /* TARGET_OS2 */ … … 31 33 #define sgbuf_align_table(tbl) ((((tbl) + SGBUF_TBL_ALIGN - 1) / SGBUF_TBL_ALIGN) * SGBUF_TBL_ALIGN) 32 34 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) 35 int snd_free_sgbuf_pages(struct snd_dma_buffer *dmab) 38 36 { 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; 48 64 } 49 65 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, 66 void *snd_malloc_sgbuf_pages(const struct snd_dma_device *dev, 67 size_t size, struct snd_dma_buffer *dmab, 69 68 size_t *res_size) 70 69 { 71 70 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; 75 73 76 74 #ifdef DEBUG … … 89 87 } 90 88 memset(sgbuf, 0, sizeof(*sgbuf)); 91 sgbuf->pci = pci; 89 sgbuf->dev = *dev; 90 sgbuf->dev.type = SNDRV_DMA_TYPE_DEV; 92 91 pages = snd_sgbuf_aligned_pages(size); 93 92 sgbuf->tblsize = sgbuf_align_table(pages); … … 98 97 dprintf(("snd_malloc_sgbuf_pages failed: error allocating sgbuf->table")); 99 98 #endif 100 return NULL;99 goto _failed; 101 100 } 102 101 memset(sgbuf->table, 0, sizeof(*sgbuf->table) * sgbuf->tblsize); … … 107 106 dprintf(("snd_malloc_sgbuf_pages failed: error allocating sgbuf->page_table")); 108 107 #endif 109 return NULL;108 goto _failed; 110 109 } 111 110 memset(sgbuf->page_table, 0, sizeof(*sgbuf->page_table) * sgbuf->tblsize); … … 114 113 dprintf(("allocating %d pages",pages)); 115 114 #endif 116 ptr = snd_malloc_pci_pages(sgbuf->pci, size, &addr);117 if (! ptr)118 goto _failed;119 115 120 116 /* 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); 129 127 sgbuf->pages++; 130 128 } 131 129 132 memset(ptr,0,size);133 134 dmab->area = ptr;135 130 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; 136 138 return dmab->area; 137 139 … … 144 146 return NULL; 145 147 } 146 147 148 /**149 * snd_free_sgbuf_pages - free the sg buffer150 * @dmab: buffer record151 *152 * Releases the pages and the SG-buffer table.153 *154 * This function is called usually from the middle-level function155 * 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 358 358 if (dpcm == NULL) 359 359 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) { 361 361 kfree(dpcm); 362 362 return -ENOMEM; … … 393 393 if (dpcm == NULL) 394 394 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) { 396 396 kfree(dpcm); 397 397 return -ENOMEM; -
GPL/branches/alsa-resync1/alsa-kernel/drivers/mpu401/mpu401.c
r212 r348 2 2 * Driver for generic MPU-401 boards (UART mode only) 3 3 * 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> 4 10 * 5 11 * … … 22 28 #include <sound/driver.h> 23 29 #include <linux/init.h> 24 #i nclude <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 27 33 #include <sound/core.h> 28 34 #include <sound/mpu401.h> 29 35 #define SNDRV_GET_ID 30 36 #include <sound/initval.h> 31 #include <linux/delay.h> 37 38 #ifdef CONFIG_ACPI_BUS 39 #define USE_ACPI_PNP 40 #endif 32 41 33 42 MODULE_AUTHOR("Jaroslav Kysela <perex@suse.cz>"); … … 39 48 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ 40 49 static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE; /* Enable this card */ 50 #ifdef USE_ACPI_PNP 51 static int acpipnp[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = 1 }; 52 #endif 41 53 static long port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT; /* MPU-401 port number */ 42 54 static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ; /* MPU-401 IRQ */ … … 54 66 MODULE_PARM_DESC(enable, "Enable MPU-401 device."); 55 67 MODULE_PARM_SYNTAX(enable, SNDRV_ENABLE_DESC); 68 #ifdef USE_ACPI_PNP 69 MODULE_PARM(acpipnp, "1-" __MODULE_STRING(SNDRV_CARDS) "i"); 70 MODULE_PARM_DESC(acpipnp, "ACPI PnP detection for MPU-401 device."); 71 MODULE_PARM_SYNTAX(acpipnp, SNDRV_ENABLED "," SNDRV_BOOLEAN_TRUE_DESC); 72 #endif 56 73 MODULE_PARM(port, "1-" __MODULE_STRING(SNDRV_CARDS) "l"); 57 74 MODULE_PARM_DESC(port, "Port # for MPU-401 device."); … … 66 83 #endif 67 84 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 86 struct acpi_device; 87 #endif 88 89 static snd_card_t *snd_mpu401_legacy_cards[SNDRV_CARDS] = SNDRV_DEFAULT_PTR; 90 static int cards; 91 92 #ifdef USE_ACPI_PNP 93 94 static int acpi_driver_registered; 95 96 struct mpu401_resources { 97 unsigned long port; 98 int irq; 99 }; 100 101 static 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 if (res->data.irq.number_of_interrupts > 0) { 108 #ifdef CONFIG_IA64 109 resources->irq = acpi_register_irq(res->data.irq.interrupts[0], 110 res->data.irq.active_high_low, 111 res->data.irq.edge_level); 112 #else 113 resources->irq = res->data.irq.interrupts[0]; 114 #endif 115 } 116 } else if (res->id == ACPI_RSTYPE_IO) { 117 if (res->data.io.range_length >= 2) { 118 resources->port = res->data.io.min_base_address; 119 } 120 } 121 return AE_OK; 122 } 123 124 static int __devinit snd_mpu401_acpi_pnp(int dev, struct acpi_device *device) 125 { 126 struct mpu401_resources res; 127 acpi_status status; 128 129 res.port = SNDRV_AUTO_PORT; 130 res.irq = SNDRV_AUTO_IRQ; 131 status = acpi_walk_resources(device->handle, METHOD_NAME__CRS, 132 snd_mpu401_acpi_resource, &res); 133 if (ACPI_FAILURE(status)) 134 return -ENODEV; 135 if (res.port == SNDRV_AUTO_PORT || res.irq == SNDRV_AUTO_IRQ) { 136 snd_printk(KERN_ERR "no port or irq in %s _CRS\n", 137 acpi_device_bid(device)); 138 return -ENODEV; 139 } 140 port[dev] = res.port; 141 irq[dev] = res.irq; 142 return 0; 143 } 144 145 #endif /* USE_ACPI_PNP */ 146 147 static int __devinit snd_card_mpu401_probe(int dev, struct acpi_device *device) 71 148 { 72 149 snd_card_t *card; 73 150 int err; 74 151 152 #ifdef USE_ACPI_PNP 153 if (!device) { 154 #endif 75 155 if (port[dev] == SNDRV_AUTO_PORT) { 76 snd_printk("specify port\n");156 snd_printk(KERN_ERR "specify port\n"); 77 157 return -EINVAL; 78 158 } 79 159 if (irq[dev] == SNDRV_AUTO_IRQ) { 80 snd_printk("specify or disable IRQ port\n");160 snd_printk(KERN_ERR "specify or disable IRQ port\n"); 81 161 return -EINVAL; 82 162 } 163 #ifdef USE_ACPI_PNP 164 } 165 #endif 166 167 #ifdef USE_ACPI_PNP 168 if (device && (err = snd_mpu401_acpi_pnp(dev, device)) < 0) 169 return err; 170 #endif 83 171 84 172 card = snd_card_new(index[dev], id[dev], THIS_MODULE, 0); 85 173 if (card == NULL) 86 174 return -ENOMEM; 87 if (snd_mpu401_uart_new(card, 0,88 #ifdef CONFIG_X86_PC980089 pc98ii[dev] ? MPU401_HW_PC98II :90 #endif91 MPU401_HW_MPU401,92 port[dev], 0,93 irq[dev], irq[dev] >= 0 ? SA_INTERRUPT : 0, NULL) < 0) {94 printk(KERN_ERR "MPU401 not detected at 0x%lx\n", port[dev]);95 snd_card_free(card);96 return -ENODEV;97 }98 175 strcpy(card->driver, "MPU-401 UART"); 99 176 strcpy(card->shortname, card->driver); … … 104 181 strcat(card->longname, "polled"); 105 182 } 183 #ifdef USE_ACPI_PNP 184 if (device) { 185 strcat(card->longname, ", bus id "); 186 strlcat(card->longname, acpi_device_bid(device), sizeof(card->longname)); 187 } 188 #endif 189 if (snd_mpu401_uart_new(card, 0, 190 #ifdef CONFIG_X86_PC9800 191 pc98ii[dev] ? MPU401_HW_PC98II : 192 #endif 193 MPU401_HW_MPU401, 194 port[dev], 0, 195 irq[dev], irq[dev] >= 0 ? SA_INTERRUPT : 0, NULL) < 0) { 196 printk(KERN_ERR "MPU401 not detected at 0x%lx\n", port[dev]); 197 snd_card_free(card); 198 return -ENODEV; 199 } 106 200 if ((err = snd_card_register(card)) < 0) { 107 201 snd_card_free(card); 108 202 return err; 109 203 } 110 snd_mpu401_cards[dev] = card; 204 #ifdef USE_ACPI_PNP 205 if (device) 206 acpi_driver_data(device) = card; 207 else 208 #endif 209 snd_mpu401_legacy_cards[dev] = card; 210 ++cards; 111 211 return 0; 112 212 } 113 213 214 #ifdef USE_ACPI_PNP 215 216 static int __devinit snd_mpu401_acpi_add(struct acpi_device *device) 217 { 218 static int dev; 219 int err; 220 221 for ( ; dev < SNDRV_CARDS; ++dev) { 222 if (!enable[dev] || !acpipnp[dev]) 223 continue; 224 err = snd_card_mpu401_probe(dev, device); 225 if (err < 0) 226 return err; 227 ++dev; 228 return 0; 229 } 230 return -ENODEV; 231 } 232 233 static int __devexit snd_mpu401_acpi_remove(struct acpi_device *device, 234 int type) 235 { 236 snd_card_t *card; 237 238 if (!device) 239 return -EINVAL; 240 card = (snd_card_t *)acpi_driver_data(device); 241 if (!card) 242 return -EINVAL; 243 244 snd_card_disconnect(card); 245 snd_card_free_in_thread(card); 246 acpi_driver_data(device) = NULL; 247 return 0; 248 } 249 250 static struct acpi_driver snd_mpu401_acpi_driver = { 251 .name = "MPU-401 Driver", 252 .class = "mpu401", 253 .ids = "PNPB006", 254 .ops = { 255 .add = snd_mpu401_acpi_add, 256 .remove = __devexit_p(snd_mpu401_acpi_remove), 257 }, 258 }; 259 260 #endif /* USE_ACPI_PNP */ 261 114 262 static int __init alsa_card_mpu401_init(void) 115 263 { 116 int dev, cards = 0; 117 264 int dev; 265 266 #ifdef USE_ACPI_PNP 267 if (acpi_bus_register_driver(&snd_mpu401_acpi_driver) >= 0) 268 acpi_driver_registered = 1; 269 #endif 118 270 for (dev = 0; dev < SNDRV_CARDS; dev++) { 119 271 if (!enable[dev]) 120 272 continue; 121 if (snd_card_mpu401_probe(dev) >= 0) 122 cards++; 273 #ifdef USE_ACPI_PNP 274 if (acpipnp[dev] && acpi_driver_registered) 275 continue; 276 #endif 277 snd_card_mpu401_probe(dev, NULL); 123 278 } 124 279 if (!cards) { … … 126 281 printk(KERN_ERR "MPU-401 device not found or device busy\n"); 127 282 #endif 283 #ifdef USE_ACPI_PNP 284 if (acpi_driver_registered) 285 acpi_bus_unregister_driver(&snd_mpu401_acpi_driver); 286 #endif 128 287 return -ENODEV; 129 288 } … … 135 294 int idx; 136 295 296 #ifdef USE_ACPI_PNP 297 if (acpi_driver_registered) 298 acpi_bus_unregister_driver(&snd_mpu401_acpi_driver); 299 #endif 137 300 for (idx = 0; idx < SNDRV_CARDS; idx++) 138 snd_card_free(snd_mpu401_ cards[idx]);301 snd_card_free(snd_mpu401_legacy_cards[idx]); 139 302 } 140 303 … … 144 307 #ifndef MODULE 145 308 146 /* format is: snd-mpu401=enable,index,id, port,irq */309 /* format is: snd-mpu401=enable,index,id,acpipnp[,pc98ii],port,irq */ 147 310 148 311 static int __init alsa_card_mpu401_setup(char *str) 149 312 { 150 313 static unsigned __initdata nr_dev = 0; 314 int __attribute__ ((__unused__)) pnp = INT_MAX; 151 315 152 316 if (nr_dev >= SNDRV_CARDS) … … 155 319 get_option(&str,&index[nr_dev]) == 2 && 156 320 get_id(&str,&id[nr_dev]) == 2 && 321 get_option(&str,&pnp) == 2 && 157 322 #ifdef CONFIG_X86_PC9800 158 323 get_option(&str,&pc98ii[nr_dev]) == 2 && … … 160 325 get_option_long(&str,&port[nr_dev]) == 2 && 161 326 get_option(&str,&irq[nr_dev]) == 2); 327 #ifdef USE_ACPI_PNP 328 if (pnp != INT_MAX) 329 acpipnp[nr_dev] = pnp; 330 #endif 162 331 nr_dev++; 163 332 return 1; -
GPL/branches/alsa-resync1/alsa-kernel/drivers/serial-u16550.c
r290 r348 352 352 353 353 /* Do some vague tests for the presence of the uart */ 354 if (io_base == 0 ) {354 if (io_base == 0 || io_base == SNDRV_AUTO_PORT) { 355 355 return -ENODEV; /* Not configured */ 356 356 } … … 830 830 } 831 831 832 if (irq >= 0) {832 if (irq >= 0 && irq != SNDRV_AUTO_IRQ) { 833 833 if (request_irq(irq, snd_uart16550_interrupt, 834 834 SA_INTERRUPT, "Serial MIDI", (void *) uart)) { 835 uart->irq = -1;836 835 snd_printk("irq %d busy. Using Polling.\n", irq); 837 836 } else { -
GPL/branches/alsa-resync1/alsa-kernel/include/sound/adriver.h
r300 r348 58 58 #endif 59 59 60 #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) 60 61 #ifndef TARGET_OS2 61 62 #include <linux/compiler.h> … … 65 66 #endif 66 67 67 #ifdef CONFIG_PCI 68 /* for compat layer */ 68 69 #include <linux/pci.h> 69 #endif70 70 71 71 #ifndef __iomem … … 181 181 #endif 182 182 183 #if !defined CONFIG_HAVE_STRLCPY && !defined TARGET_OS2 183 #endif /* < 2.6.0 */ 184 185 #ifndef TARGET_OS2 186 #ifndef CONFIG_HAVE_STRLCPY 184 187 size_t snd_compat_strlcpy(char *dest, const char *src, size_t size); 185 188 #define strlcpy(dest, src, size) snd_compat_strlcpy(dest, src, size) … … 188 191 #endif 189 192 190 #if !defined CONFIG_HAVE_SNPRINTF && !defined TARGET_OS2193 #ifndef CONFIG_HAVE_SNPRINTF 191 194 #include <stdarg.h> 192 195 int snd_compat_snprintf(char * buf, size_t size, const char * fmt, ...); … … 196 199 #endif 197 200 198 #ifndef TARGET_OS2199 201 #ifndef CONFIG_HAVE_SCNPRINTF 200 202 #define scnprintf(buf,size,fmt,args...) snprintf(buf,size,fmt,##args) … … 332 334 #endif 333 335 336 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0) 337 #define snd_dma_pci_data(pci) ((struct device *)(pci)) 338 #define snd_dma_isa_data() NULL 339 #define snd_dma_sbus_data(sbus) ((struct device *)(sbus)) 340 #define snd_dma_continuous_data(x) ((struct device *)(unsigned long)(x)) 341 #endif 342 334 343 /* pm_message_t type */ 335 344 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 11) -
GPL/branches/alsa-resync1/alsa-kernel/include/sound/compat_22.h
r290 r348 10 10 #include <linux/pagemap.h> 11 11 #include <linux/ioport.h> 12 13 #ifndef likely 14 #if __GNUC__ == 2 && __GNUC_MINOR__ < 96 15 #define __builtin_expect(x, expected_value) (x) 16 #endif 17 #define likely(x) __builtin_expect((x),1) 18 #define unlikely(x) __builtin_expect((x),0) 19 #endif 12 20 13 21 #if defined(SND_NEED_USB_WRAPPER) && (defined(CONFIG_USB) || defined(CONFIG_USB_MODULE)) … … 220 228 int snd_compat_release_resource(struct resource *resource); 221 229 222 #if 0 223 //#ifdef CONFIG_PCI 230 /* these functions are used for ISA buffer allocation, too, so they stay 231 * outside of CONFIG_PCI 232 */ 233 #define pci_alloc_consistent snd_pci_compat_alloc_consistent 234 #define pci_free_consistent snd_pci_compat_free_consistent 235 void *snd_pci_compat_alloc_consistent(struct pci_dev *, long, dma_addr_t *); 236 void snd_pci_compat_free_consistent(struct pci_dev *, long, void *, dma_addr_t); 237 238 #ifdef CONFIG_PCI 224 239 225 240 /* New-style probing supporting hot-pluggable devices */ … … 242 257 //#define pci_set_power_state snd_pci_compat_set_power_state 243 258 244 #define pci_alloc_consistent snd_pci_compat_alloc_consistent245 #define pci_free_consistent snd_pci_compat_free_consistent246 259 #define pci_dma_supported snd_pci_compat_dma_supported 247 260 … … 308 321 void snd_pci_compat_disable_device(struct pci_dev *dev); 309 322 int snd_pci_compat_find_capability(struct pci_dev *dev, int cap); 310 void *snd_pci_compat_alloc_consistent(struct pci_dev *, long, dma_addr_t *);311 void snd_pci_compat_free_consistent(struct pci_dev *, long, void *, dma_addr_t);312 323 int snd_pci_compat_dma_supported(struct pci_dev *, dma_addr_t mask); 313 324 unsigned long snd_pci_compat_get_dma_mask(struct pci_dev *); … … 477 488 unsigned long name[((bits)+BITS_PER_LONG-1)/BITS_PER_LONG] 478 489 #endif 479 #ifndef __user480 #define __user481 #endif482 490 483 491 /** -
GPL/branches/alsa-resync1/alsa-kernel/include/sound/core.h
r299 r348 279 279 void *snd_kcalloc(size_t size, int flags); 280 280 char *snd_kmalloc_strdup(const char *string, int flags); 281 void *snd_malloc_pages(unsigned long size, unsigned int dma_flags);282 void *snd_malloc_pages_fallback(unsigned long size, unsigned int dma_flags, unsigned long *res_size);283 281 int copy_to_user_fromio(void __user *dst, const volatile void __iomem *src, size_t count); 284 282 int copy_from_user_toio(volatile void __iomem *dst, const void __user *src, size_t count); -
GPL/branches/alsa-resync1/alsa-kernel/include/sound/memalloc.h
r222 r348 25 25 #define __SOUND_MEMALLOC_H 26 26 27 #include <linux/pci.h> 28 #ifdef CONFIG_SBUS 29 #include <asm/sbus.h> 30 #endif 27 struct device; 31 28 32 29 #if 0 … … 62 59 #define SNDRV_DMA_TYPE_DEV 2 /* generic device continuous */ 63 60 #define SNDRV_DMA_TYPE_DEV_SG 3 /* generic device SG-buffer */ 64 #ifdef TARGET_OS2 // Provide old types until 1.0.465 #define SNDRV_DMA_TYPE_ISA 2 /* ISA continuous */66 #define SNDRV_DMA_TYPE_PCI 3 /* PCI continuous */67 #endif /* TARGET_OS2 */68 61 #define SNDRV_DMA_TYPE_SBUS 4 /* SBUS continuous */ 69 #define SNDRV_DMA_TYPE_PCI_SG 5 /* PCI SG-buffer */70 71 #ifdef CONFIG_PCI72 #if 073 /*74 * compose a snd_dma_device struct for the PCI device75 */76 static inline void snd_dma_device_pci(struct snd_dma_device *dev, struct pci_dev *pci, unsigned int id)77 {78 memset(dev, 0, sizeof(*dev));79 dev->type = SNDRV_DMA_TYPE_PCI;80 dev->dev.pci = pci;81 dev->id = id;82 }83 #endif84 #endif85 62 86 63 #define __GFP_NOWARN 0 … … 97 74 }; 98 75 99 /* allocate/release a buffer */100 int snd_dma_alloc_pages(int type, struct device *dev, size_t size,101 struct snd_dma_buffer *dmab);102 int snd_dma_alloc_pages_fallback(int type, struct device *dev, size_t size,103 struct snd_dma_buffer *dmab);104 void snd_dma_free_pages(struct snd_dma_buffer *dmab);105 106 /* buffer-preservation managements */107 #define snd_dma_pci_buf_id(pci) (((unsigned int)(pci)->vendor << 16) | (pci)->device)108 size_t snd_dma_get_reserved_buf(struct snd_dma_buffer *dmab, unsigned int id);109 int snd_dma_reserve_buf(struct snd_dma_buffer *dmab, unsigned int id);110 111 76 /* 112 * Generic memory allocators 113 */ 114 115 /* 116 * continuous pages 117 */ 118 void *snd_malloc_pages(unsigned long size, unsigned int gfp_flags); 119 void snd_free_pages(void *ptr, unsigned long size); 120 121 #ifdef CONFIG_PCI 122 /* 123 * PCI continuous pages 124 */ 125 void *snd_malloc_pci_pages(struct pci_dev *pci, size_t size, dma_addr_t *dma_addr); 126 void *snd_malloc_pci_pages_fallback(struct pci_dev *pci, size_t size, dma_addr_t *dma_addr, size_t *res_size); 127 void snd_free_pci_pages(struct pci_dev *pci, size_t size, void *ptr, dma_addr_t dma_addr); 128 /* one page allocation */ 129 void *snd_malloc_pci_page(struct pci_dev *pci, dma_addr_t *dma_addr); 130 #define snd_free_pci_page(pci,ptr,addr) snd_free_pci_pages(pci,PAGE_SIZE,ptr,addr) 131 #endif 132 133 #ifdef CONFIG_SBUS 134 /* 135 * SBUS continuous pages 136 */ 137 void *snd_malloc_sbus_pages(struct sbus_dev *sdev, size_t size, dma_addr_t *dma_addr); 138 void *snd_malloc_sbus_pages_fallback(struct sbus_dev *sdev, size_t size, dma_addr_t *dma_addr, size_t *res_size); 139 void snd_free_sbus_pages(struct sbus_dev *sdev, size_t size, void *ptr, dma_addr_t dma_addr); 140 #endif 141 142 #ifdef CONFIG_ISA 143 /* 144 * ISA continuous pages 145 */ 146 void *snd_malloc_isa_pages(size_t size, dma_addr_t *dma_addr); 147 void *snd_malloc_isa_pages_fallback(size_t size, dma_addr_t *dma_addr, size_t *res_size); 148 void snd_free_isa_pages(size_t size, void *ptr, dma_addr_t addr); 149 #ifdef CONFIG_PCI 150 #define snd_malloc_isa_pages(size, dma_addr) snd_malloc_pci_pages(NULL, size, dma_addr) 151 #define snd_malloc_isa_pages_fallback(size, dma_addr, res_size) snd_malloc_pci_pages_fallback(NULL, size, dma_addr, res_size) 152 #define snd_free_isa_pages(size, ptr, dma_addr) snd_free_pci_pages(NULL, size, ptr, dma_addr) 153 #else /* !CONFIG_PCI */ 154 #define snd_free_isa_pages(size, ptr, dma_addr) snd_free_pages(ptr, size) 155 #endif /* CONFIG_PCI */ 156 #endif /* CONFIG_ISA */ 157 158 #ifdef CONFIG_PCI 159 /* 160 * Scatter-Gather PCI pages 77 * Scatter-Gather generic device pages 161 78 */ 162 79 struct snd_sg_page { … … 171 88 struct snd_sg_page *table; /* address table */ 172 89 struct page **page_table; /* page table (for vmap/vunmap) */ 173 struct pci_dev *pci;90 struct snd_dma_device dev; 174 91 }; 175 92 … … 189 106 return sgbuf->table[offset >> PAGE_SHIFT].addr + offset % PAGE_SIZE; 190 107 } 191 #endif /* CONFIG_PCI */ 108 109 110 /* allocate/release a buffer */ 111 int snd_dma_alloc_pages(int type, struct device *dev, size_t size, 112 struct snd_dma_buffer *dmab); 113 int snd_dma_alloc_pages_fallback(int type, struct device *dev, size_t size, 114 struct snd_dma_buffer *dmab); 115 void snd_dma_free_pages(struct snd_dma_buffer *dmab); 116 117 /* buffer-preservation managements */ 118 #define snd_dma_pci_buf_id(pci) (((unsigned int)(pci)->vendor << 16) | (pci)->device) 119 size_t snd_dma_get_reserved_buf(struct snd_dma_buffer *dmab, unsigned int id); 120 int snd_dma_reserve_buf(struct snd_dma_buffer *dmab, unsigned int id); 121 122 /* basic memory allocation functions */ 123 void *snd_malloc_pages(size_t size, unsigned int gfp_flags); 124 void *snd_malloc_pages_fallback(size_t size, unsigned int gfp_flags, size_t *res_size); 125 void snd_free_pages(void *ptr, size_t size); 192 126 193 127 #endif /* __SOUND_MEMALLOC_H */ 128 -
GPL/branches/alsa-resync1/alsa-kernel/include/sound/version.h
r300 r348 1 1 /* include/version.h. Generated by configure. */ 2 #define CONFIG_SND_VERSION "1.0. 3"2 #define CONFIG_SND_VERSION "1.0.4" 3 3 #define CONFIG_SND_DATE "" -
GPL/branches/alsa-resync1/alsa-kernel/isa/ad1816a/ad1816a_lib.c
r290 r348 685 685 snd_ad1816a_init(chip); 686 686 687 snd_pcm_lib_preallocate_isa_pages_for_all(pcm, 64*1024, chip->dma1 > 3 || chip->dma2 > 3 ? 128*1024 : 64*1024); 687 snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, 688 snd_dma_isa_data(), 689 64*1024, chip->dma1 > 3 || chip->dma2 > 3 ? 128*1024 : 64*1024); 688 690 689 691 chip->pcm = pcm; -
GPL/branches/alsa-resync1/alsa-kernel/isa/ad1848/ad1848_lib.c
r290 r348 1044 1044 strcpy(pcm->name, snd_ad1848_chip_id(chip)); 1045 1045 1046 snd_pcm_lib_preallocate_isa_pages_for_all(pcm, 64*1024, chip->dma > 3 ? 128*1024 : 64*1024); 1046 snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, 1047 snd_dma_isa_data(), 1048 64*1024, chip->dma > 3 ? 128*1024 : 64*1024); 1047 1049 1048 1050 chip->pcm = pcm; -
GPL/branches/alsa-resync1/alsa-kernel/isa/cmi8330.c
r290 r348 443 443 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &chip->streams[SNDRV_PCM_STREAM_CAPTURE].ops); 444 444 445 snd_pcm_lib_preallocate_isa_pages_for_all(pcm, 64*1024, 128*1024); 445 snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, 446 snd_dma_isa_data(), 447 64*1024, 128*1024); 446 448 chip->pcm = pcm; 447 449 -
GPL/branches/alsa-resync1/alsa-kernel/isa/cs423x/cs4231_lib.c
r290 r348 1654 1654 1655 1655 #ifdef LEGACY_SUPPORT 1656 snd_pcm_lib_preallocate_isa_pages_for_all(pcm, 64*1024, chip->dma1 > 3 || chip->dma2 > 3 ? 128*1024 : 64*1024); 1656 snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, 1657 snd_dma_isa_data(), 1658 64*1024, chip->dma1 > 3 || chip->dma2 > 3 ? 128*1024 : 64*1024); 1657 1659 #else 1658 1660 # ifdef EBUS_SUPPORT 1659 1661 if (chip->ebus_flag) { 1660 snd_pcm_lib_preallocate_pci_pages_for_all(chip->dev_u.pdev, pcm, 1662 snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_PCI, 1663 chip->dev_u.pdev, 1661 1664 64*1024, 128*1024); 1662 1665 } else { 1663 1666 # endif 1664 1667 # ifdef SBUS_SUPPORT 1665 snd_pcm_lib_preallocate_sbus_pages_for_all(chip->dev_u.sdev, pcm, 1668 snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_SBUS, 1669 chip->dev_u.sdev, 1666 1670 64*1024, 128*1024); 1667 1671 # endif -
GPL/branches/alsa-resync1/alsa-kernel/isa/dt019x.c
r290 r348 144 144 dma8[dev] = pnp_dma(pdev, 0); 145 145 irq[dev] = pnp_irq(pdev, 0); 146 snd_printdd("dt019x: found audio interface: port=0x%lx, irq=0x% lx, dma=0x%lx\n",146 snd_printdd("dt019x: found audio interface: port=0x%lx, irq=0x%x, dma=0x%x\n", 147 147 port[dev],irq[dev],dma8[dev]); 148 148 … … 165 165 mpu_port[dev] = pnp_port_start(pdev, 0); 166 166 mpu_irq[dev] = pnp_irq(pdev, 0); 167 snd_printdd("dt019x: found MPU-401: port=0x%lx, irq=0x% lx\n",167 snd_printdd("dt019x: found MPU-401: port=0x%lx, irq=0x%x\n", 168 168 mpu_port[dev],mpu_irq[dev]); 169 169 } else { … … 323 323 324 324 #ifdef MODULE 325 if (!cards) 325 if (!cards) { 326 pnp_unregister_card_driver(&dt019x_pnpc_driver); 326 327 snd_printk(KERN_ERR "no DT-019X / ALS-007 based soundcards found\n"); 328 } 327 329 #endif 328 330 return cards ? 0 : -ENODEV; -
GPL/branches/alsa-resync1/alsa-kernel/isa/es1688/es1688.c
r300 r348 187 187 { 188 188 static unsigned long possible_ports[] = {0x220, 0x240, 0x260, -1}; 189 int dev, cards = 0 ;189 int dev, cards = 0, i; 190 190 191 191 for (dev = cards = 0; dev < SNDRV_CARDS && enable[dev]; dev++) { … … 195 195 cards++; 196 196 } 197 cards += snd_legacy_auto_probe(possible_ports, snd_audiodrive_legacy_auto_probe); 197 i = snd_legacy_auto_probe(possible_ports, snd_audiodrive_legacy_auto_probe); 198 if (i > 0) 199 cards += i; 200 198 201 if (!cards) { 199 202 #ifdef MODULE -
GPL/branches/alsa-resync1/alsa-kernel/isa/es1688/es1688_lib.c
r290 r348 753 753 chip->pcm = pcm; 754 754 755 snd_pcm_lib_preallocate_isa_pages_for_all(pcm, 64*1024, 64*1024); 755 snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, 756 snd_dma_isa_data(), 757 64*1024, 64*1024); 756 758 757 759 if (rpcm) -
GPL/branches/alsa-resync1/alsa-kernel/isa/es18xx.c
r290 r348 1599 1599 chip->pcm = pcm; 1600 1600 1601 snd_pcm_lib_preallocate_isa_pages_for_all(pcm, 64*1024, chip->dma1 > 3 || chip->dma2 > 3 ? 128*1024 : 64*1024); 1601 snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, 1602 snd_dma_isa_data(), 1603 64*1024, 1604 chip->dma1 > 3 || chip->dma2 > 3 ? 128*1024 : 64*1024); 1602 1605 1603 1606 if (rpcm) … … 2237 2240 { 2238 2241 static unsigned long possible_ports[] = {0x220, 0x240, 0x260, 0x280, -1}; 2239 int dev, cards = 0 ;2242 int dev, cards = 0, i; 2240 2243 2241 2244 /* legacy non-auto cards at first */ … … 2251 2254 } 2252 2255 /* legacy auto configured cards */ 2253 cards += snd_legacy_auto_probe(possible_ports, snd_audiodrive_probe_legacy_port); 2256 i = snd_legacy_auto_probe(possible_ports, snd_audiodrive_probe_legacy_port); 2257 if (i > 0) 2258 cards += i; 2259 2254 2260 #ifdef CONFIG_PNP 2255 2261 /* ISA PnP cards at last */ 2256 cards += pnp_register_card_driver(&es18xx_pnpc_driver); 2262 i = pnp_register_card_driver(&es18xx_pnpc_driver); 2263 if (i > 0) 2264 cards += i; 2265 2257 2266 #endif 2258 2267 if(!cards) { -
GPL/branches/alsa-resync1/alsa-kernel/isa/gus/gus_pcm.c
r281 r348 875 875 876 876 for (substream = pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream; substream; substream = substream->next) 877 snd_pcm_lib_preallocate_isa_pages(substream, 64*1024, gus->gf1.dma1 > 3 ? 128*1024 : 64*1024); 877 snd_pcm_lib_preallocate_pages(substream, SNDRV_DMA_TYPE_DEV, 878 snd_dma_isa_data(), 879 64*1024, gus->gf1.dma1 > 3 ? 128*1024 : 64*1024); 878 880 879 881 pcm->info_flags = 0; … … 883 885 if (gus->gf1.dma2 == gus->gf1.dma1) 884 886 pcm->info_flags |= SNDRV_PCM_INFO_HALF_DUPLEX; 885 snd_pcm_lib_preallocate_isa_pages(pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream, 64*1024, gus->gf1.dma2 > 3 ? 128*1024 : 64*1024); 887 snd_pcm_lib_preallocate_pages(pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream, 888 SNDRV_DMA_TYPE_DEV, snd_dma_isa_data(), 889 64*1024, gus->gf1.dma2 > 3 ? 128*1024 : 64*1024); 886 890 } 887 891 strcpy(pcm->name, pcm->id); -
GPL/branches/alsa-resync1/alsa-kernel/isa/gus/gusclassic.c
r277 r348 246 246 { 247 247 static unsigned long possible_ports[] = {0x220, 0x230, 0x240, 0x250, 0x260, -1}; 248 int dev, cards ;248 int dev, cards, i; 249 249 250 250 for (dev = cards = 0; dev < SNDRV_CARDS && enable[dev]; dev++) { … … 254 254 cards++; 255 255 } 256 cards += snd_legacy_auto_probe(possible_ports, snd_gusclassic_legacy_auto_probe); 256 i = snd_legacy_auto_probe(possible_ports, snd_gusclassic_legacy_auto_probe); 257 if (i > 0) 258 cards += i; 259 257 260 if (!cards) { 258 261 #ifdef MODULE -
GPL/branches/alsa-resync1/alsa-kernel/isa/gus/gusextreme.c
r277 r348 233 233 if (xgf1_irq == SNDRV_AUTO_IRQ) { 234 234 if ((xgf1_irq = snd_legacy_find_free_irq(possible_gf1_irqs)) < 0) { 235 snd_card_free(card);236 235 snd_printk("unable to find a free IRQ for GF1\n"); 237 return -EBUSY; 236 err = -EBUSY; 237 goto out; 238 238 } 239 239 } … … 241 241 if (xess_irq == SNDRV_AUTO_IRQ) { 242 242 if ((xess_irq = snd_legacy_find_free_irq(possible_ess_irqs)) < 0) { 243 snd_card_free(card);244 243 snd_printk("unable to find a free IRQ for ES1688\n"); 245 return -EBUSY; 244 err = -EBUSY; 245 goto out; 246 246 } 247 247 } … … 254 254 if (xgf1_dma == SNDRV_AUTO_DMA) { 255 255 if ((xgf1_dma = snd_legacy_find_free_dma(possible_gf1_dmas)) < 0) { 256 snd_card_free(card);257 256 snd_printk("unable to find a free DMA for GF1\n"); 258 return -EBUSY; 257 err = -EBUSY; 258 goto out; 259 259 } 260 260 } … … 262 262 if (xess_dma == SNDRV_AUTO_DMA) { 263 263 if ((xess_dma = snd_legacy_find_free_dma(possible_ess_dmas)) < 0) { 264 snd_card_free(card);265 264 snd_printk("unable to find a free DMA for ES1688\n"); 266 return -EBUSY; 265 err = -EBUSY; 266 goto out; 267 267 } 268 268 } … … 270 270 if ((err = snd_es1688_create(card, port[dev], mpu_port[dev], 271 271 xess_irq, xmpu_irq, xess_dma, 272 ES1688_HW_1688, &es1688)) < 0) { 273 snd_card_free(card); 274 return err; 275 } 272 ES1688_HW_1688, &es1688)) < 0) 273 goto out; 276 274 if (gf1_port[dev] < 0) 277 275 gf1_port[dev] = port[dev] + 0x20; … … 283 281 0, channels[dev], 284 282 pcm_channels[dev], 0, 285 &gus)) < 0) { 286 snd_card_free(card); 287 return err; 288 } 289 if ((err = snd_gusextreme_detect(dev, card, gus, es1688)) < 0) { 290 snd_card_free(card); 291 return err; 292 } 283 &gus)) < 0) 284 goto out; 285 286 if ((err = snd_gusextreme_detect(dev, card, gus, es1688)) < 0) 287 goto out; 288 293 289 snd_gusextreme_init(dev, gus); 294 if ((err = snd_gus_initialize(gus)) < 0) { 295 snd_card_free(card); 296 return err; 297 } 290 if ((err = snd_gus_initialize(gus)) < 0) 291 goto out; 292 298 293 if (!gus->ess_flag) { 299 294 snd_printdd("GUS Extreme soundcard was not detected at 0x%lx\n", gus->gf1.port); 300 snd_card_free(card); 301 return -ENODEV; 302 } 303 if ((err = snd_es1688_pcm(es1688, 0, NULL)) < 0) { 304 snd_card_free(card); 305 return err; 306 } 307 if ((err = snd_es1688_mixer(es1688)) < 0) { 308 snd_card_free(card); 309 return err; 310 } 295 err = -ENODEV; 296 goto out; 297 } 298 if ((err = snd_es1688_pcm(es1688, 0, NULL)) < 0) 299 goto out; 300 301 if ((err = snd_es1688_mixer(es1688)) < 0) 302 goto out; 303 311 304 snd_component_add(card, "ES1688"); 312 305 if (pcm_channels[dev] > 0) { 313 if ((err = snd_gf1_pcm_new(gus, 1, 1, NULL)) < 0) { 314 snd_card_free(card); 315 return err; 316 } 317 } 318 if ((err = snd_gf1_new_mixer(gus)) < 0) { 319 snd_card_free(card); 320 return err; 321 } 322 if ((err = snd_gusextreme_mixer(es1688)) < 0) { 323 snd_card_free(card); 324 return err; 325 } 306 if ((err = snd_gf1_pcm_new(gus, 1, 1, NULL)) < 0) 307 goto out; 308 } 309 if ((err = snd_gf1_new_mixer(gus)) < 0) 310 goto out; 311 312 if ((err = snd_gusextreme_mixer(es1688)) < 0) 313 goto out; 326 314 327 315 if (snd_opl3_create(card, es1688->port, es1688->port + 2, … … 329 317 printk(KERN_ERR "gusextreme: opl3 not detected at 0x%lx\n", es1688->port); 330 318 } else { 331 if ((err = snd_opl3_hwdep_new(opl3, 0, 2, NULL)) < 0) { 332 snd_card_free(card); 333 return err; 334 } 335 } 336 337 if (es1688->mpu_port >= 0x300) { 338 if ((err = snd_mpu401_uart_new(card, 0, MPU401_HW_ES1688, 319 if ((err = snd_opl3_hwdep_new(opl3, 0, 2, NULL)) < 0) 320 goto out; 321 } 322 323 if (es1688->mpu_port >= 0x300 && 324 (err = snd_mpu401_uart_new(card, 0, MPU401_HW_ES1688, 339 325 es1688->mpu_port, 0, 340 326 xmpu_irq, 341 327 SA_INTERRUPT, 342 NULL)) < 0) { 343 snd_card_free(card); 344 return err; 345 } 346 } 328 NULL)) < 0) 329 goto out; 347 330 348 331 sprintf(card->longname, "Gravis UltraSound Extreme at 0x%lx, irq %i&%i, dma %i&%i", 349 332 es1688->port, xgf1_irq, xess_irq, xgf1_dma, xess_dma); 350 if ((err = snd_card_register(card)) < 0) { 351 snd_card_free(card); 352 return err; 353 } 333 if ((err = snd_card_register(card)) < 0) 334 goto out; 335 354 336 snd_gusextreme_cards[dev] = card; 355 337 return 0; 338 339 out: 340 snd_card_free(card); 341 return err; 356 342 } 357 343 … … 376 362 { 377 363 static unsigned long possible_ports[] = {0x220, 0x240, 0x260, -1}; 378 int dev, cards ;364 int dev, cards, i; 379 365 380 366 for (dev = cards = 0; dev < SNDRV_CARDS && enable[dev] > 0; dev++) { … … 384 370 cards++; 385 371 } 386 cards += snd_legacy_auto_probe(possible_ports, snd_gusextreme_legacy_auto_probe); 372 i = snd_legacy_auto_probe(possible_ports, snd_gusextreme_legacy_auto_probe); 373 if (i > 0) 374 cards += i; 375 387 376 if (!cards) { 388 377 #ifdef MODULE -
GPL/branches/alsa-resync1/alsa-kernel/isa/gus/gusmax.c
r277 r348 386 386 { 387 387 static unsigned long possible_ports[] = {0x220, 0x230, 0x240, 0x250, 0x260, -1}; 388 int dev, cards ;388 int dev, cards, i; 389 389 390 390 for (dev = cards = 0; dev < SNDRV_CARDS && enable[dev] > 0; dev++) { … … 394 394 cards++; 395 395 } 396 cards += snd_legacy_auto_probe(possible_ports, snd_gusmax_legacy_auto_probe); 396 i = snd_legacy_auto_probe(possible_ports, snd_gusmax_legacy_auto_probe); 397 if (i > 0) 398 cards += i; 399 397 400 if (!cards) { 398 401 #ifdef MODULE -
GPL/branches/alsa-resync1/alsa-kernel/isa/gus/interwave.c
r300 r348 942 942 static int __init alsa_card_interwave_init(void) 943 943 { 944 int cards = 0 ;944 int cards = 0, i; 945 945 static long possible_ports[] = {0x210, 0x220, 0x230, 0x240, 0x250, 0x260, -1}; 946 946 int dev; … … 962 962 } 963 963 /* legacy auto configured cards */ 964 cards += snd_legacy_auto_probe(possible_ports, snd_interwave_probe_legacy_port); 964 i = snd_legacy_auto_probe(possible_ports, snd_interwave_probe_legacy_port); 965 if (i > 0) 966 cards += i; 965 967 #ifdef CONFIG_PNP 966 968 /* ISA PnP cards */ 967 cards += pnp_register_card_driver(&interwave_pnpc_driver); 969 i = pnp_register_card_driver(&interwave_pnpc_driver); 970 if (i > 0) 971 cards += i; 968 972 #endif 969 973 -
GPL/branches/alsa-resync1/alsa-kernel/isa/opti9xx/opti92x-ad1848.c
r290 r348 312 312 { 313 313 while (*port_table != -1) { 314 if (!check_region(*port_table, size)) 314 struct resource *res; 315 if ((res = request_region(*port_table, size, "ALSA test")) != NULL) { 316 release_resource(res); 317 kfree_nocheck(res); 315 318 return *port_table; 319 } 316 320 port_table++; 317 321 } … … 1400 1404 strcpy(pcm->name, snd_opti93x_chip_id(codec)); 1401 1405 1402 snd_pcm_lib_preallocate_isa_pages_for_all(pcm, 64*1024, codec->dma1 > 3 || codec->dma2 > 3 ? 128*1024 : 64*1024); 1406 snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, 1407 snd_dma_isa_data(), 1408 64*1024, codec->dma1 > 3 || codec->dma2 > 3 ? 128*1024 : 64*1024); 1403 1409 1404 1410 codec->pcm = pcm; … … 1673 1679 return err; 1674 1680 1675 if ( check_region(chip->mc_base, chip->mc_base_size))1681 if ((chip->res_mc_base = request_region(chip->mc_base, chip->mc_base_size, "OPTi9xx MC")) == NULL) 1676 1682 continue; 1677 1683 … … 1680 1686 if (value == snd_opti9xx_read(chip, OPTi9XX_MC_REG(1))) 1681 1687 return 1; 1688 1689 release_resource(chip->res_mc_base); 1690 kfree_nocheck(chip->res_mc_base); 1691 chip->res_mc_base = NULL; 1692 1682 1693 } 1683 1694 #else /* OPTi93X */ … … 1689 1700 return err; 1690 1701 1691 if ( check_region(chip->mc_base, chip->mc_base_size))1702 if ((chip->res_mc_base = request_region(chip->mc_base, chip->mc_base_size, "OPTi9xx MC")) == NULL) 1692 1703 continue; 1693 1704 … … 1702 1713 if (snd_opti9xx_read(chip, OPTi9XX_MC_REG(7)) == 0xff - value) 1703 1714 return 1; 1715 1716 release_resource(chip->res_mc_base); 1717 kfree_nocheck(chip->res_mc_base); 1718 chip->res_mc_base = NULL; 1704 1719 } 1705 1720 #endif /* OPTi93X */ … … 1985 2000 #endif /* CONFIG_PNP */ 1986 2001 1987 if ((chip->res_mc_base = request_region(chip->mc_base, chip->mc_base_size, "OPTi9xx MC")) == NULL) { 2002 if (! chip->res_mc_base && 2003 (chip->res_mc_base = request_region(chip->mc_base, chip->mc_base_size, "OPTi9xx MC")) == NULL) { 1988 2004 snd_card_free(card); 1989 2005 return -ENOMEM; -
GPL/branches/alsa-resync1/alsa-kernel/isa/sb/es968.c
r290 r348 226 226 static int __init alsa_card_es968_init(void) 227 227 { 228 int res = pnp_register_card_driver(&es968_pnpc_driver);229 if (res == 0) 230 {228 int cards = pnp_register_card_driver(&es968_pnpc_driver); 229 #ifdef MODULE 230 if (cards == 0) { 231 231 pnp_unregister_card_driver(&es968_pnpc_driver); 232 #ifdef MODULE233 232 snd_printk(KERN_ERR "no ES968 based soundcards found\n"); 233 } 234 234 #endif 235 } 236 return res < 0 ? res : 0; 235 return cards ? 0 : -ENODEV; 237 236 } 238 237 -
GPL/branches/alsa-resync1/alsa-kernel/isa/sb/sb16.c
r290 r348 644 644 static int __init alsa_card_sb16_init(void) 645 645 { 646 int dev, cards = 0;646 int dev, cards = 0, i; 647 647 static unsigned long possible_ports[] = {0x220, 0x240, 0x260, 0x280, -1}; 648 648 … … 664 664 } 665 665 /* legacy auto configured cards */ 666 cards += snd_legacy_auto_probe(possible_ports, snd_sb16_probe_legacy_port); 666 i = snd_legacy_auto_probe(possible_ports, snd_sb16_probe_legacy_port); 667 if (i > 0) 668 cards += i; 669 667 670 #ifdef CONFIG_PNP 668 671 /* PnP cards at last */ 669 cards += pnp_register_card_driver(&sb16_pnpc_driver); 672 i = pnp_register_card_driver(&sb16_pnpc_driver); 673 if (i >0) 674 cards += i; 670 675 #endif 671 676 -
GPL/branches/alsa-resync1/alsa-kernel/isa/sb/sb16_main.c
r246 r348 882 882 pcm->info_flags = SNDRV_PCM_INFO_HALF_DUPLEX; 883 883 884 snd_pcm_lib_preallocate_isa_pages_for_all(pcm, 64*1024, 128*1024); 884 snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, 885 snd_dma_isa_data(), 886 64*1024, 128*1024); 885 887 886 888 if (rpcm) -
GPL/branches/alsa-resync1/alsa-kernel/isa/sb/sb8.c
r277 r348 200 200 { 201 201 static unsigned long possible_ports[] = {0x220, 0x240, 0x260, -1}; 202 int dev, cards;202 int dev, cards, i; 203 203 204 204 for (dev = cards = 0; dev < SNDRV_CARDS && enable[dev]; dev++) { … … 208 208 cards++; 209 209 } 210 cards += snd_legacy_auto_probe(possible_ports, snd_card_sb8_legacy_auto_probe); 210 i = snd_legacy_auto_probe(possible_ports, snd_card_sb8_legacy_auto_probe); 211 if (i > 0) 212 cards += i; 213 211 214 if (!cards) { 212 215 #ifdef MODULE -
GPL/branches/alsa-resync1/alsa-kernel/isa/sb/sb8_main.c
r246 r348 536 536 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &snd_sb8_capture_ops); 537 537 538 snd_pcm_lib_preallocate_isa_pages_for_all(pcm, 64*1024, 64*1024); 538 snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, 539 snd_dma_isa_data(), 540 64*1024, 64*1024); 539 541 540 542 if (rpcm) -
GPL/branches/alsa-resync1/alsa-kernel/pci/ac97/ac97_patch.c
r290 r348 2161 2161 unsigned short misc; 2162 2162 2163 patch_ad1881(ac97); 2163 2164 ac97->build_ops = &patch_ad1985_build_ops; 2164 2165 misc = snd_ac97_read(ac97, AC97_AD_MISC); -
GPL/branches/alsa-resync1/alsa-kernel/pci/emu10k1/emu10k1.c
r256 r348 101 101 static struct pci_device_id snd_emu10k1_ids[] = { 102 102 { 0x1102, 0x0002, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* EMU10K1 */ 103 #if 0 /* FIXME: not working! */ 103 104 { 0x1102, 0x0006, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, /* Dell OEM version (EMU10K1) */ 105 #endif 104 106 { 0x1102, 0x0004, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 }, /* Audigy */ 105 107 { 0x1102, 0x0008, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 }, /* Audigy 2 Value SB0400 */ -
GPL/branches/alsa-resync1/alsa-kernel/pci/emu10k1/emu10k1_callback.c
r84 r348 428 428 /* invalidate maps */ 429 429 temp = ((unsigned int)hw->silent_page.addr << 1) | MAP_PTI_MASK; 430 // temp = ((unsigned int)hw->silent_page_dmaaddr << 1) | MAP_PTI_MASK;431 430 snd_emu10k1_ptr_write(hw, MAPA, ch, temp); 432 431 snd_emu10k1_ptr_write(hw, MAPB, ch, temp); -
GPL/branches/alsa-resync1/alsa-kernel/pci/emu10k1/emufx.c
r207 r348 30 30 31 31 #include <sound/driver.h> 32 #include <linux/pci.h> 32 33 #include <linux/delay.h> 33 34 #include <linux/slab.h> -
GPL/branches/alsa-resync1/alsa-kernel/pci/ice1712/aureon.c
r281 r348 410 410 unsigned int i; 411 411 412 if (ice->eeprom.subvendor == VT1724_SUBDEVICE_AUREON51_SKY) 412 if (ice->eeprom.subvendor == VT1724_SUBDEVICE_AUREON51_SKY) { 413 413 ice->num_total_dacs = 6; 414 else 414 ice->num_total_adcs = 6; 415 } else { 415 416 ice->num_total_dacs = 8; 417 ice->num_total_adcs = 8; 418 } 416 419 417 420 /* to remeber the register values */ -
GPL/branches/alsa-resync1/alsa-kernel/pci/ice1712/delta.c
r300 r348 91 91 break; 92 92 case ICE1712_SUBDEVICE_AUDIOPHILE: 93 case ICE1712_SUBDEVICE_DELTA410: 93 94 tmp |= ICE1712_DELTA_AP_CCLK | ICE1712_DELTA_AP_CS_CODEC; 94 95 tmp &= ~ICE1712_DELTA_AP_CS_DIGITAL; … … 113 114 break; 114 115 case ICE1712_SUBDEVICE_AUDIOPHILE: 116 case ICE1712_SUBDEVICE_DELTA410: 115 117 tmp |= ICE1712_DELTA_AP_CS_DIGITAL; 116 118 break; … … 512 514 case ICE1712_SUBDEVICE_AUDIOPHILE: 513 515 ice->num_total_dacs = 2; 516 ice->num_total_adcs = 2; 514 517 break; 515 518 case ICE1712_SUBDEVICE_DELTA410: 516 519 ice->num_total_dacs = 8; 520 ice->num_total_adcs = 2; 517 521 break; 518 522 case ICE1712_SUBDEVICE_DELTA44: 519 523 case ICE1712_SUBDEVICE_DELTA66: 520 524 ice->num_total_dacs = ice->omni ? 8 : 4; 525 ice->num_total_adcs = ice->omni ? 8 : 4; 521 526 break; 522 527 case ICE1712_SUBDEVICE_DELTA1010: 523 528 case ICE1712_SUBDEVICE_DELTA1010LT: 524 529 ice->num_total_dacs = 8; 530 ice->num_total_adcs = 8; 525 531 break; 526 532 case ICE1712_SUBDEVICE_VX442: 527 533 ice->num_total_dacs = 4; 534 ice->num_total_adcs = 4; 528 535 break; 529 536 } -
GPL/branches/alsa-resync1/alsa-kernel/pci/ice1712/ews.c
r250 r348 407 407 case ICE1712_SUBDEVICE_EWX2496: 408 408 ice->num_total_dacs = 2; 409 ice->num_total_adcs = 2; 409 410 break; 410 411 case ICE1712_SUBDEVICE_EWS88MT: 411 412 case ICE1712_SUBDEVICE_EWS88MT_NEW: 412 413 ice->num_total_dacs = 8; 414 ice->num_total_adcs = 8; 413 415 break; 414 416 case ICE1712_SUBDEVICE_EWS88D: … … 416 418 case ICE1712_SUBDEVICE_DMX6FIRE: 417 419 ice->num_total_dacs = 6; 420 ice->num_total_adcs = 6; 418 421 break; 419 422 } -
GPL/branches/alsa-resync1/alsa-kernel/pci/ice1712/hoontech.c
r256 r348 154 154 155 155 ice->num_total_dacs = 8; 156 ice->num_total_adcs = 8; 156 157 157 158 ice->hoontech_boxbits[0] = -
GPL/branches/alsa-resync1/alsa-kernel/pci/ice1712/ice1712.c
r300 r348 83 83 static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; /* Enable this card */ 84 84 static int omni[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = 0}; /* Delta44 & 66 Omni I/O support */ 85 static int cs8427_timeout[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)] = 500}; /* CS8427 S/PDIF transciever reset timeout value in msec */ 85 86 86 87 MODULE_PARM(index, "1-" __MODULE_STRING(SNDRV_CARDS) "i"); … … 96 97 MODULE_PARM_DESC(omni, "Enable Midiman M-Audio Delta Omni I/O support."); 97 98 MODULE_PARM_SYNTAX(omni, SNDRV_ENABLED "," SNDRV_ENABLE_DESC); 99 MODULE_PARM(cs8427_timeout, "1-" __MODULE_STRING(SNDRV_CARDS) "i"); 100 MODULE_PARM_DESC(cs8427_timeout, "Define reset timeout for cs8427 chip in msec resolution."); 101 MODULE_PARM_SYNTAX(cs8427_timeout, SNDRV_ENABLED ", allows:{{1,1000}},default=500,skill:advanced"); 98 102 99 103 #ifndef PCI_VENDOR_ID_ICE … … 387 391 int err; 388 392 389 if ((err = snd_cs8427_create(ice->i2c, addr, &ice->cs8427)) < 0) { 393 if ((err = snd_cs8427_create(ice->i2c, addr, 394 (ice->cs8427_timeout * HZ) / 1000, 395 &ice->cs8427)) < 0) { 390 396 snd_printk("CS8427 initialization failed\n"); 391 397 return err; … … 887 893 ice->pcm = pcm; 888 894 889 snd_pcm_lib_preallocate_pci_pages_for_all(ice->pci, pcm, 64*1024, 64*1024); 895 snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, 896 snd_dma_pci_data(ice->pci), 64*1024, 64*1024); 890 897 891 898 if (rpcm) … … 923 930 ice->pcm_ds = pcm; 924 931 925 snd_pcm_lib_preallocate_pci_pages_for_all(ice->pci, pcm, 64*1024, 128*1024); 932 snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, 933 snd_dma_pci_data(ice->pci), 64*1024, 128*1024); 926 934 927 935 if (rpcm) … … 1270 1278 strcpy(pcm->name, "ICE1712 multi"); 1271 1279 1272 snd_pcm_lib_preallocate_pci_pages_for_all(ice->pci, pcm, 256*1024, 256*1024); 1280 snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, 1281 snd_dma_pci_data(ice->pci), 256*1024, 256*1024); 1273 1282 1274 1283 ice->pcm_pro = pcm; … … 1382 1391 1383 1392 1384 static snd_kcontrol_new_t snd_ice1712_multi_ ctrls[] __devinitdata = {1393 static snd_kcontrol_new_t snd_ice1712_multi_playback_ctrls[] __devinitdata = { 1385 1394 { 1386 1395 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, … … 1401 1410 .count = 10, 1402 1411 }, 1403 { 1412 }; 1413 1414 static snd_kcontrol_new_t snd_ice1712_multi_capture_analog_switch __devinitdata = { 1404 1415 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1405 .name = "Multi Capture Switch",1416 .name = "H/W Multi Capture Switch", 1406 1417 .info = snd_ice1712_pro_mixer_switch_info, 1407 1418 .get = snd_ice1712_pro_mixer_switch_get, 1408 1419 .put = snd_ice1712_pro_mixer_switch_put, 1409 1420 .private_value = 10, 1410 .count = 10, 1411 }, 1412 1421 }; 1422 1423 static snd_kcontrol_new_t snd_ice1712_multi_capture_spdif_switch __devinitdata = { 1413 1424 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1414 .name = "Multi Capture Volume", 1425 .name = "IEC958 Multi Capture Switch", 1426 .info = snd_ice1712_pro_mixer_switch_info, 1427 .get = snd_ice1712_pro_mixer_switch_get, 1428 .put = snd_ice1712_pro_mixer_switch_put, 1429 .private_value = 18, 1430 .count = 2, 1431 }; 1432 1433 static snd_kcontrol_new_t snd_ice1712_multi_capture_analog_volume __devinitdata = { 1434 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1435 .name = "H/W Multi Capture Volume", 1415 1436 .info = snd_ice1712_pro_mixer_volume_info, 1416 1437 .get = snd_ice1712_pro_mixer_volume_get, 1417 1438 .put = snd_ice1712_pro_mixer_volume_put, 1418 1439 .private_value = 10, 1419 .count = 10, 1420 }, 1440 }; 1441 1442 static snd_kcontrol_new_t snd_ice1712_multi_capture_spdif_volume __devinitdata = { 1443 .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1444 .name = "IEC958 Multi Capture Volume", 1445 .info = snd_ice1712_pro_mixer_volume_info, 1446 .get = snd_ice1712_pro_mixer_volume_get, 1447 .put = snd_ice1712_pro_mixer_volume_put, 1448 .private_value = 18, 1449 .count = 2, 1421 1450 }; 1422 1451 … … 1428 1457 1429 1458 /* multi-channel mixer */ 1430 for (idx = 0; idx < ARRAY_SIZE(snd_ice1712_multi_ ctrls); idx++) {1431 err = snd_ctl_add(card, snd_ctl_new1(&snd_ice1712_multi_ ctrls[idx], ice));1459 for (idx = 0; idx < ARRAY_SIZE(snd_ice1712_multi_playback_ctrls); idx++) { 1460 err = snd_ctl_add(card, snd_ctl_new1(&snd_ice1712_multi_playback_ctrls[idx], ice)); 1432 1461 if (err < 0) 1433 1462 return err; 1434 1463 } 1435 1464 1465 if (ice->num_total_adcs > 0) { 1466 snd_kcontrol_new_t tmp = snd_ice1712_multi_capture_analog_switch; 1467 tmp.count = ice->num_total_adcs; 1468 err = snd_ctl_add(card, snd_ctl_new1(&tmp, ice)); 1469 if (err < 0) 1470 return err; 1471 } 1472 1473 err = snd_ctl_add(card, snd_ctl_new1(&snd_ice1712_multi_capture_spdif_switch, ice)); 1474 if (err < 0) 1475 return err; 1476 1477 if (ice->num_total_adcs > 0) { 1478 snd_kcontrol_new_t tmp = snd_ice1712_multi_capture_analog_volume; 1479 tmp.count = ice->num_total_adcs; 1480 err = snd_ctl_add(card, snd_ctl_new1(&tmp, ice)); 1481 if (err < 0) 1482 return err; 1483 } 1484 1485 err = snd_ctl_add(card, snd_ctl_new1(&snd_ice1712_multi_capture_spdif_volume, ice)); 1486 if (err < 0) 1487 return err; 1488 1436 1489 /* initialize volumes */ 1437 for (idx = 0; idx < 20; idx++) {1490 for (idx = 0; idx < 10; idx++) { 1438 1491 ice->pro_volumes[idx] = 0x80008000; /* mute */ 1439 1492 snd_ice1712_update_volume(ice, idx); 1440 1493 } 1494 for (idx = 10; idx < 10 + ice->num_total_adcs; idx++) { 1495 ice->pro_volumes[idx] = 0x80008000; /* mute */ 1496 snd_ice1712_update_volume(ice, idx); 1497 } 1498 for (idx = 18; idx < 20; idx++) { 1499 ice->pro_volumes[idx] = 0x80008000; /* mute */ 1500 snd_ice1712_update_volume(ice, idx); 1501 } 1441 1502 return 0; 1442 1503 } … … 1451 1512 { 1452 1513 int err; 1514 ac97_t ac97; 1515 ac97_bus_t bus, *pbus; 1453 1516 1454 1517 if (ice_has_con_ac97(ice)) { 1455 ac97_bus_t bus, *pbus;1456 ac97_t ac97;1457 1518 memset(&bus, 0, sizeof(bus)); 1458 1519 bus.write = snd_ice1712_ac97_write; … … 1473 1534 1474 1535 if (! (ice->eeprom.data[ICE_EEP1_ACLINK] & ICE1712_CFG_PRO_I2S)) { 1475 ac97_bus_t bus, *pbus;1476 ac97_t ac97;1477 1536 memset(&bus, 0, sizeof(bus)); 1478 1537 bus.write = snd_ice1712_pro_ac97_write; … … 2350 2409 struct pci_dev *pci, 2351 2410 int omni, 2411 int cs8427_timeout, 2352 2412 ice1712_t ** r_ice1712) 2353 2413 { … … 2374 2434 return -ENOMEM; 2375 2435 ice->omni = omni ? 1 : 0; 2436 if (cs8427_timeout < 1) 2437 cs8427_timeout = 1; 2438 else if (cs8427_timeout > 1000) 2439 cs8427_timeout = 1000; 2440 ice->cs8427_timeout = cs8427_timeout; 2376 2441 spin_lock_init(&ice->reg_lock); 2377 2442 init_MUTEX(&ice->gpio_mutex); … … 2493 2558 strcpy(card->shortname, "ICEnsemble ICE1712"); 2494 2559 2495 if ((err = snd_ice1712_create(card, pci, omni[dev], &ice)) < 0) {2560 if ((err = snd_ice1712_create(card, pci, omni[dev], cs8427_timeout[dev], &ice)) < 0) { 2496 2561 snd_card_free(card); 2497 2562 return err; -
GPL/branches/alsa-resync1/alsa-kernel/pci/ice1712/ice1712.h
r300 r348 331 331 unsigned int vt1724: 1; 332 332 unsigned int num_total_dacs; /* total DACs */ 333 unsigned int num_total_adcs; /* total ADCs */ 333 334 unsigned char hoontech_boxbits[4]; 334 335 unsigned int hoontech_config; … … 346 347 snd_i2c_device_t *cs8404; /* CS8404A I2C device */ 347 348 snd_i2c_device_t *cs8427; /* CS8427 I2C device */ 349 unsigned int cs8427_timeout; /* CS8427 reset timeout in HZ/100 */ 348 350 snd_i2c_device_t *i2cdevs[2]; /* additional i2c devices */ 349 351 -
GPL/branches/alsa-resync1/alsa-kernel/pci/ice1712/ice1724.c
r300 r348 757 757 strcpy(pcm->name, "ICE1724"); 758 758 759 snd_pcm_lib_preallocate_pci_pages_for_all(ice->pci, pcm, 256*1024, 256*1024); 759 snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, 760 snd_dma_pci_data(ice->pci), 256*1024, 256*1024); 760 761 761 762 ice->pcm_pro = pcm; … … 911 912 strcpy(pcm->name, "ICE1724 IEC958"); 912 913 913 snd_pcm_lib_preallocate_pci_pages_for_all(ice->pci, pcm, 64*1024, 64*1024); 914 snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, 915 snd_dma_pci_data(ice->pci), 64*1024, 64*1024); 914 916 915 917 ice->pcm = pcm; … … 1032 1034 strcpy(pcm->name, "ICE1724 Surround PCM"); 1033 1035 1034 snd_pcm_lib_preallocate_pci_pages_for_all(ice->pci, pcm, 64*1024, 64*1024); 1036 snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, 1037 snd_dma_pci_data(ice->pci), 64*1024, 64*1024); 1035 1038 1036 1039 ice->pcm_ds = pcm; -
GPL/branches/alsa-resync1/alsa-kernel/pci/ice1712/revo.c
r262 r348 129 129 case VT1724_SUBDEVICE_REVOLUTION71: 130 130 ice->num_total_dacs = 8; 131 ice->num_total_adcs = 4; 131 132 break; 132 133 default: -
GPL/branches/alsa-resync1/alsa-kernel/pci/intel8x0.c
r300 r348 108 108 MODULE_PARM(ac97_quirk, "1-" __MODULE_STRING(SNDRV_CARDS) "i"); 109 109 MODULE_PARM_DESC(ac97_quirk, "AC'97 workaround for strange hardware."); 110 MODULE_PARM_SYNTAX(ac97_quirk, SNDRV_ENABLED ",allows:{{-1, 3}},dialog:list,default:-1");110 MODULE_PARM_SYNTAX(ac97_quirk, SNDRV_ENABLED ",allows:{{-1,4}},dialog:list,default:-1"); 111 111 #ifdef SUPPORT_JOYSTICK 112 112 MODULE_PARM(joystick, "1-" __MODULE_STRING(SNDRV_CARDS) "i"); … … 862 862 863 863 if ((status & chip->int_sta_mask) == 0) { 864 static int err_count = 10;865 864 if (status) { 866 865 /* ack */ … … 2982 2981 /* workaround for 440MX */ 2983 2982 if (chip->fix_nocache) 2984 fill_nocache(chip->bdbars , chip->bdbars_count * sizeof(u32) * ICH_MAX_FRAGS * 2, 1);2983 fill_nocache(chip->bdbars.area, chip->bdbars.bytes, 1); 2985 2984 int_sta_masks = 0; 2986 2985 for (i = 0; i < chip->bdbars_count; i++) { … … 3237 3236 pci_read_config_word(pci, 0xe6, &val); 3238 3237 #ifdef SUPPORT_JOYSTICK 3238 val &= ~0x100; 3239 3239 if (joystick[dev]) { 3240 3240 if (! request_region(ich_gameport.io, 8, "ICH gameport")) { … … 3249 3249 #endif 3250 3250 #ifdef SUPPORT_MIDI 3251 val &= ~0x20; 3251 3252 if (mpu_port[dev] > 0) { 3252 3253 if (mpu_port[dev] == 0x300 || mpu_port[dev] == 0x330) { -
GPL/branches/alsa-resync1/alsa-kernel/pci/korg1212/korg1212.c
r290 r348 348 348 struct resource *res_iomem2; 349 349 350 struct snd_dma_device dma_dev; 351 352 struct snd_dma_buffer dma_dsp; 353 struct snd_dma_buffer dma_play; 354 struct snd_dma_buffer dma_rec; 355 struct snd_dma_buffer dma_shared; 356 350 357 u32 dspCodeSize; 351 u32 dspMemPhy; // DSP memory block handle (Physical Address)352 void * dspMemPtr; // block memory (Virtual Address)353 358 354 359 u32 DataBufsSize; … … 358 363 359 364 KorgSharedBuffer * sharedBufferPtr; 365 360 366 u32 RecDataPhy; 361 367 u32 PlayDataPhy; … … 1239 1245 snd_korg1212_setCardState(korg1212, K1212_STATE_DSP_IN_PROCESS); 1240 1246 1241 memcpy(korg1212->d spMemPtr, dspCode, korg1212->dspCodeSize);1247 memcpy(korg1212->dma_dsp.area, dspCode, korg1212->dspCodeSize); 1242 1248 1243 1249 rc = snd_korg1212_Send1212Command(korg1212, K1212_DB_StartDSPDownload, 1244 UpperWordSwap(korg1212->d spMemPhy),1250 UpperWordSwap(korg1212->dma_dsp.addr), 1245 1251 0, 0, 0); 1246 1252 … … 2135 2141 // free up memory resources used for the DSP download. 2136 2142 // ---------------------------------------------------- 2137 if (korg1212->dspMemPtr) { 2138 snd_free_pci_pages(korg1212->pci, korg1212->dspCodeSize, 2139 korg1212->dspMemPtr, (dma_addr_t)korg1212->dspMemPhy); 2140 korg1212->dspMemPhy = 0; 2141 korg1212->dspMemPtr = 0; 2142 korg1212->dspCodeSize = 0; 2143 if (korg1212->dma_dsp.area) { 2144 snd_dma_free_pages(&korg1212->dma_dev, &korg1212->dma_dsp); 2145 korg1212->dma_dsp.area = NULL; 2143 2146 } 2144 2147 … … 2148 2151 // free up memory resources used for the Play/Rec Buffers 2149 2152 // ------------------------------------------------------ 2150 if (korg1212->playDataBufsPtr) { 2151 snd_free_pci_pages(korg1212->pci, korg1212->DataBufsSize, 2152 korg1212->playDataBufsPtr, (dma_addr_t)korg1212->PlayDataPhy); 2153 korg1212->PlayDataPhy = 0; 2154 korg1212->playDataBufsPtr = NULL; 2155 } 2156 2157 if (korg1212->recordDataBufsPtr) { 2158 snd_free_pci_pages(korg1212->pci, korg1212->DataBufsSize, 2159 korg1212->recordDataBufsPtr, (dma_addr_t)korg1212->RecDataPhy); 2160 korg1212->RecDataPhy = 0; 2161 korg1212->recordDataBufsPtr = NULL; 2153 if (korg1212->dma_play.area) { 2154 snd_dma_free_pages(&korg1212->dma_dev, &korg1212->dma_play); 2155 korg1212->dma_play.area = NULL; 2156 } 2157 2158 if (korg1212->dma_rec.area) { 2159 snd_dma_free_pages(&korg1212->dma_dev, &korg1212->dma_rec); 2160 korg1212->dma_rec.area = NULL; 2162 2161 } 2163 2162 … … 2167 2166 // free up memory resources used for the Shared Buffers 2168 2167 // ---------------------------------------------------- 2169 if (korg1212->sharedBufferPtr) { 2170 snd_free_pci_pages(korg1212->pci, (u32) sizeof(KorgSharedBuffer), 2171 korg1212->sharedBufferPtr, (dma_addr_t)korg1212->sharedBufferPhy); 2172 korg1212->sharedBufferPhy = 0; 2173 korg1212->sharedBufferPtr = NULL; 2168 if (korg1212->dma_shared.area) { 2169 snd_dma_free_pages(&korg1212->dma_dev, &korg1212->dma_shared); 2170 korg1212->dma_shared.area = NULL; 2174 2171 } 2175 2172 … … 2194 2191 unsigned int i; 2195 2192 unsigned ioport_size, iomem_size, iomem2_size; 2196 dma_addr_t phys_addr;2197 2193 korg1212_t * korg1212; 2198 2194 … … 2333 2329 #endif 2334 2330 2335 korg1212->sharedBufferPtr = (KorgSharedBuffer *) snd_malloc_pci_pages(korg1212->pci, sizeof(KorgSharedBuffer), &phys_addr); 2336 korg1212->sharedBufferPhy = (unsigned long)phys_addr; 2337 2338 if (korg1212->sharedBufferPtr == NULL) { 2331 memset(&korg1212->dma_dev, 0, sizeof(korg1212->dma_dev)); 2332 korg1212->dma_dev.type = SNDRV_DMA_TYPE_DEV; 2333 korg1212->dma_dev.dev = snd_dma_pci_data(korg1212->pci); 2334 2335 if (snd_dma_alloc_pages(&korg1212->dma_dev, sizeof(KorgSharedBuffer), &korg1212->dma_shared) < 0) { 2339 2336 snd_printk(KERN_ERR "can not allocate shared buffer memory (%Zd bytes)\n", sizeof(KorgSharedBuffer)); 2340 2337 return -ENOMEM; 2341 2338 } 2339 korg1212->sharedBufferPtr = (KorgSharedBuffer *)korg1212->dma_shared.area; 2340 korg1212->sharedBufferPhy = korg1212->dma_shared.addr; 2342 2341 2343 2342 #if K1212_DEBUG_LEVEL > 0 … … 2349 2348 korg1212->DataBufsSize = sizeof(KorgAudioBuffer) * kNumBuffers; 2350 2349 2351 korg1212->playDataBufsPtr = (KorgAudioBuffer *) snd_malloc_pci_pages(korg1212->pci, korg1212->DataBufsSize, &phys_addr); 2352 korg1212->PlayDataPhy = (u32)phys_addr; 2353 2354 if (korg1212->playDataBufsPtr == NULL) { 2350 if (snd_dma_alloc_pages(&korg1212->dma_dev, korg1212->DataBufsSize, &korg1212->dma_play) < 0) { 2355 2351 snd_printk(KERN_ERR "can not allocate play data buffer memory (%d bytes)\n", korg1212->DataBufsSize); 2356 2352 return -ENOMEM; 2357 2353 } 2354 korg1212->playDataBufsPtr = (KorgAudioBuffer *)korg1212->dma_play.area; 2355 korg1212->PlayDataPhy = korg1212->dma_play.addr; 2358 2356 2359 2357 #if K1212_DEBUG_LEVEL > 0 … … 2362 2360 #endif 2363 2361 2364 korg1212->recordDataBufsPtr = (KorgAudioBuffer *) snd_malloc_pci_pages(korg1212->pci, korg1212->DataBufsSize, &phys_addr); 2365 korg1212->RecDataPhy = (u32)phys_addr; 2366 2367 if (korg1212->recordDataBufsPtr == NULL) { 2362 if (snd_dma_alloc_pages(&korg1212->dma_dev, korg1212->DataBufsSize, &korg1212->dma_rec) < 0) { 2368 2363 snd_printk(KERN_ERR "can not allocate record data buffer memory (%d bytes)\n", korg1212->DataBufsSize); 2369 2364 return -ENOMEM; 2370 2365 } 2366 korg1212->recordDataBufsPtr = (KorgAudioBuffer *)korg1212->dma_rec.area; 2367 korg1212->RecDataPhy = korg1212->dma_rec.addr; 2371 2368 2372 2369 #if K1212_DEBUG_LEVEL > 0 2373 2370 K1212_DEBUG_PRINTK("K1212_DEBUG: Record Data Area = 0x%p (0x%08x), %d bytes\n", 2374 korg1212->recordDataBufsPtr, korg1212->RecData Phy, korg1212->DataBufsSize);2371 korg1212->recordDataBufsPtr, korg1212->RecDataBufsPhy, korg1212->DataBufsSize); 2375 2372 #endif 2376 2373 … … 2393 2390 offsetof(KorgSharedBuffer, AdatTimeCode); 2394 2391 2395 korg1212->dspMemPtr = snd_malloc_pci_pages(korg1212->pci, korg1212->dspCodeSize, &phys_addr); 2396 korg1212->dspMemPhy = (u32)phys_addr; 2397 2398 if (korg1212->dspMemPtr == NULL) { 2392 if (snd_dma_alloc_pages(&korg1212->dma_dev, korg1212->dspCodeSize, &korg1212->dma_dsp) < 0) { 2399 2393 snd_printk(KERN_ERR "can not allocate dsp code memory (%d bytes)\n", korg1212->dspCodeSize); 2400 2394 return -ENOMEM; … … 2403 2397 #if K1212_DEBUG_LEVEL > 0 2404 2398 K1212_DEBUG_PRINTK("K1212_DEBUG: DSP Code area = 0x%p (0x%08x) %d bytes [%s]\n", 2405 korg1212->d spMemPtr, korg1212->dspMemPhy, korg1212->dspCodeSize,2399 korg1212->dma_dsp.area, korg1212->dma_dsp.addr, korg1212->dspCodeSize, 2406 2400 stateName[korg1212->cardState]); 2407 2401 #endif … … 2426 2420 "RoutingTablePhy = %08x L[%08x]\n" 2427 2421 "AdatTimeCodePhy = %08x L[%08x]\n", 2428 korg1212->d spMemPhy, UpperWordSwap(korg1212->dspMemPhy),2422 korg1212->dma_dsp.addr, UpperWordSwap(korg1212->dma_dsp.addr), 2429 2423 korg1212->PlayDataPhy, LowerWordSwap(korg1212->PlayDataPhy), 2430 2424 korg1212->RecDataPhy, LowerWordSwap(korg1212->RecDataPhy), -
GPL/branches/alsa-resync1/alsa-kernel/pci/rme96.c
r290 r348 1719 1719 rme96->spdif_pcm->info_flags = 0; 1720 1720 1721 snd_pcm_lib_preallocate_pages_for_all(rme96->spdif_pcm, RME96_BUFFER_SIZE, RME96_BUFFER_SIZE, GFP_KERNEL); 1721 snd_pcm_lib_preallocate_pages_for_all(rme96->spdif_pcm, 1722 SNDRV_DMA_TYPE_CONTINUOUS, 1723 snd_dma_continuous_data(GFP_KERNEL), 1724 RME96_BUFFER_SIZE, 1725 RME96_BUFFER_SIZE); 1722 1726 1723 1727 /* set up ALSA pcm device for ADAT */ … … 1739 1743 rme96->adat_pcm->info_flags = 0; 1740 1744 1741 snd_pcm_lib_preallocate_pages_for_all(rme96->adat_pcm, RME96_BUFFER_SIZE, RME96_BUFFER_SIZE, GFP_KERNEL); 1745 snd_pcm_lib_preallocate_pages_for_all(rme96->adat_pcm, 1746 SNDRV_DMA_TYPE_CONTINUOUS, 1747 snd_dma_continuous_data(GFP_KERNEL), 1748 RME96_BUFFER_SIZE, 1749 RME96_BUFFER_SIZE); 1742 1750 } 1743 1751 -
GPL/branches/alsa-resync1/alsa-kernel/pci/rme9652/hdsp.c
r300 r348 570 570 struct snd_dma_buffer dmbuf; 571 571 572 snd_dma_device_pci(&pdev, pci, capture); 572 memset(&pdev, 0, sizeof(pdev)); 573 pdev.type = SNDRV_DMA_TYPE_DEV; 574 pdev.dev = snd_dma_pci_data(pci); 575 pdev.id = capture; 573 576 dmbuf.bytes = 0; 574 577 if (! snd_dma_get_reserved(&pdev, &dmbuf)) { … … 583 586 static void snd_hammerfall_free_buffer(struct pci_dev *pci, size_t size, void *ptr, dma_addr_t addr, int capture) 584 587 { 585 struct snd_dma_device dev; 586 snd_dma_device_pci(&dev, pci, capture); 587 snd_dma_free_reserved(&dev); 588 struct snd_dma_device pdev; 589 590 memset(&pdev, 0, sizeof(pdev)); 591 pdev.type = SNDRV_DMA_TYPE_DEV; 592 pdev.dev = snd_dma_pci_data(pci); 593 pdev.id = capture; 594 snd_dma_free_reserved(&pdev); 588 595 } 589 596 -
GPL/branches/alsa-resync1/alsa-kernel/pci/rme9652/rme9652.c
r290 r348 315 315 struct snd_dma_buffer dmbuf; 316 316 317 snd_dma_device_pci(&pdev, pci, capture); 317 memset(&pdev, 0, sizeof(pdev)); 318 pdev.type = SNDRV_DMA_TYPE_DEV; 319 pdev.dev = snd_dma_pci_data(pci); 320 pdev.id = capture; 318 321 dmbuf.bytes = 0; 319 322 if (! snd_dma_get_reserved(&pdev, &dmbuf)) { … … 328 331 static void snd_hammerfall_free_buffer(struct pci_dev *pci, size_t size, void *ptr, dma_addr_t addr, int capture) 329 332 { 330 struct snd_dma_device dev; 331 snd_dma_device_pci(&dev, pci, capture); 332 snd_dma_free_reserved(&dev); 333 struct snd_dma_device pdev; 334 335 memset(&pdev, 0, sizeof(pdev)); 336 pdev.type = SNDRV_DMA_TYPE_DEV; 337 pdev.dev = snd_dma_pci_data(pci); 338 pdev.id = capture; 339 snd_dma_free_reserved(&pdev); 333 340 } 334 341 -
GPL/branches/alsa-resync1/alsa-kernel/pci/sonicvibes.c
r290 r348 891 891 sonic->pcm = pcm; 892 892 893 snd_pcm_lib_preallocate_pci_pages_for_all(sonic->pci, pcm, 64*1024, 128*1024); 893 snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, 894 snd_dma_pci_data(sonic->pci), 64*1024, 128*1024); 894 895 895 896 if (rpcm) -
GPL/branches/alsa-resync1/alsa-kernel/pci/trident/trident_main.c
r290 r348 3580 3580 } 3581 3581 trident->irq = pci->irq; 3582 3583 memset(&trident->dma_dev, 0, sizeof(trident->dma_dev)); 3584 trident->dma_dev.type = SNDRV_DMA_TYPE_DEV; 3585 trident->dma_dev.dev = snd_dma_pci_data(pci); 3582 3586 3583 3587 /* allocate 16k-aligned TLB for NX cards */ -
GPL/branches/alsa-resync1/alsa-kernel/pci/trident/trident_memory.c
r210 r348 80 80 __set_tlb_bus(trident, page, (unsigned long)trident->tlb.silent_page.area, trident->tlb.silent_page.addr); 81 81 __set_tlb_bus(trident, page+1, (unsigned long)trident->tlb.silent_page.area, trident->tlb.silent_page.addr); 82 // __set_tlb_bus(trident, page, (unsigned long)trident->tlb.silent_page, trident->tlb.silent_page_dmaaddr);83 // __set_tlb_bus(trident, page+1, (unsigned long)trident->tlb.silent_page, trident->tlb.silent_page_dmaaddr);84 82 } 85 83 … … 116 114 for (i = 0; i < UNIT_PAGES; i++, page++) 117 115 __set_tlb_bus(trident, page, (unsigned long)trident->tlb.silent_page.area, trident->tlb.silent_page.addr); 118 // __set_tlb_bus(trident, page, (unsigned long)trident->tlb.silent_page, trident->tlb.silent_page_dmaaddr);119 116 } 120 117
Note:
See TracChangeset
for help on using the changeset viewer.