Skip to content

Commit

Permalink
dmaengine: ste_dma40: indicate directions on channels
Browse files Browse the repository at this point in the history
Since the introduction of the .directions flags, ste_dma40 was
never patched to indicate which transfer directions it can manage.
This causes a problem when trying to use the dmaengine for generic
ALSA SoC DMA:

ux500-msp-i2s.1: Failed to get DMA channel capabilities, falling
   back to period counting: -6

This patch fixes this issue by indicating the supported transfer
directions for slave and memcpy channels.

Signed-off-by: Linus Walleij <[email protected]>
Signed-off-by: Vinod Koul <[email protected]>
  • Loading branch information
linusw authored and Vinod Koul committed Jan 14, 2017
1 parent 0c744ea commit 49873e9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/dma/ste_dma40.c
Original file line number Diff line number Diff line change
Expand Up @@ -2809,12 +2809,14 @@ static void __init d40_chan_init(struct d40_base *base, struct dma_device *dma,

static void d40_ops_init(struct d40_base *base, struct dma_device *dev)
{
if (dma_has_cap(DMA_SLAVE, dev->cap_mask))
if (dma_has_cap(DMA_SLAVE, dev->cap_mask)) {
dev->device_prep_slave_sg = d40_prep_slave_sg;
dev->directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV);
}

if (dma_has_cap(DMA_MEMCPY, dev->cap_mask)) {
dev->device_prep_dma_memcpy = d40_prep_memcpy;

dev->directions = BIT(DMA_MEM_TO_MEM);
/*
* This controller can only access address at even
* 32bit boundaries, i.e. 2^2
Expand Down

0 comments on commit 49873e9

Please sign in to comment.