Lines Matching refs:dmanr
152 static __inline__ void enable_dma(unsigned int dmanr)
154 if (dmanr<=3)
155 dma_outb(dmanr, DMA1_MASK_REG);
157 dma_outb(dmanr & 3, DMA2_MASK_REG);
160 static __inline__ void disable_dma(unsigned int dmanr)
162 if (dmanr<=3)
163 dma_outb(dmanr | 4, DMA1_MASK_REG);
165 dma_outb((dmanr & 3) | 4, DMA2_MASK_REG);
175 static __inline__ void clear_dma_ff(unsigned int dmanr)
177 if (dmanr<=3)
184 static __inline__ void set_dma_mode(unsigned int dmanr, char mode)
186 if (dmanr<=3)
187 dma_outb(mode | dmanr, DMA1_MODE_REG);
189 dma_outb(mode | (dmanr&3), DMA2_MODE_REG);
197 static __inline__ void set_dma_page(unsigned int dmanr, char pagenr)
199 switch(dmanr) {
228 static __inline__ void set_dma_addr(unsigned int dmanr, unsigned int a)
230 set_dma_page(dmanr, a>>16);
231 if (dmanr <= 3) {
232 dma_outb( a & 0xff, ((dmanr&3)<<1) + IO_DMA1_BASE );
233 dma_outb( (a>>8) & 0xff, ((dmanr&3)<<1) + IO_DMA1_BASE );
235 dma_outb( (a>>1) & 0xff, ((dmanr&3)<<2) + IO_DMA2_BASE );
236 dma_outb( (a>>9) & 0xff, ((dmanr&3)<<2) + IO_DMA2_BASE );
249 static __inline__ void set_dma_count(unsigned int dmanr, unsigned int count)
252 if (dmanr <= 3) {
253 dma_outb( count & 0xff, ((dmanr&3)<<1) + 1 + IO_DMA1_BASE );
254 dma_outb( (count>>8) & 0xff, ((dmanr&3)<<1) + 1 + IO_DMA1_BASE );
256 dma_outb( (count>>1) & 0xff, ((dmanr&3)<<2) + 2 + IO_DMA2_BASE );
257 dma_outb( (count>>9) & 0xff, ((dmanr&3)<<2) + 2 + IO_DMA2_BASE );
270 static __inline__ int get_dma_residue(unsigned int dmanr)
272 unsigned int io_port = (dmanr<=3)? ((dmanr&3)<<1) + 1 + IO_DMA1_BASE
273 : ((dmanr&3)<<2) + 2 + IO_DMA2_BASE;
281 return (dmanr<=3)? count : (count<<1);
286 extern int request_dma(unsigned int dmanr, const char * device_id); /* reserve a DMA channel */
287 extern void free_dma(unsigned int dmanr); /* release it again */