• Home
  • Raw
  • Download

Lines Matching refs:chan

39 #define chan_dbg(chan, fmt, arg...)					\  argument
40 dev_dbg(chan->dev, "%s: " fmt, chan->name, ##arg)
41 #define chan_err(chan, fmt, arg...) \ argument
42 dev_err(chan->dev, "%s: " fmt, chan->name, ##arg)
50 static void set_sr(struct fsldma_chan *chan, u32 val) in set_sr() argument
52 FSL_DMA_OUT(chan, &chan->regs->sr, val, 32); in set_sr()
55 static u32 get_sr(struct fsldma_chan *chan) in get_sr() argument
57 return FSL_DMA_IN(chan, &chan->regs->sr, 32); in get_sr()
60 static void set_mr(struct fsldma_chan *chan, u32 val) in set_mr() argument
62 FSL_DMA_OUT(chan, &chan->regs->mr, val, 32); in set_mr()
65 static u32 get_mr(struct fsldma_chan *chan) in get_mr() argument
67 return FSL_DMA_IN(chan, &chan->regs->mr, 32); in get_mr()
70 static void set_cdar(struct fsldma_chan *chan, dma_addr_t addr) in set_cdar() argument
72 FSL_DMA_OUT(chan, &chan->regs->cdar, addr | FSL_DMA_SNEN, 64); in set_cdar()
75 static dma_addr_t get_cdar(struct fsldma_chan *chan) in get_cdar() argument
77 return FSL_DMA_IN(chan, &chan->regs->cdar, 64) & ~FSL_DMA_SNEN; in get_cdar()
80 static void set_bcr(struct fsldma_chan *chan, u32 val) in set_bcr() argument
82 FSL_DMA_OUT(chan, &chan->regs->bcr, val, 32); in set_bcr()
85 static u32 get_bcr(struct fsldma_chan *chan) in get_bcr() argument
87 return FSL_DMA_IN(chan, &chan->regs->bcr, 32); in get_bcr()
94 static void set_desc_cnt(struct fsldma_chan *chan, in set_desc_cnt() argument
97 hw->count = CPU_TO_DMA(chan, count, 32); in set_desc_cnt()
100 static void set_desc_src(struct fsldma_chan *chan, in set_desc_src() argument
105 snoop_bits = ((chan->feature & FSL_DMA_IP_MASK) == FSL_DMA_IP_85XX) in set_desc_src()
107 hw->src_addr = CPU_TO_DMA(chan, snoop_bits | src, 64); in set_desc_src()
110 static void set_desc_dst(struct fsldma_chan *chan, in set_desc_dst() argument
115 snoop_bits = ((chan->feature & FSL_DMA_IP_MASK) == FSL_DMA_IP_85XX) in set_desc_dst()
117 hw->dst_addr = CPU_TO_DMA(chan, snoop_bits | dst, 64); in set_desc_dst()
120 static void set_desc_next(struct fsldma_chan *chan, in set_desc_next() argument
125 snoop_bits = ((chan->feature & FSL_DMA_IP_MASK) == FSL_DMA_IP_83XX) in set_desc_next()
127 hw->next_ln_addr = CPU_TO_DMA(chan, snoop_bits | next, 64); in set_desc_next()
130 static void set_ld_eol(struct fsldma_chan *chan, struct fsl_desc_sw *desc) in set_ld_eol() argument
134 snoop_bits = ((chan->feature & FSL_DMA_IP_MASK) == FSL_DMA_IP_83XX) in set_ld_eol()
137 desc->hw.next_ln_addr = CPU_TO_DMA(chan, in set_ld_eol()
138 DMA_TO_CPU(chan, desc->hw.next_ln_addr, 64) | FSL_DMA_EOL in set_ld_eol()
146 static void dma_init(struct fsldma_chan *chan) in dma_init() argument
149 set_mr(chan, 0); in dma_init()
151 switch (chan->feature & FSL_DMA_IP_MASK) { in dma_init()
158 set_mr(chan, FSL_DMA_MR_BWC | FSL_DMA_MR_EIE in dma_init()
166 set_mr(chan, FSL_DMA_MR_EOTIE | FSL_DMA_MR_PRC_RM); in dma_init()
171 static int dma_is_idle(struct fsldma_chan *chan) in dma_is_idle() argument
173 u32 sr = get_sr(chan); in dma_is_idle()
184 static void dma_start(struct fsldma_chan *chan) in dma_start() argument
188 mode = get_mr(chan); in dma_start()
190 if (chan->feature & FSL_DMA_CHAN_PAUSE_EXT) { in dma_start()
191 set_bcr(chan, 0); in dma_start()
197 if (chan->feature & FSL_DMA_CHAN_START_EXT) { in dma_start()
204 set_mr(chan, mode); in dma_start()
207 static void dma_halt(struct fsldma_chan *chan) in dma_halt() argument
213 mode = get_mr(chan); in dma_halt()
220 if ((chan->feature & FSL_DMA_IP_MASK) == FSL_DMA_IP_85XX) { in dma_halt()
222 set_mr(chan, mode); in dma_halt()
229 set_mr(chan, mode); in dma_halt()
233 if (dma_is_idle(chan)) in dma_halt()
239 if (!dma_is_idle(chan)) in dma_halt()
240 chan_err(chan, "DMA halt timeout!\n"); in dma_halt()
254 static void fsl_chan_set_src_loop_size(struct fsldma_chan *chan, int size) in fsl_chan_set_src_loop_size() argument
258 mode = get_mr(chan); in fsl_chan_set_src_loop_size()
273 set_mr(chan, mode); in fsl_chan_set_src_loop_size()
287 static void fsl_chan_set_dst_loop_size(struct fsldma_chan *chan, int size) in fsl_chan_set_dst_loop_size() argument
291 mode = get_mr(chan); in fsl_chan_set_dst_loop_size()
306 set_mr(chan, mode); in fsl_chan_set_dst_loop_size()
321 static void fsl_chan_set_request_count(struct fsldma_chan *chan, int size) in fsl_chan_set_request_count() argument
327 mode = get_mr(chan); in fsl_chan_set_request_count()
331 set_mr(chan, mode); in fsl_chan_set_request_count()
343 static void fsl_chan_toggle_ext_pause(struct fsldma_chan *chan, int enable) in fsl_chan_toggle_ext_pause() argument
346 chan->feature |= FSL_DMA_CHAN_PAUSE_EXT; in fsl_chan_toggle_ext_pause()
348 chan->feature &= ~FSL_DMA_CHAN_PAUSE_EXT; in fsl_chan_toggle_ext_pause()
361 static void fsl_chan_toggle_ext_start(struct fsldma_chan *chan, int enable) in fsl_chan_toggle_ext_start() argument
364 chan->feature |= FSL_DMA_CHAN_START_EXT; in fsl_chan_toggle_ext_start()
366 chan->feature &= ~FSL_DMA_CHAN_START_EXT; in fsl_chan_toggle_ext_start()
371 struct fsldma_chan *chan; in fsl_dma_external_start() local
376 chan = to_fsl_chan(dchan); in fsl_dma_external_start()
378 fsl_chan_toggle_ext_start(chan, enable); in fsl_dma_external_start()
383 static void append_ld_queue(struct fsldma_chan *chan, struct fsl_desc_sw *desc) in append_ld_queue() argument
385 struct fsl_desc_sw *tail = to_fsl_desc(chan->ld_pending.prev); in append_ld_queue()
387 if (list_empty(&chan->ld_pending)) in append_ld_queue()
397 set_desc_next(chan, &tail->hw, desc->async_tx.phys); in append_ld_queue()
404 list_splice_tail_init(&desc->tx_list, &chan->ld_pending); in append_ld_queue()
409 struct fsldma_chan *chan = to_fsl_chan(tx->chan); in fsl_dma_tx_submit() local
414 spin_lock_bh(&chan->desc_lock); in fsl_dma_tx_submit()
417 if (unlikely(chan->pm_state != RUNNING)) { in fsl_dma_tx_submit()
418 chan_dbg(chan, "cannot submit due to suspend\n"); in fsl_dma_tx_submit()
419 spin_unlock_bh(&chan->desc_lock); in fsl_dma_tx_submit()
433 append_ld_queue(chan, desc); in fsl_dma_tx_submit()
435 spin_unlock_bh(&chan->desc_lock); in fsl_dma_tx_submit()
445 static void fsl_dma_free_descriptor(struct fsldma_chan *chan, in fsl_dma_free_descriptor() argument
449 chan_dbg(chan, "LD %p free\n", desc); in fsl_dma_free_descriptor()
450 dma_pool_free(chan->desc_pool, desc, desc->async_tx.phys); in fsl_dma_free_descriptor()
459 static struct fsl_desc_sw *fsl_dma_alloc_descriptor(struct fsldma_chan *chan) in fsl_dma_alloc_descriptor() argument
464 desc = dma_pool_zalloc(chan->desc_pool, GFP_ATOMIC, &pdesc); in fsl_dma_alloc_descriptor()
466 chan_dbg(chan, "out of memory for link descriptor\n"); in fsl_dma_alloc_descriptor()
471 dma_async_tx_descriptor_init(&desc->async_tx, &chan->common); in fsl_dma_alloc_descriptor()
475 chan_dbg(chan, "LD %p allocated\n", desc); in fsl_dma_alloc_descriptor()
488 static void fsldma_clean_completed_descriptor(struct fsldma_chan *chan) in fsldma_clean_completed_descriptor() argument
493 list_for_each_entry_safe(desc, _desc, &chan->ld_completed, node) in fsldma_clean_completed_descriptor()
495 fsl_dma_free_descriptor(chan, desc); in fsldma_clean_completed_descriptor()
507 static dma_cookie_t fsldma_run_tx_complete_actions(struct fsldma_chan *chan, in fsldma_run_tx_complete_actions() argument
538 static void fsldma_clean_running_descriptor(struct fsldma_chan *chan, in fsldma_clean_running_descriptor() argument
553 list_add_tail(&desc->node, &chan->ld_completed); in fsldma_clean_running_descriptor()
557 dma_pool_free(chan->desc_pool, desc, desc->async_tx.phys); in fsldma_clean_running_descriptor()
567 static void fsl_chan_xfer_ld_queue(struct fsldma_chan *chan) in fsl_chan_xfer_ld_queue() argument
575 if (list_empty(&chan->ld_pending)) { in fsl_chan_xfer_ld_queue()
576 chan_dbg(chan, "no pending LDs\n"); in fsl_chan_xfer_ld_queue()
585 if (!chan->idle) { in fsl_chan_xfer_ld_queue()
586 chan_dbg(chan, "DMA controller still busy\n"); in fsl_chan_xfer_ld_queue()
599 chan_dbg(chan, "idle, starting controller\n"); in fsl_chan_xfer_ld_queue()
600 desc = list_first_entry(&chan->ld_pending, struct fsl_desc_sw, node); in fsl_chan_xfer_ld_queue()
601 list_splice_tail_init(&chan->ld_pending, &chan->ld_running); in fsl_chan_xfer_ld_queue()
608 if ((chan->feature & FSL_DMA_IP_MASK) == FSL_DMA_IP_85XX) { in fsl_chan_xfer_ld_queue()
611 mode = get_mr(chan); in fsl_chan_xfer_ld_queue()
613 set_mr(chan, mode); in fsl_chan_xfer_ld_queue()
620 set_cdar(chan, desc->async_tx.phys); in fsl_chan_xfer_ld_queue()
621 get_cdar(chan); in fsl_chan_xfer_ld_queue()
623 dma_start(chan); in fsl_chan_xfer_ld_queue()
624 chan->idle = false; in fsl_chan_xfer_ld_queue()
636 static void fsldma_cleanup_descriptors(struct fsldma_chan *chan) in fsldma_cleanup_descriptors() argument
640 dma_addr_t curr_phys = get_cdar(chan); in fsldma_cleanup_descriptors()
643 fsldma_clean_completed_descriptor(chan); in fsldma_cleanup_descriptors()
646 list_for_each_entry_safe(desc, _desc, &chan->ld_running, node) { in fsldma_cleanup_descriptors()
661 if (!dma_is_idle(chan)) in fsldma_cleanup_descriptors()
665 cookie = fsldma_run_tx_complete_actions(chan, desc, cookie); in fsldma_cleanup_descriptors()
667 fsldma_clean_running_descriptor(chan, desc); in fsldma_cleanup_descriptors()
676 fsl_chan_xfer_ld_queue(chan); in fsldma_cleanup_descriptors()
679 chan->common.completed_cookie = cookie; in fsldma_cleanup_descriptors()
692 struct fsldma_chan *chan = to_fsl_chan(dchan); in fsl_dma_alloc_chan_resources() local
695 if (chan->desc_pool) in fsl_dma_alloc_chan_resources()
702 chan->desc_pool = dma_pool_create(chan->name, chan->dev, in fsl_dma_alloc_chan_resources()
705 if (!chan->desc_pool) { in fsl_dma_alloc_chan_resources()
706 chan_err(chan, "unable to allocate descriptor pool\n"); in fsl_dma_alloc_chan_resources()
721 static void fsldma_free_desc_list(struct fsldma_chan *chan, in fsldma_free_desc_list() argument
727 fsl_dma_free_descriptor(chan, desc); in fsldma_free_desc_list()
730 static void fsldma_free_desc_list_reverse(struct fsldma_chan *chan, in fsldma_free_desc_list_reverse() argument
736 fsl_dma_free_descriptor(chan, desc); in fsldma_free_desc_list_reverse()
745 struct fsldma_chan *chan = to_fsl_chan(dchan); in fsl_dma_free_chan_resources() local
747 chan_dbg(chan, "free all channel resources\n"); in fsl_dma_free_chan_resources()
748 spin_lock_bh(&chan->desc_lock); in fsl_dma_free_chan_resources()
749 fsldma_cleanup_descriptors(chan); in fsl_dma_free_chan_resources()
750 fsldma_free_desc_list(chan, &chan->ld_pending); in fsl_dma_free_chan_resources()
751 fsldma_free_desc_list(chan, &chan->ld_running); in fsl_dma_free_chan_resources()
752 fsldma_free_desc_list(chan, &chan->ld_completed); in fsl_dma_free_chan_resources()
753 spin_unlock_bh(&chan->desc_lock); in fsl_dma_free_chan_resources()
755 dma_pool_destroy(chan->desc_pool); in fsl_dma_free_chan_resources()
756 chan->desc_pool = NULL; in fsl_dma_free_chan_resources()
764 struct fsldma_chan *chan; in fsl_dma_prep_memcpy() local
774 chan = to_fsl_chan(dchan); in fsl_dma_prep_memcpy()
779 new = fsl_dma_alloc_descriptor(chan); in fsl_dma_prep_memcpy()
781 chan_err(chan, "%s\n", msg_ld_oom); in fsl_dma_prep_memcpy()
787 set_desc_cnt(chan, &new->hw, copy); in fsl_dma_prep_memcpy()
788 set_desc_src(chan, &new->hw, dma_src); in fsl_dma_prep_memcpy()
789 set_desc_dst(chan, &new->hw, dma_dst); in fsl_dma_prep_memcpy()
794 set_desc_next(chan, &prev->hw, new->async_tx.phys); in fsl_dma_prep_memcpy()
812 set_ld_eol(chan, new); in fsl_dma_prep_memcpy()
820 fsldma_free_desc_list_reverse(chan, &first->tx_list); in fsl_dma_prep_memcpy()
826 struct fsldma_chan *chan; in fsl_dma_device_terminate_all() local
831 chan = to_fsl_chan(dchan); in fsl_dma_device_terminate_all()
833 spin_lock_bh(&chan->desc_lock); in fsl_dma_device_terminate_all()
836 dma_halt(chan); in fsl_dma_device_terminate_all()
839 fsldma_free_desc_list(chan, &chan->ld_pending); in fsl_dma_device_terminate_all()
840 fsldma_free_desc_list(chan, &chan->ld_running); in fsl_dma_device_terminate_all()
841 fsldma_free_desc_list(chan, &chan->ld_completed); in fsl_dma_device_terminate_all()
842 chan->idle = true; in fsl_dma_device_terminate_all()
844 spin_unlock_bh(&chan->desc_lock); in fsl_dma_device_terminate_all()
851 struct fsldma_chan *chan; in fsl_dma_device_config() local
857 chan = to_fsl_chan(dchan); in fsl_dma_device_config()
860 if (!chan->set_request_count) in fsl_dma_device_config()
869 chan->set_request_count(chan, size); in fsl_dma_device_config()
880 struct fsldma_chan *chan = to_fsl_chan(dchan); in fsl_dma_memcpy_issue_pending() local
882 spin_lock_bh(&chan->desc_lock); in fsl_dma_memcpy_issue_pending()
883 fsl_chan_xfer_ld_queue(chan); in fsl_dma_memcpy_issue_pending()
884 spin_unlock_bh(&chan->desc_lock); in fsl_dma_memcpy_issue_pending()
895 struct fsldma_chan *chan = to_fsl_chan(dchan); in fsl_tx_status() local
902 spin_lock_bh(&chan->desc_lock); in fsl_tx_status()
903 fsldma_cleanup_descriptors(chan); in fsl_tx_status()
904 spin_unlock_bh(&chan->desc_lock); in fsl_tx_status()
915 struct fsldma_chan *chan = data; in fsldma_chan_irq() local
919 stat = get_sr(chan); in fsldma_chan_irq()
920 set_sr(chan, stat); in fsldma_chan_irq()
921 chan_dbg(chan, "irq: stat = 0x%x\n", stat); in fsldma_chan_irq()
929 chan_err(chan, "Transfer Error!\n"); in fsldma_chan_irq()
937 chan_dbg(chan, "irq: Programming Error INT\n"); in fsldma_chan_irq()
939 if (get_bcr(chan) != 0) in fsldma_chan_irq()
940 chan_err(chan, "Programming Error!\n"); in fsldma_chan_irq()
948 chan_dbg(chan, "irq: End-of-Chain link INT\n"); in fsldma_chan_irq()
958 chan_dbg(chan, "irq: End-of-link INT\n"); in fsldma_chan_irq()
963 if (!dma_is_idle(chan)) in fsldma_chan_irq()
964 chan_err(chan, "irq: controller not idle!\n"); in fsldma_chan_irq()
968 chan_err(chan, "irq: unhandled sr 0x%08x\n", stat); in fsldma_chan_irq()
975 tasklet_schedule(&chan->tasklet); in fsldma_chan_irq()
976 chan_dbg(chan, "irq: Exit\n"); in fsldma_chan_irq()
982 struct fsldma_chan *chan = from_tasklet(chan, t, tasklet); in dma_do_tasklet() local
984 chan_dbg(chan, "tasklet entry\n"); in dma_do_tasklet()
986 spin_lock(&chan->desc_lock); in dma_do_tasklet()
989 chan->idle = true; in dma_do_tasklet()
992 fsldma_cleanup_descriptors(chan); in dma_do_tasklet()
994 spin_unlock(&chan->desc_lock); in dma_do_tasklet()
996 chan_dbg(chan, "tasklet exit\n"); in dma_do_tasklet()
1002 struct fsldma_chan *chan; in fsldma_ctrl_irq() local
1013 chan = fdev->chan[i]; in fsldma_ctrl_irq()
1014 if (!chan) in fsldma_ctrl_irq()
1018 dev_dbg(fdev->dev, "IRQ: chan %d\n", chan->id); in fsldma_ctrl_irq()
1019 fsldma_chan_irq(irq, chan); in fsldma_ctrl_irq()
1032 struct fsldma_chan *chan; in fsldma_free_irqs() local
1042 chan = fdev->chan[i]; in fsldma_free_irqs()
1043 if (chan && chan->irq) { in fsldma_free_irqs()
1044 chan_dbg(chan, "free per-channel IRQ\n"); in fsldma_free_irqs()
1045 free_irq(chan->irq, chan); in fsldma_free_irqs()
1052 struct fsldma_chan *chan; in fsldma_request_irqs() local
1066 chan = fdev->chan[i]; in fsldma_request_irqs()
1067 if (!chan) in fsldma_request_irqs()
1070 if (!chan->irq) { in fsldma_request_irqs()
1071 chan_err(chan, "interrupts property missing in device tree\n"); in fsldma_request_irqs()
1076 chan_dbg(chan, "request per-channel IRQ\n"); in fsldma_request_irqs()
1077 ret = request_irq(chan->irq, fsldma_chan_irq, IRQF_SHARED, in fsldma_request_irqs()
1078 "fsldma-chan", chan); in fsldma_request_irqs()
1080 chan_err(chan, "unable to request per-channel IRQ\n"); in fsldma_request_irqs()
1089 chan = fdev->chan[i]; in fsldma_request_irqs()
1090 if (!chan) in fsldma_request_irqs()
1093 if (!chan->irq) in fsldma_request_irqs()
1096 free_irq(chan->irq, chan); in fsldma_request_irqs()
1109 struct fsldma_chan *chan; in fsl_dma_chan_probe() local
1114 chan = kzalloc(sizeof(*chan), GFP_KERNEL); in fsl_dma_chan_probe()
1115 if (!chan) { in fsl_dma_chan_probe()
1121 chan->regs = of_iomap(node, 0); in fsl_dma_chan_probe()
1122 if (!chan->regs) { in fsl_dma_chan_probe()
1134 chan->feature = feature; in fsl_dma_chan_probe()
1136 fdev->feature = chan->feature; in fsl_dma_chan_probe()
1142 WARN_ON(fdev->feature != chan->feature); in fsl_dma_chan_probe()
1144 chan->dev = fdev->dev; in fsl_dma_chan_probe()
1145 chan->id = (res.start & 0xfff) < 0x300 ? in fsl_dma_chan_probe()
1148 if (chan->id >= FSL_DMA_MAX_CHANS_PER_DEVICE) { in fsl_dma_chan_probe()
1154 fdev->chan[chan->id] = chan; in fsl_dma_chan_probe()
1155 tasklet_setup(&chan->tasklet, dma_do_tasklet); in fsl_dma_chan_probe()
1156 snprintf(chan->name, sizeof(chan->name), "chan%d", chan->id); in fsl_dma_chan_probe()
1159 dma_init(chan); in fsl_dma_chan_probe()
1162 set_cdar(chan, 0); in fsl_dma_chan_probe()
1164 switch (chan->feature & FSL_DMA_IP_MASK) { in fsl_dma_chan_probe()
1166 chan->toggle_ext_pause = fsl_chan_toggle_ext_pause; in fsl_dma_chan_probe()
1169 chan->toggle_ext_start = fsl_chan_toggle_ext_start; in fsl_dma_chan_probe()
1170 chan->set_src_loop_size = fsl_chan_set_src_loop_size; in fsl_dma_chan_probe()
1171 chan->set_dst_loop_size = fsl_chan_set_dst_loop_size; in fsl_dma_chan_probe()
1172 chan->set_request_count = fsl_chan_set_request_count; in fsl_dma_chan_probe()
1175 spin_lock_init(&chan->desc_lock); in fsl_dma_chan_probe()
1176 INIT_LIST_HEAD(&chan->ld_pending); in fsl_dma_chan_probe()
1177 INIT_LIST_HEAD(&chan->ld_running); in fsl_dma_chan_probe()
1178 INIT_LIST_HEAD(&chan->ld_completed); in fsl_dma_chan_probe()
1179 chan->idle = true; in fsl_dma_chan_probe()
1181 chan->pm_state = RUNNING; in fsl_dma_chan_probe()
1184 chan->common.device = &fdev->common; in fsl_dma_chan_probe()
1185 dma_cookie_init(&chan->common); in fsl_dma_chan_probe()
1188 chan->irq = irq_of_parse_and_map(node, 0); in fsl_dma_chan_probe()
1191 list_add_tail(&chan->common.device_node, &fdev->common.channels); in fsl_dma_chan_probe()
1193 dev_info(fdev->dev, "#%d (%s), irq %d\n", chan->id, compatible, in fsl_dma_chan_probe()
1194 chan->irq ? chan->irq : fdev->irq); in fsl_dma_chan_probe()
1199 iounmap(chan->regs); in fsl_dma_chan_probe()
1201 kfree(chan); in fsl_dma_chan_probe()
1206 static void fsl_dma_chan_remove(struct fsldma_chan *chan) in fsl_dma_chan_remove() argument
1208 irq_dispose_mapping(chan->irq); in fsl_dma_chan_remove()
1209 list_del(&chan->common.device_node); in fsl_dma_chan_remove()
1210 iounmap(chan->regs); in fsl_dma_chan_remove()
1211 kfree(chan); in fsl_dma_chan_remove()
1298 if (fdev->chan[i]) in fsldma_of_probe()
1299 fsl_dma_chan_remove(fdev->chan[i]); in fsldma_of_probe()
1320 if (fdev->chan[i]) in fsldma_of_remove()
1321 fsl_dma_chan_remove(fdev->chan[i]); in fsldma_of_remove()
1335 struct fsldma_chan *chan; in fsldma_suspend_late() local
1339 chan = fdev->chan[i]; in fsldma_suspend_late()
1340 if (!chan) in fsldma_suspend_late()
1343 spin_lock_bh(&chan->desc_lock); in fsldma_suspend_late()
1344 if (unlikely(!chan->idle)) in fsldma_suspend_late()
1346 chan->regs_save.mr = get_mr(chan); in fsldma_suspend_late()
1347 chan->pm_state = SUSPENDED; in fsldma_suspend_late()
1348 spin_unlock_bh(&chan->desc_lock); in fsldma_suspend_late()
1354 chan = fdev->chan[i]; in fsldma_suspend_late()
1355 if (!chan) in fsldma_suspend_late()
1357 chan->pm_state = RUNNING; in fsldma_suspend_late()
1358 spin_unlock_bh(&chan->desc_lock); in fsldma_suspend_late()
1366 struct fsldma_chan *chan; in fsldma_resume_early() local
1371 chan = fdev->chan[i]; in fsldma_resume_early()
1372 if (!chan) in fsldma_resume_early()
1375 spin_lock_bh(&chan->desc_lock); in fsldma_resume_early()
1376 mode = chan->regs_save.mr in fsldma_resume_early()
1378 set_mr(chan, mode); in fsldma_resume_early()
1379 chan->pm_state = RUNNING; in fsldma_resume_early()
1380 spin_unlock_bh(&chan->desc_lock); in fsldma_resume_early()