Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dmaengine: pl08x: Add support for the DMA slave map

This patch adds support for the new channel request API introduced
in commit a8135d0d79e9d0ad3a4ff494fceeaae83
"dmaengine: core: Introduce new, universal API to request a channel".

param field of struct dma_slave_map type entries in the platform
data structure should be pointing to struct pl08x_channel_data
of related DMA channel.

Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Tested-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>

authored by

Sylwester Nawrocki and committed by
Vinod Koul
da6f8ca1 1001354c

+15
+11
drivers/dma/amba-pl08x.c
··· 1793 1793 } 1794 1794 EXPORT_SYMBOL_GPL(pl08x_filter_id); 1795 1795 1796 + static bool pl08x_filter_fn(struct dma_chan *chan, void *chan_id) 1797 + { 1798 + struct pl08x_dma_chan *plchan = to_pl08x_chan(chan); 1799 + 1800 + return plchan->cd == chan_id; 1801 + } 1802 + 1796 1803 /* 1797 1804 * Just check that the device is there and active 1798 1805 * TODO: turn this bit on/off depending on the number of physical channels ··· 2314 2307 ret = -EINVAL; 2315 2308 goto out_no_platdata; 2316 2309 } 2310 + } else { 2311 + pl08x->slave.filter.map = pl08x->pd->slave_map; 2312 + pl08x->slave.filter.mapcnt = pl08x->pd->slave_map_len; 2313 + pl08x->slave.filter.fn = pl08x_filter_fn; 2317 2314 } 2318 2315 2319 2316 /* By default, AHB1 only. If dualmaster, from platform */
+4
include/linux/amba/pl08x.h
··· 84 84 * running any DMA transfer and multiplexing can be recycled 85 85 * @lli_buses: buses which LLIs can be fetched from: PL08X_AHB1 | PL08X_AHB2 86 86 * @mem_buses: buses which memory can be accessed from: PL08X_AHB1 | PL08X_AHB2 87 + * @slave_map: DMA slave matching table 88 + * @slave_map_len: number of elements in @slave_map 87 89 */ 88 90 struct pl08x_platform_data { 89 91 struct pl08x_channel_data *slave_channels; ··· 95 93 void (*put_xfer_signal)(const struct pl08x_channel_data *, int); 96 94 u8 lli_buses; 97 95 u8 mem_buses; 96 + const struct dma_slave_map *slave_map; 97 + int slave_map_len; 98 98 }; 99 99 100 100 #ifdef CONFIG_AMBA_PL08X