From b8a4dd28f3b719d176fed5dc8d23a898463b072c Mon Sep 17 00:00:00 2001 From: Vignesh Raghavendra Date: Wed, 4 Dec 2019 22:17:20 +0530 Subject: dma: Introduce dma_get_cfg() interface Sometimes, there would be a need to exchange data between DMA provider and DMA client which are very specific to DMA driver of the SoC/platform and are not generic enough to be put into struct dma. Therefore, introduce dma_get_cfg() interface to get DMA provider specific data from client device. Clients can use unique configuration ID flags to get different configuration data from DMA driver. Signed-off-by: Vignesh Raghavendra Acked-by: Joe Hershberger Reviewed-by: Grygorii Strashko --- include/dma-uclass.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include/dma-uclass.h') diff --git a/include/dma-uclass.h b/include/dma-uclass.h index 31b43fb4b9..a1d9d26ac5 100644 --- a/include/dma-uclass.h +++ b/include/dma-uclass.h @@ -108,6 +108,17 @@ struct dma_ops { * @return zero on success, or -ve error code. */ int (*send)(struct dma *dma, void *src, size_t len, void *metadata); + /** + * get_cfg() - Get DMA channel configuration for client's use + * + * @dma: The DMA Channel to manipulate + * @cfg_id: DMA provider specific ID to identify what + * configuration data client needs + * @data: Pointer to store pointer to DMA driver specific + * configuration data for the given cfg_id (output param) + * @return zero on success, or -ve error code. + */ + int (*get_cfg)(struct dma *dma, u32 cfg_id, void **data); #endif /* CONFIG_DMA_CHANNELS */ /** * transfer() - Issue a DMA transfer. The implementation must -- cgit v1.2.3