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: 10349077 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 1EFF06053F for ; Thu, 19 Apr 2018 02:02:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1044F2883F for ; Thu, 19 Apr 2018 02:02:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0507028893; Thu, 19 Apr 2018 02:02:39 +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=-7.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, 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 A249D2883F for ; Thu, 19 Apr 2018 02:02:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752159AbeDSCBf (ORCPT ); Wed, 18 Apr 2018 22:01:35 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:45654 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752077AbeDSCBe (ORCPT ); Wed, 18 Apr 2018 22:01:34 -0400 Received: by mail-pg0-f68.google.com with SMTP id i29so229785pgn.12 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=Y8mY5BZhWUq29Fqu0baBJnHpwZMCQiFkj8RYvMo6aglBcj7a+qmVYWtHwUxqjl1/n1 N0x2BlkRCx2n09VQwNpc/UKE2Bn7/JSWiZ67B+d7LxM4wAYjmAThnmqnO7SKJRflbidV wpoZFVoqG5douuLHfVKVEOKV4aGB6qIAvZiqCZUfRNrzMkex77IRMM2Zm5XBUAUTYkB3 fyGrMRHXhxHqgZsGv1hbQ2FqYlSsyaiSw4NhTMSbflHdrdREhcpXa9EJYkUEqkvXQjsX xUz0i5drCJqPejm4q3+wTTTH9sJ5dZ0R/+VvqGAq2KLrY86FQDgZeB2sfngmDutQpFgH XkSg== X-Gm-Message-State: ALQs6tA8txbBgqaA1154wMQNwHD/S4u1Cw9U2SjVGS9MFl5i4I2FWQ94 Gs4K9AYlffaPzRFVqeV5FdVYsg== X-Google-Smtp-Source: AIpwx4/c8sXwsh7uLDFAS32mYnYCz10+OeDFIK44UW7l/Gx9iXJozuLyDKxbgeHNkksiQEwNS1NuZQ== 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: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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;