config COMEDI_DT282X
tristate "Data Translation DT2821 series and DT-EZ ISA card support"
- depends on VIRT_TO_BUS && ISA_DMA_API
+ depends on ISA_DMA_API
---help---
Enable support for Data Translation DT2821 series including DT-EZ
DT2821, DT2821-F-16SE, DT2821-F-8DI, DT2821-G-16SE, DT2821-G-8DI,
struct dt282x_dma_desc {
unsigned int chan; /* DMA channel */
- unsigned short *virt_addr; /* virtual address of DMA buffer */
+ void *virt_addr; /* virtual address of DMA buffer */
+ dma_addr_t hw_addr; /* hardware (bus) address of DMA buffer */
unsigned int size; /* transfer size (in bytes) */
};
set_dma_mode(dma->chan, DMA_MODE_READ);
flags = claim_dma_lock();
clear_dma_ff(dma->chan);
- set_dma_addr(dma->chan, virt_to_bus(dma->virt_addr));
+ set_dma_addr(dma->chan, dma->hw_addr);
set_dma_count(dma->chan, dma->size);
release_dma_lock(flags);
set_dma_mode(dma->chan, DMA_MODE_WRITE);
flags = claim_dma_lock();
clear_dma_ff(dma->chan);
- set_dma_addr(dma->chan, virt_to_bus(dma->virt_addr));
+ set_dma_addr(dma->chan, dma->hw_addr);
set_dma_count(dma->chan, dma->size);
release_dma_lock(flags);
struct dt282x_dma_desc *dma = &devpriv->dma_desc[i];
dma->chan = dma_chan[i];
- dma->virt_addr = (void *)__get_free_page(GFP_KERNEL | GFP_DMA);
+ dma->virt_addr = dma_alloc_coherent(NULL, devpriv->dma_maxsize,
+ &dma->hw_addr, GFP_KERNEL);
if (!dma->virt_addr)
return -ENOMEM;
}
if (dma->chan)
free_dma(dma->chan);
if (dma->virt_addr)
- free_page((unsigned long)dma->virt_addr);
+ dma_free_coherent(NULL, devpriv->dma_maxsize,
+ dma->virt_addr, dma->hw_addr);
}
}