Received: by 10.192.165.156 with SMTP id m28csp142798imm; Wed, 18 Apr 2018 19:03:39 -0700 (PDT) X-Google-Smtp-Source: AIpwx48zf7zEbIvFG6SCWOPzFDRr2ETuoR0i0KKyhDYVlqn9nQQkiifQJOmlFesihY8bkt95RF65 X-Received: by 10.101.75.135 with SMTP id t7mr3575430pgq.235.1524103418978; Wed, 18 Apr 2018 19:03:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524103418; cv=none; d=google.com; s=arc-20160816; b=Kmw79EOupbxzl3bZVyscZwUlMTA/xyT6j8283F313v29Tbb1E2TRI7fKU+6RL9rBXV MoZWL7vKYsXtD8BbTTCmtvZTacUeEYAD9OVeBIwXD7J3jNNI9tOv2QKHRL3FbukWyHyW 0P0IQrfTct8/6WUn/b75mRaA9ylBsWSDM0sn11RFwalYsnD2ptTKa8n5ppx2hLMBJRh0 JVz6ZG9CifmD5DaAMo7Gr84MpxpbQpQjPnLqRwcJ7UEyPT6uQVSp+VAJHbLts5INSMAY qzS4NSR+e8greT4ceIQURPW/AZqv7etmRMdJURA7akpeEpEYQYyxvaTr8r+bT2KjgtoW kzWw== 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 d11si2060767pgn.404.2018.04.18.19.03.25; Wed, 18 Apr 2018 19:03:38 -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 S1752807AbeDSCBm (ORCPT + 99 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(-) 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; } -- 1.7.9.5