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

Source file repositories/reference/linux-study-clean/Documentation/driver-api/men-chameleon-bus.rst

File Facts

System
Linux kernel
Corpus path
Documentation/driver-api/men-chameleon-bus.rst
Extension
.rst
Size
6226 bytes
Lines
188
Domain
Support Tooling And Documentation
Bucket
Documentation
Inferred role
Support Tooling And Documentation: exported/initcall integration point
Status
integration implementation candidate

Why This File Exists

Repository support layer: documentation, build tooling, samples, user-space helper tools, generated initramfs support, licenses, and validation utilities.

Dependency Surface

Detected Declarations

Annotated Snippet

module_init(foo_init);

	static void __exit foo_exit(void)
	{
		mcb_unregister_driver(&foo_driver);
	}
	module_exit(foo_exit);

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 */

Annotation

Implementation Notes