Skip to content

Commit 7594bb0

Browse files
morbidrsaJonathan Corbet
authored andcommitted
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>
1 parent 7178b4a commit 7594bb0

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎Documentation/driver-api/men-chameleon-bus.rst‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ MEN Chameleon Bus
1818
4.1 The driver structure
1919
4.2 Probing and attaching
2020
4.3 Initializing the driver
21+
4.4 Using DMA
2122
2223
2324
Introduction
@@ -173,3 +174,14 @@ module at the MCB core::
173174
The module_mcb_driver() macro can be used to reduce the above code::
174175

175176
module_mcb_driver(foo_driver);
177+
178+
Using DMA
179+
---------
180+
181+
To make use of the kernel's DMA-API's function, you will need to use the
182+
carrier device's 'struct device'. Fortunately 'struct mcb_device' embeds a
183+
pointer (->dma_dev) to the carrier's device for DMA purposes::
184+
185+
ret = dma_set_mask_and_coherent(&mdev->dma_dev, DMA_BIT_MASK(dma_bits));
186+
if (rc)
187+
/* Handle errors */

0 commit comments

Comments
 (0)