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: 10349071 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 0E0F8602B7 for ; Thu, 19 Apr 2018 02:02:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 00CD528831 for ; Thu, 19 Apr 2018 02:02:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EA40F28849; Thu, 19 Apr 2018 02:02:19 +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 5987828831 for ; Thu, 19 Apr 2018 02:02:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752703AbeDSCBl (ORCPT ); Wed, 18 Apr 2018 22:01:41 -0400 Received: from mail-pl0-f68.google.com ([209.85.160.68]:33249 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752511AbeDSCBh (ORCPT ); Wed, 18 Apr 2018 22:01:37 -0400 Received: by mail-pl0-f68.google.com with SMTP id w12-v6so2254201plp.0 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=m3SsscMwZ3OhFYRV3ja8sB2OlN1OHp0w7N1TPY9iexZTrV+AW9YbSOuNgLrJctUdqk X9bNThexL/NVn5K6OSiSODinAsNQfzDD4/XuY5XJaA4EyF9kJQQgaPGGlU89VcceLsZv Oaz4PyU1Tq+vNFWGiV9Ckl5ugFqDlQ+lIVDDJ0NplP4JpSa7z9q9ofvYom5LQfj6sr+V TQv7EKGd9d2KKCs3WIqsZ5t9Skyual/ae5tdN3KXZ+ymyoW4PhILqw1L6W2HuVlM9Fsp ldgiYmtH1OR/hlKit0NhTqXAy4W1pM32GpZgF5JOHjn/4oRHqtrc92Aq5RdK+XkBwdM2 4lWw== X-Gm-Message-State: ALQs6tCffw8CEexaO313Tb/YaqXBJMo/gWyFSF8c6r7c6Bm/KU0fg6WL P9oeR8r8gJMSLZYlZfF+1ziTrA== X-Google-Smtp-Source: AIpwx48W3gI9+qDI5EJK2z1/LcmYS6hwaks4ILr1zsfRa+UHWJ8/LLRekPyURKdNiegcGKIxubWmdA== 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: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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; }