aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/dma/at_hdmac.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/dma/at_hdmac.c')
-rw-r--r--drivers/dma/at_hdmac.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
index f3cb4a009e7d..3b0c28ff4ad6 100644
--- a/drivers/dma/at_hdmac.c
+++ b/drivers/dma/at_hdmac.c
@@ -662,7 +662,7 @@ err_desc_get:
662 */ 662 */
663static struct dma_async_tx_descriptor * 663static struct dma_async_tx_descriptor *
664atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl, 664atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
665 unsigned int sg_len, enum dma_data_direction direction, 665 unsigned int sg_len, enum dma_transfer_direction direction,
666 unsigned long flags) 666 unsigned long flags)
667{ 667{
668 struct at_dma_chan *atchan = to_at_dma_chan(chan); 668 struct at_dma_chan *atchan = to_at_dma_chan(chan);
@@ -680,7 +680,7 @@ atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
680 680
681 dev_vdbg(chan2dev(chan), "prep_slave_sg (%d): %s f0x%lx\n", 681 dev_vdbg(chan2dev(chan), "prep_slave_sg (%d): %s f0x%lx\n",
682 sg_len, 682 sg_len,
683 direction == DMA_TO_DEVICE ? "TO DEVICE" : "FROM DEVICE", 683 direction == DMA_MEM_TO_DEV ? "TO DEVICE" : "FROM DEVICE",
684 flags); 684 flags);
685 685
686 if (unlikely(!atslave || !sg_len)) { 686 if (unlikely(!atslave || !sg_len)) {
@@ -694,7 +694,7 @@ atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
694 ctrlb = ATC_IEN; 694 ctrlb = ATC_IEN;
695 695
696 switch (direction) { 696 switch (direction) {
697 case DMA_TO_DEVICE: 697 case DMA_MEM_TO_DEV:
698 ctrla |= ATC_DST_WIDTH(reg_width); 698 ctrla |= ATC_DST_WIDTH(reg_width);
699 ctrlb |= ATC_DST_ADDR_MODE_FIXED 699 ctrlb |= ATC_DST_ADDR_MODE_FIXED
700 | ATC_SRC_ADDR_MODE_INCR 700 | ATC_SRC_ADDR_MODE_INCR
@@ -727,7 +727,7 @@ atc_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl,
727 total_len += len; 727 total_len += len;
728 } 728 }
729 break; 729 break;
730 case DMA_FROM_DEVICE: 730 case DMA_DEV_TO_MEM:
731 ctrla |= ATC_SRC_WIDTH(reg_width); 731 ctrla |= ATC_SRC_WIDTH(reg_width);
732 ctrlb |= ATC_DST_ADDR_MODE_INCR 732 ctrlb |= ATC_DST_ADDR_MODE_INCR
733 | ATC_SRC_ADDR_MODE_FIXED 733 | ATC_SRC_ADDR_MODE_FIXED
@@ -789,7 +789,7 @@ err_desc_get:
789 */ 789 */
790static int 790static int
791atc_dma_cyclic_check_values(unsigned int reg_width, dma_addr_t buf_addr, 791atc_dma_cyclic_check_values(unsigned int reg_width, dma_addr_t buf_addr,
792 size_t period_len, enum dma_data_direction direction) 792 size_t period_len, enum dma_transfer_direction direction)
793{ 793{
794 if (period_len > (ATC_BTSIZE_MAX << reg_width)) 794 if (period_len > (ATC_BTSIZE_MAX << reg_width))
795 goto err_out; 795 goto err_out;
@@ -797,7 +797,7 @@ atc_dma_cyclic_check_values(unsigned int reg_width, dma_addr_t buf_addr,
797 goto err_out; 797 goto err_out;
798 if (unlikely(buf_addr & ((1 << reg_width) - 1))) 798 if (unlikely(buf_addr & ((1 << reg_width) - 1)))
799 goto err_out; 799 goto err_out;
800 if (unlikely(!(direction & (DMA_TO_DEVICE | DMA_FROM_DEVICE)))) 800 if (unlikely(!(direction & (DMA_DEV_TO_MEM | DMA_MEM_TO_DEV))))
801 goto err_out; 801 goto err_out;
802 802
803 return 0; 803 return 0;
@@ -812,7 +812,7 @@ err_out:
812static int 812static int
813atc_dma_cyclic_fill_desc(struct at_dma_slave *atslave, struct at_desc *desc, 813atc_dma_cyclic_fill_desc(struct at_dma_slave *atslave, struct at_desc *desc,
814 unsigned int period_index, dma_addr_t buf_addr, 814 unsigned int period_index, dma_addr_t buf_addr,
815 size_t period_len, enum dma_data_direction direction) 815 size_t period_len, enum dma_transfer_direction direction)
816{ 816{
817 u32 ctrla; 817 u32 ctrla;
818 unsigned int reg_width = atslave->reg_width; 818 unsigned int reg_width = atslave->reg_width;
@@ -824,7 +824,7 @@ atc_dma_cyclic_fill_desc(struct at_dma_slave *atslave, struct at_desc *desc,
824 | period_len >> reg_width; 824 | period_len >> reg_width;
825 825
826 switch (direction) { 826 switch (direction) {
827 case DMA_TO_DEVICE: 827 case DMA_MEM_TO_DEV:
828 desc->lli.saddr = buf_addr + (period_len * period_index); 828 desc->lli.saddr = buf_addr + (period_len * period_index);
829 desc->lli.daddr = atslave->tx_reg; 829 desc->lli.daddr = atslave->tx_reg;
830 desc->lli.ctrla = ctrla; 830 desc->lli.ctrla = ctrla;
@@ -835,7 +835,7 @@ atc_dma_cyclic_fill_desc(struct at_dma_slave *atslave, struct at_desc *desc,
835 | ATC_DIF(AT_DMA_PER_IF); 835 | ATC_DIF(AT_DMA_PER_IF);
836 break; 836 break;
837 837
838 case DMA_FROM_DEVICE: 838 case DMA_DEV_TO_MEM:
839 desc->lli.saddr = atslave->rx_reg; 839 desc->lli.saddr = atslave->rx_reg;
840 desc->lli.daddr = buf_addr + (period_len * period_index); 840 desc->lli.daddr = buf_addr + (period_len * period_index);
841 desc->lli.ctrla = ctrla; 841 desc->lli.ctrla = ctrla;
@@ -863,7 +863,7 @@ atc_dma_cyclic_fill_desc(struct at_dma_slave *atslave, struct at_desc *desc,
863 */ 863 */
864static struct dma_async_tx_descriptor * 864static struct dma_async_tx_descriptor *
865atc_prep_dma_cyclic(struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len, 865atc_prep_dma_cyclic(struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len,
866 size_t period_len, enum dma_data_direction direction) 866 size_t period_len, enum dma_transfer_direction direction)
867{ 867{
868 struct at_dma_chan *atchan = to_at_dma_chan(chan); 868 struct at_dma_chan *atchan = to_at_dma_chan(chan);
869 struct at_dma_slave *atslave = chan->private; 869 struct at_dma_slave *atslave = chan->private;
@@ -874,7 +874,7 @@ atc_prep_dma_cyclic(struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len,
874 unsigned int i; 874 unsigned int i;
875 875
876 dev_vdbg(chan2dev(chan), "prep_dma_cyclic: %s buf@0x%08x - %d (%d/%d)\n", 876 dev_vdbg(chan2dev(chan), "prep_dma_cyclic: %s buf@0x%08x - %d (%d/%d)\n",
877 direction == DMA_TO_DEVICE ? "TO DEVICE" : "FROM DEVICE", 877 direction == DMA_MEM_TO_DEV ? "TO DEVICE" : "FROM DEVICE",
878 buf_addr, 878 buf_addr,
879 periods, buf_len, period_len); 879 periods, buf_len, period_len);
880 880