From patchwork Thu Apr 19 02:00:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 133681 Delivered-To: patch@linaro.org Received: by 10.46.66.142 with SMTP id h14csp105166ljf; Wed, 18 Apr 2018 19:01:42 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+KhkQd0ITgZr2tPpL9VPNBSa/AiiEfwpscx9r6Hy8lHw9BnH7gq5jv1ok1FCiMA3uaiwu5 X-Received: by 2002:a17:902:bb8c:: with SMTP id m12-v6mr4283404pls.53.1524103302728; Wed, 18 Apr 2018 19:01:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524103302; cv=none; d=google.com; s=arc-20160816; b=s60yOHOoZjt8mb259TK0yVjiwOGcLwTbjmUgr6Q/+W8CyNA5u7Igm65yAMjiEiQr88 FHdUSpdgVPy9AfhiPOBaCnZ3AUEw9vkKG7XkADxI1Qn15LR47h1ujVoo9vHOGLDUvDvW jUBpvud1W9Gtetpb9Cf6b+MW3zSFQMrH2OKaDaLd8gljm/n8S1aWNK5kzOW7pRlk5d/i Ky9ZteQy3dIXtxefR7LIqeryQ8EduZ95VoBJ2Nueybip0ANPZX8BmxVuxFTSwAnmTWRg 42fBQD+V5kD2HKLewNbIYmlnBAd6qOLvZdnG9qbF8PAwb/JdNa8xzSgdjBbZHGfyiBjk WXGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=3AIlnJI9SfwLmXT42iXI9BlF+8TtLhl6rh8h7xYBuAw=; b=tOx2rK1X0GleILm2IA2aBWsEVrD5isqGSXUNZqeRWNs49QhK2xlDTLM56C9ZxeL49C Esmv2zWLTckIgGRWXeGn9zMzzawwHqnxPC/Qq7ZgKBpwuygxVEj9bchOVoP1wlIZvs96 JXLIbSekVKZq+7eczyx0UKH/LkMHrNd3E9CJohHNKijIrJmuSoW5FB7JViAkHoneDc4/ p2Fd+ieLtKU9ThWQTxukozpHM5m+za6fyiv3quLtlzLkiA9/p6c5g9Wc6gV+z1cIQ+/V qmnl+EGir/bGubOKuHsafmUk4u1seqesY92JUoz6xpKMCnoJQ9HC3Tq3WHhJtLbiNX3s kddg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=aTSSc4b5; 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 w9-v6si2341131plp.389.2018.04.18.19.01.42; Wed, 18 Apr 2018 19:01:42 -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=aTSSc4b5; 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 S1752504AbeDSCBf (ORCPT + 29 others); Wed, 18 Apr 2018 22:01:35 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:43427 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751878AbeDSCBe (ORCPT ); Wed, 18 Apr 2018 22:01:34 -0400 Received: by mail-pg0-f67.google.com with SMTP id f132so1732124pgc.10 for ; Wed, 18 Apr 2018 19:01:34 -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; bh=3AIlnJI9SfwLmXT42iXI9BlF+8TtLhl6rh8h7xYBuAw=; b=aTSSc4b5dHXQwPg/Vefuh1GjN2dyYBm+UTAmLKw9ohuH8bETagEYDGkI0RS2dLBgzY H7w6s6+ITwO9R9ycOer3m7BNALrAeOkeOnyab2UJhZRNNM80WdUlNe9cwAPdirgTNpR2 ndgSu4U+D6Y4jz2szcF1dbaRYt+7RHnANQ/EA= 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; bh=3AIlnJI9SfwLmXT42iXI9BlF+8TtLhl6rh8h7xYBuAw=; b=FrPRmUORVVWJ5Z8/53LVyAZMTZAJe32Cc5xiMd1SVlzSgqRnzcgrp4bqaWhFsfRLjj q7lEfxiestpAy9Nabm4mPdpskzk83kxTLPfyhMbWI9yupGu6cKQwnqiE/fDNnYH11Mbv oAwtvOaQxxoRDVohRgEkw8EbkDnYXo9Rqxv2qt/oxI9NVg8N7qUhl5M/DzhGOnPtbCJw vGgbVevFyi8uDm8h3XPyYhgchXv1kpPMkC4PnDA+eSRRLswEBSf4fD5F9fLHx7bHS3lX heSBm7wyImcOUqJlq2WUHKs4xQDyACVEXni8i4zo0ihPDfjZLRkS6pWWsn9uJlJbgXw+ MmrQ== X-Gm-Message-State: ALQs6tBbeLge1lc5F7oxLMJ/AJPjJbwEyvAb3Q5LDsjQ1UJBOcJ6+6X+ neb7mE3qp9/Q86ll9P7HfbQQHg== X-Received: by 10.98.194.142 with SMTP id w14mr4023924pfk.226.1524103293716; Wed, 18 Apr 2018 19:01:33 -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.30 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 Apr 2018 19:01:33 -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 1/5] dmaengine: sprd: Define the DMA transfer step type Date: Thu, 19 Apr 2018 10:00:46 +0800 Message-Id: <2ec1e8ddade0be5b4412b031b98d0d69a1af421f.1524054807.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Eric Long Define the DMA transfer step type to make code more readable. Signed-off-by: Eric Long Signed-off-by: Baolin Wang --- Changes since v1: - Convert enum structure to macros definition for DMA step type. --- drivers/dma/sprd-dma.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) -- 1.7.9.5 diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c index b106e8a..dcfa417 100644 --- a/drivers/dma/sprd-dma.c +++ b/drivers/dma/sprd-dma.c @@ -116,6 +116,13 @@ #define SPRD_DMA_SRC_TRSF_STEP_OFFSET 0 #define SPRD_DMA_TRSF_STEP_MASK GENMASK(15, 0) +/* define the DMA transfer step type */ +#define SPRD_DMA_NONE_STEP 0 +#define SPRD_DMA_BYTE_STEP 1 +#define SPRD_DMA_SHORT_STEP 2 +#define SPRD_DMA_WORD_STEP 4 +#define SPRD_DMA_DWORD_STEP 8 + #define SPRD_DMA_SOFTWARE_UID 0 /* @@ -598,16 +605,16 @@ static int sprd_dma_config(struct dma_chan *chan, struct sprd_dma_desc *sdesc, if (IS_ALIGNED(len, 4)) { datawidth = 2; - src_step = 4; - des_step = 4; + src_step = SPRD_DMA_WORD_STEP; + des_step = SPRD_DMA_WORD_STEP; } else if (IS_ALIGNED(len, 2)) { datawidth = 1; - src_step = 2; - des_step = 2; + src_step = SPRD_DMA_SHORT_STEP; + des_step = SPRD_DMA_SHORT_STEP; } else { datawidth = 0; - src_step = 1; - des_step = 1; + src_step = SPRD_DMA_BYTE_STEP; + des_step = SPRD_DMA_BYTE_STEP; } fragment_len = SPRD_DMA_MEMCPY_MIN_SIZE;