From patchwork Mon Jun 26 12:49:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abhishek Sahu X-Patchwork-Id: 9809637 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 E9BF360329 for ; Mon, 26 Jun 2017 12:55:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EEFA527F97 for ; Mon, 26 Jun 2017 12:55:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E0E1328578; Mon, 26 Jun 2017 12:55:07 +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 5A69427F97 for ; Mon, 26 Jun 2017 12:55:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751997AbdFZMt7 (ORCPT ); Mon, 26 Jun 2017 08:49:59 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:52464 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752128AbdFZMt4 (ORCPT ); Mon, 26 Jun 2017 08:49:56 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 503B5613C9; Mon, 26 Jun 2017 12:49:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1498481390; bh=JUunyLJVu1ae8Mrnfta/JPF7+M3wkZOpiOx2G7wn1XA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Efs7RbJy2rJdBRy1WSVF+E8ptadtfDFm2wPqh0OkIdg/KlJMRD9tPHYXOgSQa9CP0 Q535whUXdAnp/nvvJlaKO7ilXHtKBajp1cd8QwXMofd8QkidNEP/MPKy3FdY6ryd5v 0B6tlr8zWBd/S4daFo7mclAtymdbaKgnJHfnh+rE= 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 0905B613C9; Mon, 26 Jun 2017 12:49:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1498481389; bh=JUunyLJVu1ae8Mrnfta/JPF7+M3wkZOpiOx2G7wn1XA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dbLLgzTlSTFDF5A7RprZIvwhS8u1/SSYsYyYp0RCqGV0iWtObNlj1rKrQfnSFbI4D JB+xUPqXtoyiHg8/Ih+fvXp1VWiQhnMfXaPTKTkdf2k2m/UbiDoh5xHFTQ5cVa3EQe 6l3R/wA8sl+3SRQI9hz6LNfJmMEFScpfY3K0QuNM= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 0905B613C9 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: andy.gross@linaro.org, david.brown@linaro.org, vinod.koul@intel.com, dan.j.williams@intel.com Cc: linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, Abhishek Sahu Subject: [PATCH v2 3/3] dmaengine: qcom: bam_dma: add command descriptor flag Date: Mon, 26 Jun 2017 18:19:29 +0530 Message-Id: <1498481369-29497-4-git-send-email-absahu@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1498481369-29497-1-git-send-email-absahu@codeaurora.org> References: <1498481369-29497-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 |=