From patchwork Sun Nov 11 15:47:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 150768 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2155460ljp; Sun, 11 Nov 2018 07:47:22 -0800 (PST) X-Google-Smtp-Source: AJdET5cMrNKWqtCGDH3wkq8MHKXITkx9BP7K3u82jjMfOETe/xsLCyFBEYXPeD1aHEU5UgotxYbL X-Received: by 2002:a65:4208:: with SMTP id c8-v6mr14199197pgq.335.1541951242655; Sun, 11 Nov 2018 07:47:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541951242; cv=none; d=google.com; s=arc-20160816; b=ILxvkkkqK7Q86dcpSGh8aLJaK3ClYIwHVG659gpqu4BLNgGO7UEi7zYB+y+VIX8nGH vDqizhzBHlu8+oYMBlQIMaBBTdh0DtCyhPfi7gD9sFFujPleIAWCCfiGhKSvlkxbFC9a 2egVfl0kcOoAjgVox8EEr3ssulTJVRG9o4sgzdS3Gsd4zC1SVps90QcYyftk7hjD6Ldn yo9k2n5g4O1VLrjncJQ9vTfNB9Z12NKXZa9UJVlInEYaj83ezUm3zyzCtmORqPZWtdbi cs4Kd9PDyoxRktHs0r+t1p6UmhdHoAl4e6yul331vM8+nebIyREAI2s9x36kIFvL9teJ 7R0Q== 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=kRHPQiJsYRW3DFfjFJZ7qEYJPmxAzxT204JIrDY6S18=; b=w8B8Ob9tZzDeFhRzu27r8RFHzEVOue1PI442ZH2Qw9bQ4knuy3pMW1s2tzpOjxPAee dg/xP330SWml6n8VpHx+2x4ypxax2HqdS3q9QfKwn5ls8gyUwSKK4ve0Ynx1K6Ku4Smc nzGxnVXhDZqvMvDpyk5cyPjro0IzcaEU77SWsYBxiUvfprTXJ6dXQUnAtm/HisE9+ynb 4Am09nwKUpe310L5r2/6INhuZdWL1mLGWD0XhgKuu3hJ9Seq9REEfzpVGYc/UugUtNpx 2LEUQ1l+HgMx/HqUrC7lXtjsLMnP99eiWVWIdisXU7eLec4rr14mzD5RgpR24hVlc9ZQ DBGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=juo1vL2s; 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.22; Sun, 11 Nov 2018 07:47:22 -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=juo1vL2s; 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 S1728667AbeKLBgO (ORCPT + 3 others); Sun, 11 Nov 2018 20:36:14 -0500 Received: from mail.kernel.org ([198.145.29.99]:55988 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728542AbeKLBgO (ORCPT ); Sun, 11 Nov 2018 20:36:14 -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 22BBA21479; Sun, 11 Nov 2018 15:47:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541951241; bh=aWVFRndksWzo+EVLWXTRn9U1Q6ZA9c9OOUAOGsNkqRM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=juo1vL2sox/qzSZPczCoJSMh693YggwlHXE4cXtX6Y5QZM/3WqFAylE7Ur8BsuWFo DFc/X/KTY/3O+S3A0TCF3lv4a40saBGRK24eKLP2m1UajMoDnRujdAfbO5hb4znJkD pSW/LKFE5DikXc0ojLxkZLz3sCgB04NBYW3rLurs= From: Vinod Koul To: dmaengine@vger.kernel.org Cc: Vinod Koul Subject: [PATCH 1/5] dmaengine: mmp_pdma: remove dma_slave_config direction usage Date: Sun, 11 Nov 2018 21:17:06 +0530 Message-Id: <20181111154710.26904-2-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/mmp_pdma.c | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) -- 2.14.4 diff --git a/drivers/dma/mmp_pdma.c b/drivers/dma/mmp_pdma.c index eb3a1f42ab06..334bab92d26d 100644 --- a/drivers/dma/mmp_pdma.c +++ b/drivers/dma/mmp_pdma.c @@ -96,6 +96,7 @@ struct mmp_pdma_chan { struct dma_async_tx_descriptor desc; struct mmp_pdma_phy *phy; enum dma_transfer_direction dir; + struct dma_slave_config slave_config; struct mmp_pdma_desc_sw *cyclic_first; /* first desc_sw if channel * is in cyclic mode */ @@ -140,6 +141,10 @@ struct mmp_pdma_device { #define to_mmp_pdma_dev(dmadev) \ container_of(dmadev, struct mmp_pdma_device, device) +static int mmp_pdma_config_write(struct dma_chan *dchan, + struct dma_slave_config *cfg, + enum dma_transfer_direction direction); + static void set_desc(struct mmp_pdma_phy *phy, dma_addr_t addr) { u32 reg = (phy->idx << 4) + DDADR; @@ -537,6 +542,8 @@ mmp_pdma_prep_slave_sg(struct dma_chan *dchan, struct scatterlist *sgl, chan->byte_align = false; + mmp_pdma_config_write(dchan, &chan->slave_config, dir); + for_each_sg(sgl, sg, sg_len, i) { addr = sg_dma_address(sg); avail = sg_dma_len(sgl); @@ -619,6 +626,7 @@ mmp_pdma_prep_dma_cyclic(struct dma_chan *dchan, return NULL; chan = to_mmp_pdma_chan(dchan); + mmp_pdma_config_write(dchan, &chan->slave_config, direction); switch (direction) { case DMA_MEM_TO_DEV: @@ -684,8 +692,9 @@ mmp_pdma_prep_dma_cyclic(struct dma_chan *dchan, return NULL; } -static int mmp_pdma_config(struct dma_chan *dchan, - struct dma_slave_config *cfg) +static int mmp_pdma_config_write(struct dma_chan *dchan, + struct dma_slave_config *cfg, + enum dma_transfer_direction direction) { struct mmp_pdma_chan *chan = to_mmp_pdma_chan(dchan); u32 maxburst = 0, addr = 0; @@ -694,12 +703,12 @@ static int mmp_pdma_config(struct dma_chan *dchan, if (!dchan) return -EINVAL; - if (cfg->direction == DMA_DEV_TO_MEM) { + if (direction == DMA_DEV_TO_MEM) { chan->dcmd = DCMD_INCTRGADDR | DCMD_FLOWSRC; maxburst = cfg->src_maxburst; width = cfg->src_addr_width; addr = cfg->src_addr; - } else if (cfg->direction == DMA_MEM_TO_DEV) { + } else if (direction == DMA_MEM_TO_DEV) { chan->dcmd = DCMD_INCSRCADDR | DCMD_FLOWTRG; maxburst = cfg->dst_maxburst; width = cfg->dst_addr_width; @@ -720,7 +729,7 @@ static int mmp_pdma_config(struct dma_chan *dchan, else if (maxburst == 32) chan->dcmd |= DCMD_BURST32; - chan->dir = cfg->direction; + chan->dir = direction; chan->dev_addr = addr; /* FIXME: drivers should be ported over to use the filter * function. Once that's done, the following two lines can @@ -732,6 +741,15 @@ static int mmp_pdma_config(struct dma_chan *dchan, return 0; } +static int mmp_pdma_config(struct dma_chan *dchan, + struct dma_slave_config *cfg) +{ + struct mmp_pdma_chan *chan = to_mmp_pdma_chan(dchan); + + memcpy(&chan->slave_config, cfg, sizeof(*cfg)); + return 0; +} + static int mmp_pdma_terminate_all(struct dma_chan *dchan) { struct mmp_pdma_chan *chan = to_mmp_pdma_chan(dchan);