Skip to content

Commit

Permalink
dmaengine: ti-dma-crossbar: Correct am335x/am43xx mux value type
Browse files Browse the repository at this point in the history
The used 0x1f mask is only valid for am335x family of SoC, different family
using this type of crossbar might have different number of electable
events. In case of am43xx family 0x3f mask should have been used for
example.
Instead of trying to handle each family's mask, just use u8 type to store
the mux value since the event offsets are aligned to byte offset.

Fixes: 42dbdcc ("dmaengine: ti-dma-crossbar: Add support for crossbar on AM33xx/AM43xx")
Signed-off-by: Peter Ujfalusi <[email protected]>
Signed-off-by: Vinod Koul <[email protected]>
  • Loading branch information
Peter Ujfalusi authored and Vinod Koul committed Nov 8, 2017
1 parent 05ec62a commit 288e756
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/dma/ti-dma-crossbar.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ struct ti_am335x_xbar_data {

struct ti_am335x_xbar_map {
u16 dma_line;
u16 mux_val;
u8 mux_val;
};

static inline void ti_am335x_xbar_write(void __iomem *iomem, int event, u16 val)
static inline void ti_am335x_xbar_write(void __iomem *iomem, int event, u8 val)
{
writeb_relaxed(val & 0x1f, iomem + event);
writeb_relaxed(val, iomem + event);
}

static void ti_am335x_xbar_free(struct device *dev, void *route_data)
Expand Down Expand Up @@ -105,7 +105,7 @@ static void *ti_am335x_xbar_route_allocate(struct of_phandle_args *dma_spec,
}

map->dma_line = (u16)dma_spec->args[0];
map->mux_val = (u16)dma_spec->args[2];
map->mux_val = (u8)dma_spec->args[2];

dma_spec->args[2] = 0;
dma_spec->args_count = 2;
Expand Down

0 comments on commit 288e756

Please sign in to comment.