Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757944AbcLOJ4d (ORCPT ); Thu, 15 Dec 2016 04:56:33 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:59530 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754603AbcLOJ41 (ORCPT ); Thu, 15 Dec 2016 04:56:27 -0500 DMARC-Filter: OpenDMARC Filter v1.3.1 smtp.codeaurora.org A9D4F61616 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=pass smtp.mailfrom=absahu@codeaurora.org From: Abhishek Sahu To: vinod.koul@intel.com, dan.j.williams@intel.com, andy.gross@linaro.org Cc: stanimir.varbanov@linaro.org, mcgrof@suse.com, okaya@codeaurora.org, pramod.gurav@linaro.org, arnd@arndb.de, linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, linux-arm-msm@vger.kernel.org, Abhishek Sahu Subject: [PATCH 2/5] dmaengine: Add support for custom data mapping Date: Thu, 15 Dec 2016 15:25:52 +0530 Message-Id: <1481795755-15302-3-git-send-email-absahu@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1481795755-15302-1-git-send-email-absahu@codeaurora.org> References: <1481795755-15302-1-git-send-email-absahu@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2310 Lines: 51 The current DMA APIs only support SGL or data in generic format. The QCA BAM DMA engine data cannot be mapped with already available APIs due to following reasons. 1. The QCA BAM DMA engine uses custom flags which cannot be mapped with generic DMA engine flags. 2. Some peripheral driver like QCA QPIC NAND/LCD requires to set specific flags (Like NWD, EOT) for some of the descriptors in scatter gather list. The already available mapping APIs take flags parameter in API itself and there is no support for passing DMA specific flags for each SGL entry. Now this patch adds the support for making the DMA descriptor from custom data with new DMA mapping function prep_dma_custom_mapping. The peripheral driver will pass the custom data in this function and DMA engine driver will form the descriptor according to its own logic. In future, this API can be used by any other DMA engine drivers also which are unable to do DMA mapping with already available API’s. Signed-off-by: Abhishek Sahu --- include/linux/dmaengine.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index cc535a4..6324c1f 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h @@ -692,6 +692,8 @@ struct dma_filter { * be called after period_len bytes have been transferred. * @device_prep_interleaved_dma: Transfer expression in a generic way. * @device_prep_dma_imm_data: DMA's 8 byte immediate data to the dst address + * @device_prep_dma_custom_mapping: prepares a dma operation from dma driver + * specific custom data * @device_config: Pushes a new configuration to a channel, return 0 or an error * code * @device_pause: Pauses any transfer happening on a channel. Returns @@ -783,6 +785,9 @@ struct dma_device { struct dma_async_tx_descriptor *(*device_prep_dma_imm_data)( struct dma_chan *chan, dma_addr_t dst, u64 data, unsigned long flags); + struct dma_async_tx_descriptor *(*device_prep_dma_custom_mapping)( + struct dma_chan *chan, void *data, + unsigned long flags); int (*device_config)(struct dma_chan *chan, struct dma_slave_config *config); -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project