Skip to content

Commit da6f8ca

Browse files
Sylwester NawrockiVinod Koul
authored andcommitted
dmaengine: pl08x: Add support for the DMA slave map
This patch adds support for the new channel request API introduced in commit a8135d0 "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>
1 parent 1001354 commit da6f8ca

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

‎drivers/dma/amba-pl08x.c‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1793,6 +1793,13 @@ bool pl08x_filter_id(struct dma_chan *chan, void *chan_id)
17931793
}
17941794
EXPORT_SYMBOL_GPL(pl08x_filter_id);
17951795

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+
17961803
/*
17971804
* Just check that the device is there and active
17981805
* TODO: turn this bit on/off depending on the number of physical channels
@@ -2307,6 +2314,10 @@ static int pl08x_probe(struct amba_device *adev, const struct amba_id *id)
23072314
ret = -EINVAL;
23082315
goto out_no_platdata;
23092316
}
2317+
} else {
2318+
pl08x->slave.filter.map = pl08x->pd->slave_map;
2319+
pl08x->slave.filter.mapcnt = pl08x->pd->slave_map_len;
2320+
pl08x->slave.filter.fn = pl08x_filter_fn;
23102321
}
23112322

23122323
/* By default, AHB1 only. If dualmaster, from platform */

‎include/linux/amba/pl08x.h‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ struct pl08x_channel_data {
8484
* running any DMA transfer and multiplexing can be recycled
8585
* @lli_buses: buses which LLIs can be fetched from: PL08X_AHB1 | PL08X_AHB2
8686
* @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
8789
*/
8890
struct pl08x_platform_data {
8991
struct pl08x_channel_data *slave_channels;
@@ -93,6 +95,8 @@ struct pl08x_platform_data {
9395
void (*put_xfer_signal)(const struct pl08x_channel_data *, int);
9496
u8 lli_buses;
9597
u8 mem_buses;
98+
const struct dma_slave_map *slave_map;
99+
int slave_map_len;
96100
};
97101

98102
#ifdef CONFIG_AMBA_PL08X

0 commit comments

Comments
 (0)