From patchwork Thu Apr 19 02:00:47 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: 133682 Delivered-To: patch@linaro.org Received: by 10.46.66.142 with SMTP id h14csp105294ljf; Wed, 18 Apr 2018 19:01:51 -0700 (PDT) X-Google-Smtp-Source: AIpwx48x7GdSPV4s1BQHWQuA53M6ZM70xGTxs4dNGmnX+D72YLBo+IJeZJ2Av5jrjgVgI1hGdTYC X-Received: by 10.99.179.68 with SMTP id x4mr3568213pgt.132.1524103310830; Wed, 18 Apr 2018 19:01:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524103310; cv=none; d=google.com; s=arc-20160816; b=ZBlCYID5vhpxbWSanDYvOEBOQtp41WV/PRP4ClsaXheSzm4bO1vnhvLaKL6XJpdLiz D+nM4nTPWEUzJ/IPvJX4QCd4KfqBQySGHvI++Sjxwbnw7EesiNzSHeE5FK5KJGkKMZA8 zoTCIj3j9fSAfcT8LVe/d8QFADcefq/EhKrMf/fEXXzS+GrJuXaoy87o9YikfsQpe2X0 ErLfoKubQ0oSJw1dcB5MvIA/+8lhuLMamDQxfr0tCBwguOt7IF2VDRel5SJryWQ+kYm0 yH+eeFWEHwhTwipIeZ1WGqy9cb/e+5i9Cb5lg6t1UsdOYgTHykNIRXoNQcmI52FM5NS4 rI3g== 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=S8cxIwV1Mlsv0oDjoIxmzwGF/6p93zW1Ta6SI/c62Gw=; b=FZTEk/yXWF/4cUWmZeF09DZpIQuPKEZlTBh3or30viKFjammP0BYfQKJqfHldzdVRH 3RX7gnZ41hvPHny+cHMjg9YvJ5yVRXOQKQknxpetZj1bo5TiTNVTyuD8wNKx/gJ/XCir lhHpgBbfi0+UKe/S5LXSUsXZS+oAgf5wFrLUcHOjK7wUtb1Ia3Exdpai5C0cSoupm/8n LySRCSh07q03wMy3obr64W2UeC4A9Wc0PP5gDJ29dJJtIYJ0oAjvXtGHX6BdeyQrbmt/ OWQ1IYOvwoTM6jnOLJmspMURpssnQAGrGAvhABDr6s+PciqljnztvV0+lNFsELySImt2 7XiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eA/B8qxY; 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 q127si2079709pga.326.2018.04.18.19.01.50; Wed, 18 Apr 2018 19:01:50 -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=eA/B8qxY; 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 S1752810AbeDSCBm (ORCPT + 29 others); Wed, 18 Apr 2018 22:01:42 -0400 Received: from mail-pl0-f66.google.com ([209.85.160.66]:38316 "EHLO mail-pl0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751878AbeDSCBg (ORCPT ); Wed, 18 Apr 2018 22:01:36 -0400 Received: by mail-pl0-f66.google.com with SMTP id c7-v6so2245482plr.5 for ; Wed, 18 Apr 2018 19:01:36 -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=S8cxIwV1Mlsv0oDjoIxmzwGF/6p93zW1Ta6SI/c62Gw=; b=eA/B8qxYeXg5/gCLW0cPFrHLnnlBkU3QmOeqlcUJisAzYZXzHvnIsn6tAznwqCb96c 6pC6/KzZbbhqgGxkNxeT3MRcySrFtnxVSgdCpMFWDC5Z9AuK4woy/lR+zU72ou6pznnS Mpnn5czVe0oRUfrciRkYii1SdfrRc5YntCxbk= 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=S8cxIwV1Mlsv0oDjoIxmzwGF/6p93zW1Ta6SI/c62Gw=; b=PQYomeP5M/SdNuhj91ceUKG8t8oG4pQRiDZp1gWfhvnc9pcQs4NtqxXC8FQN12oWN4 S9B5qVzOSl5DbPyFGQVdMPUQeao7u8GNEdVyjZpK47XVTCfGq2PvQUsENG23HOBMpE5r Ia57jAveOEo23fJOS6D0PBtOHYhtfFc2AZOtBDv2KBjtp1T3wL5hNPNXa5kY3NC4FdUa SJJwoMjUyxttWmB7CPzrjtU0AQ8IPAa65qNG4dFa91zTXinr/BZuvY/2CMeBG7YPy2wu Z2SMMXnXSTSaPh+INFS+VNiXrEt2bOTq/jO2DXIJQdCb4YqJVUq+x3QNmWVZZMZqSMbr +0SQ== X-Gm-Message-State: ALQs6tAeVvSDaq19Wx4Ya9VN4CU/HwDspl2zLOrInwRvph227B6SFdlF ycXJg1ZyRwDJqcSAJICbdaBMXg== X-Received: by 2002:a17:902:108a:: with SMTP id c10-v6mr3752734pla.111.1524103296514; Wed, 18 Apr 2018 19:01:36 -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.33 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 Apr 2018 19:01:35 -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 2/5] dmaengine: sprd: Define the DMA data width type Date: Thu, 19 Apr 2018 10:00:47 +0800 Message-Id: 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 Define the DMA data width type to make code more readable. Signed-off-by: Baolin Wang --- Changes since v1: - No updates. --- drivers/dma/sprd-dma.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) -- 1.7.9.5 diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c index dcfa417..65ff0a58 100644 --- a/drivers/dma/sprd-dma.c +++ b/drivers/dma/sprd-dma.c @@ -176,6 +176,14 @@ enum sprd_dma_int_type { SPRD_DMA_CFGERR_INT, }; +/* dma data width values */ +enum sprd_dma_datawidth { + SPRD_DMA_DATAWIDTH_1_BYTE, + SPRD_DMA_DATAWIDTH_2_BYTES, + SPRD_DMA_DATAWIDTH_4_BYTES, + SPRD_DMA_DATAWIDTH_8_BYTES, +}; + /* dma channel hardware configuration */ struct sprd_dma_chn_hw { u32 pause; @@ -604,15 +612,15 @@ static int sprd_dma_config(struct dma_chan *chan, struct sprd_dma_desc *sdesc, u32 fix_mode = 0, fix_en = 0; if (IS_ALIGNED(len, 4)) { - datawidth = 2; + datawidth = SPRD_DMA_DATAWIDTH_4_BYTES; src_step = SPRD_DMA_WORD_STEP; des_step = SPRD_DMA_WORD_STEP; } else if (IS_ALIGNED(len, 2)) { - datawidth = 1; + datawidth = SPRD_DMA_DATAWIDTH_2_BYTES; src_step = SPRD_DMA_SHORT_STEP; des_step = SPRD_DMA_SHORT_STEP; } else { - datawidth = 0; + datawidth = SPRD_DMA_DATAWIDTH_1_BYTE; src_step = SPRD_DMA_BYTE_STEP; des_step = SPRD_DMA_BYTE_STEP; }