Lines Matching refs:chan

38 #define chan_dbg(chan, fmt, arg...)					\  argument
39 dev_dbg(chan->dev, "%s: " fmt, chan->name, ##arg)
40 #define chan_err(chan, fmt, arg...) \ argument
41 dev_err(chan->dev, "%s: " fmt, chan->name, ##arg)
49 static void set_sr(struct fsldma_chan *chan, u32 val) in set_sr() argument
51 FSL_DMA_OUT(chan, &chan->regs->sr, val, 32); in set_sr()
54 static u32 get_sr(struct fsldma_chan *chan) in get_sr() argument
56 return FSL_DMA_IN(chan, &chan->regs->sr, 32); in get_sr()
59 static void set_mr(struct fsldma_chan *chan, u32 val) in set_mr() argument
61 FSL_DMA_OUT(chan, &chan->regs->mr, val, 32); in set_mr()
64 static u32 get_mr(struct fsldma_chan *chan) in get_mr() argument
66 return FSL_DMA_IN(chan, &chan->regs->mr, 32); in get_mr()
69 static void set_cdar(struct fsldma_chan *chan, dma_addr_t addr) in set_cdar() argument
71 FSL_DMA_OUT(chan, &chan->regs->cdar, addr | FSL_DMA_SNEN, 64); in set_cdar()
74 static dma_addr_t get_cdar(struct fsldma_chan *chan) in get_cdar() argument
76 return FSL_DMA_IN(chan, &chan->regs->cdar, 64) & ~FSL_DMA_SNEN; in get_cdar()
79 static void set_bcr(struct fsldma_chan *chan, u32 val) in set_bcr() argument
81 FSL_DMA_OUT(chan, &chan->regs->bcr, val, 32); in set_bcr()
84 static u32 get_bcr(struct fsldma_chan *chan) in get_bcr() argument
86 return FSL_DMA_IN(chan, &chan->regs->bcr, 32); in get_bcr()
93 static void set_desc_cnt(struct fsldma_chan *chan, in set_desc_cnt() argument
96 hw->count = CPU_TO_DMA(chan, count, 32); in set_desc_cnt()
99 static void set_desc_src(struct fsldma_chan *chan, in set_desc_src() argument
104 snoop_bits = ((chan->feature & FSL_DMA_IP_MASK) == FSL_DMA_IP_85XX) in set_desc_src()
106 hw->src_addr = CPU_TO_DMA(chan, snoop_bits | src, 64); in set_desc_src()
109 static void set_desc_dst(struct fsldma_chan *chan, in set_desc_dst() argument
114 snoop_bits = ((chan->feature & FSL_DMA_IP_MASK) == FSL_DMA_IP_85XX) in set_desc_dst()
116 hw->dst_addr = CPU_TO_DMA(chan, snoop_bits | dst, 64); in set_desc_dst()
119 static void set_desc_next(struct fsldma_chan *chan, in set_desc_next() argument
124 snoop_bits = ((chan->feature & FSL_DMA_IP_MASK) == FSL_DMA_IP_83XX) in set_desc_next()
126 hw->next_ln_addr = CPU_TO_DMA(chan, snoop_bits | next, 64); in set_desc_next()
129 static void set_ld_eol(struct fsldma_chan *chan, struct fsl_desc_sw *desc) in set_ld_eol() argument
133 snoop_bits = ((chan->feature & FSL_DMA_IP_MASK) == FSL_DMA_IP_83XX) in set_ld_eol()
136 desc->hw.next_ln_addr = CPU_TO_DMA(chan, in set_ld_eol()
137 DMA_TO_CPU(chan, desc->hw.next_ln_addr, 64) | FSL_DMA_EOL in set_ld_eol()
145 static void dma_init(struct fsldma_chan *chan) in dma_init() argument
148 set_mr(chan, 0); in dma_init()
150 switch (chan->feature & FSL_DMA_IP_MASK) { in dma_init()
157 set_mr(chan, FSL_DMA_MR_BWC | FSL_DMA_MR_EIE in dma_init()
165 set_mr(chan, FSL_DMA_MR_EOTIE | FSL_DMA_MR_PRC_RM); in dma_init()
170 static int dma_is_idle(struct fsldma_chan *chan) in dma_is_idle() argument
172 u32 sr = get_sr(chan); in dma_is_idle()
183 static void dma_start(struct fsldma_chan *chan) in dma_start() argument
187 mode = get_mr(chan); in dma_start()
189 if (chan->feature & FSL_DMA_CHAN_PAUSE_EXT) { in dma_start()
190 set_bcr(chan, 0); in dma_start()
196 if (chan->feature & FSL_DMA_CHAN_START_EXT) { in dma_start()
203 set_mr(chan, mode); in dma_start()
206 static void dma_halt(struct fsldma_chan *chan) in dma_halt() argument
212 mode = get_mr(chan); in dma_halt()
219 if ((chan->feature & FSL_DMA_IP_MASK) == FSL_DMA_IP_85XX) { in dma_halt()
221 set_mr(chan, mode); in dma_halt()
228 set_mr(chan, mode); in dma_halt()
232 if (dma_is_idle(chan)) in dma_halt()
238 if (!dma_is_idle(chan)) in dma_halt()
239 chan_err(chan, "DMA halt timeout!\n"); in dma_halt()
253 static void fsl_chan_set_src_loop_size(struct fsldma_chan *chan, int size) in fsl_chan_set_src_loop_size() argument
257 mode = get_mr(chan); in fsl_chan_set_src_loop_size()
272 set_mr(chan, mode); in fsl_chan_set_src_loop_size()
286 static void fsl_chan_set_dst_loop_size(struct fsldma_chan *chan, int size) in fsl_chan_set_dst_loop_size() argument
290 mode = get_mr(chan); in fsl_chan_set_dst_loop_size()
305 set_mr(chan, mode); in fsl_chan_set_dst_loop_size()
320 static void fsl_chan_set_request_count(struct fsldma_chan *chan, int size) in fsl_chan_set_request_count() argument
326 mode = get_mr(chan); in fsl_chan_set_request_count()
330 set_mr(chan, mode); in fsl_chan_set_request_count()
342 static void fsl_chan_toggle_ext_pause(struct fsldma_chan *chan, int enable) in fsl_chan_toggle_ext_pause() argument
345 chan->feature |= FSL_DMA_CHAN_PAUSE_EXT; in fsl_chan_toggle_ext_pause()
347 chan->feature &= ~FSL_DMA_CHAN_PAUSE_EXT; in fsl_chan_toggle_ext_pause()
360 static void fsl_chan_toggle_ext_start(struct fsldma_chan *chan, int enable) in fsl_chan_toggle_ext_start() argument
363 chan->feature |= FSL_DMA_CHAN_START_EXT; in fsl_chan_toggle_ext_start()
365 chan->feature &= ~FSL_DMA_CHAN_START_EXT; in fsl_chan_toggle_ext_start()
370 struct fsldma_chan *chan; in fsl_dma_external_start() local
375 chan = to_fsl_chan(dchan); in fsl_dma_external_start()
377 fsl_chan_toggle_ext_start(chan, enable); in fsl_dma_external_start()
382 static void append_ld_queue(struct fsldma_chan *chan, struct fsl_desc_sw *desc) in append_ld_queue() argument
384 struct fsl_desc_sw *tail = to_fsl_desc(chan->ld_pending.prev); in append_ld_queue()
386 if (list_empty(&chan->ld_pending)) in append_ld_queue()
396 set_desc_next(chan, &tail->hw, desc->async_tx.phys); in append_ld_queue()
403 list_splice_tail_init(&desc->tx_list, &chan->ld_pending); in append_ld_queue()
408 struct fsldma_chan *chan = to_fsl_chan(tx->chan); in fsl_dma_tx_submit() local
413 spin_lock_bh(&chan->desc_lock); in fsl_dma_tx_submit()
416 if (unlikely(chan->pm_state != RUNNING)) { in fsl_dma_tx_submit()
417 chan_dbg(chan, "cannot submit due to suspend\n"); in fsl_dma_tx_submit()
418 spin_unlock_bh(&chan->desc_lock); in fsl_dma_tx_submit()
432 append_ld_queue(chan, desc); in fsl_dma_tx_submit()
434 spin_unlock_bh(&chan->desc_lock); in fsl_dma_tx_submit()
444 static void fsl_dma_free_descriptor(struct fsldma_chan *chan, in fsl_dma_free_descriptor() argument
448 chan_dbg(chan, "LD %p free\n", desc); in fsl_dma_free_descriptor()
449 dma_pool_free(chan->desc_pool, desc, desc->async_tx.phys); in fsl_dma_free_descriptor()
458 static struct fsl_desc_sw *fsl_dma_alloc_descriptor(struct fsldma_chan *chan) in fsl_dma_alloc_descriptor() argument
463 desc = dma_pool_zalloc(chan->desc_pool, GFP_ATOMIC, &pdesc); in fsl_dma_alloc_descriptor()
465 chan_dbg(chan, "out of memory for link descriptor\n"); in fsl_dma_alloc_descriptor()
470 dma_async_tx_descriptor_init(&desc->async_tx, &chan->common); in fsl_dma_alloc_descriptor()
474 chan_dbg(chan, "LD %p allocated\n", desc); in fsl_dma_alloc_descriptor()
487 static void fsldma_clean_completed_descriptor(struct fsldma_chan *chan) in fsldma_clean_completed_descriptor() argument
492 list_for_each_entry_safe(desc, _desc, &chan->ld_completed, node) in fsldma_clean_completed_descriptor()
494 fsl_dma_free_descriptor(chan, desc); in fsldma_clean_completed_descriptor()
506 static dma_cookie_t fsldma_run_tx_complete_actions(struct fsldma_chan *chan, in fsldma_run_tx_complete_actions() argument
537 static void fsldma_clean_running_descriptor(struct fsldma_chan *chan, in fsldma_clean_running_descriptor() argument
552 list_add_tail(&desc->node, &chan->ld_completed); in fsldma_clean_running_descriptor()
556 dma_pool_free(chan->desc_pool, desc, desc->async_tx.phys); in fsldma_clean_running_descriptor()
566 static void fsl_chan_xfer_ld_queue(struct fsldma_chan *chan) in fsl_chan_xfer_ld_queue() argument
574 if (list_empty(&chan->ld_pending)) { in fsl_chan_xfer_ld_queue()
575 chan_dbg(chan, "no pending LDs\n"); in fsl_chan_xfer_ld_queue()
584 if (!chan->idle) { in fsl_chan_xfer_ld_queue()
585 chan_dbg(chan, "DMA controller still busy\n"); in fsl_chan_xfer_ld_queue()
598 chan_dbg(chan, "idle, starting controller\n"); in fsl_chan_xfer_ld_queue()
599 desc = list_first_entry(&chan->ld_pending, struct fsl_desc_sw, node); in fsl_chan_xfer_ld_queue()
600 list_splice_tail_init(&chan->ld_pending, &chan->ld_running); in fsl_chan_xfer_ld_queue()
607 if ((chan->feature & FSL_DMA_IP_MASK) == FSL_DMA_IP_85XX) { in fsl_chan_xfer_ld_queue()
610 mode = get_mr(chan); in fsl_chan_xfer_ld_queue()
612 set_mr(chan, mode); in fsl_chan_xfer_ld_queue()
619 set_cdar(chan, desc->async_tx.phys); in fsl_chan_xfer_ld_queue()
620 get_cdar(chan); in fsl_chan_xfer_ld_queue()
622 dma_start(chan); in fsl_chan_xfer_ld_queue()
623 chan->idle = false; in fsl_chan_xfer_ld_queue()
635 static void fsldma_cleanup_descriptors(struct fsldma_chan *chan) in fsldma_cleanup_descriptors() argument
639 dma_addr_t curr_phys = get_cdar(chan); in fsldma_cleanup_descriptors()
642 fsldma_clean_completed_descriptor(chan); in fsldma_cleanup_descriptors()
645 list_for_each_entry_safe(desc, _desc, &chan->ld_running, node) { in fsldma_cleanup_descriptors()
660 if (!dma_is_idle(chan)) in fsldma_cleanup_descriptors()
664 cookie = fsldma_run_tx_complete_actions(chan, desc, cookie); in fsldma_cleanup_descriptors()
666 fsldma_clean_running_descriptor(chan, desc); in fsldma_cleanup_descriptors()
675 fsl_chan_xfer_ld_queue(chan); in fsldma_cleanup_descriptors()
678 chan->common.completed_cookie = cookie; in fsldma_cleanup_descriptors()
691 struct fsldma_chan *chan = to_fsl_chan(dchan); in fsl_dma_alloc_chan_resources() local
694 if (chan->desc_pool) in fsl_dma_alloc_chan_resources()
701 chan->desc_pool = dma_pool_create(chan->name, chan->dev, in fsl_dma_alloc_chan_resources()
704 if (!chan->desc_pool) { in fsl_dma_alloc_chan_resources()
705 chan_err(chan, "unable to allocate descriptor pool\n"); in fsl_dma_alloc_chan_resources()
720 static void fsldma_free_desc_list(struct fsldma_chan *chan, in fsldma_free_desc_list() argument
726 fsl_dma_free_descriptor(chan, desc); in fsldma_free_desc_list()
729 static void fsldma_free_desc_list_reverse(struct fsldma_chan *chan, in fsldma_free_desc_list_reverse() argument
735 fsl_dma_free_descriptor(chan, desc); in fsldma_free_desc_list_reverse()
744 struct fsldma_chan *chan = to_fsl_chan(dchan); in fsl_dma_free_chan_resources() local
746 chan_dbg(chan, "free all channel resources\n"); in fsl_dma_free_chan_resources()
747 spin_lock_bh(&chan->desc_lock); in fsl_dma_free_chan_resources()
748 fsldma_cleanup_descriptors(chan); in fsl_dma_free_chan_resources()
749 fsldma_free_desc_list(chan, &chan->ld_pending); in fsl_dma_free_chan_resources()
750 fsldma_free_desc_list(chan, &chan->ld_running); in fsl_dma_free_chan_resources()
751 fsldma_free_desc_list(chan, &chan->ld_completed); in fsl_dma_free_chan_resources()
752 spin_unlock_bh(&chan->desc_lock); in fsl_dma_free_chan_resources()
754 dma_pool_destroy(chan->desc_pool); in fsl_dma_free_chan_resources()
755 chan->desc_pool = NULL; in fsl_dma_free_chan_resources()
763 struct fsldma_chan *chan; in fsl_dma_prep_memcpy() local
773 chan = to_fsl_chan(dchan); in fsl_dma_prep_memcpy()
778 new = fsl_dma_alloc_descriptor(chan); in fsl_dma_prep_memcpy()
780 chan_err(chan, "%s\n", msg_ld_oom); in fsl_dma_prep_memcpy()
786 set_desc_cnt(chan, &new->hw, copy); in fsl_dma_prep_memcpy()
787 set_desc_src(chan, &new->hw, dma_src); in fsl_dma_prep_memcpy()
788 set_desc_dst(chan, &new->hw, dma_dst); in fsl_dma_prep_memcpy()
793 set_desc_next(chan, &prev->hw, new->async_tx.phys); in fsl_dma_prep_memcpy()
811 set_ld_eol(chan, new); in fsl_dma_prep_memcpy()
819 fsldma_free_desc_list_reverse(chan, &first->tx_list); in fsl_dma_prep_memcpy()
825 struct fsldma_chan *chan; in fsl_dma_device_terminate_all() local
830 chan = to_fsl_chan(dchan); in fsl_dma_device_terminate_all()
832 spin_lock_bh(&chan->desc_lock); in fsl_dma_device_terminate_all()
835 dma_halt(chan); in fsl_dma_device_terminate_all()
838 fsldma_free_desc_list(chan, &chan->ld_pending); in fsl_dma_device_terminate_all()
839 fsldma_free_desc_list(chan, &chan->ld_running); in fsl_dma_device_terminate_all()
840 fsldma_free_desc_list(chan, &chan->ld_completed); in fsl_dma_device_terminate_all()
841 chan->idle = true; in fsl_dma_device_terminate_all()
843 spin_unlock_bh(&chan->desc_lock); in fsl_dma_device_terminate_all()
850 struct fsldma_chan *chan; in fsl_dma_device_config() local
856 chan = to_fsl_chan(dchan); in fsl_dma_device_config()
859 if (!chan->set_request_count) in fsl_dma_device_config()
868 chan->set_request_count(chan, size); in fsl_dma_device_config()
879 struct fsldma_chan *chan = to_fsl_chan(dchan); in fsl_dma_memcpy_issue_pending() local
881 spin_lock_bh(&chan->desc_lock); in fsl_dma_memcpy_issue_pending()
882 fsl_chan_xfer_ld_queue(chan); in fsl_dma_memcpy_issue_pending()
883 spin_unlock_bh(&chan->desc_lock); in fsl_dma_memcpy_issue_pending()
894 struct fsldma_chan *chan = to_fsl_chan(dchan); in fsl_tx_status() local
901 spin_lock_bh(&chan->desc_lock); in fsl_tx_status()
902 fsldma_cleanup_descriptors(chan); in fsl_tx_status()
903 spin_unlock_bh(&chan->desc_lock); in fsl_tx_status()
914 struct fsldma_chan *chan = data; in fsldma_chan_irq() local
918 stat = get_sr(chan); in fsldma_chan_irq()
919 set_sr(chan, stat); in fsldma_chan_irq()
920 chan_dbg(chan, "irq: stat = 0x%x\n", stat); in fsldma_chan_irq()
928 chan_err(chan, "Transfer Error!\n"); in fsldma_chan_irq()
936 chan_dbg(chan, "irq: Programming Error INT\n"); in fsldma_chan_irq()
938 if (get_bcr(chan) != 0) in fsldma_chan_irq()
939 chan_err(chan, "Programming Error!\n"); in fsldma_chan_irq()
947 chan_dbg(chan, "irq: End-of-Chain link INT\n"); in fsldma_chan_irq()
957 chan_dbg(chan, "irq: End-of-link INT\n"); in fsldma_chan_irq()
962 if (!dma_is_idle(chan)) in fsldma_chan_irq()
963 chan_err(chan, "irq: controller not idle!\n"); in fsldma_chan_irq()
967 chan_err(chan, "irq: unhandled sr 0x%08x\n", stat); in fsldma_chan_irq()
974 tasklet_schedule(&chan->tasklet); in fsldma_chan_irq()
975 chan_dbg(chan, "irq: Exit\n"); in fsldma_chan_irq()
981 struct fsldma_chan *chan = from_tasklet(chan, t, tasklet); in dma_do_tasklet() local
983 chan_dbg(chan, "tasklet entry\n"); in dma_do_tasklet()
985 spin_lock(&chan->desc_lock); in dma_do_tasklet()
988 chan->idle = true; in dma_do_tasklet()
991 fsldma_cleanup_descriptors(chan); in dma_do_tasklet()
993 spin_unlock(&chan->desc_lock); in dma_do_tasklet()
995 chan_dbg(chan, "tasklet exit\n"); in dma_do_tasklet()
1001 struct fsldma_chan *chan; in fsldma_ctrl_irq() local
1012 chan = fdev->chan[i]; in fsldma_ctrl_irq()
1013 if (!chan) in fsldma_ctrl_irq()
1017 dev_dbg(fdev->dev, "IRQ: chan %d\n", chan->id); in fsldma_ctrl_irq()
1018 fsldma_chan_irq(irq, chan); in fsldma_ctrl_irq()
1031 struct fsldma_chan *chan; in fsldma_free_irqs() local
1041 chan = fdev->chan[i]; in fsldma_free_irqs()
1042 if (chan && chan->irq) { in fsldma_free_irqs()
1043 chan_dbg(chan, "free per-channel IRQ\n"); in fsldma_free_irqs()
1044 free_irq(chan->irq, chan); in fsldma_free_irqs()
1051 struct fsldma_chan *chan; in fsldma_request_irqs() local
1065 chan = fdev->chan[i]; in fsldma_request_irqs()
1066 if (!chan) in fsldma_request_irqs()
1069 if (!chan->irq) { in fsldma_request_irqs()
1070 chan_err(chan, "interrupts property missing in device tree\n"); in fsldma_request_irqs()
1075 chan_dbg(chan, "request per-channel IRQ\n"); in fsldma_request_irqs()
1076 ret = request_irq(chan->irq, fsldma_chan_irq, IRQF_SHARED, in fsldma_request_irqs()
1077 "fsldma-chan", chan); in fsldma_request_irqs()
1079 chan_err(chan, "unable to request per-channel IRQ\n"); in fsldma_request_irqs()
1088 chan = fdev->chan[i]; in fsldma_request_irqs()
1089 if (!chan) in fsldma_request_irqs()
1092 if (!chan->irq) in fsldma_request_irqs()
1095 free_irq(chan->irq, chan); in fsldma_request_irqs()
1108 struct fsldma_chan *chan; in fsl_dma_chan_probe() local
1113 chan = kzalloc(sizeof(*chan), GFP_KERNEL); in fsl_dma_chan_probe()
1114 if (!chan) { in fsl_dma_chan_probe()
1120 chan->regs = of_iomap(node, 0); in fsl_dma_chan_probe()
1121 if (!chan->regs) { in fsl_dma_chan_probe()
1133 chan->feature = feature; in fsl_dma_chan_probe()
1135 fdev->feature = chan->feature; in fsl_dma_chan_probe()
1141 WARN_ON(fdev->feature != chan->feature); in fsl_dma_chan_probe()
1143 chan->dev = fdev->dev; in fsl_dma_chan_probe()
1144 chan->id = (res.start & 0xfff) < 0x300 ? in fsl_dma_chan_probe()
1147 if (chan->id >= FSL_DMA_MAX_CHANS_PER_DEVICE) { in fsl_dma_chan_probe()
1153 fdev->chan[chan->id] = chan; in fsl_dma_chan_probe()
1154 tasklet_setup(&chan->tasklet, dma_do_tasklet); in fsl_dma_chan_probe()
1155 snprintf(chan->name, sizeof(chan->name), "chan%d", chan->id); in fsl_dma_chan_probe()
1158 dma_init(chan); in fsl_dma_chan_probe()
1161 set_cdar(chan, 0); in fsl_dma_chan_probe()
1163 switch (chan->feature & FSL_DMA_IP_MASK) { in fsl_dma_chan_probe()
1165 chan->toggle_ext_pause = fsl_chan_toggle_ext_pause; in fsl_dma_chan_probe()
1168 chan->toggle_ext_start = fsl_chan_toggle_ext_start; in fsl_dma_chan_probe()
1169 chan->set_src_loop_size = fsl_chan_set_src_loop_size; in fsl_dma_chan_probe()
1170 chan->set_dst_loop_size = fsl_chan_set_dst_loop_size; in fsl_dma_chan_probe()
1171 chan->set_request_count = fsl_chan_set_request_count; in fsl_dma_chan_probe()
1174 spin_lock_init(&chan->desc_lock); in fsl_dma_chan_probe()
1175 INIT_LIST_HEAD(&chan->ld_pending); in fsl_dma_chan_probe()
1176 INIT_LIST_HEAD(&chan->ld_running); in fsl_dma_chan_probe()
1177 INIT_LIST_HEAD(&chan->ld_completed); in fsl_dma_chan_probe()
1178 chan->idle = true; in fsl_dma_chan_probe()
1180 chan->pm_state = RUNNING; in fsl_dma_chan_probe()
1183 chan->common.device = &fdev->common; in fsl_dma_chan_probe()
1184 dma_cookie_init(&chan->common); in fsl_dma_chan_probe()
1187 chan->irq = irq_of_parse_and_map(node, 0); in fsl_dma_chan_probe()
1190 list_add_tail(&chan->common.device_node, &fdev->common.channels); in fsl_dma_chan_probe()
1192 dev_info(fdev->dev, "#%d (%s), irq %d\n", chan->id, compatible, in fsl_dma_chan_probe()
1193 chan->irq ? chan->irq : fdev->irq); in fsl_dma_chan_probe()
1198 iounmap(chan->regs); in fsl_dma_chan_probe()
1200 kfree(chan); in fsl_dma_chan_probe()
1205 static void fsl_dma_chan_remove(struct fsldma_chan *chan) in fsl_dma_chan_remove() argument
1207 irq_dispose_mapping(chan->irq); in fsl_dma_chan_remove()
1208 list_del(&chan->common.device_node); in fsl_dma_chan_remove()
1209 iounmap(chan->regs); in fsl_dma_chan_remove()
1210 kfree(chan); in fsl_dma_chan_remove()
1297 if (fdev->chan[i]) in fsldma_of_probe()
1298 fsl_dma_chan_remove(fdev->chan[i]); in fsldma_of_probe()
1319 if (fdev->chan[i]) in fsldma_of_remove()
1320 fsl_dma_chan_remove(fdev->chan[i]); in fsldma_of_remove()
1334 struct fsldma_chan *chan; in fsldma_suspend_late() local
1338 chan = fdev->chan[i]; in fsldma_suspend_late()
1339 if (!chan) in fsldma_suspend_late()
1342 spin_lock_bh(&chan->desc_lock); in fsldma_suspend_late()
1343 if (unlikely(!chan->idle)) in fsldma_suspend_late()
1345 chan->regs_save.mr = get_mr(chan); in fsldma_suspend_late()
1346 chan->pm_state = SUSPENDED; in fsldma_suspend_late()
1347 spin_unlock_bh(&chan->desc_lock); in fsldma_suspend_late()
1353 chan = fdev->chan[i]; in fsldma_suspend_late()
1354 if (!chan) in fsldma_suspend_late()
1356 chan->pm_state = RUNNING; in fsldma_suspend_late()
1357 spin_unlock_bh(&chan->desc_lock); in fsldma_suspend_late()
1365 struct fsldma_chan *chan; in fsldma_resume_early() local
1370 chan = fdev->chan[i]; in fsldma_resume_early()
1371 if (!chan) in fsldma_resume_early()
1374 spin_lock_bh(&chan->desc_lock); in fsldma_resume_early()
1375 mode = chan->regs_save.mr in fsldma_resume_early()
1377 set_mr(chan, mode); in fsldma_resume_early()
1378 chan->pm_state = RUNNING; in fsldma_resume_early()
1379 spin_unlock_bh(&chan->desc_lock); in fsldma_resume_early()