Lines Matching refs:dmanr
214 static __inline__ void enable_dma(unsigned int dmanr) in enable_dma() argument
216 if (dmanr<=3) in enable_dma()
217 dma_outb(dmanr, DMA1_MASK_REG); in enable_dma()
219 dma_outb(dmanr & 3, DMA2_MASK_REG); in enable_dma()
222 static __inline__ void disable_dma(unsigned int dmanr) in disable_dma() argument
224 if (dmanr<=3) in disable_dma()
225 dma_outb(dmanr | 4, DMA1_MASK_REG); in disable_dma()
227 dma_outb((dmanr & 3) | 4, DMA2_MASK_REG); in disable_dma()
237 static __inline__ void clear_dma_ff(unsigned int dmanr) in clear_dma_ff() argument
239 if (dmanr<=3) in clear_dma_ff()
246 static __inline__ void set_dma_mode(unsigned int dmanr, char mode) in set_dma_mode() argument
248 if (dmanr<=3) in set_dma_mode()
249 dma_outb(mode | dmanr, DMA1_MODE_REG); in set_dma_mode()
251 dma_outb(mode | (dmanr&3), DMA2_MODE_REG); in set_dma_mode()
255 static __inline__ void set_dma_ext_mode(unsigned int dmanr, char ext_mode) in set_dma_ext_mode() argument
257 if (dmanr<=3) in set_dma_ext_mode()
258 dma_outb(ext_mode | dmanr, DMA1_EXT_MODE_REG); in set_dma_ext_mode()
260 dma_outb(ext_mode | (dmanr&3), DMA2_EXT_MODE_REG); in set_dma_ext_mode()
267 static __inline__ void set_dma_page(unsigned int dmanr, unsigned int pagenr) in set_dma_page() argument
269 switch(dmanr) { in set_dma_page()
305 static __inline__ void set_dma_addr(unsigned int dmanr, unsigned int a) in set_dma_addr() argument
307 if (dmanr <= 3) { in set_dma_addr()
308 dma_outb( a & 0xff, ((dmanr&3)<<1) + IO_DMA1_BASE ); in set_dma_addr()
309 dma_outb( (a>>8) & 0xff, ((dmanr&3)<<1) + IO_DMA1_BASE ); in set_dma_addr()
311 dma_outb( (a>>1) & 0xff, ((dmanr&3)<<2) + IO_DMA2_BASE ); in set_dma_addr()
312 dma_outb( (a>>9) & 0xff, ((dmanr&3)<<2) + IO_DMA2_BASE ); in set_dma_addr()
314 set_dma_page(dmanr, a>>16); /* set hipage last to enable 32-bit mode */ in set_dma_addr()
326 static __inline__ void set_dma_count(unsigned int dmanr, unsigned int count) in set_dma_count() argument
329 if (dmanr <= 3) { in set_dma_count()
330 dma_outb( count & 0xff, ((dmanr&3)<<1) + 1 + IO_DMA1_BASE ); in set_dma_count()
331 dma_outb( (count>>8) & 0xff, ((dmanr&3)<<1) + 1 + IO_DMA1_BASE ); in set_dma_count()
333 dma_outb( (count>>1) & 0xff, ((dmanr&3)<<2) + 2 + IO_DMA2_BASE ); in set_dma_count()
334 dma_outb( (count>>9) & 0xff, ((dmanr&3)<<2) + 2 + IO_DMA2_BASE ); in set_dma_count()
347 static __inline__ int get_dma_residue(unsigned int dmanr) in get_dma_residue() argument
349 unsigned int io_port = (dmanr<=3)? ((dmanr&3)<<1) + 1 + IO_DMA1_BASE in get_dma_residue()
350 : ((dmanr&3)<<2) + 2 + IO_DMA2_BASE; in get_dma_residue()
358 return (dmanr<=3)? count : (count<<1); in get_dma_residue()
363 extern int request_dma(unsigned int dmanr, const char * device_id); /* reserve a DMA channel */
364 extern void free_dma(unsigned int dmanr); /* release it again */
366 extern int check_dma(unsigned int dmanr);