linux/drivers/dma
Peter Ujfalusi a8135d0d79 dmaengine: core: Introduce new, universal API to request a channel
The two API function can cover most, if not all current APIs used to
request a channel. With minimal effort dmaengine drivers, platforms and
dmaengine user drivers can be converted to use the two function.

struct dma_chan *dma_request_chan_by_mask(const dma_cap_mask_t *mask);

To request any channel matching with the requested capabilities, can be
used to request channel for memcpy, memset, xor, etc where no hardware
synchronization is needed.

struct dma_chan *dma_request_chan(struct device *dev, const char *name);
To request a slave channel. The dma_request_chan() will try to find the
channel via DT, ACPI or in case if the kernel booted in non DT/ACPI mode
it will use a filter lookup table and retrieves the needed information from
the dma_slave_map provided by the DMA drivers.
This legacy mode needs changes in platform code, in dmaengine drivers and
finally the dmaengine user drivers can be converted:

For each dmaengine driver an array of DMA device, slave and the parameter
for the filter function needs to be added:

static const struct dma_slave_map da830_edma_map[] = {
	{ "davinci-mcasp.0", "rx", EDMA_FILTER_PARAM(0, 0) },
	{ "davinci-mcasp.0", "tx", EDMA_FILTER_PARAM(0, 1) },
	{ "davinci-mcasp.1", "rx", EDMA_FILTER_PARAM(0, 2) },
	{ "davinci-mcasp.1", "tx", EDMA_FILTER_PARAM(0, 3) },
	{ "davinci-mcasp.2", "rx", EDMA_FILTER_PARAM(0, 4) },
	{ "davinci-mcasp.2", "tx", EDMA_FILTER_PARAM(0, 5) },
	{ "spi_davinci.0", "rx", EDMA_FILTER_PARAM(0, 14) },
	{ "spi_davinci.0", "tx", EDMA_FILTER_PARAM(0, 15) },
	{ "da830-mmc.0", "rx", EDMA_FILTER_PARAM(0, 16) },
	{ "da830-mmc.0", "tx", EDMA_FILTER_PARAM(0, 17) },
	{ "spi_davinci.1", "rx", EDMA_FILTER_PARAM(0, 18) },
	{ "spi_davinci.1", "tx", EDMA_FILTER_PARAM(0, 19) },
};

This information is going to be needed by the dmaengine driver, so
modification to the platform_data is needed, and the driver map should be
added to the pdata of the DMA driver:

da8xx_edma0_pdata.slave_map = da830_edma_map;
da8xx_edma0_pdata.slavecnt = ARRAY_SIZE(da830_edma_map);

The DMA driver then needs to configure the needed device -> filter_fn
mapping before it registers with dma_async_device_register() :

ecc->dma_slave.filter_map.map = info->slave_map;
ecc->dma_slave.filter_map.mapcnt = info->slavecnt;
ecc->dma_slave.filter_map.fn = edma_filter_fn;

