From patchwork Tue Sep 11 08:35:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 10595265 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 770E914E0 for ; Tue, 11 Sep 2018 08:36:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 666C729156 for ; Tue, 11 Sep 2018 08:36:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 58FDE29162; Tue, 11 Sep 2018 08:36:26 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 0B08229156 for ; Tue, 11 Sep 2018 08:36:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726492AbeIKNej (ORCPT ); Tue, 11 Sep 2018 09:34:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:52150 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726387AbeIKNej (ORCPT ); Tue, 11 Sep 2018 09:34:39 -0400 Received: from localhost.localdomain (unknown [171.76.126.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D04A22086E; Tue, 11 Sep 2018 08:36:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1536654985; bh=VYO1dPNu+PynQthrcAInyDKH+FO9NPygZV/Vfne1s7A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fY4euzwZ4e9yfQMviiod5eXVC+hGBKOb02NiHcyjtcOpTvYHCsJho2HkghC1acez/ 0GsJK3zLM36NPxJmL7LAemE3aMzJTtuj5mSQzSbz1X8aRmxVuBcdMFg31psqRkAUsc ysPk7itnSuepXko+VdFr3GUtA0XAgJeJx0C6/KCY= From: Vinod Koul To: dmaengine@vger.kernel.org Cc: Vinod Koul , Ludovic Desroches Subject: [PATCH 01/12] dmaengine: at_hdmac: remove dma_slave_config direction usage Date: Tue, 11 Sep 2018 14:05:25 +0530 Message-Id: <20180911083536.16482-2-vkoul@kernel.org> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180911083536.16482-1-vkoul@kernel.org> References: <20180911083536.16482-1-vkoul@kernel.org> Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP dma_slave_config direction was marked as deprecated quite some time back, remove the usage from this driver so that the field can be removed Signed-off-by: Vinod Koul Acked-by: Ludovic Desroches --- CC: Ludovic Desroches drivers/dma/at_hdmac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c index 75f38d19fcbe..7cbac6e8c113 100644 --- a/drivers/dma/at_hdmac.c +++ b/drivers/dma/at_hdmac.c @@ -1320,7 +1320,7 @@ atc_prep_dma_cyclic(struct dma_chan *chan, dma_addr_t buf_addr, size_t buf_len, if (unlikely(!is_slave_direction(direction))) goto err_out; - if (sconfig->direction == DMA_MEM_TO_DEV) + if (direction == DMA_MEM_TO_DEV) reg_width = convert_buswidth(sconfig->dst_addr_width); else reg_width = convert_buswidth(sconfig->src_addr_width); From patchwork Tue Sep 11 08:35:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 10595267 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 37C266CB for ; Tue, 11 Sep 2018 08:36:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1F44829156 for ; Tue, 11 Sep 2018 08:36:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 13C8229162; Tue, 11 Sep 2018 08:36:29 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 B6FEA29156 for ; Tue, 11 Sep 2018 08:36:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726517AbeIKNem (ORCPT ); Tue, 11 Sep 2018 09:34:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:52174 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726387AbeIKNem (ORCPT ); Tue, 11 Sep 2018 09:34:42 -0400 Received: from localhost.localdomain (unknown [171.76.126.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 181A22086E; Tue, 11 Sep 2018 08:36:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1536654987; bh=H7/i6AZfjmiVIvAvKv6kptmRE51UO7Un1sNatdgCGj8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1OXaG5967s2XqRB08YGJCcjDe6Xew7XmBIP9Ly48uOsggiFBspR64Bw9W+sKKCkir 7+BTTEG5pvSTR7tJ1+AROMolYSzqoVov6HLGbaFbe/D89T+GOD5YP680kt7Lw0qdIh MzEe+gMQakuYdU+72Q3oUBE9nKnIc7tTrGgki06Q= From: Vinod Koul To: dmaengine@vger.kernel.org Cc: Vinod Koul , Ray Jui , Scott Branden Subject: [PATCH 02/12] dmaengine: bcm2835: remove dma_slave_config direction usage Date: Tue, 11 Sep 2018 14:05:26 +0530 Message-Id: <20180911083536.16482-3-vkoul@kernel.org> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180911083536.16482-1-vkoul@kernel.org> References: <20180911083536.16482-1-vkoul@kernel.org> Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP dma_slave_config direction was marked as deprecated quite some time back, remove the usage from this driver so that the field can be removed Signed-off-by: Vinod Koul Acked-by: Scott Branden --- CC: Ray Jui CC: Scott Branden drivers/dma/bcm2835-dma.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/drivers/dma/bcm2835-dma.c b/drivers/dma/bcm2835-dma.c index 847f84a41a69..cad55ab80d41 100644 --- a/drivers/dma/bcm2835-dma.c +++ b/drivers/dma/bcm2835-dma.c @@ -778,14 +778,6 @@ static int bcm2835_dma_slave_config(struct dma_chan *chan, { struct bcm2835_chan *c = to_bcm2835_dma_chan(chan); - if ((cfg->direction == DMA_DEV_TO_MEM && - cfg->src_addr_width != DMA_SLAVE_BUSWIDTH_4_BYTES) || - (cfg->direction == DMA_MEM_TO_DEV && - cfg->dst_addr_width != DMA_SLAVE_BUSWIDTH_4_BYTES) || - !is_slave_direction(cfg->direction)) { - return -EINVAL; - } - c->cfg = *cfg; return 0; From patchwork Tue Sep 11 08:35:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 10595269 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BA8D16CB for ; Tue, 11 Sep 2018 08:36:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A73E629156 for ; Tue, 11 Sep 2018 08:36:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9BFF729162; Tue, 11 Sep 2018 08:36:32 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 36A3429156 for ; Tue, 11 Sep 2018 08:36:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726529AbeIKNeq (ORCPT ); Tue, 11 Sep 2018 09:34:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:52198 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726387AbeIKNeq (ORCPT ); Tue, 11 Sep 2018 09:34:46 -0400 Received: from localhost.localdomain (unknown [171.76.126.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A13772086E; Tue, 11 Sep 2018 08:36:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1536654991; bh=zYa91ZiJ4xME2+3qUM2uyt/jjY4OZ2rvHOU4G/TLMwY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=m2aK/coaAR2N/gNa94WELM3pE+i7IXcyywHzIk3R3qXNvfmquOtZZ47aPT5oOzQZa KOOGNQP1Vaa8cnR/a52ei2yDy6lCQhe0ESKm9w/vQdMI4dqPhy5wj6nd2wu8h1qnna flWsVZzFgvRwuCtJhez3aQx/CYcu33f7ImdaqKiw= From: Vinod Koul To: dmaengine@vger.kernel.org Cc: Vinod Koul , Eric Anholt , Linus Walleij Subject: [PATCH 03/12] dmaengine: coh901318: remove dma_slave_config direction usage Date: Tue, 11 Sep 2018 14:05:27 +0530 Message-Id: <20180911083536.16482-4-vkoul@kernel.org> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180911083536.16482-1-vkoul@kernel.org> References: <20180911083536.16482-1-vkoul@kernel.org> Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP dma_slave_config direction was marked as deprecated quite some time back, remove the usage from this driver so that the field can be removed Signed-off-by: Vinod Koul Acked-by: Linus Walleij --- CC: Eric Anholt CC: Linus Walleij drivers/dma/coh901318.c | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/drivers/dma/coh901318.c b/drivers/dma/coh901318.c index da74fd74636b..eebaba3d9e78 100644 --- a/drivers/dma/coh901318.c +++ b/drivers/dma/coh901318.c @@ -1306,6 +1306,7 @@ struct coh901318_chan { unsigned long nbr_active_done; unsigned long busy; + struct dma_slave_config config; u32 addr; u32 ctrl; @@ -1402,6 +1403,10 @@ static inline struct coh901318_chan *to_coh901318_chan(struct dma_chan *chan) return container_of(chan, struct coh901318_chan, chan); } +static int coh901318_dma_set_runtimeconfig(struct dma_chan *chan, + struct dma_slave_config *config, + enum dma_transfer_direction direction); + static inline const struct coh901318_params * cohc_chan_param(struct coh901318_chan *cohc) { @@ -2360,6 +2365,8 @@ coh901318_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl, if (lli == NULL) goto err_dma_alloc; + coh901318_dma_set_runtimeconfig(chan, &cohc->config, direction); + /* initiate allocated lli list */ ret = coh901318_lli_fill_sg(&cohc->base->pool, lli, sgl, sg_len, cohc->addr, @@ -2499,7 +2506,8 @@ static const struct burst_table burst_sizes[] = { }; static int coh901318_dma_set_runtimeconfig(struct dma_chan *chan, - struct dma_slave_config *config) + struct dma_slave_config *config, + enum dma_transfer_direction direction) { struct coh901318_chan *cohc = to_coh901318_chan(chan); dma_addr_t addr; @@ -2509,11 +2517,11 @@ static int coh901318_dma_set_runtimeconfig(struct dma_chan *chan, int i = 0; /* We only support mem to per or per to mem transfers */ - if (config->direction == DMA_DEV_TO_MEM) { + if (direction == DMA_DEV_TO_MEM) { addr = config->src_addr; addr_width = config->src_addr_width; maxburst = config->src_maxburst; - } else if (config->direction == DMA_MEM_TO_DEV) { + } else if (direction == DMA_MEM_TO_DEV) { addr = config->dst_addr; addr_width = config->dst_addr_width; maxburst = config->dst_maxburst; @@ -2579,6 +2587,16 @@ static int coh901318_dma_set_runtimeconfig(struct dma_chan *chan, return 0; } +static int coh901318_dma_slave_config(struct dma_chan *chan, + struct dma_slave_config *config) +{ + struct coh901318_chan *cohc = to_coh901318_chan(chan); + + memcpy(&cohc->config, config, sizeof(*config)); + + return 0; +} + static void coh901318_base_init(struct dma_device *dma, const int *pick_chans, struct coh901318_base *base) { @@ -2684,7 +2702,7 @@ static int __init coh901318_probe(struct platform_device *pdev) base->dma_slave.device_prep_slave_sg = coh901318_prep_slave_sg; base->dma_slave.device_tx_status = coh901318_tx_status; base->dma_slave.device_issue_pending = coh901318_issue_pending; - base->dma_slave.device_config = coh901318_dma_set_runtimeconfig; + base->dma_slave.device_config = coh901318_dma_slave_config; base->dma_slave.device_pause = coh901318_pause; base->dma_slave.device_resume = coh901318_resume; base->dma_slave.device_terminate_all = coh901318_terminate_all; @@ -2707,7 +2725,7 @@ static int __init coh901318_probe(struct platform_device *pdev) base->dma_memcpy.device_prep_dma_memcpy = coh901318_prep_memcpy; base->dma_memcpy.device_tx_status = coh901318_tx_status; base->dma_memcpy.device_issue_pending = coh901318_issue_pending; - base->dma_memcpy.device_config = coh901318_dma_set_runtimeconfig; + base->dma_memcpy.device_config = coh901318_dma_slave_config; base->dma_memcpy.device_pause = coh901318_pause; base->dma_memcpy.device_resume = coh901318_resume; base->dma_memcpy.device_terminate_all = coh901318_terminate_all; From patchwork Tue Sep 11 08:35:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 10595271 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5E45F14E0 for ; Tue, 11 Sep 2018 08:36:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4EE6D29156 for ; Tue, 11 Sep 2018 08:36:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4362429162; Tue, 11 Sep 2018 08:36:34 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 E689929156 for ; Tue, 11 Sep 2018 08:36:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726546AbeIKNer (ORCPT ); Tue, 11 Sep 2018 09:34:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:52220 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726387AbeIKNer (ORCPT ); Tue, 11 Sep 2018 09:34:47 -0400 Received: from localhost.localdomain (unknown [171.76.126.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B293820870; Tue, 11 Sep 2018 08:36:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1536654992; bh=W9mMSOkcW+9aQIDQReFEmCf+mRnV5aVkzXhQzF7MeiY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Cbs4BqSTAGT9Lo985d2PAeO3x1+TcdkA+HMOVCIuE7+KegjbBiwNHbBzvXSJZ1hyj DyjyCnOr9NpXa9U+iJbqmehGyO5tgirVEdgDgESzJeFRlD/shASyIQ3NakRqvNcOYJ 8RX7ck/zexpU/Yt5nh/GY+fmXfm+cdItZeQtIQcc= From: Vinod Koul To: dmaengine@vger.kernel.org Cc: Vinod Koul Subject: [PATCH 04/12] dmaengine: jz4740: remove dma_slave_config direction usage Date: Tue, 11 Sep 2018 14:05:28 +0530 Message-Id: <20180911083536.16482-5-vkoul@kernel.org> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180911083536.16482-1-vkoul@kernel.org> References: <20180911083536.16482-1-vkoul@kernel.org> Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP dma_slave_config direction was marked as deprecated quite some time back, remove the usage from this driver so that the field can be removed Signed-off-by: Vinod Koul --- drivers/dma/dma-jz4740.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/drivers/dma/dma-jz4740.c b/drivers/dma/dma-jz4740.c index afd5e10f8927..5253e3c0dc04 100644 --- a/drivers/dma/dma-jz4740.c +++ b/drivers/dma/dma-jz4740.c @@ -113,6 +113,7 @@ struct jz4740_dma_desc { struct jz4740_dmaengine_chan { struct virt_dma_chan vchan; unsigned int id; + struct dma_slave_config config; dma_addr_t fifo_addr; unsigned int transfer_shift; @@ -203,8 +204,9 @@ static enum jz4740_dma_transfer_size jz4740_dma_maxburst(u32 maxburst) return JZ4740_DMA_TRANSFER_SIZE_32BYTE; } -static int jz4740_dma_slave_config(struct dma_chan *c, - struct dma_slave_config *config) +static int jz4740_dma_slave_config_write(struct dma_chan *c, + struct dma_slave_config *config, + enum dma_transfer_direction direction) { struct jz4740_dmaengine_chan *chan = to_jz4740_dma_chan(c); struct jz4740_dma_dev *dmadev = jz4740_dma_chan_get_dev(chan); @@ -214,7 +216,7 @@ static int jz4740_dma_slave_config(struct dma_chan *c, enum jz4740_dma_flags flags; uint32_t cmd; - switch (config->direction) { + switch (direction) { case DMA_MEM_TO_DEV: flags = JZ4740_DMA_SRC_AUTOINC; transfer_size = jz4740_dma_maxburst(config->dst_maxburst); @@ -265,6 +267,15 @@ static int jz4740_dma_slave_config(struct dma_chan *c, return 0; } +static int jz4740_dma_slave_config(struct dma_chan *c, + struct dma_slave_config *config) +{ + struct jz4740_dmaengine_chan *chan = to_jz4740_dma_chan(c); + + memcpy(&chan->config, config, sizeof(*config)); + return 0; +} + static int jz4740_dma_terminate_all(struct dma_chan *c) { struct jz4740_dmaengine_chan *chan = to_jz4740_dma_chan(c); @@ -407,6 +418,8 @@ static struct dma_async_tx_descriptor *jz4740_dma_prep_slave_sg( desc->direction = direction; desc->cyclic = false; + jz4740_dma_slave_config_write(c, &chan->config, direction); + return vchan_tx_prep(&chan->vchan, &desc->vdesc, flags); } @@ -438,6 +451,8 @@ static struct dma_async_tx_descriptor *jz4740_dma_prep_dma_cyclic( desc->direction = direction; desc->cyclic = true; + jz4740_dma_slave_config_write(c, &chan->config, direction); + return vchan_tx_prep(&chan->vchan, &desc->vdesc, flags); } From patchwork Tue Sep 11 08:35:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 10595273 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A02F614E0 for ; Tue, 11 Sep 2018 08:36:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 904E029156 for ; Tue, 11 Sep 2018 08:36:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8417729167; Tue, 11 Sep 2018 08:36:41 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 3145229156 for ; Tue, 11 Sep 2018 08:36:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726556AbeIKNeu (ORCPT ); Tue, 11 Sep 2018 09:34:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:52240 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726387AbeIKNeu (ORCPT ); Tue, 11 Sep 2018 09:34:50 -0400 Received: from localhost.localdomain (unknown [171.76.126.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A538520870; Tue, 11 Sep 2018 08:36:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1536654995; bh=YwcRFHdufay0K2mEkRq7eAMIN4m903B1r3ZsP3D8ETg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ihP0WhOosHVy8uokkl5q6dZdlEFhKAwHOxlcmnlL6qG6MoVjSn86A8nk17Fm+6v5v 6XWemjLQsbw+ke0ziRpisPWq5rlCEdRtmSsMvirCKNQHBlKj/PcFAXX+BhM+ia1gjV mO9NgkVXqwAo59iGwXpIRuwvrrT+CO3BMVsrLp90= From: Vinod Koul To: dmaengine@vger.kernel.org Cc: Vinod Koul , Viresh Kumar , Andy Shevchenko Subject: [PATCH 05/12] dmaengine: dw: remove dma_slave_config direction usage Date: Tue, 11 Sep 2018 14:05:29 +0530 Message-Id: <20180911083536.16482-6-vkoul@kernel.org> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180911083536.16482-1-vkoul@kernel.org> References: <20180911083536.16482-1-vkoul@kernel.org> Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP dma_slave_config direction was marked as deprecated quite some time back, remove the usage from this driver so that the field can be removed Signed-off-by: Vinod Koul Acked-by: Andy Shevchenko --- CC: Viresh Kumar CC: Andy Shevchenko drivers/dma/dw/core.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/dma/dw/core.c b/drivers/dma/dw/core.c index f43e6dafe446..d0c3e50b39fb 100644 --- a/drivers/dma/dw/core.c +++ b/drivers/dma/dw/core.c @@ -886,12 +886,7 @@ static int dwc_config(struct dma_chan *chan, struct dma_slave_config *sconfig) */ u32 s = dw->pdata->is_idma32 ? 1 : 2; - /* Check if chan will be configured for slave transfers */ - if (!is_slave_direction(sconfig->direction)) - return -EINVAL; - memcpy(&dwc->dma_sconfig, sconfig, sizeof(*sconfig)); - dwc->direction = sconfig->direction; sc->src_maxburst = sc->src_maxburst > 1 ? fls(sc->src_maxburst) - s : 0; sc->dst_maxburst = sc->dst_maxburst > 1 ? fls(sc->dst_maxburst) - s : 0; From patchwork Tue Sep 11 08:35:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 10595275 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 018096CB for ; Tue, 11 Sep 2018 08:36:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E639429156 for ; Tue, 11 Sep 2018 08:36:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DAAA629162; Tue, 11 Sep 2018 08:36:41 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 571322915A for ; Tue, 11 Sep 2018 08:36:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726563AbeIKNex (ORCPT ); Tue, 11 Sep 2018 09:34:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:52260 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726387AbeIKNex (ORCPT ); Tue, 11 Sep 2018 09:34:53 -0400 Received: from localhost.localdomain (unknown [171.76.126.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3999020870; Tue, 11 Sep 2018 08:36:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1536654997; bh=wSvRLqBbf8LAwqX8if7+TukDJpNxSM3cdanfE/GNx4Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B704ZPEOnrlfiFcQ7z8xrr2XwuitJTsxKjiKE492/tv0EQjpNxeqSFICtm2jP5oDH 69/kyC3Cl3TFULTFbpF2KHwU5iaLLD05BQyKNolbCFSRngVhsvsKWkP7OOCDkXlh7f 7QBHcrJRlBjQ8oB9/afHr53avYGFIKXxgiXw5R0M= From: Vinod Koul To: dmaengine@vger.kernel.org Cc: Vinod Koul Subject: [PATCH 06/12] dmaengine: fsl-edma: remove dma_slave_config direction usage Date: Tue, 11 Sep 2018 14:05:30 +0530 Message-Id: <20180911083536.16482-7-vkoul@kernel.org> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180911083536.16482-1-vkoul@kernel.org> References: <20180911083536.16482-1-vkoul@kernel.org> Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP dma_slave_config direction was marked as deprecated quite some time back, remove the usage from this driver so that the field can be removed Signed-off-by: Vinod Koul --- drivers/dma/fsl-edma.c | 87 ++++++++++++++++++++++++++------------------------ 1 file changed, 46 insertions(+), 41 deletions(-) diff --git a/drivers/dma/fsl-edma.c b/drivers/dma/fsl-edma.c index c7568869284e..f8b4408aedb8 100644 --- a/drivers/dma/fsl-edma.c +++ b/drivers/dma/fsl-edma.c @@ -140,14 +140,6 @@ struct fsl_edma_sw_tcd { struct fsl_edma_hw_tcd *vtcd; }; -struct fsl_edma_slave_config { - enum dma_transfer_direction dir; - enum dma_slave_buswidth addr_width; - u32 dev_addr; - u32 burst; - u32 attr; -}; - struct fsl_edma_chan { struct virt_dma_chan vchan; enum dma_status status; @@ -156,7 +148,8 @@ struct fsl_edma_chan { u32 slave_id; struct fsl_edma_engine *edma; struct fsl_edma_desc *edesc; - struct fsl_edma_slave_config fsc; + struct dma_slave_config cfg; + u32 attr; struct dma_pool *tcd_pool; }; @@ -164,6 +157,7 @@ struct fsl_edma_desc { struct virt_dma_desc vdesc; struct fsl_edma_chan *echan; bool iscyclic; + enum dma_transfer_direction dirn; unsigned int n_tcds; struct fsl_edma_sw_tcd tcd[]; }; @@ -347,20 +341,8 @@ static int fsl_edma_slave_config(struct dma_chan *chan, { struct fsl_edma_chan *fsl_chan = to_fsl_edma_chan(chan); - fsl_chan->fsc.dir = cfg->direction; - if (cfg->direction == DMA_DEV_TO_MEM) { - fsl_chan->fsc.dev_addr = cfg->src_addr; - fsl_chan->fsc.addr_width = cfg->src_addr_width; - fsl_chan->fsc.burst = cfg->src_maxburst; - fsl_chan->fsc.attr = fsl_edma_get_tcd_attr(cfg->src_addr_width); - } else if (cfg->direction == DMA_MEM_TO_DEV) { - fsl_chan->fsc.dev_addr = cfg->dst_addr; - fsl_chan->fsc.addr_width = cfg->dst_addr_width; - fsl_chan->fsc.burst = cfg->dst_maxburst; - fsl_chan->fsc.attr = fsl_edma_get_tcd_attr(cfg->dst_addr_width); - } else { - return -EINVAL; - } + memcpy(&fsl_chan->cfg, cfg, sizeof(*cfg)); + return 0; } @@ -370,7 +352,7 @@ static size_t fsl_edma_desc_residue(struct fsl_edma_chan *fsl_chan, struct fsl_edma_desc *edesc = fsl_chan->edesc; void __iomem *addr = fsl_chan->edma->membase; u32 ch = fsl_chan->vchan.chan.chan_id; - enum dma_transfer_direction dir = fsl_chan->fsc.dir; + enum dma_transfer_direction dir = edesc->dirn; dma_addr_t cur_addr, dma_addr; size_t len, size; int i; @@ -550,7 +532,7 @@ static struct dma_async_tx_descriptor *fsl_edma_prep_dma_cyclic( u32 src_addr, dst_addr, last_sg, nbytes; u16 soff, doff, iter; - if (!is_slave_direction(fsl_chan->fsc.dir)) + if (!is_slave_direction(direction)) return NULL; sg_len = buf_len / period_len; @@ -558,9 +540,21 @@ static struct dma_async_tx_descriptor *fsl_edma_prep_dma_cyclic( if (!fsl_desc) return NULL; fsl_desc->iscyclic = true; + fsl_desc->dirn = direction; dma_buf_next = dma_addr; - nbytes = fsl_chan->fsc.addr_width * fsl_chan->fsc.burst; + if (direction == DMA_MEM_TO_DEV) { + fsl_chan->attr = + fsl_edma_get_tcd_attr(fsl_chan->cfg.dst_addr_width); + nbytes = fsl_chan->cfg.dst_addr_width * + fsl_chan->cfg.dst_maxburst; + } else { + fsl_chan->attr = + fsl_edma_get_tcd_attr(fsl_chan->cfg.src_addr_width); + nbytes = fsl_chan->cfg.src_addr_width * + fsl_chan->cfg.src_maxburst; + } + iter = period_len / nbytes; for (i = 0; i < sg_len; i++) { @@ -570,20 +564,20 @@ static struct dma_async_tx_descriptor *fsl_edma_prep_dma_cyclic( /* get next sg's physical address */ last_sg = fsl_desc->tcd[(i + 1) % sg_len].ptcd; - if (fsl_chan->fsc.dir == DMA_MEM_TO_DEV) { + if (direction == DMA_MEM_TO_DEV) { src_addr = dma_buf_next; - dst_addr = fsl_chan->fsc.dev_addr; - soff = fsl_chan->fsc.addr_width; + dst_addr = fsl_chan->cfg.dst_addr; + soff = fsl_chan->cfg.dst_addr_width; doff = 0; } else { - src_addr = fsl_chan->fsc.dev_addr; + src_addr = fsl_chan->cfg.src_addr; dst_addr = dma_buf_next; soff = 0; - doff = fsl_chan->fsc.addr_width; + doff = fsl_chan->cfg.src_addr_width; } fsl_edma_fill_tcd(fsl_desc->tcd[i].vtcd, src_addr, dst_addr, - fsl_chan->fsc.attr, soff, nbytes, 0, iter, + fsl_chan->attr, soff, nbytes, 0, iter, iter, doff, last_sg, true, false, true); dma_buf_next += period_len; } @@ -603,42 +597,53 @@ static struct dma_async_tx_descriptor *fsl_edma_prep_slave_sg( u16 soff, doff, iter; int i; - if (!is_slave_direction(fsl_chan->fsc.dir)) + if (!is_slave_direction(direction)) return NULL; fsl_desc = fsl_edma_alloc_desc(fsl_chan, sg_len); if (!fsl_desc) return NULL; fsl_desc->iscyclic = false; + fsl_desc->dirn = direction; - nbytes = fsl_chan->fsc.addr_width * fsl_chan->fsc.burst; + if (direction == DMA_MEM_TO_DEV) { + fsl_chan->attr = + fsl_edma_get_tcd_attr(fsl_chan->cfg.dst_addr_width); + nbytes = fsl_chan->cfg.dst_addr_width * + fsl_chan->cfg.dst_maxburst; + } else { + fsl_chan->attr = + fsl_edma_get_tcd_attr(fsl_chan->cfg.src_addr_width); + nbytes = fsl_chan->cfg.src_addr_width * + fsl_chan->cfg.src_maxburst; + } for_each_sg(sgl, sg, sg_len, i) { /* get next sg's physical address */ last_sg = fsl_desc->tcd[(i + 1) % sg_len].ptcd; - if (fsl_chan->fsc.dir == DMA_MEM_TO_DEV) { + if (direction == DMA_MEM_TO_DEV) { src_addr = sg_dma_address(sg); - dst_addr = fsl_chan->fsc.dev_addr; - soff = fsl_chan->fsc.addr_width; + dst_addr = fsl_chan->cfg.dst_addr; + soff = fsl_chan->cfg.dst_addr_width; doff = 0; } else { - src_addr = fsl_chan->fsc.dev_addr; + src_addr = fsl_chan->cfg.src_addr; dst_addr = sg_dma_address(sg); soff = 0; - doff = fsl_chan->fsc.addr_width; + doff = fsl_chan->cfg.src_addr_width; } iter = sg_dma_len(sg) / nbytes; if (i < sg_len - 1) { last_sg = fsl_desc->tcd[(i + 1)].ptcd; fsl_edma_fill_tcd(fsl_desc->tcd[i].vtcd, src_addr, - dst_addr, fsl_chan->fsc.attr, soff, + dst_addr, fsl_chan->attr, soff, nbytes, 0, iter, iter, doff, last_sg, false, false, true); } else { last_sg = 0; fsl_edma_fill_tcd(fsl_desc->tcd[i].vtcd, src_addr, - dst_addr, fsl_chan->fsc.attr, soff, + dst_addr, fsl_chan->attr, soff, nbytes, 0, iter, iter, doff, last_sg, true, true, false); } From patchwork Tue Sep 11 08:35:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 10595277 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BC0796CB for ; Tue, 11 Sep 2018 08:36:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AD95F29156 for ; Tue, 11 Sep 2018 08:36:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A215029167; Tue, 11 Sep 2018 08:36:42 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 5E2A529156 for ; Tue, 11 Sep 2018 08:36:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726569AbeIKNe4 (ORCPT ); Tue, 11 Sep 2018 09:34:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:52292 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726387AbeIKNe4 (ORCPT ); Tue, 11 Sep 2018 09:34:56 -0400 Received: from localhost.localdomain (unknown [171.76.126.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 13D6220880; Tue, 11 Sep 2018 08:36:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1536654999; bh=OaEXva+QICvlkf6bownaIvps4Nr2nG1uFdNNqtz4mY8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lySSBfzLOFrj8I9yeqFlkx1783YVuQm8Uj8hcbcKtFyhBxijwyGIG2K1h1ZjQEPyq Ew08poAuwBWH9ArLpdOSEGtZw1c4ZlAZVBorXCR3jN5Tqt0Sly/ba9X4TFqeYbNv8P JvnP7QzDK0t+xsZI1eCC0izXyk/EnqCsANKmB0V0= From: Vinod Koul To: dmaengine@vger.kernel.org Cc: Vinod Koul , Andy Shevchenko Subject: [PATCH 07/12] dmaengine: hsu: remove dma_slave_config direction usage Date: Tue, 11 Sep 2018 14:05:31 +0530 Message-Id: <20180911083536.16482-8-vkoul@kernel.org> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180911083536.16482-1-vkoul@kernel.org> References: <20180911083536.16482-1-vkoul@kernel.org> Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP dma_slave_config direction was marked as deprecated quite some time back, remove the usage from this driver so that the field can be removed Signed-off-by: Vinod Koul Acked-by: Andy Shevchenko --- CC: Andy Shevchenko drivers/dma/hsu/hsu.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/dma/hsu/hsu.c b/drivers/dma/hsu/hsu.c index 202ffa9f7611..e06f20272fd7 100644 --- a/drivers/dma/hsu/hsu.c +++ b/drivers/dma/hsu/hsu.c @@ -348,10 +348,6 @@ static int hsu_dma_slave_config(struct dma_chan *chan, { struct hsu_dma_chan *hsuc = to_hsu_dma_chan(chan); - /* Check if chan will be configured for slave transfers */ - if (!is_slave_direction(config->direction)) - return -EINVAL; - memcpy(&hsuc->config, config, sizeof(hsuc->config)); return 0; From patchwork Tue Sep 11 08:35:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 10595279 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F331B14E5 for ; Tue, 11 Sep 2018 08:36:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E389C29156 for ; Tue, 11 Sep 2018 08:36:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D85FF2915A; Tue, 11 Sep 2018 08:36:42 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 9686A29162 for ; Tue, 11 Sep 2018 08:36:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726387AbeIKNe4 (ORCPT ); Tue, 11 Sep 2018 09:34:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:52302 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726547AbeIKNe4 (ORCPT ); Tue, 11 Sep 2018 09:34:56 -0400 Received: from localhost.localdomain (unknown [171.76.126.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3853520881; Tue, 11 Sep 2018 08:36:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1536655001; bh=qAt9WdW/ehc/cYraQU7loq8iaHl2TmbST+88XdUUlJM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tauRlDpsjvjFR0PBkRt8dKfTVrJaEAks5v6Kr6Y8CX+uhphgQYAlH/ayjl4EjlEhS rEpIeXi60GkF+7aBkWA0HruAwI/ZcpWfnOZ7lNgPCNjoq5k3ifKEcp4ObjvCBnGhSe TgiKmK6xxkfNzhk3/s5MFuVR0wbr6wHQl8xRbkxw= From: Vinod Koul To: dmaengine@vger.kernel.org Cc: Vinod Koul , Andy Shevchenko Subject: [PATCH 08/12] dmaengine: idma: remove dma_slave_config direction usage Date: Tue, 11 Sep 2018 14:05:32 +0530 Message-Id: <20180911083536.16482-9-vkoul@kernel.org> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180911083536.16482-1-vkoul@kernel.org> References: <20180911083536.16482-1-vkoul@kernel.org> Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP dma_slave_config direction was marked as deprecated quite some time back, remove the usage from this driver so that the field can be removed Signed-off-by: Vinod Koul Acked-by: Andy Shevchenko --- CC: Andy Shevchenko drivers/dma/idma64.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/dma/idma64.c b/drivers/dma/idma64.c index 1fbf9cb9b742..40dc5d2ddf3d 100644 --- a/drivers/dma/idma64.c +++ b/drivers/dma/idma64.c @@ -408,10 +408,6 @@ static int idma64_slave_config(struct dma_chan *chan, { struct idma64_chan *idma64c = to_idma64_chan(chan); - /* Check if chan will be configured for slave transfers */ - if (!is_slave_direction(config->direction)) - return -EINVAL; - memcpy(&idma64c->config, config, sizeof(idma64c->config)); convert_burst(&idma64c->config.src_maxburst); From patchwork Tue Sep 11 08:35:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 10595281 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 669AA6CB for ; Tue, 11 Sep 2018 08:36:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5678629156 for ; Tue, 11 Sep 2018 08:36:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4B0B429162; Tue, 11 Sep 2018 08:36:45 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 E086329156 for ; Tue, 11 Sep 2018 08:36:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726572AbeIKNe6 (ORCPT ); Tue, 11 Sep 2018 09:34:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:52318 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726547AbeIKNe6 (ORCPT ); Tue, 11 Sep 2018 09:34:58 -0400 Received: from localhost.localdomain (unknown [171.76.126.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5CC9320870; Tue, 11 Sep 2018 08:36:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1536655003; bh=IOS9jx/zhvP2HJ4aeGn0nBgEiLp//2rTY4KwqHrx0AU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I5Hp/WfN70t8HxnhxVlKKb9sGaTcMEbA57uWnc7hL6FdKt7k55aAVqttBUS6e3xB7 3geA9qPj0Ke0JCYlSergioOL6IfG5So4S8nFvT6MYuWPWoSUE7a0fw2hCXv9HQqYmz vXHM9Dehz4qm1m4ZG8fXLfGVYCnNzCof4tct63UU= From: Vinod Koul To: dmaengine@vger.kernel.org Cc: Vinod Koul , Fabio Estevam Subject: [PATCH 09/12] dmaengine: imx-dma: remove dma_slave_config direction usage Date: Tue, 11 Sep 2018 14:05:33 +0530 Message-Id: <20180911083536.16482-10-vkoul@kernel.org> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180911083536.16482-1-vkoul@kernel.org> References: <20180911083536.16482-1-vkoul@kernel.org> Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP dma_slave_config direction was marked as deprecated quite some time back, remove the usage from this driver so that the field can be removed Signed-off-by: Vinod Koul --- CC: Fabio Estevam drivers/dma/imx-dma.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/drivers/dma/imx-dma.c b/drivers/dma/imx-dma.c index 75b6ff0415ee..c2fff3f6c9ca 100644 --- a/drivers/dma/imx-dma.c +++ b/drivers/dma/imx-dma.c @@ -162,6 +162,7 @@ struct imxdma_channel { bool enabled_2d; int slot_2d; unsigned int irq; + struct dma_slave_config config; }; enum imx_dma_type { @@ -675,14 +676,15 @@ static int imxdma_terminate_all(struct dma_chan *chan) return 0; } -static int imxdma_config(struct dma_chan *chan, - struct dma_slave_config *dmaengine_cfg) +static int imxdma_config_write(struct dma_chan *chan, + struct dma_slave_config *dmaengine_cfg, + enum dma_transfer_direction direction) { struct imxdma_channel *imxdmac = to_imxdma_chan(chan); struct imxdma_engine *imxdma = imxdmac->imxdma; unsigned int mode = 0; - if (dmaengine_cfg->direction == DMA_DEV_TO_MEM) { + if (direction == DMA_DEV_TO_MEM) { imxdmac->per_address = dmaengine_cfg->src_addr; imxdmac->watermark_level = dmaengine_cfg->src_maxburst; imxdmac->word_size = dmaengine_cfg->src_addr_width; @@ -723,6 +725,16 @@ static int imxdma_config(struct dma_chan *chan, return 0; } +static int imxdma_config(struct dma_chan *chan, + struct dma_slave_config *dmaengine_cfg) +{ + struct imxdma_channel *imxdmac = to_imxdma_chan(chan); + + memcpy(&imxdmac->config, dmaengine_cfg, sizeof(*dmaengine_cfg)); + + return 0; +} + static enum dma_status imxdma_tx_status(struct dma_chan *chan, dma_cookie_t cookie, struct dma_tx_state *txstate) @@ -905,6 +917,8 @@ static struct dma_async_tx_descriptor *imxdma_prep_dma_cyclic( desc->desc.callback = NULL; desc->desc.callback_param = NULL; + imxdma_config_write(chan, &imxdmac->config, direction); + return &desc->desc; } From patchwork Tue Sep 11 08:35:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 10595283 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A4D426CB for ; Tue, 11 Sep 2018 08:36:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 956EF29156 for ; Tue, 11 Sep 2018 08:36:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8A18E29162; Tue, 11 Sep 2018 08:36:47 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 2B82429156 for ; Tue, 11 Sep 2018 08:36:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726670AbeIKNfB (ORCPT ); Tue, 11 Sep 2018 09:35:01 -0400 Received: from mail.kernel.org ([198.145.29.99]:52338 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726547AbeIKNfB (ORCPT ); Tue, 11 Sep 2018 09:35:01 -0400 Received: from localhost.localdomain (unknown [171.76.126.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 81BD220880; Tue, 11 Sep 2018 08:36:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1536655006; bh=BwsAZc238C9odLx+oP2I4FQy0z9GL2o4Efchzkn9hUs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VrZBzjQsbMsof16Fym/6veP6Om/YG5JYeowT//kE1OfTc/mzmTni/Xaxk8l+f3wOq qzsE9p4vlLWsaK3oElXARN7RgkXd/flPRspkvHa70SYUqjzRQ8AucGXllQeqDpTTSa b4vbUbAC5yKCxj0XJmtTHKD+3o9/znSrkQIjfRJo= From: Vinod Koul To: dmaengine@vger.kernel.org Cc: Vinod Koul , Zhangfei Gao Subject: [PATCH 10/12] dmaengine: k3dma: remove dma_slave_config direction usage Date: Tue, 11 Sep 2018 14:05:34 +0530 Message-Id: <20180911083536.16482-11-vkoul@kernel.org> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180911083536.16482-1-vkoul@kernel.org> References: <20180911083536.16482-1-vkoul@kernel.org> Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP dma_slave_config direction was marked as deprecated quite some time back, remove the usage from this driver so that the field can be removed Signed-off-by: Vinod Koul --- CC: Zhangfei Gao drivers/dma/k3dma.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/drivers/dma/k3dma.c b/drivers/dma/k3dma.c index 6bfa217ed6d0..10e2e0a0735b 100644 --- a/drivers/dma/k3dma.c +++ b/drivers/dma/k3dma.c @@ -91,6 +91,7 @@ struct k3_dma_chan { dma_addr_t dev_addr; enum dma_status status; bool cyclic; + struct dma_slave_config slave_config; }; struct k3_dma_phy { @@ -118,6 +119,10 @@ struct k3_dma_dev { #define to_k3_dma(dmadev) container_of(dmadev, struct k3_dma_dev, slave) +static int k3_dma_config_write(struct dma_chan *chan, + enum dma_transfer_direction dir, + struct dma_slave_config *cfg); + static struct k3_dma_chan *to_k3_chan(struct dma_chan *chan) { return container_of(chan, struct k3_dma_chan, vc.chan); @@ -542,6 +547,7 @@ static struct dma_async_tx_descriptor *k3_dma_prep_slave_sg( if (!ds) return NULL; num = 0; + k3_dma_config_write(chan, dir, &c->slave_config); for_each_sg(sgl, sg, sglen, i) { addr = sg_dma_address(sg); @@ -602,6 +608,7 @@ k3_dma_prep_dma_cyclic(struct dma_chan *chan, dma_addr_t buf_addr, avail = buf_len; total = avail; num = 0; + k3_dma_config_write(chan, dir, &c->slave_config); if (period_len < modulo) modulo = period_len; @@ -642,13 +649,21 @@ static int k3_dma_config(struct dma_chan *chan, struct dma_slave_config *cfg) { struct k3_dma_chan *c = to_k3_chan(chan); + + memcpy(&c->slave_config, cfg, sizeof(*cfg)); + + return 0; +} + +static int k3_dma_config_write(struct dma_chan *chan, + enum dma_transfer_direction dir, + struct dma_slave_config *cfg) +{ + struct k3_dma_chan *c = to_k3_chan(chan); u32 maxburst = 0, val = 0; enum dma_slave_buswidth width = DMA_SLAVE_BUSWIDTH_UNDEFINED; - if (cfg == NULL) - return -EINVAL; - c->dir = cfg->direction; - if (c->dir == DMA_DEV_TO_MEM) { + if (dir == DMA_DEV_TO_MEM) { c->ccfg = CX_CFG_DSTINCR; c->dev_addr = cfg->src_addr; maxburst = cfg->src_maxburst; From patchwork Tue Sep 11 08:35:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 10595285 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B144414E0 for ; Tue, 11 Sep 2018 08:36:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A25F229156 for ; Tue, 11 Sep 2018 08:36:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 89B5D29162; Tue, 11 Sep 2018 08:36:49 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 3718429156 for ; Tue, 11 Sep 2018 08:36:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726488AbeIKNfD (ORCPT ); Tue, 11 Sep 2018 09:35:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:52358 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726547AbeIKNfD (ORCPT ); Tue, 11 Sep 2018 09:35:03 -0400 Received: from localhost.localdomain (unknown [171.76.126.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A694B20882; Tue, 11 Sep 2018 08:36:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1536655008; bh=F4b5OuvJP3ZFhUyVvPxEsuSN3nbihBdgsMjhxIVWl5s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wBjtaXGz2pLSHBTrK2sbNpsZOofYPzWK33m+p+XcHzxr1R1UbbtvklbBK0cjE8sIK ZMdCDe1Xe2mvMc47OSlLJSDYbyIQFqGaVHzNTf/biMrb9RO9WEBWXk0y/WvtBFW1LQ JZj3UKZrz0jen1EHhhL75cKEuer3EMq0Z7WjuHvk= From: Vinod Koul To: dmaengine@vger.kernel.org Cc: Vinod Koul Subject: [PATCH 11/12] dmaengine: ep93xx_dma: remove dma_slave_config direction usage Date: Tue, 11 Sep 2018 14:05:35 +0530 Message-Id: <20180911083536.16482-12-vkoul@kernel.org> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180911083536.16482-1-vkoul@kernel.org> References: <20180911083536.16482-1-vkoul@kernel.org> Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP dma_slave_config direction was marked as deprecated quite some time back, remove the usage from this driver so that the field can be removed Signed-off-by: Vinod Koul --- drivers/dma/ep93xx_dma.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/drivers/dma/ep93xx_dma.c b/drivers/dma/ep93xx_dma.c index a15592383d4e..f674eb5fbbef 100644 --- a/drivers/dma/ep93xx_dma.c +++ b/drivers/dma/ep93xx_dma.c @@ -109,6 +109,9 @@ #define DMA_MAX_CHAN_DESCRIPTORS 32 struct ep93xx_dma_engine; +static int ep93xx_dma_slave_config_write(struct dma_chan *chan, + enum dma_transfer_direction dir, + struct dma_slave_config *config); /** * struct ep93xx_dma_desc - EP93xx specific transaction descriptor @@ -180,6 +183,7 @@ struct ep93xx_dma_chan { struct list_head free_list; u32 runtime_addr; u32 runtime_ctrl; + struct dma_slave_config slave_config; }; /** @@ -1051,6 +1055,8 @@ ep93xx_dma_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl, return NULL; } + ep93xx_dma_slave_config_write(chan, dir, &edmac->slave_config); + first = NULL; for_each_sg(sgl, sg, sg_len, i) { size_t len = sg_dma_len(sg); @@ -1136,6 +1142,8 @@ ep93xx_dma_prep_dma_cyclic(struct dma_chan *chan, dma_addr_t dma_addr, return NULL; } + ep93xx_dma_slave_config_write(chan, dir, &edmac->slave_config); + /* Split the buffer into period size chunks */ first = NULL; for (offset = 0; offset < buf_len; offset += period_len) { @@ -1227,6 +1235,17 @@ static int ep93xx_dma_slave_config(struct dma_chan *chan, struct dma_slave_config *config) { struct ep93xx_dma_chan *edmac = to_ep93xx_dma_chan(chan); + + memcpy(&edmac->slave_config, config, sizeof(*config)); + + return 0; +} + +static int ep93xx_dma_slave_config_write(struct dma_chan *chan, + enum dma_transfer_direction dir, + struct dma_slave_config *config) +{ + struct ep93xx_dma_chan *edmac = to_ep93xx_dma_chan(chan); enum dma_slave_buswidth width; unsigned long flags; u32 addr, ctrl; @@ -1234,7 +1253,7 @@ static int ep93xx_dma_slave_config(struct dma_chan *chan, if (!edmac->edma->m2m) return -EINVAL; - switch (config->direction) { + switch (dir) { case DMA_DEV_TO_MEM: width = config->src_addr_width; addr = config->src_addr; From patchwork Tue Sep 11 08:35:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 10595287 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8AF3C14E0 for ; Tue, 11 Sep 2018 08:36:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7478C29162 for ; Tue, 11 Sep 2018 08:36:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 689DA29207; Tue, 11 Sep 2018 08:36:51 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 12CF629162 for ; Tue, 11 Sep 2018 08:36:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726519AbeIKNfF (ORCPT ); Tue, 11 Sep 2018 09:35:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:52376 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726517AbeIKNfF (ORCPT ); Tue, 11 Sep 2018 09:35:05 -0400 Received: from localhost.localdomain (unknown [171.76.126.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2221720870; Tue, 11 Sep 2018 08:36:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1536655010; bh=PtCuXlnwF2Ru6PdDJYz8Pc4AfSe+fa4pBcnW3ZVSPTM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RPBurPeBzRA7ljePzqwN5jtn7peuzJC4TAfC5Dx4IjIZKdwspVU2GjUDidyNMF1Z7 XWtiJpxcIj31G5VJ2ypiaeKyvlZlCHgeGIZvbY1Unqt/zAJh9014pYWqu+Rg8IT1Nr CB8axITy8XvRwyLpXEdWryWRK40rOlR+MOVr8y4w= From: Vinod Koul To: dmaengine@vger.kernel.org Cc: Vinod Koul Subject: [PATCH 12/12] dmaengine: mmp_tdma: remove dma_slave_config direction usage Date: Tue, 11 Sep 2018 14:05:36 +0530 Message-Id: <20180911083536.16482-13-vkoul@kernel.org> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180911083536.16482-1-vkoul@kernel.org> References: <20180911083536.16482-1-vkoul@kernel.org> Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP dma_slave_config direction was marked as deprecated quite some time back, remove the usage from this driver so that the field can be removed Signed-off-by: Vinod Koul --- drivers/dma/mmp_tdma.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/drivers/dma/mmp_tdma.c b/drivers/dma/mmp_tdma.c index 13c68b6434ce..c14f8820a567 100644 --- a/drivers/dma/mmp_tdma.c +++ b/drivers/dma/mmp_tdma.c @@ -116,6 +116,7 @@ struct mmp_tdma_chan { u32 burst_sz; enum dma_slave_buswidth buswidth; enum dma_status status; + struct dma_slave_config slave_config; int idx; enum mmp_tdma_type type; @@ -139,6 +140,10 @@ struct mmp_tdma_device { #define to_mmp_tdma_chan(dchan) container_of(dchan, struct mmp_tdma_chan, chan) +static int mmp_tdma_config_write(struct dma_chan *chan, + enum dma_transfer_direction dir, + struct dma_slave_config *dmaengine_cfg); + static void mmp_tdma_chan_set_desc(struct mmp_tdma_chan *tdmac, dma_addr_t phys) { writel(phys, tdmac->reg_base + TDNDPR); @@ -442,6 +447,8 @@ static struct dma_async_tx_descriptor *mmp_tdma_prep_dma_cyclic( if (!desc) goto err_out; + mmp_tdma_config_write(chan, direction, &tdmac->slave_config); + while (buf < buf_len) { desc = &tdmac->desc_arr[i]; @@ -495,7 +502,18 @@ static int mmp_tdma_config(struct dma_chan *chan, { struct mmp_tdma_chan *tdmac = to_mmp_tdma_chan(chan); - if (dmaengine_cfg->direction == DMA_DEV_TO_MEM) { + memcpy(&tdmac->slave_config, dmaengine_cfg, sizeof(*dmaengine_cfg)); + + return 0; +} + +static int mmp_tdma_config_write(struct dma_chan *chan, + enum dma_transfer_direction dir, + struct dma_slave_config *dmaengine_cfg) +{ + struct mmp_tdma_chan *tdmac = to_mmp_tdma_chan(chan); + + if (dir == DMA_DEV_TO_MEM) { tdmac->dev_addr = dmaengine_cfg->src_addr; tdmac->burst_sz = dmaengine_cfg->src_maxburst; tdmac->buswidth = dmaengine_cfg->src_addr_width; @@ -504,7 +522,7 @@ static int mmp_tdma_config(struct dma_chan *chan, tdmac->burst_sz = dmaengine_cfg->dst_maxburst; tdmac->buswidth = dmaengine_cfg->dst_addr_width; } - tdmac->dir = dmaengine_cfg->direction; + tdmac->dir = dir; return mmp_tdma_config_chan(chan); }