• Peter Ujfalusi's avatar
    dmaengine: Add metadata_ops for dma_async_tx_descriptor · 4db8fd32
    Peter Ujfalusi authored
    The metadata is best described as side band data or parameters traveling
    alongside the data DMAd by the DMA engine. It is data
    which is understood by the peripheral and the peripheral driver only, the
    DMA engine see it only as data block and it is not interpreting it in any
    way.
    
    The metadata can be different per descriptor as it is a parameter for the
    data being transferred.
    
    If the DMA supports per descriptor metadata it can implement the attach,
    get_ptr/set_len callbacks.
    
    Client drivers must only use either attach or get_ptr/set_len to avoid
    misconfiguration.
    
    Client driver can check if a given metadata mode is supported by the
    channel during probe time with
    dmaengine_is_metadata_mode_supported(chan, DESC_METADATA_CLIENT);
    dmaengine_is_metadata_mode_supported(chan, DESC_METADATA_ENGINE);
    
    and based on this information can use either mode.
    
    Wrappers are also added for the metadata_ops.
    
    To be used in DESC_METADATA_CLIENT mode:
    dmaengine_desc_attach_metadata()
    
    To be used in DESC_METADATA_ENGINE mode:
    dmaengine_desc_get_metadata_ptr()
    dmaengine_desc_set_metadata_len()
    Signed-off-by: default avatarPeter Ujfalusi <peter.ujfalusi@ti.com>
    Reviewed-by: default avatarTero Kristo <t-kristo@ti.com>
    Tested-by: default avatarKeerthy <j-keerthy@ti.com>
    Reviewed-by: default avatarGrygorii Strashko <grygorii.strashko@ti.com>
    Link: https://lore.kernel.org/r/20191223110458.30766-5-peter.ujfalusi@ti.comSigned-off-by: default avatarVinod Koul <vkoul@kernel.org>
    4db8fd32
dmaengine.c 36.9 KB