From patchwork Sun Nov 11 15:47:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 150772 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2155572ljp; Sun, 11 Nov 2018 07:47:31 -0800 (PST) X-Google-Smtp-Source: AJdET5ezqRLWC65p5OqPuy4ir4OKfZS83CB4+5llsFfQm/6mLjLK/PythNJmBTfU5rZi3j5kLLc1 X-Received: by 2002:a62:714a:: with SMTP id m71-v6mr17409921pfc.89.1541951250919; Sun, 11 Nov 2018 07:47:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541951250; cv=none; d=google.com; s=arc-20160816; b=KyNVfLEm4tDiIHLAS2R4+9lFPr4XtnN8HJdzgyHafCVKuHTeqcmI6Jw5CEyVb2a+yX M6XRc8RUqlW+OqPtnczIuAlsSX+6RhVkNbX20zDwic7ZcG72Vd+yrsg2o7QNcMD6ITic gJg+m+w5q+cpxfx3So6/E7hKc1NfQQnQYMopfSB7xO29oESZh/+w5KovLSGyYbBw9j5H 1ZcKn6F6aLdchjBLr4K2Q76y8ggyWqUNnf7zY91xtuAmxQEzq1g1cp1q/kLLvsOGFLTx Xg+5lT5wkAfGzV0U6eIKdARhnUNhaJKTOQSBY4JrxH8xmU6l5o7L/rTt7uaDpidvo817 Rifg== 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=vOwPJ2zIWGA1Oekba2Ze6PG8M8nQcIoo3dtHOO12DjI=; b=eTJMRyFAWOxOlRRiWpNDrAHJozxrj7n6nlGQ67zi1r/Dllv19b3clmurEMmMzs6VF7 BjIi7WQ8WY3bVehEX5P2M9MD7yMlF3SdDhf8pSxeTbOdAYnqXkRUo7fwiz8yofHVKnsD L+OAyli3klNEIm+gDRxZXUzp40CPYe3s52w4flzre2Fg7qX9dcUCkNVOfSi3JFltuXW9 rqTWBV3fA5YRolXaHDbOiXhPHzdxEPepdKUXbcj04uk5cAQZICmooIwZUGMEXNvOJAKJ t2c4PNHJ2JYpol9BmjyvQoq/tsa+YnPb9761uF6ItpTW3qT25ywCWOPwZE5NiOrHfvPd kpDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ZvN8J5kp; 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.30; Sun, 11 Nov 2018 07:47:30 -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=ZvN8J5kp; 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 S1728706AbeKLBgX (ORCPT + 3 others); Sun, 11 Nov 2018 20:36:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:56016 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728542AbeKLBgX (ORCPT ); Sun, 11 Nov 2018 20:36:23 -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 076FF21479; Sun, 11 Nov 2018 15:47:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541951249; bh=OCKBFRvaknMPpC4BRtQscYyEqqD8Vaypv5wqnZ242WQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZvN8J5kpgklT49y+uyVoh2QkU/wrop3hL0WBCx7wb5pNNTPDw5RmFCE2vm8Kc3KoG 2obEoCFeVZv+rr9fpIRwmn2QsmAyWDoiBGjO3oODF6uhu4umpYXy54qIx5EkoftqjC bCDnf+k3XbD4kuyb7Y7J2g9168MTotZZZF16iCZQ= From: Vinod Koul To: dmaengine@vger.kernel.org Cc: Vinod Koul , Linus Walleij Subject: [PATCH 5/5] dmaengine: ste_dma40: remove dma_slave_config direction usage Date: Sun, 11 Nov 2018 21:17:10 +0530 Message-Id: <20181111154710.26904-6-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/ste_dma40.c | 31 +++++++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) -- 2.14.4 Reviewed-by: Linus Walleij diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c index 5e328bd10c27..907ae97a3ef4 100644 --- a/drivers/dma/ste_dma40.c +++ b/drivers/dma/ste_dma40.c @@ -442,6 +442,7 @@ struct d40_base; * @queue: Queued jobs. * @prepare_queue: Prepared jobs. * @dma_cfg: The client configuration of this dma channel. + * @slave_config: DMA slave configuration. * @configured: whether the dma_cfg configuration is valid * @base: Pointer to the device instance struct. * @src_def_cfg: Default cfg register setting for src. @@ -468,6 +469,7 @@ struct d40_chan { struct list_head queue; struct list_head prepare_queue; struct stedma40_chan_cfg dma_cfg; + struct dma_slave_config slave_config; bool configured; struct d40_base *base; /* Default register configurations */ @@ -625,6 +627,10 @@ static void __iomem *chan_base(struct d40_chan *chan) #define chan_err(d40c, format, arg...) \ d40_err(chan2dev(d40c), format, ## arg) +static int d40_set_runtime_config_write(struct dma_chan *chan, + struct dma_slave_config *config, + enum dma_transfer_direction direction); + static int d40_pool_lli_alloc(struct d40_chan *d40c, struct d40_desc *d40d, int lli_len) { @@ -2216,6 +2222,8 @@ d40_prep_sg(struct dma_chan *dchan, struct scatterlist *sg_src, return NULL; } + d40_set_runtime_config_write(dchan, &chan->slave_config, direction); + spin_lock_irqsave(&chan->lock, flags); desc = d40_prep_desc(chan, sg_src, sg_len, dma_flags); @@ -2634,11 +2642,22 @@ dma40_config_to_halfchannel(struct d40_chan *d40c, return 0; } -/* Runtime reconfiguration extension */ static int d40_set_runtime_config(struct dma_chan *chan, struct dma_slave_config *config) { struct d40_chan *d40c = container_of(chan, struct d40_chan, chan); + + memcpy(&d40c->slave_config, config, sizeof(*config)); + + return 0; +} + +/* Runtime reconfiguration extension */ +static int d40_set_runtime_config_write(struct dma_chan *chan, + struct dma_slave_config *config, + enum dma_transfer_direction direction) +{ + struct d40_chan *d40c = container_of(chan, struct d40_chan, chan); struct stedma40_chan_cfg *cfg = &d40c->dma_cfg; enum dma_slave_buswidth src_addr_width, dst_addr_width; dma_addr_t config_addr; @@ -2655,7 +2674,7 @@ static int d40_set_runtime_config(struct dma_chan *chan, dst_addr_width = config->dst_addr_width; dst_maxburst = config->dst_maxburst; - if (config->direction == DMA_DEV_TO_MEM) { + if (direction == DMA_DEV_TO_MEM) { config_addr = config->src_addr; if (cfg->dir != DMA_DEV_TO_MEM) @@ -2671,7 +2690,7 @@ static int d40_set_runtime_config(struct dma_chan *chan, if (dst_maxburst == 0) dst_maxburst = src_maxburst; - } else if (config->direction == DMA_MEM_TO_DEV) { + } else if (direction == DMA_MEM_TO_DEV) { config_addr = config->dst_addr; if (cfg->dir != DMA_MEM_TO_DEV) @@ -2689,7 +2708,7 @@ static int d40_set_runtime_config(struct dma_chan *chan, } else { dev_err(d40c->base->dev, "unrecognized channel direction %d\n", - config->direction); + direction); return -EINVAL; } @@ -2746,12 +2765,12 @@ static int d40_set_runtime_config(struct dma_chan *chan, /* These settings will take precedence later */ d40c->runtime_addr = config_addr; - d40c->runtime_direction = config->direction; + d40c->runtime_direction = direction; dev_dbg(d40c->base->dev, "configured channel %s for %s, data width %d/%d, " "maxburst %d/%d elements, LE, no flow control\n", dma_chan_name(chan), - (config->direction == DMA_DEV_TO_MEM) ? "RX" : "TX", + (direction == DMA_DEV_TO_MEM) ? "RX" : "TX", src_addr_width, dst_addr_width, src_maxburst, dst_maxburst);