Skip to content

RFC: DMA API: API to reload/refresh DMA buffer(s) #8974

@sathishkuttan

Description

@sathishkuttan

Currently, DMA driver has 3 APIs, namely, config, start and stop.

Data buffers for DMA transfers are provided in one or more DMA blocks as part of the config API. This method works well when using fixed set of buffers that are provided during configuration and the DMA driver recycles the buffers internally.
However, when the application manages the buffers and wants to provide new buffers for future transactions, only way to accomplish this is to use the config API. config API does many things including configuring the hardware, so IMO it is not a desirable mechanism for just reloading new buffers.

A new API reload maybe a better approach

typedef int (*dma_api_reload)(struct device *dev, u32_t channel, u32_t src, u32_t dst, size_t size);

struct dma_driver_api {
        dma_api_config config;
        dma_api_reload reload; /* NEW */
        dma_api_start start;
        dma_api_stop stop;
};

Comments?

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementChanges/Updates/Additions to existing featuresarea: APIChanges to public APIsarea: DMADirect Memory Accessarea: Drivers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions