Received: by 10.192.165.156 with SMTP id m28csp143290imm; Wed, 18 Apr 2018 19:04:15 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/3wgW81u7EnjWi8ABugPf5g1dX5rYu5GeBX0spOMPJMIJ8fjJridluvv+HT+e9mmTCqo/m X-Received: by 2002:a17:902:b903:: with SMTP id bf3-v6mr4139342plb.37.1524103454957; Wed, 18 Apr 2018 19:04:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524103454; cv=none; d=google.com; s=arc-20160816; b=vbvxOKGdEK0kZ6IwHBfAlIFQDrUsRLQ73AnCQkR3HzosHScfI7XF9w6rX05rr1LuBS vZ6ycw2w4x3m6j2mgqQk0FrATH1lEc1RdDkZtYbPoyn9vtr/VPWWIN3aN1AMsjmKHO9X P++Z+WjsK6xdN1+dFK0R81TOAhOkbpABwSI1txow4wHxlrQ8jSPLnmpPXLLuYPDLlkzv oLQPiTu7ZX95JvLbAGpD0ncz8FD5s0yCOrMBx9rzNQQRP+7D3Z78k2NptYR8Nn7Y/49T e6zcE1Uzx8oluGQLKYbEQ+XX4jsZUx2S/Klktcp3YShYmYL4Fycqsy+aYaNBvDkdUwq/ czyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=VbPghuNDxyogCasTQ1bmBwkrEhCnQJnfeqHL8ukX/M8=; b=s876bKtRK43dRzQZllU7I4yXdhPGwvzlnRTNDZSGQOFkI6fRCGOuULyOrO5JX3g56p QMTJg5sTsDf8UrMpntl03kdKSWzfZ0zMNnoFpS/oWvXWdS+b5lfNH4+vHFa4z3mPDNW3 dp3TOruYiRUhqiQ870x+AVXZUmyJ2mMUOV5LKRSjxQgXqRmhiA5++9w65ifufW/aXydu qb5zO49oE3QYJ+3V6SWVi5DNcsnYEvIEv0sskjNxQ2vLiQkHegru4TI2BfGyfBEcCPer LttdQNaEszQcTIqDBYMSI5OuOnq7mSMxIdvORvGWmqd8FZDaPP8sOLAo2pDtPUzGGNLa qTWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dcBjfdj8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 73si2225449pfb.204.2018.04.18.19.04.01; Wed, 18 Apr 2018 19:04:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dcBjfdj8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753273AbeDSCCV (ORCPT + 99 others); Wed, 18 Apr 2018 22:02:21 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:46606 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752634AbeDSCBj (ORCPT ); Wed, 18 Apr 2018 22:01:39 -0400 Received: by mail-pf0-f196.google.com with SMTP id h69so1822199pfe.13 for ; Wed, 18 Apr 2018 19:01:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=VbPghuNDxyogCasTQ1bmBwkrEhCnQJnfeqHL8ukX/M8=; b=dcBjfdj82fipwEIw7A+3niym6AjmBkb68LefVHKLpIRjmj4IETibu4I4smsIAbflRc PzPQkyCCE7PkocQz9VQ1c4AsKNokjN4m7r6Wk5ysMh6HmnhEHLFgJmFbG13sH3Xhf8na qmjbVs6gQQA52DnAhTz3U5uaNkQIfnu1qVjGI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=VbPghuNDxyogCasTQ1bmBwkrEhCnQJnfeqHL8ukX/M8=; b=M6Olp5jmvr+UUXmsVMcUlMNhtlNgsJ7puImVQ03EGZcjfyvIur+HFnDj1CFQhuqlmj I6BL2XLeZhyEfxLwX5gt5zIQvkvb8X8pFeKN/sqGNNQGl+lPsXVnQ1nIqJw2M7iZ+CZY MIIkhGHg37a1LzK4fhybJ3i7GJSrhiGK5DoCLB7p+EHo2JEZvsTu6ZzNC9Ej7ooSDv1O A84K1D9hiTOGMdM0RYH04+I2saOnzrqNl/hI0PmW12iVTlsbTbJZN7G4wxVugb2JKuYu mB6fW9NguSkeSEceLUlP048gSd/gnAjKzXivx+Fx88UKxk38UvFG7xLwPGuFm5spf/Qx kVQg== X-Gm-Message-State: ALQs6tDIF+a32bEHJuWfdfraA1Te79uBGgwROCSv57EQJXaERifGrs59 1Ev963NoQ3d7+QZ/DI8toRHN5g== X-Received: by 10.98.207.130 with SMTP id b124mr4071114pfg.9.1524103298960; Wed, 18 Apr 2018 19:01:38 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id e83sm6136938pfd.175.2018.04.18.19.01.36 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 Apr 2018 19:01:38 -0700 (PDT) From: Baolin Wang To: dan.j.williams@intel.com, vinod.koul@intel.com Cc: eric.long@spreadtrum.com, broonie@kernel.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, baolin.wang@linaro.org Subject: [PATCH v2 3/5] dmaengine: sprd: Move DMA request mode and interrupt type into head file Date: Thu, 19 Apr 2018 10:00:48 +0800 Message-Id: <0ec72acc564401cdbada3ff1f4c9500d1233398e.1524054807.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <2ec1e8ddade0be5b4412b031b98d0d69a1af421f.1524054807.git.baolin.wang@linaro.org> References: <2ec1e8ddade0be5b4412b031b98d0d69a1af421f.1524054807.git.baolin.wang@linaro.org> In-Reply-To: <2ec1e8ddade0be5b4412b031b98d0d69a1af421f.1524054807.git.baolin.wang@linaro.org> References: <2ec1e8ddade0be5b4412b031b98d0d69a1af421f.1524054807.git.baolin.wang@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Eric Long This patch will move the Spreadtrum DMA request mode and interrupt type into one head file for user to configure. Signed-off-by: Eric Long Signed-off-by: Baolin Wang --- Changes since v1: - No updates. --- drivers/dma/sprd-dma.c | 52 +------------------------------------- include/linux/dma/sprd-dma.h | 57 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 51 deletions(-) create mode 100644 include/linux/dma/sprd-dma.h diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c index 65ff0a58..ccdeb8f 100644 --- a/drivers/dma/sprd-dma.c +++ b/drivers/dma/sprd-dma.c @@ -6,6 +6,7 @@ #include #include +#include #include #include #include @@ -125,57 +126,6 @@ #define SPRD_DMA_SOFTWARE_UID 0 -/* - * enum sprd_dma_req_mode: define the DMA request mode - * @SPRD_DMA_FRAG_REQ: fragment request mode - * @SPRD_DMA_BLK_REQ: block request mode - * @SPRD_DMA_TRANS_REQ: transaction request mode - * @SPRD_DMA_LIST_REQ: link-list request mode - * - * We have 4 types request mode: fragment mode, block mode, transaction mode - * and linklist mode. One transaction can contain several blocks, one block can - * contain several fragments. Link-list mode means we can save several DMA - * configuration into one reserved memory, then DMA can fetch each DMA - * configuration automatically to start transfer. - */ -enum sprd_dma_req_mode { - SPRD_DMA_FRAG_REQ, - SPRD_DMA_BLK_REQ, - SPRD_DMA_TRANS_REQ, - SPRD_DMA_LIST_REQ, -}; - -/* - * enum sprd_dma_int_type: define the DMA interrupt type - * @SPRD_DMA_NO_INT: do not need generate DMA interrupts. - * @SPRD_DMA_FRAG_INT: fragment done interrupt when one fragment request - * is done. - * @SPRD_DMA_BLK_INT: block done interrupt when one block request is done. - * @SPRD_DMA_BLK_FRAG_INT: block and fragment interrupt when one fragment - * or one block request is done. - * @SPRD_DMA_TRANS_INT: tansaction done interrupt when one transaction - * request is done. - * @SPRD_DMA_TRANS_FRAG_INT: transaction and fragment interrupt when one - * transaction request or fragment request is done. - * @SPRD_DMA_TRANS_BLK_INT: transaction and block interrupt when one - * transaction request or block request is done. - * @SPRD_DMA_LIST_INT: link-list done interrupt when one link-list request - * is done. - * @SPRD_DMA_CFGERR_INT: configure error interrupt when configuration is - * incorrect. - */ -enum sprd_dma_int_type { - SPRD_DMA_NO_INT, - SPRD_DMA_FRAG_INT, - SPRD_DMA_BLK_INT, - SPRD_DMA_BLK_FRAG_INT, - SPRD_DMA_TRANS_INT, - SPRD_DMA_TRANS_FRAG_INT, - SPRD_DMA_TRANS_BLK_INT, - SPRD_DMA_LIST_INT, - SPRD_DMA_CFGERR_INT, -}; - /* dma data width values */ enum sprd_dma_datawidth { SPRD_DMA_DATAWIDTH_1_BYTE, diff --git a/include/linux/dma/sprd-dma.h b/include/linux/dma/sprd-dma.h new file mode 100644 index 0000000..c545162 --- /dev/null +++ b/include/linux/dma/sprd-dma.h @@ -0,0 +1,57 @@ +/* SPDX-License-Identifier: GPL-2.0 */ + +#ifndef _SPRD_DMA_H_ +#define _SPRD_DMA_H_ + +/* + * enum sprd_dma_req_mode: define the DMA request mode + * @SPRD_DMA_FRAG_REQ: fragment request mode + * @SPRD_DMA_BLK_REQ: block request mode + * @SPRD_DMA_TRANS_REQ: transaction request mode + * @SPRD_DMA_LIST_REQ: link-list request mode + * + * We have 4 types request mode: fragment mode, block mode, transaction mode + * and linklist mode. One transaction can contain several blocks, one block can + * contain several fragments. Link-list mode means we can save several DMA + * configuration into one reserved memory, then DMA can fetch each DMA + * configuration automatically to start transfer. + */ +enum sprd_dma_req_mode { + SPRD_DMA_FRAG_REQ, + SPRD_DMA_BLK_REQ, + SPRD_DMA_TRANS_REQ, + SPRD_DMA_LIST_REQ, +}; + +/* + * enum sprd_dma_int_type: define the DMA interrupt type + * @SPRD_DMA_NO_INT: do not need generate DMA interrupts. + * @SPRD_DMA_FRAG_INT: fragment done interrupt when one fragment request + * is done. + * @SPRD_DMA_BLK_INT: block done interrupt when one block request is done. + * @SPRD_DMA_BLK_FRAG_INT: block and fragment interrupt when one fragment + * or one block request is done. + * @SPRD_DMA_TRANS_INT: tansaction done interrupt when one transaction + * request is done. + * @SPRD_DMA_TRANS_FRAG_INT: transaction and fragment interrupt when one + * transaction request or fragment request is done. + * @SPRD_DMA_TRANS_BLK_INT: transaction and block interrupt when one + * transaction request or block request is done. + * @SPRD_DMA_LIST_INT: link-list done interrupt when one link-list request + * is done. + * @SPRD_DMA_CFGERR_INT: configure error interrupt when configuration is + * incorrect. + */ +enum sprd_dma_int_type { + SPRD_DMA_NO_INT, + SPRD_DMA_FRAG_INT, + SPRD_DMA_BLK_INT, + SPRD_DMA_BLK_FRAG_INT, + SPRD_DMA_TRANS_INT, + SPRD_DMA_TRANS_FRAG_INT, + SPRD_DMA_TRANS_BLK_INT, + SPRD_DMA_LIST_INT, + SPRD_DMA_CFGERR_INT, +}; + +#endif -- 1.7.9.5