From patchwork Sun Nov 11 15:47:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 150771 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2155546ljp; Sun, 11 Nov 2018 07:47:28 -0800 (PST) X-Google-Smtp-Source: AJdET5cOoJNxiNU4BWPDdyNBJwgZYwPzkZT1pfvPMWiGfKLmVJV8CQi8CZe3+GmLRoJgGD1gfq/j X-Received: by 2002:a63:ef47:: with SMTP id c7mr14521929pgk.386.1541951248668; Sun, 11 Nov 2018 07:47:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541951248; cv=none; d=google.com; s=arc-20160816; b=BOQ4JXebSbw+LOe1Uy7AVYoGh5HWusTBaZpzjp4IZL0ANpzw9iUA+i6A7sG2eR0VTq vgtQwwKuecA205yE04QYZPiPtipziazQLhmPZh+5F4hGd3Oyf9qroMzgUj/6X5Sz6giW Ap7GbzQ1EuvSTKl09dyZrOOLuNhV2Pql4+2ipmbG0zgEYxX7SYOC3ek94id/yf5YI0tD Ot2y9e8csIOdO2pvVEPl7krY4OE4Qdyy3DY4GuunubnpEiXC1l3oResNB1daF+U3MXIR RPbezrJHhNJ+RUiyWSy4IwSB+g5scMJ3jc8fUbERHpT1Q8PWeZnbfNQNq594apt8jgmo pQcg== 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=XWwABUNdrsYtSjsjpC+FjROp/FQ4i/depCmxd5Ry1OA=; b=kLjE/PLfuUx56SdRU4KxIcfRqKOng+uURn67NbFbkcOOqkJdOe5ZMWVA6Bpv94FiN+ 78MjHmXgG50gC0pqTPqC0R+ig7wJ+Bk0MPsk7GIrrOtxpqJVK0avaQeL006tOFlw8kf3 jL9qnjj/1XblI8qWAdndRqvsUpOqmCmRMWeHtT10iEVCJtgHxt8GqaIjbRKw/3mhJPIh BqRCWh/Ick/nCaERNiYN/4A+fBgygxrnLEcsZLIOVeZ2s9X2HVouapCo23j3hcIudORa 19CQKt0di7FpUS7ORtOT4OQ42r0Fd6ed7d3gqHrKrvEXTLIkMuoDn1J9zI+Vm6/bJO7l orfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=gP84qO1Y; 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 l184si13183057pgd.523.2018.11.11.07.47.28; Sun, 11 Nov 2018 07:47:28 -0800 (PST) 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=gP84qO1Y; 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 S1728704AbeKLBgU (ORCPT + 3 others); Sun, 11 Nov 2018 20:36:20 -0500 Received: from mail.kernel.org ([198.145.29.99]:56010 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728542AbeKLBgU (ORCPT ); Sun, 11 Nov 2018 20:36:20 -0500 Received: from vkoul-mobl.Dlink (unknown [49.207.50.99]) (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 2DD0321104; Sun, 11 Nov 2018 15:47:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541951247; bh=bIW9bR06N1/HXYWtT10dORcB09VCICEnJCyDIxZqilQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gP84qO1YrTFOM+LPHlzmIubnpqrG0ok8+XTzRSVgqhcDTNiCtGfWd7R2VaRq4+pqs fQ8vHOkxtNzQTWwp7FtG6ORq1975EQv35EDsve+Y4arbTQH02BDzpe2ijGQHoLBM8W p/UuCoS5fIfhxFKe81nbWghGQo5rhX8QknYXXEY0= From: Vinod Koul To: dmaengine@vger.kernel.org Cc: Vinod Koul Subject: [PATCH 4/5] dmaengine: pl330: remove dma_slave_config direction usage Date: Sun, 11 Nov 2018 21:17:09 +0530 Message-Id: <20181111154710.26904-5-vkoul@kernel.org> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20181111154710.26904-1-vkoul@kernel.org> References: <20181111154710.26904-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/pl330.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) -- 2.14.4 diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index 88750a34e859..cff1b143fff5 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c @@ -448,6 +448,7 @@ struct dma_pl330_chan { /* DMA-mapped view of the FIFO; may differ if an IOMMU is present */ dma_addr_t fifo_dma; enum dma_data_direction dir; + struct dma_slave_config slave_config; /* for cyclic capability */ bool cyclic; @@ -542,6 +543,10 @@ struct _xfer_spec { struct dma_pl330_desc *desc; }; +static int pl330_config_write(struct dma_chan *chan, + struct dma_slave_config *slave_config, + enum dma_transfer_direction direction); + static inline bool _queue_full(struct pl330_thread *thrd) { return thrd->req[0].desc != NULL && thrd->req[1].desc != NULL; @@ -2220,20 +2225,21 @@ static int fixup_burst_len(int max_burst_len, int quirks) return max_burst_len; } -static int pl330_config(struct dma_chan *chan, - struct dma_slave_config *slave_config) +static int pl330_config_write(struct dma_chan *chan, + struct dma_slave_config *slave_config, + enum dma_transfer_direction direction) { struct dma_pl330_chan *pch = to_pchan(chan); pl330_unprep_slave_fifo(pch); - if (slave_config->direction == DMA_MEM_TO_DEV) { + if (direction == DMA_MEM_TO_DEV) { if (slave_config->dst_addr) pch->fifo_addr = slave_config->dst_addr; if (slave_config->dst_addr_width) pch->burst_sz = __ffs(slave_config->dst_addr_width); pch->burst_len = fixup_burst_len(slave_config->dst_maxburst, pch->dmac->quirks); - } else if (slave_config->direction == DMA_DEV_TO_MEM) { + } else if (direction == DMA_DEV_TO_MEM) { if (slave_config->src_addr) pch->fifo_addr = slave_config->src_addr; if (slave_config->src_addr_width) @@ -2245,6 +2251,16 @@ static int pl330_config(struct dma_chan *chan, return 0; } +static int pl330_config(struct dma_chan *chan, + struct dma_slave_config *slave_config) +{ + struct dma_pl330_chan *pch = to_pchan(chan); + + memcpy(&pch->slave_config, slave_config, sizeof(*slave_config)); + + return 0; +} + static int pl330_terminate_all(struct dma_chan *chan) { struct dma_pl330_chan *pch = to_pchan(chan); @@ -2661,6 +2677,8 @@ static struct dma_async_tx_descriptor *pl330_prep_dma_cyclic( return NULL; } + pl330_config_write(chan, &pch->slave_config, direction); + if (!pl330_prep_slave_fifo(pch, direction)) return NULL; @@ -2815,6 +2833,8 @@ pl330_prep_slave_sg(struct dma_chan *chan, struct scatterlist *sgl, if (unlikely(!pch || !sgl || !sg_len)) return NULL; + pl330_config_write(chan, &pch->slave_config, direction); + if (!pl330_prep_slave_fifo(pch, direction)) return NULL;