From patchwork Tue Apr 10 07:46:04 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: 133059 Delivered-To: patch@linaro.org Received: by 10.46.84.29 with SMTP id i29csp1029240ljb; Tue, 10 Apr 2018 00:46:48 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+RaPsJPSO7fLTSS0cpFFVV2ZqfgD4cmh9IErY4WV9PGf9G/ud3grH7R0byCkA92K8PcfdP X-Received: by 2002:a17:902:8e86:: with SMTP id bg6-v6mr41692330plb.91.1523346408227; Tue, 10 Apr 2018 00:46:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523346408; cv=none; d=google.com; s=arc-20160816; b=s7NEqPp7B00vLRcTRt4fR27pyGHA/E7rE3JyAHEGJWuvn8SPaVWKUnBD7NX443+LhJ bekVfOj2IQlPj6g5y/4V4tchWXSJOQgEI8jjvf2aotonsi8DL3UoAMy0LOGqppTOoSru JmzpE4s4wJgloWF4a51+KyNGq8lo2fuOYWI4vrnF94UuVnA0o6p7uj8g/RchGwbjIPme sHPHYBPT+2UCRA+fK02AqO88Zz0Vmcv2hS1UKmqXRK4twgqCRWntk6xlxbo8tKm4z876 dNKFYJmdmzt2eQQrWvaMg5y3Ox5JUzOzXtNuc88H2r7Tn4Mr/tWF2G92gmHliiMigTkP bnIw== 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=/B8Z7SuimBAoytmzIiPGRvRsxqNt+/JUJOGQdhegUFc=; b=c/UmY8gTPMkGxxaJLZQWY4GcYTP8c1sRAtmmK+lcG0pVT2V/gVK3qlL6Mk95qEQ6/J diFLG2/eaADy3sHMab7UYgfOJbCdnlIvLRXAZWnR/joCZBkvtm5OqB7KURFNaWdhjU4a ld22FW5EdMTqR2nkTqvj7lPnJjOsWAD5Y21/2Y0tJOVCBFxsjmPbwOaNuEqkRpoZ6rp4 MeYsLw5h1uTwOUiHOvweRMXZRE58J7m8d4NDJOzl8OfxVBcCQGamI95kRmDF+l7+rapa 6hMNZYMTF3/Ai8ullR+IGgEN/Ng6V2mWkGi4YgdUQIxyCwySSmNNvbCL6lFnbIgbtIFa RZ6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TaPV+Lik; 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 v61-v6si2145484plb.297.2018.04.10.00.46.47; Tue, 10 Apr 2018 00:46:48 -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=TaPV+Lik; 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 S1752438AbeDJHqp (ORCPT + 29 others); Tue, 10 Apr 2018 03:46:45 -0400 Received: from mail-pl0-f65.google.com ([209.85.160.65]:46287 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751978AbeDJHql (ORCPT ); Tue, 10 Apr 2018 03:46:41 -0400 Received: by mail-pl0-f65.google.com with SMTP id 59-v6so6914379plc.13 for ; Tue, 10 Apr 2018 00:46:40 -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=/B8Z7SuimBAoytmzIiPGRvRsxqNt+/JUJOGQdhegUFc=; b=TaPV+LikTjFdN+I3sWqvkF/wUghvMbDc3Dr48VKXryg8bDSDpYN+IgB76BYlNZCeTA +cd6pMDbmUq+ttz8+Bg0t4nLPHAD1iVo/Jtbgt2qB3GTlvsefCrRezWnGTi8Zm0xPY3G TID73zgAREdaS5UaeW3vJ8EUOnU4OorM1Os78= 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=/B8Z7SuimBAoytmzIiPGRvRsxqNt+/JUJOGQdhegUFc=; b=nMJu6OsYkLKBByxW16g55vqxkGfN36KOZhSgUY+I1eyVWk9d1HbS+8c9Xlk6KmXaaU qlvVJ64mHnfYoG2AgmakHwDW49JW5ThF1xcpnceb6bvJapXwtR9DO5qy/ZHVSmQK8Oay muPof2mGFsu46AG6MWxo38u38b7GTfglOSPzmD29Idm5j9550NHY0l4qAS2j7NPO5zJI 7k2VskDSgXJvRgjjdBjkor+vagsgyRVyKdOC72A19hnTJqVjJqXjRXC7vV5GGxe5JNZh Uz37PbKN60sH0NxPy2y1iE7Zt8dPDc7PvXlWAT2Rgnwumf305+UjO+IzjRyESa9lEiKO JmAA== X-Gm-Message-State: AElRT7F7BdiIOC9CF9J+zsn3wOnnnVzXjdUtvKNBk6+/RUb9ko76MmZl jU6JmNaq6khPl9XHfJEu9f2/Rw== X-Received: by 2002:a17:902:9a82:: with SMTP id w2-v6mr41624451plp.6.1523346400359; Tue, 10 Apr 2018 00:46:40 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id x17sm3095279pfm.161.2018.04.10.00.46.38 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 10 Apr 2018 00:46:39 -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 2/5] dmaengine: sprd: Define the DMA data width type Date: Tue, 10 Apr 2018 15:46:04 +0800 Message-Id: <695931ac827adb5b2c5a7939341ff61ba00af1a1.1523346135.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: 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 --- 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 af9c156..9f44d6f 100644 --- a/drivers/dma/sprd-dma.c +++ b/drivers/dma/sprd-dma.c @@ -185,6 +185,14 @@ enum sprd_dma_step { SPRD_DMA_DWORD_STEP = BIT(3), }; +/* 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; @@ -613,15 +621,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; }