jzdma 182 drivers/dma/dma-jz4780.c static inline uint32_t jz4780_dma_chn_readl(struct jz4780_dma_dev *jzdma, jzdma 185 drivers/dma/dma-jz4780.c return readl(jzdma->chn_base + reg + JZ_DMA_REG_CHAN(chn)); jzdma 188 drivers/dma/dma-jz4780.c static inline void jz4780_dma_chn_writel(struct jz4780_dma_dev *jzdma, jzdma 191 drivers/dma/dma-jz4780.c writel(val, jzdma->chn_base + reg + JZ_DMA_REG_CHAN(chn)); jzdma 194 drivers/dma/dma-jz4780.c static inline uint32_t jz4780_dma_ctrl_readl(struct jz4780_dma_dev *jzdma, jzdma 197 drivers/dma/dma-jz4780.c return readl(jzdma->ctrl_base + reg); jzdma 200 drivers/dma/dma-jz4780.c static inline void jz4780_dma_ctrl_writel(struct jz4780_dma_dev *jzdma, jzdma 203 drivers/dma/dma-jz4780.c writel(val, jzdma->ctrl_base + reg); jzdma 206 drivers/dma/dma-jz4780.c static inline void jz4780_dma_chan_enable(struct jz4780_dma_dev *jzdma, jzdma 209 drivers/dma/dma-jz4780.c if (jzdma->soc_data->flags & JZ_SOC_DATA_PER_CHAN_PM) { jzdma 212 drivers/dma/dma-jz4780.c if (jzdma->soc_data->flags & JZ_SOC_DATA_NO_DCKES_DCKEC) jzdma 217 drivers/dma/dma-jz4780.c jz4780_dma_ctrl_writel(jzdma, reg, BIT(chn)); jzdma 221 drivers/dma/dma-jz4780.c static inline void jz4780_dma_chan_disable(struct jz4780_dma_dev *jzdma, jzdma 224 drivers/dma/dma-jz4780.c if ((jzdma->soc_data->flags & JZ_SOC_DATA_PER_CHAN_PM) && jzdma 225 drivers/dma/dma-jz4780.c !(jzdma->soc_data->flags & JZ_SOC_DATA_NO_DCKES_DCKEC)) jzdma 226 drivers/dma/dma-jz4780.c jz4780_dma_ctrl_writel(jzdma, JZ_DMA_REG_DCKEC, BIT(chn)); jzdma 266 drivers/dma/dma-jz4780.c struct jz4780_dma_dev *jzdma = jz4780_dma_chan_parent(jzchan); jzdma 278 drivers/dma/dma-jz4780.c else if (ord > jzdma->soc_data->transfer_ord_max) jzdma 279 drivers/dma/dma-jz4780.c ord = jzdma->soc_data->transfer_ord_max; jzdma 359 drivers/dma/dma-jz4780.c struct jz4780_dma_dev *jzdma = jz4780_dma_chan_parent(jzchan); jzdma 381 drivers/dma/dma-jz4780.c !(jzdma->soc_data->flags & JZ_SOC_DATA_BREAK_LINKS)) { jzdma 480 drivers/dma/dma-jz4780.c struct jz4780_dma_dev *jzdma = jz4780_dma_chan_parent(jzchan); jzdma 524 drivers/dma/dma-jz4780.c jz4780_dma_chan_enable(jzdma, jzchan->id); jzdma 527 drivers/dma/dma-jz4780.c jz4780_dma_chn_writel(jzdma, jzchan->id, JZ_DMA_REG_DCS, 0); jzdma 530 drivers/dma/dma-jz4780.c jz4780_dma_chn_writel(jzdma, jzchan->id, JZ_DMA_REG_DRT, jzdma 539 drivers/dma/dma-jz4780.c jz4780_dma_chn_writel(jzdma, jzchan->id, JZ_DMA_REG_DTC, jzdma 545 drivers/dma/dma-jz4780.c jz4780_dma_chn_writel(jzdma, jzchan->id, JZ_DMA_REG_DDA, desc_phys); jzdma 546 drivers/dma/dma-jz4780.c jz4780_dma_ctrl_writel(jzdma, JZ_DMA_REG_DDRS, BIT(jzchan->id)); jzdma 549 drivers/dma/dma-jz4780.c jz4780_dma_chn_writel(jzdma, jzchan->id, JZ_DMA_REG_DCS, jzdma 569 drivers/dma/dma-jz4780.c struct jz4780_dma_dev *jzdma = jz4780_dma_chan_parent(jzchan); jzdma 576 drivers/dma/dma-jz4780.c jz4780_dma_chn_writel(jzdma, jzchan->id, JZ_DMA_REG_DCS, 0); jzdma 582 drivers/dma/dma-jz4780.c jz4780_dma_chan_disable(jzdma, jzchan->id); jzdma 595 drivers/dma/dma-jz4780.c struct jz4780_dma_dev *jzdma = jz4780_dma_chan_parent(jzchan); jzdma 598 drivers/dma/dma-jz4780.c jz4780_dma_chan_disable(jzdma, jzchan->id); jzdma 619 drivers/dma/dma-jz4780.c struct jz4780_dma_dev *jzdma = jz4780_dma_chan_parent(jzchan); jzdma 627 drivers/dma/dma-jz4780.c count += jz4780_dma_chn_readl(jzdma, jzchan->id, jzdma 667 drivers/dma/dma-jz4780.c static bool jz4780_dma_chan_irq(struct jz4780_dma_dev *jzdma, jzdma 670 drivers/dma/dma-jz4780.c const unsigned int soc_flags = jzdma->soc_data->flags; jzdma 677 drivers/dma/dma-jz4780.c dcs = jz4780_dma_chn_readl(jzdma, jzchan->id, JZ_DMA_REG_DCS); jzdma 678 drivers/dma/dma-jz4780.c jz4780_dma_chn_writel(jzdma, jzchan->id, JZ_DMA_REG_DCS, 0); jzdma 709 drivers/dma/dma-jz4780.c jz4780_dma_chn_writel(jzdma, jzchan->id, jzdma 726 drivers/dma/dma-jz4780.c struct jz4780_dma_dev *jzdma = data; jzdma 727 drivers/dma/dma-jz4780.c unsigned int nb_channels = jzdma->soc_data->nb_channels; jzdma 732 drivers/dma/dma-jz4780.c pending = jz4780_dma_ctrl_readl(jzdma, JZ_DMA_REG_DIRQP); jzdma 735 drivers/dma/dma-jz4780.c if (jz4780_dma_chan_irq(jzdma, &jzdma->chan[i])) jzdma 740 drivers/dma/dma-jz4780.c dmac = jz4780_dma_ctrl_readl(jzdma, JZ_DMA_REG_DMAC); jzdma 742 drivers/dma/dma-jz4780.c jz4780_dma_ctrl_writel(jzdma, JZ_DMA_REG_DMAC, dmac); jzdma 745 drivers/dma/dma-jz4780.c jz4780_dma_ctrl_writel(jzdma, JZ_DMA_REG_DIRQP, pending); jzdma 779 drivers/dma/dma-jz4780.c struct jz4780_dma_dev *jzdma = jz4780_dma_chan_parent(jzchan); jzdma 786 drivers/dma/dma-jz4780.c } else if (jzdma->chan_reserved & BIT(jzchan->id)) { jzdma 798 drivers/dma/dma-jz4780.c struct jz4780_dma_dev *jzdma = ofdma->of_dma_data; jzdma 799 drivers/dma/dma-jz4780.c dma_cap_mask_t mask = jzdma->dma_device.cap_mask; jzdma 809 drivers/dma/dma-jz4780.c if (data.channel >= jzdma->soc_data->nb_channels) { jzdma 810 drivers/dma/dma-jz4780.c dev_err(jzdma->dma_device.dev, jzdma 817 drivers/dma/dma-jz4780.c if (!(jzdma->chan_reserved & BIT(data.channel))) { jzdma 818 drivers/dma/dma-jz4780.c dev_err(jzdma->dma_device.dev, jzdma 824 drivers/dma/dma-jz4780.c jzdma->chan[data.channel].transfer_type = data.transfer_type; jzdma 827 drivers/dma/dma-jz4780.c &jzdma->chan[data.channel].vchan.chan); jzdma 838 drivers/dma/dma-jz4780.c struct jz4780_dma_dev *jzdma; jzdma 853 drivers/dma/dma-jz4780.c jzdma = devm_kzalloc(dev, struct_size(jzdma, chan, jzdma 855 drivers/dma/dma-jz4780.c if (!jzdma) jzdma 858 drivers/dma/dma-jz4780.c jzdma->soc_data = soc_data; jzdma 859 drivers/dma/dma-jz4780.c platform_set_drvdata(pdev, jzdma); jzdma 867 drivers/dma/dma-jz4780.c jzdma->chn_base = devm_ioremap_resource(dev, res); jzdma 868 drivers/dma/dma-jz4780.c if (IS_ERR(jzdma->chn_base)) jzdma 869 drivers/dma/dma-jz4780.c return PTR_ERR(jzdma->chn_base); jzdma 873 drivers/dma/dma-jz4780.c jzdma->ctrl_base = devm_ioremap_resource(dev, res); jzdma 874 drivers/dma/dma-jz4780.c if (IS_ERR(jzdma->ctrl_base)) jzdma 875 drivers/dma/dma-jz4780.c return PTR_ERR(jzdma->ctrl_base); jzdma 882 drivers/dma/dma-jz4780.c jzdma->ctrl_base = jzdma->chn_base + JZ4780_DMA_CTRL_OFFSET; jzdma 892 drivers/dma/dma-jz4780.c jzdma->irq = ret; jzdma 894 drivers/dma/dma-jz4780.c ret = request_irq(jzdma->irq, jz4780_dma_irq_handler, 0, dev_name(dev), jzdma 895 drivers/dma/dma-jz4780.c jzdma); jzdma 897 drivers/dma/dma-jz4780.c dev_err(dev, "failed to request IRQ %u!\n", jzdma->irq); jzdma 901 drivers/dma/dma-jz4780.c jzdma->clk = devm_clk_get(dev, NULL); jzdma 902 drivers/dma/dma-jz4780.c if (IS_ERR(jzdma->clk)) { jzdma 904 drivers/dma/dma-jz4780.c ret = PTR_ERR(jzdma->clk); jzdma 908 drivers/dma/dma-jz4780.c clk_prepare_enable(jzdma->clk); jzdma 912 drivers/dma/dma-jz4780.c 0, &jzdma->chan_reserved); jzdma 914 drivers/dma/dma-jz4780.c dd = &jzdma->dma_device; jzdma 942 drivers/dma/dma-jz4780.c jz4780_dma_ctrl_writel(jzdma, JZ_DMA_REG_DMAC, JZ_DMA_DMAC_DMAE | jzdma 946 drivers/dma/dma-jz4780.c jz4780_dma_ctrl_writel(jzdma, JZ_DMA_REG_DMACP, 0); jzdma 951 drivers/dma/dma-jz4780.c jzchan = &jzdma->chan[i]; jzdma 966 drivers/dma/dma-jz4780.c jzdma); jzdma 976 drivers/dma/dma-jz4780.c clk_disable_unprepare(jzdma->clk); jzdma 979 drivers/dma/dma-jz4780.c free_irq(jzdma->irq, jzdma); jzdma 985 drivers/dma/dma-jz4780.c struct jz4780_dma_dev *jzdma = platform_get_drvdata(pdev); jzdma 990 drivers/dma/dma-jz4780.c free_irq(jzdma->irq, jzdma); jzdma 992 drivers/dma/dma-jz4780.c for (i = 0; i < jzdma->soc_data->nb_channels; i++) jzdma 993 drivers/dma/dma-jz4780.c tasklet_kill(&jzdma->chan[i].vchan.task);