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