Lines Matching refs:lch

82 static inline void omap_disable_channel_irq(int lch)
85 p->dma_write(0, CICR, lch);
87 p->dma_read(CSR, lch);
103 void omap_set_dma_priority(int lch, int dst_port, int priority)
146 void omap_set_dma_transfer_params(int lch, int data_type, int elem_count,
153 l = p->dma_read(CSDP, lch);
156 p->dma_write(l, CSDP, lch);
158 ccr = p->dma_read(CCR, lch);
162 p->dma_write(ccr, CCR, lch);
164 ccr = p->dma_read(CCR2, lch);
168 p->dma_write(ccr, CCR2, lch);
169 p->dma_write(elem_count, CEN, lch);
170 p->dma_write(frame_count, CFN, lch);
174 void omap_set_dma_channel_mode(int lch, enum omap_dma_channel_mode mode)
179 l = p->dma_read(LCH_CTRL, lch);
182 p->dma_write(l, LCH_CTRL, lch);
188 void omap_set_dma_src_params(int lch, int src_port, int src_amode,
195 w = p->dma_read(CSDP, lch);
198 p->dma_write(w, CSDP, lch);
200 l = p->dma_read(CCR, lch);
203 p->dma_write(l, CCR, lch);
205 p->dma_write(src_start, CSSA, lch);
207 p->dma_write(src_ei, CSEI, lch);
208 p->dma_write(src_fi, CSFI, lch);
212 void omap_set_dma_src_data_pack(int lch, int enable)
216 l = p->dma_read(CSDP, lch);
220 p->dma_write(l, CSDP, lch);
224 void omap_set_dma_src_burst_mode(int lch, enum omap_dma_burst_mode burst_mode)
229 l = p->dma_read(CSDP, lch);
252 p->dma_write(l, CSDP, lch);
257 void omap_set_dma_dest_params(int lch, int dest_port, int dest_amode,
263 l = p->dma_read(CSDP, lch);
266 p->dma_write(l, CSDP, lch);
268 l = p->dma_read(CCR, lch);
271 p->dma_write(l, CCR, lch);
273 p->dma_write(dest_start, CDSA, lch);
275 p->dma_write(dst_ei, CDEI, lch);
276 p->dma_write(dst_fi, CDFI, lch);
280 void omap_set_dma_dest_data_pack(int lch, int enable)
284 l = p->dma_read(CSDP, lch);
288 p->dma_write(l, CSDP, lch);
292 void omap_set_dma_dest_burst_mode(int lch, enum omap_dma_burst_mode burst_mode)
297 l = p->dma_read(CSDP, lch);
318 p->dma_write(l, CSDP, lch);
322 static inline void omap_enable_channel_irq(int lch)
325 p->dma_read(CSR, lch);
328 p->dma_write(dma_chan[lch].enabled_irqs, CICR, lch);
331 void omap_disable_dma_irq(int lch, u16 bits)
333 dma_chan[lch].enabled_irqs &= ~bits;
337 static inline void enable_lnk(int lch)
341 l = p->dma_read(CLNK_CTRL, lch);
346 if (dma_chan[lch].next_lch != -1)
347 l = dma_chan[lch].next_lch | (1 << 15);
349 p->dma_write(l, CLNK_CTRL, lch);
352 static inline void disable_lnk(int lch)
356 l = p->dma_read(CLNK_CTRL, lch);
359 omap_disable_channel_irq(lch);
364 p->dma_write(l, CLNK_CTRL, lch);
365 dma_chan[lch].flags &= ~OMAP_DMA_ACTIVE;
370 void (*callback)(int lch, u16 ch_status, void *data),
429 void omap_free_dma(int lch)
433 if (dma_chan[lch].dev_id == -1) {
435 lch);
440 omap_disable_channel_irq(lch);
443 p->dma_write(0, CCR, lch);
446 dma_chan[lch].dev_id = -1;
447 dma_chan[lch].next_lch = -1;
448 dma_chan[lch].callback = NULL;
457 static void omap_clear_dma(int lch)
462 p->clear_dma(lch);
467 void omap_start_dma(int lch)
476 p->dma_write(0, CPC, lch);
478 p->dma_write(0, CDAC, lch);
480 if (!omap_dma_in_1510_mode() && dma_chan[lch].next_lch != -1) {
485 enable_lnk(lch);
488 dma_chan_link_map[lch] = 1;
490 cur_lch = dma_chan[lch].next_lch;
506 p->dma_write(lch, CLNK_CTRL, lch);
508 omap_enable_channel_irq(lch);
510 l = p->dma_read(CCR, lch);
523 p->dma_write(l, CCR, lch);
525 dma_chan[lch].flags |= OMAP_DMA_ACTIVE;
529 void omap_stop_dma(int lch)
534 omap_disable_channel_irq(lch);
536 l = p->dma_read(CCR, lch);
543 l = p->dma_read(OCP_SYSCONFIG, lch);
549 l = p->dma_read(CCR, lch);
551 p->dma_write(l, CCR, lch);
554 l = p->dma_read(CCR, lch);
559 l = p->dma_read(CCR, lch);
562 pr_err("DMA drain did not complete on lch %d\n", lch);
564 p->dma_write(sys_cf, OCP_SYSCONFIG, lch);
567 p->dma_write(l, CCR, lch);
577 if (!omap_dma_in_1510_mode() && dma_chan[lch].next_lch != -1) {
578 int next_lch, cur_lch = lch;
596 dma_chan[lch].flags &= ~OMAP_DMA_ACTIVE;
612 dma_addr_t omap_get_dma_src_pos(int lch)
617 offset = p->dma_read(CPC, lch);
619 offset = p->dma_read(CSAC, lch);
622 offset = p->dma_read(CSAC, lch);
630 if (likely(p->dma_read(CDAC, lch)))
631 offset = p->dma_read(CSAC, lch);
633 offset = p->dma_read(CSSA, lch);
636 offset |= (p->dma_read(CSSA, lch) & 0xFFFF0000);
650 dma_addr_t omap_get_dma_dst_pos(int lch)
655 offset = p->dma_read(CPC, lch);
657 offset = p->dma_read(CDAC, lch);
664 offset = p->dma_read(CDAC, lch);
671 offset = p->dma_read(CDSA, lch);
674 offset |= (p->dma_read(CDSA, lch) & 0xFFFF0000);
680 int omap_get_dma_active_status(int lch)
682 return (p->dma_read(CCR, lch) & OMAP_DMA_CCR_EN) != 0;
689 int lch;
694 for (lch = 0; lch < dma_chan_count; lch++)
695 if (p->dma_read(CCR, lch) & OMAP_DMA_CCR_EN)