From patchwork Thu Sep 14 18:46:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolin Chen X-Patchwork-Id: 9953705 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 213F66024A for ; Thu, 14 Sep 2017 18:46:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1638629219 for ; Thu, 14 Sep 2017 18:46:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0B0782921E; Thu, 14 Sep 2017 18:46:18 +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=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, 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 B4AFA29219 for ; Thu, 14 Sep 2017 18:46:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751619AbdINSqR (ORCPT ); Thu, 14 Sep 2017 14:46:17 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:38706 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751512AbdINSqQ (ORCPT ); Thu, 14 Sep 2017 14:46:16 -0400 Received: by mail-pf0-f196.google.com with SMTP id q76so89951pfq.5; Thu, 14 Sep 2017 11:46:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=Pmo8XKCSpjtk3EmoqMEmquMk0O8qX4MQfPrA9LygcGQ=; b=Soepa0d2PinH1lo8e+Bx6Z6AvgDqBceiVI+I9LxRKVOSP9YfudIhUgWqRB5/YFYfCu 9HfxWioH7U7mKHycVFk9u4SGe0vc/tOmc1DOBzRvvKPMHnwzW3ZCZFrdfhRmY/4OtJaE o4k3fwFGEwDbEVv3uN0F0qdFlsAYBNcG1qy7nEWoa7ZL0O8S+/8FjfHreaBIE06wuOlb 2woaT0A56ou09j2fb52iThjw3pSkOxLaUIlEuJh9bQZ/Shi81Hoor+7UvO8pVwpT6i54 BUWkumG8YrsONda0jLo1mawxiuFipk4s56P/j+unMgq9bvZ1WnkK7YTAbWmSrM3vF3Ky SW+w== 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=Pmo8XKCSpjtk3EmoqMEmquMk0O8qX4MQfPrA9LygcGQ=; b=OQWe17+UqdmA8WW1wBlkJfHPEzYkFx2POmnIW2Oz+gAApjyg6r9kVQQmH+ZoJSsFnU e1OK5oUcBfEDuk86SOONMOH1WeL0gsf5naaCPBx7GF/EwBYOS7DhZwVdvfp1q3f1pQ4e OQFH06c+839wQHIJDificH85CZZeneA6zIdqtKeQHE/FB5tQpw3VCA9bGXFjOhdjbijD NzDBKgXSEiGX0HwLFSDT3dd6eGcZejr4pLEh2vVe8QzaouZ/h3j0xA/gNEBIDzc5vR+l pg8VfGZPZuk51Pfbl3Py6OcWHC6/ZdvZ8d2f1GVHLRl4aLwLpnkBBb9ucRRF+/TYc/2L aD0Q== X-Gm-Message-State: AHPjjUhgZhAJTlbkAbeq/t4s1JRXKsb5/TI9CXS3PZqm/Yi0fDMyjEeI OSH72HBcsPrTtP1W X-Google-Smtp-Source: ADKCNb6tPTqu2cAUY/FVLVwO+WJhs/Bw3WZJlP+mGtmnqDOTalperLpnqIMqHXXlMSk+x9IfvGC5/w== X-Received: by 10.98.20.19 with SMTP id 19mr21800669pfu.167.1505414775680; Thu, 14 Sep 2017 11:46:15 -0700 (PDT) Received: from Asurada-Nvidia.nvidia.com (searspoint.nvidia.com. [216.228.112.21]) by smtp.gmail.com with ESMTPSA id s17sm26273818pgq.25.2017.09.14.11.46.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 14 Sep 2017 11:46:15 -0700 (PDT) From: Nicolin Chen To: vinod.koul@intel.com Cc: fabio.estevam@nxp.com, dan.j.williams@intel.com, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] dmaengine: imx-sdma: Correct src_addr_widths and directions Date: Thu, 14 Sep 2017 11:46:43 -0700 Message-Id: <1505414803-21226-1-git-send-email-nicoleotsuka@gmail.com> X-Mailer: git-send-email 2.1.4 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The driver already supports DMA_DEV_TO_DEV in sdma_config(), DMA_SLAVE_BUSWIDTH_2_BYTES and DMA_SLAVE_BUSWIDTH_1_BYTE in sdma_prep_slave_sg(). So this patch adds them to the lists. Signed-off-by: Nicolin Chen --- drivers/dma/imx-sdma.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index a67ec1b..2184881 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -178,6 +178,14 @@ #define SDMA_WATERMARK_LEVEL_HWE BIT(29) #define SDMA_WATERMARK_LEVEL_CONT BIT(31) +#define SDMA_DMA_BUSWIDTHS (BIT(DMA_SLAVE_BUSWIDTH_1_BYTE) | \ + BIT(DMA_SLAVE_BUSWIDTH_2_BYTES) | \ + BIT(DMA_SLAVE_BUSWIDTH_4_BYTES)) + +#define SDMA_DMA_DIRECTIONS (BIT(DMA_DEV_TO_MEM) | \ + BIT(DMA_MEM_TO_DEV) | \ + BIT(DMA_DEV_TO_DEV)) + /* * Mode/Count of data node descriptors - IPCv2 */ @@ -1851,9 +1859,9 @@ static int sdma_probe(struct platform_device *pdev) sdma->dma_device.device_prep_dma_cyclic = sdma_prep_dma_cyclic; sdma->dma_device.device_config = sdma_config; sdma->dma_device.device_terminate_all = sdma_disable_channel_with_delay; - sdma->dma_device.src_addr_widths = BIT(DMA_SLAVE_BUSWIDTH_4_BYTES); - sdma->dma_device.dst_addr_widths = BIT(DMA_SLAVE_BUSWIDTH_4_BYTES); - sdma->dma_device.directions = BIT(DMA_DEV_TO_MEM) | BIT(DMA_MEM_TO_DEV); + sdma->dma_device.src_addr_widths = SDMA_DMA_BUSWIDTHS; + sdma->dma_device.dst_addr_widths = SDMA_DMA_BUSWIDTHS; + sdma->dma_device.directions = SDMA_DMA_DIRECTIONS; sdma->dma_device.residue_granularity = DMA_RESIDUE_GRANULARITY_SEGMENT; sdma->dma_device.device_issue_pending = sdma_issue_pending; sdma->dma_device.dev->dma_parms = &sdma->dma_parms;