From patchwork Tue Aug 1 14:11:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abhishek Sahu X-Patchwork-Id: 9874695 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 EBB806037D for ; Tue, 1 Aug 2017 14:12:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DDC29286A8 for ; Tue, 1 Aug 2017 14:12:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D2E67286B4; Tue, 1 Aug 2017 14:12:50 +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=unavailable 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 87469286BF for ; Tue, 1 Aug 2017 14:12:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751860AbdHAOME (ORCPT ); Tue, 1 Aug 2017 10:12:04 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:57948 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751339AbdHAOMA (ORCPT ); Tue, 1 Aug 2017 10:12:00 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id EEA776087E; Tue, 1 Aug 2017 14:11:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1501596719; bh=I71hRlToiP46g7UNUEyw0GXxk6y+Be9BhVGKJV9Kb8g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kiVHJtgwGWu0ZsOeWL9+Yu7T/OK6vpgHG/jWMptEgk8xjf3vJGMbrtMPnRUW7BcrE 9lGKcEltCZseiQkMhG9i/MXPC0Mf1Ti+bztLCPhujhfpnYa6wTOkbjc0iqQWmkxocW J9XbMT+W9zpn0iusXb2r2kfMsqnP5tNsSBrc0B2Q= 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 BBC76607EA; Tue, 1 Aug 2017 14:11:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1501596718; bh=I71hRlToiP46g7UNUEyw0GXxk6y+Be9BhVGKJV9Kb8g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g3q7gCvB9zkXaivAttaugvpl19vTeAF8Gik9ze7fOgVzsz0A58Mvrs+XmYfbUd/JK Pa1Z99BUU/jXnCpOIT2jB5uR47zH+fQcX0pJivXqMkrVH8lZXLp9Fmr+MDfliSdHAq MiW+Lm//eNpVZ1z8xIgRGxgtoRh1+9bkFoGBzhv0= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org BBC76607EA 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 1/3] dmaengine: add DMA_PREP_CMD for non-Data descriptors. Date: Tue, 1 Aug 2017 19:41:42 +0530 Message-Id: <1501596704-21137-2-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 Some of the DMA controllers are capable of issuing the commands to peripheral by the DMA. These commands can be list of register reads/writes and its different from normal data reads/writes. This patch adds new flag DMA_PREP_CMD in DMA API which tells the driver that the data passed to DMA API is command data and DMA controller driver will form descriptor in the required format. This flag can be used by any DMA controller driver which requires the descriptor in different format for non-Data descriptors. Signed-off-by: Abhishek Sahu --- Documentation/dmaengine/provider.txt | 7 +++++++ include/linux/dmaengine.h | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/Documentation/dmaengine/provider.txt b/Documentation/dmaengine/provider.txt index e33bc1c..bfadbfd 100644 --- a/Documentation/dmaengine/provider.txt +++ b/Documentation/dmaengine/provider.txt @@ -395,6 +395,13 @@ where to put them) when DMA_CTRL_REUSE is already set - Terminating the channel + * DMA_PREP_CMD + - If set, the client driver tells DMA controller that passed data in DMA + API is command data. + - Interpretation of command data is DMA controller specific. It can be + used for issuing commands to other peripherals/register reads/register + writes for which the descriptor should be in different format from + normal data descriptors. General Design Notes -------------------- diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index 5336808..45fc833 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h @@ -186,6 +186,9 @@ struct dma_interleaved_template { * on the result of this operation * @DMA_CTRL_REUSE: client can reuse the descriptor and submit again till * cleared or freed + * @DMA_PREP_CMD: tell the driver that the data passed to DMA API is command + * data and the descriptor should be in different format from normal + * data descriptors. */ enum dma_ctrl_flags { DMA_PREP_INTERRUPT = (1 << 0), @@ -195,6 +198,7 @@ enum dma_ctrl_flags { DMA_PREP_CONTINUE = (1 << 4), DMA_PREP_FENCE = (1 << 5), DMA_CTRL_REUSE = (1 << 6), + DMA_PREP_CMD = (1 << 7), }; /**