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: 146965 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp3386166ljw; Tue, 11 Sep 2018 01:36:34 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbiRizcyNiHn5pNX84rr9OKt0o8TRYlGsDuC9Dp80YVMRHf5/ACkGUxWeGoLItotsLogirr X-Received: by 2002:a17:902:e281:: with SMTP id cf1-v6mr26031373plb.86.1536654994142; Tue, 11 Sep 2018 01:36:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536654994; cv=none; d=google.com; s=arc-20160816; b=VnRAzHnoOEARkSLX2jNAnqU8tmnpUsiMF5YnhcaZQKcvCF0jJybJiHmUBX3EtkD+Ir 8fDaHovAu0YZwKjaLmubHRK5LFjVCrxjsSRX8Ad1Rr8D9uSedTGqzRIvuLccsT5ZcB2U 7AvIbVtrSJef7F+5YnkeO5sgZz2gJWeOcSkD7mQ5G/1c6IXw+EjMr+4Gq6ImNZNN/Lo8 7GlVxO5xQ29ByWE1jsfeW9iqbSVjzx90Cm0FlKUmMQOUZCMoSfan1xTnVfrDAsXbJeGQ WbuHajvm6NCBsJGn0lCHlga5MOvItrZ9UMyFe6uWK88sZJuzHAJUDMj6keFig5YUlX1T lGXw== 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:message-id:date :subject:cc:to:from:dkim-signature; bh=PLK/FZK+q8ksbJ4UsCthBWOnra0zk4K27sMfxRxU3zY=; b=y4SqoWDIA2Vc5HyO8zOWfRf1vYPp0AMPE+YKmLaEWauMH5D2UiCxLuOx9y3RpVr3Oz t4ubpI7QCQrRkCoPPhUFBWfDhXUnvARchyTEoJeMARzqsQ9UX7hIl8tKQVvooS2zvI8s qMTX8H+5IAibd8zsy8Zv8NZD0/qOxkx9Jm3kEYzhovnoOf0SO6vWA+ezhFE+C7w880ZM XPpC0AKWmf7ChCLHWR8w0IC8BhMSqjh64b/6cFeg5fhoK6dqunM1b/VVMYU+bQipX1PQ 6X2evCGqzpAQDK0oafaaFQo9wrXG35ut388Vaihidwt8psgEr8xR6SMiNctuaJURFr1h mPSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Cbs4BqST; spf=pass (google.com: best guess record for domain of dmaengine-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=dmaengine-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 21-v6si19613906pfy.169.2018.09.11.01.36.33; Tue, 11 Sep 2018 01:36:34 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dmaengine-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=@kernel.org header.s=default header.b=Cbs4BqST; spf=pass (google.com: best guess record for domain of dmaengine-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=dmaengine-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726546AbeIKNer (ORCPT + 3 others); 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 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(-) -- 2.14.4 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); }