When neither DT or ACPI lookup is available the dma_request_chan() will
try to match the requester's device name with the filter_map's list of
device names, when a match found it will use the information from the
dma_slave_map to get the channel with the dma_get_channel() internal
function.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
2015-12-18 11:17:26 +05:30
..
bestcomm dmaengine: constify of_device_id array 2015-03-18 22:13:14 +05:30
dw dmaengine updates for 4.4-rc1 2015-11-10 10:05:17 -08:00
hsu dmaengine: hsu: remove platform data 2015-10-17 21:22:08 -07:00
ioat dmaengine: ioatdma: add PCIe AER handlers 2015-09-21 21:10:05 +05:30
ipu genirq: Remove irq argument from irq flow handlers 2015-09-16 15:47:51 +02:00
ppc4xx dmaengine: Remove FSF mailing addresses 2015-03-16 22:28:15 +05:30
sh dmaengine: sort the sh Makefile 2015-08-26 07:50:17 +05:30
xilinx dmaengine: xilinx: Fix module autoload for OF platform driver 2015-10-01 07:35:39 +05:30
acpi-dma.c dmaengine updates for 4.4-rc1 2015-11-10 10:05:17 -08:00
amba-pl08x.c dmaengine: pl08x: support dt channel assignment 2015-08-18 22:12:14 +05:30
at_hdmac_regs.h dmaengine: hdmac: factorise memset descriptor allocation 2015-10-29 10:40:09 +09:00
at_hdmac.c dmaengine: hdmac: Add scatter-gathered memset support 2015-10-29 10:41:16 +09:00
at_xdmac.c dmaengine updates for 4.4-rc1 2015-11-10 10:05:17 -08:00
bcm2835-dma.c dmaengine: bcm2835-dma: Fix memory leak when stopping a running transfer 2015-03-30 23:17:08 +05:30
coh901318_lli.c
coh901318.c dmaengine: Add an enum for the dmaengine alignment constraints 2015-08-05 10:53:52 +05:30
coh901318.h
cppi41.c dmaengine: cppi41: add missing bitfields 2015-04-11 21:12:58 +05:30
dma-axi-dmac.c dmaengine: Add support for the Analog Devices AXI-DMAC DMA controller 2015-08-23 18:55:10 +05:30
dma-jz4740.c Merge branch 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma 2015-04-24 09:49:37 -07:00
dma-jz4780.c dmaengine: jz4780: Kill tasklets before unregistering the device 2015-08-18 22:28:50 +05:30
dmaengine.c dmaengine: core: Introduce new, universal API to request a channel 2015-12-18 11:17:26 +05:30
dmaengine.h
dmatest.c kernel/params: constify struct kernel_param_ops uses 2015-05-28 11:32:10 +09:30
edma.c dmaengine: edma: Add dummy driver skeleton for edma3-tptc 2015-11-04 22:11:42 +05:30
ep93xx_dma.c dmaengine: ep93xx: Constify platform_device_id 2015-05-04 16:38:55 +05:30
fsl_raid.c dmaengine: fsl_raid: statify fsl_re_chan_probe 2015-04-02 16:11:35 +05:30
fsl_raid.h dmaengine: Driver support for FSL RaidEngine device. 2015-04-02 16:10:27 +05:30
fsl-edma.c dmaengine: fsl-edma: clear pending interrupts on initialization 2015-06-25 09:22:32 +05:30
fsldma.c dmaengine: fsldma: Fix module autoload for OF platform driver 2015-10-01 07:34:31 +05:30
fsldma.h dmaengine: fsldma: declare slave capabilities for the generic code 2015-01-13 23:58:08 +05:30
idma64.c dmaengine updates for 4.4-rc1 2015-11-10 10:05:17 -08:00
idma64.h dmaengine: idma64: use lo_hi_readq() / lo_hi_writeq() 2015-09-25 07:54:05 +05:30
img-mdc-dma.c dmaengine: img-mdc: remove device_alloc_chan_resources handler 2015-03-18 22:44:58 +05:30
imx-dma.c dmaengine: Add an enum for the dmaengine alignment constraints 2015-08-05 10:53:52 +05:30
imx-sdma.c dmaengine: imx-sdma: Remove unneeded dev_info() 2015-10-07 15:03:08 +01:00
iop-adma.c drivers/dma/iop-adma: Use dma_alloc_writecombine() kernel-style 2015-08-25 09:59:46 +02:00
k3dma.c dmaengine: Add an enum for the dmaengine alignment constraints 2015-08-05 10:53:52 +05:30
Kconfig Merge branch 'topic/idma' into for-linus 2015-10-31 07:37:05 +05:30
lpc18xx-dmamux.c dmaengine: add driver for lpc18xx dmamux 2015-08-18 22:12:14 +05:30
Makefile dmaengine: idma: rename to INTEL_IDMA64 2015-09-24 20:55:58 +05:30
mic_x100_dma.c dma: Add support to program MIC x100 status descriptiors 2015-10-04 12:46:06 +01:00
mic_x100_dma.h dmaengine: Add an enum for the dmaengine alignment constraints 2015-08-05 10:53:52 +05:30
mmp_pdma.c dmaengine: Add an enum for the dmaengine alignment constraints 2015-08-05 10:53:52 +05:30
mmp_tdma.c dmaengine: Add an enum for the dmaengine alignment constraints 2015-08-05 10:53:52 +05:30
moxart-dma.c dmaengine: moxart-dma: Fix module autoload for OF platform driver 2015-10-01 07:34:31 +05:30
mpc512x_dma.c dmaengine: mpc512x: Fix module autoload for OF platform driver 2015-10-01 07:34:31 +05:30
mv_xor.c dmaengine updates for 4.3-rc1 2015-09-04 11:10:18 -07:00
mv_xor.h dmaengine: mv_xor: improve descriptors list handling and reduce locking 2015-06-10 22:18:31 +05:30
mxs-dma.c dmaengine: mxs: Constify platform_device_id 2015-05-04 16:38:55 +05:30
nbpfaxi.c dmaengine: nbpfaxi: Constify platform_device_id 2015-05-04 16:38:55 +05:30
of-dma.c dmaengine: of_dma: Support for DMA routers 2015-05-09 17:11:25 +05:30
omap-dma.c dmaengine: omap-dma: Enable packed accesses for cyclic transfers 2015-10-05 16:31:34 +01:00
pch_dma.c dmaengine: Remove remaining FSF mailing addresses 2015-07-06 19:18:53 +05:30
pl330.c dmaengine updates for 4.3-rc1 2015-09-04 11:10:18 -07:00
pxa_dma.c dmaengine: pxa_dma: fix residue corner case 2015-10-01 07:44:31 +05:30
qcom_bam_dma.c Merge branch 'for-linus' of git://git.infradead.org/users/vkoul/slave-dma 2015-04-24 09:49:37 -07:00
s3c24xx-dma.c dmaengine: s3c24xx: Constify platform_device_id 2015-05-04 16:38:55 +05:30
sa11x0-dma.c dmaengine: sa11x0: report slave capabilities to upper layers 2015-04-17 23:24:35 +05:30
sirf-dma.c dmaengine: sirf: Fix module autoload for OF platform driver 2015-10-01 07:34:31 +05:30
ste_dma40_ll.c
ste_dma40_ll.h
ste_dma40.c dmaengine: ste_dma40: fix a trivial typo 2015-10-25 04:15:40 +05:30
sun4i-dma.c dmaengine: sun4i: fix unsafe list iteration 2015-09-30 12:17:22 +05:30
sun6i-dma.c dmaengine: sun6i: Fix module autoload for OF platform driver 2015-10-01 07:35:26 +05:30
tegra20-apb-dma.c dmaengine: tegra-apb: Simplify locking for device using global pause 2015-08-20 12:10:25 +05:30
ti-dma-crossbar.c dmaengine: ti-dma-crossbar: Add support for crossbar on AM33xx/AM43xx 2015-10-27 10:22:45 +09:00
timb_dma.c dmaengine: Remove remaining FSF mailing addresses 2015-07-06 19:18:53 +05:30
TODO dmaengine: dw: don't perform DMA when dmaengine_submit is called 2014-07-15 22:14:30 +05:30
txx9dmac.c dmaengine: txx9: Rename device_control 2014-12-22 12:33:22 +05:30
txx9dmac.h MIPS: Replace MIPS-specific 64BIT_PHYS_ADDR with generic PHYS_ADDR_T_64BIT 2014-11-24 22:46:44 +01:00
virt-dma.c Revert "dmaengine: virt-dma: don't always free descriptor upon completion" 2015-07-31 20:33:43 +05:30
virt-dma.h dmaengine: virt-dma: Fix kernel-doc annotations 2015-10-27 11:12:09 +09:00
xgene-dma.c dmaengine updates for 4.4-rc1 2015-11-10 10:05:17 -08:00
zx296702_dma.c dmaengine updates for 4.4-rc1 2015-11-10 10:05:17 -08:00