From patchwork Sun Nov 11 15:47:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vinod Koul X-Patchwork-Id: 150770 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp2155527ljp; Sun, 11 Nov 2018 07:47:26 -0800 (PST) X-Google-Smtp-Source: AJdET5cdW1poh7R0b7xHmB7CdxnRgbz1d28k9U2EnFQ2bMmFb/zmCz720or0mfBE97WBDVafSO9q X-Received: by 2002:a63:e19:: with SMTP id d25mr14373094pgl.272.1541951246835; Sun, 11 Nov 2018 07:47:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541951246; cv=none; d=google.com; s=arc-20160816; b=nL3XdL+/s6zmFEbDVLZsBp0KGR4Ej+l6SkOqgjZZM838aiHsgiuvGRWyLjL4rT12Xy gFXHkOPyyAOmP/BYjycg4JrV/pi/iBnX6QWsquN7GrI8Jj15rQjwknFnZfGjQ+erkOb9 5ChBMhexNNXW6NmDLpDL03nRtbK5OBXK7xE92AgzNzOEpXl25XRFhsSvpYhITQqbdX0g qdfUHvHLbkWKZg1Lt1SKdo3Xr6LYPnhOo62Ia+bBai2rANUa8YuD30Em3tNrhAaXH6F5 dwLe+EqnHU6xrpegJymEu7bcjrFn9HBSqh0rWVj7sbmhzIcvTpgTa9hkjPQDVpeT5qQb jSgQ== 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=BRF0tMrirb+Q+G5LDkQD8amqMD7vRelK+5QVtCcqdhk=; b=zZ6HirZLSj5b48K8fa7fbyo1DTTxiUNBbjeLZaS64jxldDs9XNwi2zKNC52DyzwcpE YyByrwZaRsHuuKGzYw5O6fKXdNNvXVKv7cBAMNGzH8a90WIVPhvNdnUfx1RjsaSlXhc8 0K9aKXxZIemUsDY6DUIqruHOMcgXB1L15z8tQPfGrv9G5xYkSnozQknK7947uTMKBmA7 wlUWMZlGctiEGxy0DUKDcFSsvkFOnNHxhoG6hof8wmqz8gUcSjrG9c+mZn6TGR3J4Zs5 Vtje6uE/sJyQCGIF84EuUNcsvTooljordzbX1b3nFpl7flOosyLgUQbWqiH8/5Tv8R4w BTrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mDFb6Fkb; 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.26; Sun, 11 Nov 2018 07:47:26 -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=mDFb6Fkb; 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 S1728675AbeKLBgT (ORCPT + 3 others); Sun, 11 Nov 2018 20:36:19 -0500 Received: from mail.kernel.org ([198.145.29.99]:56002 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728542AbeKLBgT (ORCPT ); Sun, 11 Nov 2018 20:36:19 -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 08F3520866; Sun, 11 Nov 2018 15:47:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541951245; bh=jKVqLaGlGtDo6BMoJO5QV5TJTYEIt7DflhaBqF/luY0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mDFb6FkbxUFf8wsV0qL/gPuJ4IPQKAreCK2BrERH+A1ByWHFDX23ywpLKBFlUqs42 bHS7m2XsT6LUqHDBYeIVbcj3KCAybH2zvQmFK297etT21iyKtmDZpu7nSoSwf4eCbK /8xCUy7RFaVDJbb2sooyppL3kj58Bi+kVKkbzZ/8= From: Vinod Koul To: dmaengine@vger.kernel.org Cc: Vinod Koul , Robin Gong Subject: [PATCH 3/5] dmaengine: imx-sdma: remove dma_slave_config direction usage Date: Sun, 11 Nov 2018 21:17:08 +0530 Message-Id: <20181111154710.26904-4-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/imx-sdma.c | 31 ++++++++++++++++++++++++++----- 1 file changed, 26 insertions(+), 5 deletions(-) -- 2.14.4 Signed-off-by: Robin Gong Tested-by:.. or you may review the patch and provide Reviewed-by:... or diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c index b4ec2d20e661..49ac851bb352 100644 --- a/drivers/dma/imx-sdma.c +++ b/drivers/dma/imx-sdma.c @@ -335,6 +335,7 @@ struct sdma_desc { * @sdma: pointer to the SDMA engine for this channel * @channel: the channel number, matches dmaengine chan_id + 1 * @direction: transfer type. Needed for setting SDMA script + * @slave_config Slave configuration * @peripheral_type: Peripheral type. Needed for setting SDMA script * @event_id0: aka dma request line * @event_id1: for channels that use 2 events @@ -362,6 +363,7 @@ struct sdma_channel { struct sdma_engine *sdma; unsigned int channel; enum dma_transfer_direction direction; + struct dma_slave_config slave_config; enum sdma_peripheral_type peripheral_type; unsigned int event_id0; unsigned int event_id1; @@ -440,6 +442,10 @@ struct sdma_engine { struct sdma_buffer_descriptor *bd0; }; +static int sdma_config_write(struct dma_chan *chan, + struct dma_slave_config *dmaengine_cfg, + enum dma_transfer_direction direction); + static struct sdma_driver_data sdma_imx31 = { .chnenbl0 = SDMA_CHNENBL0_IMX31, .num_events = 32, @@ -1415,6 +1421,8 @@ static struct dma_async_tx_descriptor *sdma_prep_slave_sg( struct scatterlist *sg; struct sdma_desc *desc; + sdma_config_write(chan, &sdmac->slave_config, direction); + desc = sdma_transfer_init(sdmac, direction, sg_len); if (!desc) goto err_out; @@ -1499,6 +1507,8 @@ static struct dma_async_tx_descriptor *sdma_prep_dma_cyclic( dev_dbg(sdma->dev, "%s channel: %d\n", __func__, channel); + sdma_config_write(chan, &sdmac->slave_config, direction); + desc = sdma_transfer_init(sdmac, direction, num_periods); if (!desc) goto err_out; @@ -1554,17 +1564,18 @@ static struct dma_async_tx_descriptor *sdma_prep_dma_cyclic( return NULL; } -static int sdma_config(struct dma_chan *chan, - struct dma_slave_config *dmaengine_cfg) +static int sdma_config_write(struct dma_chan *chan, + struct dma_slave_config *dmaengine_cfg, + enum dma_transfer_direction direction) { struct sdma_channel *sdmac = to_sdma_chan(chan); - if (dmaengine_cfg->direction == DMA_DEV_TO_MEM) { + if (direction == DMA_DEV_TO_MEM) { sdmac->per_address = dmaengine_cfg->src_addr; sdmac->watermark_level = dmaengine_cfg->src_maxburst * dmaengine_cfg->src_addr_width; sdmac->word_size = dmaengine_cfg->src_addr_width; - } else if (dmaengine_cfg->direction == DMA_DEV_TO_DEV) { + } else if (direction == DMA_DEV_TO_DEV) { sdmac->per_address2 = dmaengine_cfg->src_addr; sdmac->per_address = dmaengine_cfg->dst_addr; sdmac->watermark_level = dmaengine_cfg->src_maxburst & @@ -1578,10 +1589,20 @@ static int sdma_config(struct dma_chan *chan, dmaengine_cfg->dst_addr_width; sdmac->word_size = dmaengine_cfg->dst_addr_width; } - sdmac->direction = dmaengine_cfg->direction; + sdmac->direction = direction; return sdma_config_channel(chan); } +static int sdma_config(struct dma_chan *chan, + struct dma_slave_config *dmaengine_cfg) +{ + struct sdma_channel *sdmac = to_sdma_chan(chan); + + memcpy(&sdmac->slave_config, dmaengine_cfg, sizeof(*dmaengine_cfg)); + + return 0; +} + static enum dma_status sdma_tx_status(struct dma_chan *chan, dma_cookie_t cookie, struct dma_tx_state *txstate)