Home | History | Annotate | Download | only in asm-mips

Lines Matching full:dmanr

170 static __inline__ void enable_dma(unsigned int dmanr)
172 if (dmanr<=3)
173 dma_outb(dmanr, DMA1_MASK_REG);
175 dma_outb(dmanr & 3, DMA2_MASK_REG);
178 static __inline__ void disable_dma(unsigned int dmanr)
180 if (dmanr<=3)
181 dma_outb(dmanr | 4, DMA1_MASK_REG);
183 dma_outb((dmanr & 3) | 4, DMA2_MASK_REG);
193 static __inline__ void clear_dma_ff(unsigned int dmanr)
195 if (dmanr<=3)
202 static __inline__ void set_dma_mode(unsigned int dmanr, char mode)
204 if (dmanr<=3)
205 dma_outb(mode | dmanr, DMA1_MODE_REG);
207 dma_outb(mode | (dmanr&3), DMA2_MODE_REG);
215 static __inline__ void set_dma_page(unsigned int dmanr, char pagenr)
217 switch(dmanr) {
246 static __inline__ void set_dma_addr(unsigned int dmanr, unsigned int a)
248 set_dma_page(dmanr, a>>16);
249 if (dmanr <= 3) {
250 dma_outb( a & 0xff, ((dmanr&3)<<1) + IO_DMA1_BASE );
251 dma_outb( (a>>8) & 0xff, ((dmanr&3)<<1) + IO_DMA1_BASE );
253 dma_outb( (a>>1) & 0xff, ((dmanr&3)<<2) + IO_DMA2_BASE );
254 dma_outb( (a>>9) & 0xff, ((dmanr&3)<<2) + IO_DMA2_BASE );
267 static __inline__ void set_dma_count(unsigned int dmanr, unsigned int count)
270 if (dmanr <= 3) {
271 dma_outb( count & 0xff, ((dmanr&3)<<1) + 1 + IO_DMA1_BASE );
272 dma_outb( (count>>8) & 0xff, ((dmanr&3)<<1) + 1 + IO_DMA1_BASE );
274 dma_outb( (count>>1) & 0xff, ((dmanr&3)<<2) + 2 + IO_DMA2_BASE );
275 dma_outb( (count>>9) & 0xff, ((dmanr&3)<<2) + 2 + IO_DMA2_BASE );
288 static __inline__ int get_dma_residue(unsigned int dmanr)
290 unsigned int io_port = (dmanr<=3)? ((dmanr&3)<<1) + 1 + IO_DMA1_BASE
291 : ((dmanr&3)<<2) + 2 + IO_DMA2_BASE;
299 return (dmanr<=3)? count : (count<<1);
304 extern int request_dma(unsigned int dmanr, const char * device_id); /* reserve a DMA channel */
305 extern void free_dma(unsigned int dmanr); /* release it again */