Lines Matching refs:idma
48 static void iomd_get_next_sg(struct scatterlist *sg, struct iomd_dma *idma)
52 if (idma->dma.sg) {
53 sg->dma_address = idma->dma_addr;
56 end = offset + idma->dma_len;
66 idma->dma_len -= end - offset;
67 idma->dma_addr += end - offset;
69 if (idma->dma_len == 0) {
70 if (idma->dma.sgcount > 1) {
71 idma->dma.sg = sg_next(idma->dma.sg);
72 idma->dma_addr = idma->dma.sg->dma_address;
73 idma->dma_len = idma->dma.sg->length;
74 idma->dma.sgcount--;
76 idma->dma.sg = NULL;
91 struct iomd_dma *idma = dev_id;
92 unsigned long base = idma->base;
101 if ((idma->state ^ status) & DMA_ST_AB)
102 iomd_get_next_sg(&idma->cur_sg, idma);
107 iomd_writel(idma->cur_sg.dma_address, base + CURA);
108 iomd_writel(idma->cur_sg.length, base + ENDA);
109 idma->state = DMA_ST_AB;
114 iomd_writel(idma->cur_sg.dma_address, base + CURB);
115 iomd_writel(idma->cur_sg.length, base + ENDB);
116 idma->state = 0;
121 idma->cur_sg.length == (DMA_END_S|DMA_END_L))
125 idma->state = ~DMA_ST_AB;
133 struct iomd_dma *idma = container_of(dma, struct iomd_dma, dma);
135 return request_irq(idma->irq, iomd_dma_handle,
136 IRQF_DISABLED, idma->dma.device_id, idma);
141 struct iomd_dma *idma = container_of(dma, struct iomd_dma, dma);
143 free_irq(idma->irq, idma);
148 struct iomd_dma *idma = container_of(dma, struct iomd_dma, dma);
149 unsigned long dma_base = idma->base;
152 if (idma->dma.invalid) {
153 idma->dma.invalid = 0;
159 if (!idma->dma.sg) {
160 idma->dma.sg = &idma->dma.buf;
161 idma->dma.sgcount = 1;
162 idma->dma.buf.length = idma->dma.count;
163 idma->dma.buf.dma_address = dma_map_single(NULL,
164 idma->dma.addr, idma->dma.count,
165 idma->dma.dma_mode == DMA_MODE_READ ?
170 idma->state = DMA_ST_AB;
173 if (idma->dma.dma_mode == DMA_MODE_READ)
177 enable_irq(idma->irq);
182 struct iomd_dma *idma = container_of(dma, struct iomd_dma, dma);
183 unsigned long dma_base = idma->base;
187 if (idma->state != ~DMA_ST_AB)
188 disable_irq(idma->irq);