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: 146959 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp3386347ljw; Tue, 11 Sep 2018 01:36:47 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZTY89IzB9UaGa82XyWuDGANQ1UT2Pt8OkAeTRLb6mkNsJ7/M3xCh7iVJ+2yxV43eltwb1H X-Received: by 2002:a62:e08b:: with SMTP id d11-v6mr28165311pfm.214.1536655007364; Tue, 11 Sep 2018 01:36:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536655007; cv=none; d=google.com; s=arc-20160816; b=iHwnrxUBGsGyY3oU5Oo7DSeVH/C4F3Wyd2IYVhWrn3kS4fywu5Kkx2ftl60fKoqtdY I+Bwtl2c0SXJDTuDaYaPHygywPfbz9pX1amnNWtRf7jeAYutwUCH8+zSFmkIthyJI59E J4xunI16jsBPNEslybHfwtj6GB4fpLPPMilrYjflTNEjCSZ1Vzfs+zljf9zVzExl4OHF F1ZCQlU/z44blVeUdRHeX7IsYm79SqNXJjRrmPFB9072IBbvEW7FHrawyUjWGJMGkyH5 2N1qNmJQruh6AUpPcywkC+XPYQrANckOPmc0conkeYSQrY1ec/KBEkxGBNT9lvYTfLtO O8xA== 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=W6RIWwmlEQb0qmMQIRlEck5/4yPrjQ53MmEgKjK9L6E=; b=XTRlikfsC3fQLUyYk/syiG+pCZAqCK8/tJVg3upLVxcIvDQXmhSBVrkpAdViUxAKvQ Ml0VShF1eUQSTPba2NKruZ6n2v1qI6pr9huEQcBf32MBgG3YLuKv821Lmn2OPdI1ekrZ YT+nB8atxitIB1Fhae+/xMkGtLk/k78DDsDdsZrZ0JlAbzANEIPGpF7JLQJwwBl05oxr 3ef/zX9ZBHrYHqloD8Y1KBMN1ul1t0/6kBL9A3DIN8e+yZaPeOsna1aW1tJjZDFsxHxa fXlUfko/swErvfoiCkf3PKqFAGqhSXOcMAf2Xih/rl8uP9xl2PGG5qKvrE5zc3QU92GS Rb5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VrZBzjQs; 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.47; Tue, 11 Sep 2018 01:36:47 -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=VrZBzjQs; 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 S1726670AbeIKNfB (ORCPT + 3 others); 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 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(-) -- 2.14.4 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;