Commit b45bb7b7 authored by Jaroslav Kysela's avatar Jaroslav Kysela

ALSA CVS update - Takashi Iwai <tiwai@suse.de>

Documentation,Memalloc module,ALS4000 driver,AZT3328 driver
ES1938 driver,ES1968 driver,Maestro3 driver,SonicVibes driver
ALI5451 driver,EMU10K1/EMU10K2 driver,ICE1712 driver,ICE1724 driver
Trident driver
- use pci_set_consistent_dma_mask().
parent 9d78e338
......@@ -1295,7 +1295,7 @@
printk(KERN_ERR "error to set 28bit mask DMA\n");
return -ENXIO;
}
pci_set_dma_mask(pci, 0x0fffffff);
pci_set_consistent_dma_mask(pci, 0x0fffffff);
chip = snd_magic_kcalloc(mychip_t, 0, GFP_KERNEL);
if (chip == NULL)
......@@ -1413,7 +1413,7 @@
printk(KERN_ERR "error to set 28bit mask DMA\n");
return -ENXIO;
}
pci_set_dma_mask(pci, 0x0fffffff);
pci_set_consistent_dma_mask(pci, 0x0fffffff);
]]>
</programlisting>
</informalexample>
......
......@@ -95,25 +95,25 @@ static void *snd_pci_hack_alloc_consistent(struct pci_dev *hwdev, size_t size,
{
void *ret;
u64 dma_mask;
unsigned long rmask;
unsigned long mask;
if (hwdev == NULL)
return pci_alloc_consistent(hwdev, size, dma_handle);
dma_mask = hwdev->dma_mask;
rmask = ~((unsigned long)dma_mask);
hwdev->dma_mask = 0xffffffff; /* do without masking */
dma_mask = hwdev->consistent_dma_mask;
mask = (unsigned long)dma_mask;
hwdev->consistent_dma_mask = 0xffffffff; /* do without masking */
ret = pci_alloc_consistent(hwdev, size, dma_handle);
hwdev->dma_mask = dma_mask; /* restore */
hwdev->consistent_dma_mask = dma_mask; /* restore */
if (ret) {
/* obtained address is out of range? */
if (((unsigned long)*dma_handle + size - 1) & rmask) {
if (((unsigned long)*dma_handle + size - 1) & ~mask) {
/* reallocate with the proper mask */
pci_free_consistent(hwdev, size, ret, *dma_handle);
ret = pci_alloc_consistent(hwdev, size, dma_handle);
}
} else {
/* wish to success now with the proper mask... */
if (dma_mask != 0xffffffff)
if (mask != 0xffffffffUL)
ret = pci_alloc_consistent(hwdev, size, dma_handle);
}
return ret;
......@@ -640,13 +640,13 @@ void *snd_malloc_pci_page(struct pci_dev *pci, dma_addr_t *addrp)
{
void *ptr;
dma_addr_t addr;
unsigned long rmask;
unsigned long mask;
rmask = ~(unsigned long)(pci ? pci->dma_mask : 0x00ffffff);
mask = pci ? (unsigned long)pci->consistent_dma_mask : 0x00ffffffUL;
ptr = (void *)__get_free_page(GFP_KERNEL);
if (ptr) {
addr = virt_to_phys(ptr);
if (((unsigned long)addr + PAGE_SIZE - 1) & rmask) {
if (((unsigned long)addr + PAGE_SIZE - 1) & ~mask) {
/* try to reallocate with the GFP_DMA */
free_page((unsigned long)ptr);
/* use GFP_ATOMIC for the DMA zone to avoid stall */
......@@ -833,7 +833,7 @@ static void __init preallocate_cards(void)
if (! enable[card++])
continue;
if (pci_set_dma_mask(pci, dev->dma_mask) < 0) {
if (pci_set_consistent_dma_mask(pci, dev->dma_mask) < 0) {
printk(KERN_ERR "snd-page-alloc: cannot set DMA mask %lx for pci %04x:%04x\n", dev->dma_mask, dev->vendor, dev->device);
continue;
}
......
......@@ -2096,7 +2096,7 @@ static int __devinit snd_ali_create(snd_card_t * card,
snd_printk("architecture does not support 31bit PCI busmaster DMA\n");
return -ENXIO;
}
pci_set_dma_mask(pci, 0x7fffffff);
pci_set_consistent_dma_mask(pci, 0x7fffffff);
if ((codec = snd_magic_kcalloc(ali_t, 0, GFP_KERNEL)) == NULL)
return -ENOMEM;
......
......@@ -625,7 +625,7 @@ static int __devinit snd_card_als4000_probe(struct pci_dev *pci,
snd_printk("architecture does not support 24bit PCI busmaster DMA\n");
return -ENXIO;
}
pci_set_dma_mask(pci, 0x00ffffff);
pci_set_consistent_dma_mask(pci, 0x00ffffff);
gcr = pci_resource_start(pci, 0);
if ((res_gcr_port = request_region(gcr, 0x40, "ALS4000")) == NULL) {
......
......@@ -1365,7 +1365,7 @@ static int __devinit snd_azf3328_create(snd_card_t * card,
snd_printk("architecture does not support 24bit PCI busmaster DMA\n");
return -ENXIO;
}
pci_set_dma_mask(pci, 0x00ffffff);
pci_set_consistent_dma_mask(pci, 0x00ffffff);
chip->codec_port = pci_resource_start(pci, 0);
if ((chip->res_codec_port = request_region(chip->codec_port, 0x80, "Aztech AZF3328 I/O")) == NULL) {
......
......@@ -604,7 +604,7 @@ int __devinit snd_emu10k1_create(snd_card_t * card,
return -ENOMEM;
/* set the DMA transfer mask */
emu->dma_mask = is_audigy ? AUDIGY_DMA_MASK : EMU10K1_DMA_MASK;
if (pci_set_dma_mask(pci, emu->dma_mask) < 0) {
if (pci_set_consistent_dma_mask(pci, emu->dma_mask) < 0) {
snd_printk(KERN_ERR "architecture does not support PCI busmaster DMA with mask 0x%lx\n", emu->dma_mask);
snd_magic_kfree(emu);
return -ENXIO;
......
......@@ -1402,7 +1402,7 @@ static int __devinit snd_es1938_create(snd_card_t * card,
snd_printk("architecture does not support 24bit PCI busmaster DMA\n");
return -ENXIO;
}
pci_set_dma_mask(pci, 0x00ffffff);
pci_set_consistent_dma_mask(pci, 0x00ffffff);
chip = snd_magic_kcalloc(es1938_t, 0, GFP_KERNEL);
if (chip == NULL)
......
......@@ -2562,7 +2562,7 @@ static int __devinit snd_es1968_create(snd_card_t * card,
snd_printk("architecture does not support 28bit PCI busmaster DMA\n");
return -ENXIO;
}
pci_set_dma_mask(pci, 0x0fffffff);
pci_set_consistent_dma_mask(pci, 0x0fffffff);
chip = (es1968_t *) snd_magic_kcalloc(es1968_t, 0, GFP_KERNEL);
if (! chip)
......
......@@ -2357,7 +2357,7 @@ static int __devinit snd_ice1712_create(snd_card_t * card,
snd_printk("architecture does not support 28bit PCI busmaster DMA\n");
return -ENXIO;
}
pci_set_dma_mask(pci, 0x0fffffff);
pci_set_consistent_dma_mask(pci, 0x0fffffff);
ice = snd_magic_kcalloc(ice1712_t, 0, GFP_KERNEL);
if (ice == NULL)
......
......@@ -1793,7 +1793,7 @@ static int __devinit snd_vt1724_create(snd_card_t * card,
/* enable PCI device */
if ((err = pci_enable_device(pci)) < 0)
return err;
pci_set_dma_mask(pci, 0xffffffff);
pci_set_consistent_dma_mask(pci, 0xffffffff);
ice = snd_magic_kcalloc(ice1712_t, 0, GFP_KERNEL);
if (ice == NULL)
......
......@@ -2546,7 +2546,7 @@ snd_m3_create(snd_card_t *card, struct pci_dev *pci,
snd_printk("architecture does not support 28bit PCI busmaster DMA\n");
return -ENXIO;
}
pci_set_dma_mask(pci, 0x0fffffff);
pci_set_consistent_dma_mask(pci, 0x0fffffff);
chip = snd_magic_kcalloc(m3_t, 0, GFP_KERNEL);
if (chip == NULL)
......
......@@ -1253,7 +1253,7 @@ static int __devinit snd_sonicvibes_create(snd_card_t * card,
snd_printk("architecture does not support 24bit PCI busmaster DMA\n");
return -ENXIO;
}
pci_set_dma_mask(pci, 0x00ffffff);
pci_set_consistent_dma_mask(pci, 0x00ffffff);
sonic = snd_magic_kcalloc(sonicvibes_t, 0, GFP_KERNEL);
if (sonic == NULL)
......
......@@ -3522,7 +3522,7 @@ int __devinit snd_trident_create(snd_card_t * card,
snd_printk("architecture does not support 30bit PCI busmaster DMA\n");
return -ENXIO;
}
pci_set_dma_mask(pci, 0x3fffffff);
pci_set_consistent_dma_mask(pci, 0x3fffffff);
trident = snd_magic_kcalloc(trident_t, 0, GFP_KERNEL);
if (trident == NULL)
......@@ -3947,7 +3947,7 @@ void snd_trident_resume(trident_t *trident)
return;
pci_enable_device(trident->pci);
pci_set_dma_mask(trident->pci, 0x3fffffff); /* to be sure */
pci_set_consistent_dma_mask(trident->pci, 0x3fffffff); /* FIXME: correct? */
pci_set_master(trident->pci); /* to be sure */
switch (trident->device) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment