imxdmac 242 drivers/dma/imx-dma.c static inline bool imxdma_chan_is_doing_cyclic(struct imxdma_channel *imxdmac) imxdmac 246 drivers/dma/imx-dma.c if (!list_empty(&imxdmac->ld_active)) { imxdmac 247 drivers/dma/imx-dma.c desc = list_first_entry(&imxdmac->ld_active, struct imxdma_desc, imxdmac 268 drivers/dma/imx-dma.c static int imxdma_hw_chain(struct imxdma_channel *imxdmac) imxdmac 270 drivers/dma/imx-dma.c struct imxdma_engine *imxdma = imxdmac->imxdma; imxdmac 273 drivers/dma/imx-dma.c return imxdmac->hw_chaining; imxdmac 283 drivers/dma/imx-dma.c struct imxdma_channel *imxdmac = to_imxdma_chan(d->desc.chan); imxdmac 284 drivers/dma/imx-dma.c struct imxdma_engine *imxdma = imxdmac->imxdma; imxdmac 294 drivers/dma/imx-dma.c DMA_DAR(imxdmac->channel)); imxdmac 297 drivers/dma/imx-dma.c DMA_SAR(imxdmac->channel)); imxdmac 299 drivers/dma/imx-dma.c imx_dmav1_writel(imxdma, now, DMA_CNTR(imxdmac->channel)); imxdmac 302 drivers/dma/imx-dma.c "size 0x%08x\n", __func__, imxdmac->channel, imxdmac 303 drivers/dma/imx-dma.c imx_dmav1_readl(imxdma, DMA_DAR(imxdmac->channel)), imxdmac 304 drivers/dma/imx-dma.c imx_dmav1_readl(imxdma, DMA_SAR(imxdmac->channel)), imxdmac 305 drivers/dma/imx-dma.c imx_dmav1_readl(imxdma, DMA_CNTR(imxdmac->channel))); imxdmac 310 drivers/dma/imx-dma.c struct imxdma_channel *imxdmac = to_imxdma_chan(d->desc.chan); imxdmac 311 drivers/dma/imx-dma.c struct imxdma_engine *imxdma = imxdmac->imxdma; imxdmac 312 drivers/dma/imx-dma.c int channel = imxdmac->channel; imxdmac 326 drivers/dma/imx-dma.c d->sg && imxdma_hw_chain(imxdmac)) { imxdmac 340 drivers/dma/imx-dma.c static void imxdma_disable_hw(struct imxdma_channel *imxdmac) imxdmac 342 drivers/dma/imx-dma.c struct imxdma_engine *imxdma = imxdmac->imxdma; imxdmac 343 drivers/dma/imx-dma.c int channel = imxdmac->channel; imxdmac 348 drivers/dma/imx-dma.c if (imxdma_hw_chain(imxdmac)) imxdmac 349 drivers/dma/imx-dma.c del_timer(&imxdmac->watchdog); imxdmac 362 drivers/dma/imx-dma.c struct imxdma_channel *imxdmac = from_timer(imxdmac, t, watchdog); imxdmac 363 drivers/dma/imx-dma.c struct imxdma_engine *imxdma = imxdmac->imxdma; imxdmac 364 drivers/dma/imx-dma.c int channel = imxdmac->channel; imxdmac 369 drivers/dma/imx-dma.c tasklet_schedule(&imxdmac->dma_tasklet); imxdmac 371 drivers/dma/imx-dma.c imxdmac->channel); imxdmac 427 drivers/dma/imx-dma.c static void dma_irq_handle_channel(struct imxdma_channel *imxdmac) imxdmac 429 drivers/dma/imx-dma.c struct imxdma_engine *imxdma = imxdmac->imxdma; imxdmac 430 drivers/dma/imx-dma.c int chno = imxdmac->channel; imxdmac 435 drivers/dma/imx-dma.c if (list_empty(&imxdmac->ld_active)) { imxdmac 440 drivers/dma/imx-dma.c desc = list_first_entry(&imxdmac->ld_active, imxdmac 454 drivers/dma/imx-dma.c if (imxdma_hw_chain(imxdmac)) { imxdmac 458 drivers/dma/imx-dma.c mod_timer(&imxdmac->watchdog, imxdmac 471 drivers/dma/imx-dma.c if (imxdma_chan_is_doing_cyclic(imxdmac)) imxdmac 473 drivers/dma/imx-dma.c tasklet_schedule(&imxdmac->dma_tasklet); imxdmac 478 drivers/dma/imx-dma.c if (imxdma_hw_chain(imxdmac)) { imxdmac 479 drivers/dma/imx-dma.c del_timer(&imxdmac->watchdog); imxdmac 487 drivers/dma/imx-dma.c tasklet_schedule(&imxdmac->dma_tasklet); imxdmac 513 drivers/dma/imx-dma.c struct imxdma_channel *imxdmac = to_imxdma_chan(d->desc.chan); imxdmac 514 drivers/dma/imx-dma.c struct imxdma_engine *imxdma = imxdmac->imxdma; imxdmac 539 drivers/dma/imx-dma.c imxdmac->slot_2d = slot; imxdmac 540 drivers/dma/imx-dma.c imxdmac->enabled_2d = true; imxdmac 561 drivers/dma/imx-dma.c imx_dmav1_writel(imxdma, d->src, DMA_SAR(imxdmac->channel)); imxdmac 562 drivers/dma/imx-dma.c imx_dmav1_writel(imxdma, d->dest, DMA_DAR(imxdmac->channel)); imxdmac 564 drivers/dma/imx-dma.c DMA_CCR(imxdmac->channel)); imxdmac 566 drivers/dma/imx-dma.c imx_dmav1_writel(imxdma, d->len, DMA_CNTR(imxdmac->channel)); imxdmac 570 drivers/dma/imx-dma.c __func__, imxdmac->channel, imxdmac 579 drivers/dma/imx-dma.c imx_dmav1_writel(imxdma, imxdmac->per_address, imxdmac 580 drivers/dma/imx-dma.c DMA_SAR(imxdmac->channel)); imxdmac 581 drivers/dma/imx-dma.c imx_dmav1_writel(imxdma, imxdmac->ccr_from_device, imxdmac 582 drivers/dma/imx-dma.c DMA_CCR(imxdmac->channel)); imxdmac 586 drivers/dma/imx-dma.c __func__, imxdmac->channel, imxdmac 588 drivers/dma/imx-dma.c (unsigned long long)imxdmac->per_address); imxdmac 590 drivers/dma/imx-dma.c imx_dmav1_writel(imxdma, imxdmac->per_address, imxdmac 591 drivers/dma/imx-dma.c DMA_DAR(imxdmac->channel)); imxdmac 592 drivers/dma/imx-dma.c imx_dmav1_writel(imxdma, imxdmac->ccr_to_device, imxdmac 593 drivers/dma/imx-dma.c DMA_CCR(imxdmac->channel)); imxdmac 597 drivers/dma/imx-dma.c __func__, imxdmac->channel, imxdmac 599 drivers/dma/imx-dma.c (unsigned long long)imxdmac->per_address); imxdmac 602 drivers/dma/imx-dma.c __func__, imxdmac->channel); imxdmac 618 drivers/dma/imx-dma.c struct imxdma_channel *imxdmac = (void *)data; imxdmac 619 drivers/dma/imx-dma.c struct imxdma_engine *imxdma = imxdmac->imxdma; imxdmac 625 drivers/dma/imx-dma.c if (list_empty(&imxdmac->ld_active)) { imxdmac 630 drivers/dma/imx-dma.c desc = list_first_entry(&imxdmac->ld_active, struct imxdma_desc, node); imxdmac 636 drivers/dma/imx-dma.c if (imxdma_chan_is_doing_cyclic(imxdmac)) imxdmac 642 drivers/dma/imx-dma.c if (imxdmac->enabled_2d) { imxdmac 643 drivers/dma/imx-dma.c imxdma->slots_2d[imxdmac->slot_2d].count--; imxdmac 644 drivers/dma/imx-dma.c imxdmac->enabled_2d = false; imxdmac 647 drivers/dma/imx-dma.c list_move_tail(imxdmac->ld_active.next, &imxdmac->ld_free); imxdmac 649 drivers/dma/imx-dma.c if (!list_empty(&imxdmac->ld_queue)) { imxdmac 650 drivers/dma/imx-dma.c next_desc = list_first_entry(&imxdmac->ld_queue, imxdmac 652 drivers/dma/imx-dma.c list_move_tail(imxdmac->ld_queue.next, &imxdmac->ld_active); imxdmac 655 drivers/dma/imx-dma.c __func__, imxdmac->channel); imxdmac 665 drivers/dma/imx-dma.c struct imxdma_channel *imxdmac = to_imxdma_chan(chan); imxdmac 666 drivers/dma/imx-dma.c struct imxdma_engine *imxdma = imxdmac->imxdma; imxdmac 669 drivers/dma/imx-dma.c imxdma_disable_hw(imxdmac); imxdmac 672 drivers/dma/imx-dma.c list_splice_tail_init(&imxdmac->ld_active, &imxdmac->ld_free); imxdmac 673 drivers/dma/imx-dma.c list_splice_tail_init(&imxdmac->ld_queue, &imxdmac->ld_free); imxdmac 682 drivers/dma/imx-dma.c struct imxdma_channel *imxdmac = to_imxdma_chan(chan); imxdmac 683 drivers/dma/imx-dma.c struct imxdma_engine *imxdma = imxdmac->imxdma; imxdmac 687 drivers/dma/imx-dma.c imxdmac->per_address = dmaengine_cfg->src_addr; imxdmac 688 drivers/dma/imx-dma.c imxdmac->watermark_level = dmaengine_cfg->src_maxburst; imxdmac 689 drivers/dma/imx-dma.c imxdmac->word_size = dmaengine_cfg->src_addr_width; imxdmac 691 drivers/dma/imx-dma.c imxdmac->per_address = dmaengine_cfg->dst_addr; imxdmac 692 drivers/dma/imx-dma.c imxdmac->watermark_level = dmaengine_cfg->dst_maxburst; imxdmac 693 drivers/dma/imx-dma.c imxdmac->word_size = dmaengine_cfg->dst_addr_width; imxdmac 696 drivers/dma/imx-dma.c switch (imxdmac->word_size) { imxdmac 709 drivers/dma/imx-dma.c imxdmac->hw_chaining = 0; imxdmac 711 drivers/dma/imx-dma.c imxdmac->ccr_from_device = (mode | IMX_DMA_TYPE_FIFO) | imxdmac 714 drivers/dma/imx-dma.c imxdmac->ccr_to_device = imxdmac 717 drivers/dma/imx-dma.c imx_dmav1_writel(imxdma, imxdmac->dma_request, imxdmac 718 drivers/dma/imx-dma.c DMA_RSSR(imxdmac->channel)); imxdmac 721 drivers/dma/imx-dma.c imx_dmav1_writel(imxdma, imxdmac->watermark_level * imxdmac 722 drivers/dma/imx-dma.c imxdmac->word_size, DMA_BLR(imxdmac->channel)); imxdmac 730 drivers/dma/imx-dma.c struct imxdma_channel *imxdmac = to_imxdma_chan(chan); imxdmac 732 drivers/dma/imx-dma.c memcpy(&imxdmac->config, dmaengine_cfg, sizeof(*dmaengine_cfg)); imxdmac 746 drivers/dma/imx-dma.c struct imxdma_channel *imxdmac = to_imxdma_chan(tx->chan); imxdmac 747 drivers/dma/imx-dma.c struct imxdma_engine *imxdma = imxdmac->imxdma; imxdmac 752 drivers/dma/imx-dma.c list_move_tail(imxdmac->ld_free.next, &imxdmac->ld_queue); imxdmac 761 drivers/dma/imx-dma.c struct imxdma_channel *imxdmac = to_imxdma_chan(chan); imxdmac 765 drivers/dma/imx-dma.c imxdmac->dma_request = data->dma_request; imxdmac 767 drivers/dma/imx-dma.c while (imxdmac->descs_allocated < IMXDMA_MAX_CHAN_DESCRIPTORS) { imxdmac 780 drivers/dma/imx-dma.c list_add_tail(&desc->node, &imxdmac->ld_free); imxdmac 781 drivers/dma/imx-dma.c imxdmac->descs_allocated++; imxdmac 784 drivers/dma/imx-dma.c if (!imxdmac->descs_allocated) imxdmac 787 drivers/dma/imx-dma.c return imxdmac->descs_allocated; imxdmac 792 drivers/dma/imx-dma.c struct imxdma_channel *imxdmac = to_imxdma_chan(chan); imxdmac 793 drivers/dma/imx-dma.c struct imxdma_engine *imxdma = imxdmac->imxdma; imxdmac 799 drivers/dma/imx-dma.c imxdma_disable_hw(imxdmac); imxdmac 800 drivers/dma/imx-dma.c list_splice_tail_init(&imxdmac->ld_active, &imxdmac->ld_free); imxdmac 801 drivers/dma/imx-dma.c list_splice_tail_init(&imxdmac->ld_queue, &imxdmac->ld_free); imxdmac 805 drivers/dma/imx-dma.c list_for_each_entry_safe(desc, _desc, &imxdmac->ld_free, node) { imxdmac 807 drivers/dma/imx-dma.c imxdmac->descs_allocated--; imxdmac 809 drivers/dma/imx-dma.c INIT_LIST_HEAD(&imxdmac->ld_free); imxdmac 811 drivers/dma/imx-dma.c kfree(imxdmac->sg_list); imxdmac 812 drivers/dma/imx-dma.c imxdmac->sg_list = NULL; imxdmac 820 drivers/dma/imx-dma.c struct imxdma_channel *imxdmac = to_imxdma_chan(chan); imxdmac 825 drivers/dma/imx-dma.c if (list_empty(&imxdmac->ld_free) || imxdmac 826 drivers/dma/imx-dma.c imxdma_chan_is_doing_cyclic(imxdmac)) imxdmac 829 drivers/dma/imx-dma.c desc = list_first_entry(&imxdmac->ld_free, struct imxdma_desc, node); imxdmac 835 drivers/dma/imx-dma.c switch (imxdmac->word_size) { imxdmac 856 drivers/dma/imx-dma.c desc->src = imxdmac->per_address; imxdmac 858 drivers/dma/imx-dma.c desc->dest = imxdmac->per_address; imxdmac 871 drivers/dma/imx-dma.c struct imxdma_channel *imxdmac = to_imxdma_chan(chan); imxdmac 872 drivers/dma/imx-dma.c struct imxdma_engine *imxdma = imxdmac->imxdma; imxdmac 878 drivers/dma/imx-dma.c __func__, imxdmac->channel, buf_len, period_len); imxdmac 880 drivers/dma/imx-dma.c if (list_empty(&imxdmac->ld_free) || imxdmac 881 drivers/dma/imx-dma.c imxdma_chan_is_doing_cyclic(imxdmac)) imxdmac 884 drivers/dma/imx-dma.c desc = list_first_entry(&imxdmac->ld_free, struct imxdma_desc, node); imxdmac 886 drivers/dma/imx-dma.c kfree(imxdmac->sg_list); imxdmac 888 drivers/dma/imx-dma.c imxdmac->sg_list = kcalloc(periods + 1, imxdmac 890 drivers/dma/imx-dma.c if (!imxdmac->sg_list) imxdmac 893 drivers/dma/imx-dma.c sg_init_table(imxdmac->sg_list, periods); imxdmac 896 drivers/dma/imx-dma.c sg_assign_page(&imxdmac->sg_list[i], NULL); imxdmac 897 drivers/dma/imx-dma.c imxdmac->sg_list[i].offset = 0; imxdmac 898 drivers/dma/imx-dma.c imxdmac->sg_list[i].dma_address = dma_addr; imxdmac 899 drivers/dma/imx-dma.c sg_dma_len(&imxdmac->sg_list[i]) = period_len; imxdmac 904 drivers/dma/imx-dma.c sg_chain(imxdmac->sg_list, periods + 1, imxdmac->sg_list); imxdmac 907 drivers/dma/imx-dma.c desc->sg = imxdmac->sg_list; imxdmac 912 drivers/dma/imx-dma.c desc->src = imxdmac->per_address; imxdmac 914 drivers/dma/imx-dma.c desc->dest = imxdmac->per_address; imxdmac 919 drivers/dma/imx-dma.c imxdma_config_write(chan, &imxdmac->config, direction); imxdmac 928 drivers/dma/imx-dma.c struct imxdma_channel *imxdmac = to_imxdma_chan(chan); imxdmac 929 drivers/dma/imx-dma.c struct imxdma_engine *imxdma = imxdmac->imxdma; imxdmac 933 drivers/dma/imx-dma.c __func__, imxdmac->channel, (unsigned long long)src, imxdmac 936 drivers/dma/imx-dma.c if (list_empty(&imxdmac->ld_free) || imxdmac 937 drivers/dma/imx-dma.c imxdma_chan_is_doing_cyclic(imxdmac)) imxdmac 940 drivers/dma/imx-dma.c desc = list_first_entry(&imxdmac->ld_free, struct imxdma_desc, node); imxdmac 959 drivers/dma/imx-dma.c struct imxdma_channel *imxdmac = to_imxdma_chan(chan); imxdmac 960 drivers/dma/imx-dma.c struct imxdma_engine *imxdma = imxdmac->imxdma; imxdmac 965 drivers/dma/imx-dma.c imxdmac->channel, (unsigned long long)xt->src_start, imxdmac 970 drivers/dma/imx-dma.c if (list_empty(&imxdmac->ld_free) || imxdmac 971 drivers/dma/imx-dma.c imxdma_chan_is_doing_cyclic(imxdmac)) imxdmac 977 drivers/dma/imx-dma.c desc = list_first_entry(&imxdmac->ld_free, struct imxdma_desc, node); imxdmac 1001 drivers/dma/imx-dma.c struct imxdma_channel *imxdmac = to_imxdma_chan(chan); imxdmac 1002 drivers/dma/imx-dma.c struct imxdma_engine *imxdma = imxdmac->imxdma; imxdmac 1007 drivers/dma/imx-dma.c if (list_empty(&imxdmac->ld_active) && imxdmac 1008 drivers/dma/imx-dma.c !list_empty(&imxdmac->ld_queue)) { imxdmac 1009 drivers/dma/imx-dma.c desc = list_first_entry(&imxdmac->ld_queue, imxdmac 1015 drivers/dma/imx-dma.c __func__, imxdmac->channel); imxdmac 1017 drivers/dma/imx-dma.c list_move_tail(imxdmac->ld_queue.next, imxdmac 1018 drivers/dma/imx-dma.c &imxdmac->ld_active); imxdmac 1150 drivers/dma/imx-dma.c struct imxdma_channel *imxdmac = &imxdma->channel[i]; imxdmac 1162 drivers/dma/imx-dma.c imxdmac->irq = irq + i; imxdmac 1163 drivers/dma/imx-dma.c timer_setup(&imxdmac->watchdog, imxdma_watchdog, 0); imxdmac 1166 drivers/dma/imx-dma.c imxdmac->imxdma = imxdma; imxdmac 1168 drivers/dma/imx-dma.c INIT_LIST_HEAD(&imxdmac->ld_queue); imxdmac 1169 drivers/dma/imx-dma.c INIT_LIST_HEAD(&imxdmac->ld_free); imxdmac 1170 drivers/dma/imx-dma.c INIT_LIST_HEAD(&imxdmac->ld_active); imxdmac 1172 drivers/dma/imx-dma.c tasklet_init(&imxdmac->dma_tasklet, imxdma_tasklet, imxdmac 1173 drivers/dma/imx-dma.c (unsigned long)imxdmac); imxdmac 1174 drivers/dma/imx-dma.c imxdmac->chan.device = &imxdma->dma_device; imxdmac 1175 drivers/dma/imx-dma.c dma_cookie_init(&imxdmac->chan); imxdmac 1176 drivers/dma/imx-dma.c imxdmac->channel = i; imxdmac 1179 drivers/dma/imx-dma.c list_add_tail(&imxdmac->chan.device_node, imxdmac 1238 drivers/dma/imx-dma.c struct imxdma_channel *imxdmac = &imxdma->channel[i]; imxdmac 1241 drivers/dma/imx-dma.c disable_irq(imxdmac->irq); imxdmac 1243 drivers/dma/imx-dma.c tasklet_kill(&imxdmac->dma_tasklet);