Lines Matching refs:chan
156 struct dma_chan *chan = get_dma_chan(dmanr); in enable_dma_buffer0() local
158 if (!chan) in enable_dma_buffer0()
160 __raw_writel(DMA_BE0, chan->io + DMA_MODE_SET); in enable_dma_buffer0()
165 struct dma_chan *chan = get_dma_chan(dmanr); in enable_dma_buffer1() local
167 if (!chan) in enable_dma_buffer1()
169 __raw_writel(DMA_BE1, chan->io + DMA_MODE_SET); in enable_dma_buffer1()
173 struct dma_chan *chan = get_dma_chan(dmanr); in enable_dma_buffers() local
175 if (!chan) in enable_dma_buffers()
177 __raw_writel(DMA_BE0 | DMA_BE1, chan->io + DMA_MODE_SET); in enable_dma_buffers()
182 struct dma_chan *chan = get_dma_chan(dmanr); in start_dma() local
184 if (!chan) in start_dma()
186 __raw_writel(DMA_GO, chan->io + DMA_MODE_SET); in start_dma()
193 struct dma_chan *chan = get_dma_chan(dmanr); in halt_dma() local
196 if (!chan) in halt_dma()
198 __raw_writel(DMA_GO, chan->io + DMA_MODE_CLEAR); in halt_dma()
202 if (__raw_readl(chan->io + DMA_MODE_READ) & DMA_HALT) in halt_dma()
210 struct dma_chan *chan = get_dma_chan(dmanr); in disable_dma() local
212 if (!chan) in disable_dma()
218 __raw_writel(~DMA_GO, chan->io + DMA_MODE_CLEAR); in disable_dma()
223 struct dma_chan *chan = get_dma_chan(dmanr); in dma_halted() local
225 if (!chan) in dma_halted()
227 return (__raw_readl(chan->io + DMA_MODE_READ) & DMA_HALT) ? 1 : 0; in dma_halted()
233 struct dma_chan *chan = get_dma_chan(dmanr); in init_dma() local
236 if (!chan) in init_dma()
242 __raw_writel(CPHYSADDR(chan->fifo_addr), chan->io + DMA_PERIPHERAL_ADDR); in init_dma()
244 mode = chan->mode | (chan->dev_id << DMA_DID_BIT); in init_dma()
245 if (chan->irq) in init_dma()
248 __raw_writel(~mode, chan->io + DMA_MODE_CLEAR); in init_dma()
249 __raw_writel(mode, chan->io + DMA_MODE_SET); in init_dma()
257 struct dma_chan *chan = get_dma_chan(dmanr); in set_dma_mode() local
259 if (!chan) in set_dma_mode()
267 chan->mode &= ~(DMA_BE | DMA_DR | DMA_TS8 | DMA_DW_MASK | DMA_NC); in set_dma_mode()
268 chan->mode |= mode; in set_dma_mode()
273 struct dma_chan *chan = get_dma_chan(dmanr); in get_dma_mode() local
275 if (!chan) in get_dma_mode()
277 return chan->mode; in get_dma_mode()
282 struct dma_chan *chan = get_dma_chan(dmanr); in get_dma_active_buffer() local
284 if (!chan) in get_dma_active_buffer()
286 return (__raw_readl(chan->io + DMA_MODE_READ) & DMA_AB) ? 1 : 0; in get_dma_active_buffer()
296 struct dma_chan *chan = get_dma_chan(dmanr); in set_dma_fifo_addr() local
298 if (!chan) in set_dma_fifo_addr()
301 if (chan->mode & DMA_DS) /* second bank of device IDs */ in set_dma_fifo_addr()
304 if (chan->dev_id != DMA_ID_GP04 && chan->dev_id != DMA_ID_GP05) in set_dma_fifo_addr()
307 __raw_writel(CPHYSADDR(a), chan->io + DMA_PERIPHERAL_ADDR); in set_dma_fifo_addr()
315 struct dma_chan *chan = get_dma_chan(dmanr); in clear_dma_done0() local
317 if (!chan) in clear_dma_done0()
319 __raw_writel(DMA_D0, chan->io + DMA_MODE_CLEAR); in clear_dma_done0()
324 struct dma_chan *chan = get_dma_chan(dmanr); in clear_dma_done1() local
326 if (!chan) in clear_dma_done1()
328 __raw_writel(DMA_D1, chan->io + DMA_MODE_CLEAR); in clear_dma_done1()
343 struct dma_chan *chan = get_dma_chan(dmanr); in set_dma_addr0() local
345 if (!chan) in set_dma_addr0()
347 __raw_writel(a, chan->io + DMA_BUFFER0_START); in set_dma_addr0()
355 struct dma_chan *chan = get_dma_chan(dmanr); in set_dma_addr1() local
357 if (!chan) in set_dma_addr1()
359 __raw_writel(a, chan->io + DMA_BUFFER1_START); in set_dma_addr1()
368 struct dma_chan *chan = get_dma_chan(dmanr); in set_dma_count0() local
370 if (!chan) in set_dma_count0()
373 __raw_writel(count, chan->io + DMA_BUFFER0_COUNT); in set_dma_count0()
381 struct dma_chan *chan = get_dma_chan(dmanr); in set_dma_count1() local
383 if (!chan) in set_dma_count1()
386 __raw_writel(count, chan->io + DMA_BUFFER1_COUNT); in set_dma_count1()
394 struct dma_chan *chan = get_dma_chan(dmanr); in set_dma_count() local
396 if (!chan) in set_dma_count()
399 __raw_writel(count, chan->io + DMA_BUFFER0_COUNT); in set_dma_count()
400 __raw_writel(count, chan->io + DMA_BUFFER1_COUNT); in set_dma_count()
409 struct dma_chan *chan = get_dma_chan(dmanr); in get_dma_buffer_done() local
411 if (!chan) in get_dma_buffer_done()
413 return __raw_readl(chan->io + DMA_MODE_READ) & (DMA_D0 | DMA_D1); in get_dma_buffer_done()
422 struct dma_chan *chan = get_dma_chan(dmanr); in get_dma_done_irq() local
424 if (!chan) in get_dma_done_irq()
426 return chan->irq; in get_dma_done_irq()
435 struct dma_chan *chan = get_dma_chan(dmanr); in get_dma_residue() local
437 if (!chan) in get_dma_residue()
440 curBufCntReg = (__raw_readl(chan->io + DMA_MODE_READ) & DMA_AB) ? in get_dma_residue()
443 count = __raw_readl(chan->io + curBufCntReg) & DMA_COUNT_MASK; in get_dma_residue()
445 if ((chan->mode & DMA_DW_MASK) == DMA_DW16) in get_dma_residue()
447 else if ((chan->mode & DMA_DW_MASK) == DMA_DW32) in get_dma_residue()