Lines Matching refs:dw
68 struct dw_edma *dw = chan->chip->dw; in dw_edma_alloc_chunk() local
85 chunk->ll_region.paddr = dw->ll_region_wr[chan->id].paddr; in dw_edma_alloc_chunk()
86 chunk->ll_region.vaddr = dw->ll_region_wr[chan->id].vaddr; in dw_edma_alloc_chunk()
88 chunk->ll_region.paddr = dw->ll_region_rd[chan->id].paddr; in dw_edma_alloc_chunk()
89 chunk->ll_region.vaddr = dw->ll_region_rd[chan->id].vaddr; in dw_edma_alloc_chunk()
603 struct dw_edma *dw = dw_irq->dw; in dw_edma_interrupt() local
609 total = dw->wr_ch_cnt; in dw_edma_interrupt()
613 total = dw->rd_ch_cnt; in dw_edma_interrupt()
614 off = dw->wr_ch_cnt; in dw_edma_interrupt()
618 val = dw_edma_v0_core_status_done_int(dw, write ? in dw_edma_interrupt()
623 struct dw_edma_chan *chan = &dw->chan[pos + off]; in dw_edma_interrupt()
628 val = dw_edma_v0_core_status_abort_int(dw, write ? in dw_edma_interrupt()
633 struct dw_edma_chan *chan = &dw->chan[pos + off]; in dw_edma_interrupt()
696 struct dw_edma *dw = chip->dw; in dw_edma_channel_setup() local
707 cnt = dw->wr_ch_cnt; in dw_edma_channel_setup()
708 dma = &dw->wr_edma; in dw_edma_channel_setup()
712 i = dw->wr_ch_cnt; in dw_edma_channel_setup()
713 cnt = dw->rd_ch_cnt; in dw_edma_channel_setup()
714 dma = &dw->rd_edma; in dw_edma_channel_setup()
720 for (j = 0; (alloc || dw->nr_irqs == 1) && j < cnt; j++, i++) { in dw_edma_channel_setup()
721 chan = &dw->chan[i]; in dw_edma_channel_setup()
737 chan->ll_max = (dw->ll_region_wr[j].sz / EDMA_LL_SZ); in dw_edma_channel_setup()
739 chan->ll_max = (dw->ll_region_rd[j].sz / EDMA_LL_SZ); in dw_edma_channel_setup()
745 if (dw->nr_irqs == 1) in dw_edma_channel_setup()
750 irq = &dw->irq[pos]; in dw_edma_channel_setup()
757 irq->dw = dw; in dw_edma_channel_setup()
769 dt_region->paddr = dw->dt_region_wr[j].paddr; in dw_edma_channel_setup()
770 dt_region->vaddr = dw->dt_region_wr[j].vaddr; in dw_edma_channel_setup()
771 dt_region->sz = dw->dt_region_wr[j].sz; in dw_edma_channel_setup()
773 dt_region->paddr = dw->dt_region_rd[j].paddr; in dw_edma_channel_setup()
774 dt_region->vaddr = dw->dt_region_rd[j].vaddr; in dw_edma_channel_setup()
775 dt_region->sz = dw->dt_region_rd[j].sz; in dw_edma_channel_setup()
833 struct dw_edma *dw = chip->dw; in dw_edma_irq_request() local
840 ch_cnt = dw->wr_ch_cnt + dw->rd_ch_cnt; in dw_edma_irq_request()
842 if (dw->nr_irqs < 1) in dw_edma_irq_request()
845 if (dw->nr_irqs == 1) { in dw_edma_irq_request()
847 irq = dw->ops->irq_vector(dev, 0); in dw_edma_irq_request()
849 IRQF_SHARED, dw->name, &dw->irq[0]); in dw_edma_irq_request()
851 dw->nr_irqs = 0; in dw_edma_irq_request()
856 get_cached_msi_msg(irq, &dw->irq[0].msi); in dw_edma_irq_request()
859 int tmp = dw->nr_irqs; in dw_edma_irq_request()
862 dw_edma_dec_irq_alloc(&tmp, wr_alloc, dw->wr_ch_cnt); in dw_edma_irq_request()
863 dw_edma_dec_irq_alloc(&tmp, rd_alloc, dw->rd_ch_cnt); in dw_edma_irq_request()
866 dw_edma_add_irq_mask(&wr_mask, *wr_alloc, dw->wr_ch_cnt); in dw_edma_irq_request()
867 dw_edma_add_irq_mask(&rd_mask, *rd_alloc, dw->rd_ch_cnt); in dw_edma_irq_request()
870 irq = dw->ops->irq_vector(dev, i); in dw_edma_irq_request()
875 IRQF_SHARED, dw->name, in dw_edma_irq_request()
876 &dw->irq[i]); in dw_edma_irq_request()
878 dw->nr_irqs = i; in dw_edma_irq_request()
883 get_cached_msi_msg(irq, &dw->irq[i].msi); in dw_edma_irq_request()
886 dw->nr_irqs = i; in dw_edma_irq_request()
895 struct dw_edma *dw; in dw_edma_probe() local
907 dw = chip->dw; in dw_edma_probe()
908 if (!dw || !dw->irq || !dw->ops || !dw->ops->irq_vector) in dw_edma_probe()
911 raw_spin_lock_init(&dw->lock); in dw_edma_probe()
913 dw->wr_ch_cnt = min_t(u16, dw->wr_ch_cnt, in dw_edma_probe()
914 dw_edma_v0_core_ch_count(dw, EDMA_DIR_WRITE)); in dw_edma_probe()
915 dw->wr_ch_cnt = min_t(u16, dw->wr_ch_cnt, EDMA_MAX_WR_CH); in dw_edma_probe()
917 dw->rd_ch_cnt = min_t(u16, dw->rd_ch_cnt, in dw_edma_probe()
918 dw_edma_v0_core_ch_count(dw, EDMA_DIR_READ)); in dw_edma_probe()
919 dw->rd_ch_cnt = min_t(u16, dw->rd_ch_cnt, EDMA_MAX_RD_CH); in dw_edma_probe()
921 if (!dw->wr_ch_cnt && !dw->rd_ch_cnt) in dw_edma_probe()
925 dw->wr_ch_cnt, dw->rd_ch_cnt); in dw_edma_probe()
928 dw->chan = devm_kcalloc(dev, dw->wr_ch_cnt + dw->rd_ch_cnt, in dw_edma_probe()
929 sizeof(*dw->chan), GFP_KERNEL); in dw_edma_probe()
930 if (!dw->chan) in dw_edma_probe()
933 snprintf(dw->name, sizeof(dw->name), "dw-edma-core:%d", chip->id); in dw_edma_probe()
936 dw_edma_v0_core_off(dw); in dw_edma_probe()
962 for (i = (dw->nr_irqs - 1); i >= 0; i--) in dw_edma_probe()
963 free_irq(dw->ops->irq_vector(dev, i), &dw->irq[i]); in dw_edma_probe()
965 dw->nr_irqs = 0; in dw_edma_probe()
975 struct dw_edma *dw = chip->dw; in dw_edma_remove() local
979 dw_edma_v0_core_off(dw); in dw_edma_remove()
982 for (i = (dw->nr_irqs - 1); i >= 0; i--) in dw_edma_remove()
983 free_irq(dw->ops->irq_vector(dev, i), &dw->irq[i]); in dw_edma_remove()
989 dma_async_device_unregister(&dw->wr_edma); in dw_edma_remove()
990 list_for_each_entry_safe(chan, _chan, &dw->wr_edma.channels, in dw_edma_remove()
996 dma_async_device_unregister(&dw->rd_edma); in dw_edma_remove()
997 list_for_each_entry_safe(chan, _chan, &dw->rd_edma.channels, in dw_edma_remove()