From patchwork Tue Aug 1 14:11:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abhishek Sahu X-Patchwork-Id: 9874689 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6CA386037D for ; Tue, 1 Aug 2017 14:12:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5E8CE286A8 for ; Tue, 1 Aug 2017 14:12:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 534FA286DA; Tue, 1 Aug 2017 14:12:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D4FA7286D9 for ; Tue, 1 Aug 2017 14:12:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752025AbdHAOMN (ORCPT ); Tue, 1 Aug 2017 10:12:13 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:58132 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751339AbdHAOMJ (ORCPT ); Tue, 1 Aug 2017 10:12:09 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 0B1C8607EA; Tue, 1 Aug 2017 14:12:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1501596728; bh=JUunyLJVu1ae8Mrnfta/JPF7+M3wkZOpiOx2G7wn1XA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LjoTsEmPvHwn6oBE92FFUvzAjTPNzHF/1k/253vlCrL7ZnWM6ZElWTQjWwD9UiJqn KwwkIe8fC/BWVTeQPZmaVACgVg6uqioWKRNNzdstNi8Uije+vMci7OGM/P5QNFyTln zilxaIBuCCZ04DUVlrDLMgSEmU6FhPCnP7ihvwkY= Received: from absahu-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: absahu@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 3BBEA607EB; Tue, 1 Aug 2017 14:12:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1501596726; bh=JUunyLJVu1ae8Mrnfta/JPF7+M3wkZOpiOx2G7wn1XA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f6j1RkKzhl8Iwq8qDRcM/mWlMQ0yfL5DRceyhAP2xEmY2BVOTnDb9ewj+aA7OG24y fOpqiuG63O1tbgVrTwfZogt1l6t3CCyNBx7Konq/zk76RIjoNdLr3HutGMyO7m0ZxI hfspXvJT5VsXpwZHM747A8FCzm7BKnoi6kV1t9o0= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 3BBEA607EB Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=absahu@codeaurora.org From: Abhishek Sahu To: vinod.koul@intel.com, corbet@lwn.net, dan.j.williams@intel.com Cc: andy.gross@linaro.org, david.brown@linaro.org, linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Abhishek Sahu Subject: [PATCH v3 3/3] dmaengine: qcom: bam_dma: add command descriptor flag Date: Tue, 1 Aug 2017 19:41:44 +0530 Message-Id: <1501596704-21137-4-git-send-email-absahu@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1501596704-21137-1-git-send-email-absahu@codeaurora.org> References: <1501596704-21137-1-git-send-email-absahu@codeaurora.org> Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If DMA_PREP_CMD flag is passed in prep_slave_sg then peripheral driver has passed the data is in BAM command descriptor format and BAM driver should set CMD bit for each of the HW descriptors. Signed-off-by: Abhishek Sahu --- drivers/dma/qcom/bam_dma.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/dma/qcom/bam_dma.c b/drivers/dma/qcom/bam_dma.c index 03c4eb3..6d89fb6 100644 --- a/drivers/dma/qcom/bam_dma.c +++ b/drivers/dma/qcom/bam_dma.c @@ -65,6 +65,7 @@ struct bam_desc_hw { #define DESC_FLAG_EOT BIT(14) #define DESC_FLAG_EOB BIT(13) #define DESC_FLAG_NWD BIT(12) +#define DESC_FLAG_CMD BIT(11) struct bam_async_desc { struct virt_dma_desc vd; @@ -645,6 +646,9 @@ static struct dma_async_tx_descriptor *bam_prep_slave_sg(struct dma_chan *chan, unsigned int curr_offset = 0; do { + if (flags & DMA_PREP_CMD) + desc->flags |= cpu_to_le16(DESC_FLAG_CMD); + desc->addr = cpu_to_le32(sg_dma_address(sg) + curr_offset); @@ -960,7 +964,7 @@ static void bam_start_dma(struct bam_chan *bchan) /* set any special flags on the last descriptor */ if (async_desc->num_desc == async_desc->xfer_len) - desc[async_desc->xfer_len - 1].flags = + desc[async_desc->xfer_len - 1].flags |= cpu_to_le16(async_desc->flags); else desc[async_desc->xfer_len - 1].flags |=