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

Documentation: document dma device use for mcb

Hannes reported a problem with setting up dma transfers on a mcb device.
The problem boiled down to the use of a wrong 'device' for the dma
functions.

Document how to setup dma transfers for a IP core on a mcb carrier.

Reported-by: Hannes Duerr <Hannes.Duerr@duagon.com>
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Link: https://lore.kernel.org/r/3bdc8f76b30c2b0e2a2bfab06c2e73797ddc9384.1608305690.git.johannes.thumshirn@wdc.com
Signed-off-by: Jonathan Corbet <corbet@lwn.net>

authored by

Johannes Thumshirn and committed by
Jonathan Corbet
7594bb08 7178b4a7

+12
+12
Documentation/driver-api/men-chameleon-bus.rst
··· 18 18 4.1 The driver structure 19 19 4.2 Probing and attaching 20 20 4.3 Initializing the driver 21 + 4.4 Using DMA 21 22 22 23 23 24 Introduction ··· 174 173 The module_mcb_driver() macro can be used to reduce the above code:: 175 174 176 175 module_mcb_driver(foo_driver); 176 + 177 + Using DMA 178 + --------- 179 + 180 + To make use of the kernel's DMA-API's function, you will need to use the 181 + carrier device's 'struct device'. Fortunately 'struct mcb_device' embeds a 182 + pointer (->dma_dev) to the carrier's device for DMA purposes:: 183 + 184 + ret = dma_set_mask_and_coherent(&mdev->dma_dev, DMA_BIT_MASK(dma_bits)); 185 + if (rc) 186 + /* Handle errors */