Lines Matching refs:idma

54 static void iomd_get_next_sg(struct iomd_dma *idma)  in iomd_get_next_sg()  argument
58 if (idma->dma.sg) { in iomd_get_next_sg()
59 idma->cur_addr = idma->dma_addr; in iomd_get_next_sg()
60 offset = idma->cur_addr & ~PAGE_MASK; in iomd_get_next_sg()
62 end = offset + idma->dma_len; in iomd_get_next_sg()
70 idma->cur_len = end - TRANSFER_SIZE; in iomd_get_next_sg()
72 idma->dma_len -= end - offset; in iomd_get_next_sg()
73 idma->dma_addr += end - offset; in iomd_get_next_sg()
75 if (idma->dma_len == 0) { in iomd_get_next_sg()
76 if (idma->dma.sgcount > 1) { in iomd_get_next_sg()
77 idma->dma.sg = sg_next(idma->dma.sg); in iomd_get_next_sg()
78 idma->dma_addr = idma->dma.sg->dma_address; in iomd_get_next_sg()
79 idma->dma_len = idma->dma.sg->length; in iomd_get_next_sg()
80 idma->dma.sgcount--; in iomd_get_next_sg()
82 idma->dma.sg = NULL; in iomd_get_next_sg()
88 idma->cur_addr = 0; in iomd_get_next_sg()
89 idma->cur_len = 0; in iomd_get_next_sg()
92 idma->cur_len |= flags; in iomd_get_next_sg()
97 struct iomd_dma *idma = dev_id; in iomd_dma_handle() local
98 void __iomem *base = idma->base; in iomd_dma_handle()
99 unsigned int state = idma->state; in iomd_dma_handle()
108 iomd_get_next_sg(idma); in iomd_dma_handle()
119 writel(idma->cur_addr, base + cur); in iomd_dma_handle()
120 writel(idma->cur_len, base + end); in iomd_dma_handle()
123 idma->cur_len == (DMA_END_S|DMA_END_L)) in iomd_dma_handle()
130 idma->state = state; in iomd_dma_handle()
136 struct iomd_dma *idma = container_of(dma, struct iomd_dma, dma); in iomd_request_dma() local
138 return request_irq(idma->irq, iomd_dma_handle, in iomd_request_dma()
139 0, idma->dma.device_id, idma); in iomd_request_dma()
144 struct iomd_dma *idma = container_of(dma, struct iomd_dma, dma); in iomd_free_dma() local
146 free_irq(idma->irq, idma); in iomd_free_dma()
157 struct iomd_dma *idma = container_of(dma, struct iomd_dma, dma); in iomd_enable_dma() local
158 void __iomem *base = idma->base; in iomd_enable_dma()
161 if (idma->dma.invalid) { in iomd_enable_dma()
162 idma->dma.invalid = 0; in iomd_enable_dma()
168 if (!idma->dma.sg) { in iomd_enable_dma()
169 idma->dma.sg = &idma->dma.buf; in iomd_enable_dma()
170 idma->dma.sgcount = 1; in iomd_enable_dma()
171 idma->dma.buf.length = idma->dma.count; in iomd_enable_dma()
172 idma->dma.buf.dma_address = dma_map_single(&isa_dma_dev, in iomd_enable_dma()
173 idma->dma.addr, idma->dma.count, in iomd_enable_dma()
174 idma->dma.dma_mode == DMA_MODE_READ ? in iomd_enable_dma()
178 idma->dma_addr = idma->dma.sg->dma_address; in iomd_enable_dma()
179 idma->dma_len = idma->dma.sg->length; in iomd_enable_dma()
182 idma->state = DMA_ST_AB; in iomd_enable_dma()
185 if (idma->dma.dma_mode == DMA_MODE_READ) in iomd_enable_dma()
189 enable_irq(idma->irq); in iomd_enable_dma()
194 struct iomd_dma *idma = container_of(dma, struct iomd_dma, dma); in iomd_disable_dma() local
195 void __iomem *base = idma->base; in iomd_disable_dma()
199 if (idma->state != ~DMA_ST_AB) in iomd_disable_dma()
200 disable_irq(idma->irq); in iomd_disable_dma()