Commit 0aa930bb authored by Peter Ujfalusi's avatar Peter Ujfalusi Committed by Kleber Sacilotto de Souza

dmaengine: ti-dma-crossbar: Correct am335x/am43xx mux value type

BugLink: http://bugs.launchpad.net/bugs/1745052

[ Upstream commit 288e7560 ]

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: 42dbdcc6 ("dmaengine: ti-dma-crossbar: Add support for crossbar on AM33xx/AM43xx")
Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
Signed-off-by: default avatarSasha Levin <alexander.levin@verizon.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
parent 77bf8c1d
...@@ -46,12 +46,12 @@ struct ti_am335x_xbar_data { ...@@ -46,12 +46,12 @@ struct ti_am335x_xbar_data {
struct ti_am335x_xbar_map { struct ti_am335x_xbar_map {
u16 dma_line; 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) static void ti_am335x_xbar_free(struct device *dev, void *route_data)
...@@ -102,7 +102,7 @@ static void *ti_am335x_xbar_route_allocate(struct of_phandle_args *dma_spec, ...@@ -102,7 +102,7 @@ static void *ti_am335x_xbar_route_allocate(struct of_phandle_args *dma_spec,
} }
map->dma_line = (u16)dma_spec->args[0]; 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[2] = 0;
dma_spec->args_count = 2; dma_spec->args_count = 2;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment