aboutsummaryrefslogtreecommitdiff
path: root/Documentation/driver-api/men-chameleon-bus.rst
diff options
context:
space:
mode:
authorJohannes Thumshirn2020-12-19 00:35:25 +0900
committerJonathan Corbet2021-01-11 13:26:13 -0700
commit7594bb08fb68ffe7e77c2e77ecc33c1e21631ead (patch)
treeca28fad089ff59fd187b9045a59ebcf84a5ed01e /Documentation/driver-api/men-chameleon-bus.rst
parent7178b4a7d69ca96db6e0bb3593c202c2dd323089 (diff)
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>
Diffstat (limited to 'Documentation/driver-api/men-chameleon-bus.rst')
-rw-r--r--Documentation/driver-api/men-chameleon-bus.rst12
1 files changed, 12 insertions, 0 deletions
diff --git a/Documentation/driver-api/men-chameleon-bus.rst b/Documentation/driver-api/men-chameleon-bus.rst
index 1b1f048aa748..6f0b9ee47595 100644
--- a/Documentation/driver-api/men-chameleon-bus.rst
+++ b/Documentation/driver-api/men-chameleon-bus.rst
@@ -18,6 +18,7 @@ MEN Chameleon Bus
4.1 The driver structure
4.2 Probing and attaching
4.3 Initializing the driver
+ 4.4 Using DMA
Introduction
@@ -173,3 +174,14 @@ module at the MCB core::
The module_mcb_driver() macro can be used to reduce the above code::
module_mcb_driver(foo_driver);
+
+Using DMA
+---------
+
+To make use of the kernel's DMA-API's function, you will need to use the
+carrier device's 'struct device'. Fortunately 'struct mcb_device' embeds a
+pointer (->dma_dev) to the carrier's device for DMA purposes::
+
+ ret = dma_set_mask_and_coherent(&mdev->dma_dev, DMA_BIT_MASK(dma_bits));
+ if (rc)
+ /* Handle errors */