From patchwork Mon Nov 15 08:54:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 519145 Delivered-To: patch@linaro.org Received: by 2002:ac0:c605:0:0:0:0:0 with SMTP id p5csp5345715imj; Mon, 15 Nov 2021 00:55:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJwb16nBX17tyWYQBjfZoBHbZwoOWv2GCcJ5S7188D/xGsFG0mv1IBSSHbr7+ZzALfVZ7CmP X-Received: by 2002:a63:9518:: with SMTP id p24mr23359573pgd.80.1636966553846; Mon, 15 Nov 2021 00:55:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636966553; cv=none; d=google.com; s=arc-20160816; b=BMVMz/3pUxmxe8dPCppeZKTytGp478Cz3iaWbQbylHAdJUap4A0X1K4o3ZAJXyAq7Q 0M3OmPLV6Obhg5DH87aJzc9kMqvHaYUK+Mry2BtHTaY60HKBG8HzXrKhfgagbv0Tvyi9 W1tMFQb7C9NF8onOqCv/OhYa+lFnbhapmxcslZAXzSQ1NnMCFYoL01Dq4glm12UkQgxg fhyy+goKU/uly7G8mSIt2Z/7aSmJgtIosCVBZkNLSoXfN8mu8ImkHxhTKWkpcIQfrLqM 8Jdz9SvPgs5YM0DSB/L7M+CRSXzLZpF9f8brTb7UkJcLqPT679FJDLI2Pb/WtKO+FEF9 f6Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature:delivered-to; bh=Z53XpBSkP+iXq1oDYXoWhobjTehjbUJRpQI1QlVj4BU=; b=IbSHxt1b7Hra4/4QdpEWYtDlQodYYrr+b335H7EGcPcANMQ4J5VYGbpt890AEoiMk8 s6xRm3gNZgFmyFrdlPPFFFGsEXKmjzZDgMwIPTtlNFwSfXiQ1qi0BBiVuJceF+03FdUT K04wcDZenMqtloLozoJUx/6meOT3yhrCFtXOR4IVJw1bRo+NcgUn/PsukpAjGUbCXjW+ SBQk2k8HYwAeWBcmRQdr6Sc4LPAEtB43Ugw6ExBUUz1LgYAkAWP+R2qE0F3794IRW4KO fNiWsLlrrOyTHxFiPgYlEzNbX7Vo/CNIHkphcT0ixhyfVPrR05B2AmEHRqgAIDG67bYE TjSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=E3hAwHAF; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTPS id nm6si19143756pjb.100.2021.11.15.00.55.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Nov 2021 00:55:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=E3hAwHAF; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BCBE86EB9D; Mon, 15 Nov 2021 08:55:52 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by gabe.freedesktop.org (Postfix) with ESMTPS id D8FC76EBA8 for ; Mon, 15 Nov 2021 08:55:51 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 97B2063227; Mon, 15 Nov 2021 08:55:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1636966551; bh=t+sujmlGUVrYtWCA2Iqgm4qzwcVm4cE+7MUCYHiTmt8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=E3hAwHAFBi1veWTZ9KC3LUqplVBzvhHkJdmHwzLmUaxHGxHQt/Uao9jUuL7+wYtM1 t5/KCd2DhDnIMvpS1fzLHld+q6AChRUElQMbmbJgDaTpHm5vW1Uyudi7cSpoV3wALW 3+TEcRqIWccqr7FIxw+On4njyPKMPuD/VUQ+uBZMxLJI2xjFiVqAFgV6Ym1M8MXblp H3AtGfulWPCW1XQE3Nvr6vFEwAXxjhfbUBy3AmIdd5/EjenYc84yhK4dgbFVtzWJe/ uGxVZ0BY9bYvtABbO19Hw4xqxf+bkbhZDmO0g57I7eSW+8dnN8ZNhH3IrlxeCNnqJt h19+P/ZGx52Ig== From: Arnd Bergmann To: Vinod Koul Subject: [PATCH 10/11] staging: ralink-gdma: stop using slave_id config Date: Mon, 15 Nov 2021 09:54:02 +0100 Message-Id: <20211115085403.360194-11-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20211115085403.360194-1-arnd@kernel.org> References: <20211115085403.360194-1-arnd@kernel.org> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alsa-devel@alsa-project.org, dri-devel@lists.freedesktop.org, Bjorn Andersson , linux-tegra@vger.kernel.org, Thierry Reding , linux-mtd@lists.infradead.org, Laurent Pinchart , linux-spi@vger.kernel.org, Robert Jarzmik , Chunyan Zhang , linux-staging@lists.linux.dev, Michal Simek , Jon Hunter , Andy Gross , bcm-kernel-feedback-list@broadcom.com, linux-serial@vger.kernel.org, Orson Zhai , Nicolas Saenz Julienne , Arnd Bergmann , Manivannan Sadhasivam , linux-arm-msm@vger.kernel.org, dmaengine@vger.kernel.org, Mark Brown , linux-rpi-kernel@lists.infradead.org, Jaroslav Kysela , Andy Shevchenko , linux-arm-kernel@lists.infradead.org, Scott Branden , Hyun Kwon , Greg Kroah-Hartman , linux-mmc@vger.kernel.org, Takashi Iwai , linux-kernel@vger.kernel.org, Laxman Dewangan , Baolin Wang Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Arnd Bergmann Picking the connection between a DMA controller and its attached device is done through devicetree using the "dmas" property, which is implemented by the gdma driver, but it also allows overriding the "req" configuration with the slave_id field, as it was done in some linux-2.6 era drivers. There is no driver in the tree that sets these values, so stop interpreting them before anything accidentally starts relying on it. Rename the field in the channel from "slave_id" to "req" to better match the purpose and the naming in the hardware. If any driver actually starts using this DMA engine, it may be necessary to implement a .xlate callback that sets this field at probe time. Signed-off-by: Arnd Bergmann --- drivers/staging/ralink-gdma/ralink-gdma.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/staging/ralink-gdma/ralink-gdma.c b/drivers/staging/ralink-gdma/ralink-gdma.c index b5229bc6eae5..f00240e62e1b 100644 --- a/drivers/staging/ralink-gdma/ralink-gdma.c +++ b/drivers/staging/ralink-gdma/ralink-gdma.c @@ -106,7 +106,7 @@ struct gdma_dma_desc { struct gdma_dmaengine_chan { struct virt_dma_chan vchan; unsigned int id; - unsigned int slave_id; + unsigned int req; dma_addr_t fifo_addr; enum gdma_dma_transfer_size burst_size; @@ -194,7 +194,6 @@ static int gdma_dma_config(struct dma_chan *c, dev_err(dma_dev->ddev.dev, "only support 4 byte buswidth\n"); return -EINVAL; } - chan->slave_id = config->slave_id; chan->fifo_addr = config->dst_addr; chan->burst_size = gdma_dma_maxburst(config->dst_maxburst); break; @@ -203,7 +202,6 @@ static int gdma_dma_config(struct dma_chan *c, dev_err(dma_dev->ddev.dev, "only support 4 byte buswidth\n"); return -EINVAL; } - chan->slave_id = config->slave_id; chan->fifo_addr = config->src_addr; chan->burst_size = gdma_dma_maxburst(config->src_maxburst); break; @@ -288,12 +286,12 @@ static int rt305x_gdma_start_transfer(struct gdma_dmaengine_chan *chan) dst_addr = chan->fifo_addr; ctrl0 = GDMA_REG_CTRL0_DST_ADDR_FIXED | (8 << GDMA_RT305X_CTRL0_SRC_REQ_SHIFT) | - (chan->slave_id << GDMA_RT305X_CTRL0_DST_REQ_SHIFT); + (chan->req << GDMA_RT305X_CTRL0_DST_REQ_SHIFT); } else if (chan->desc->direction == DMA_DEV_TO_MEM) { src_addr = chan->fifo_addr; dst_addr = sg->dst_addr; ctrl0 = GDMA_REG_CTRL0_SRC_ADDR_FIXED | - (chan->slave_id << GDMA_RT305X_CTRL0_SRC_REQ_SHIFT) | + (chan->req << GDMA_RT305X_CTRL0_SRC_REQ_SHIFT) | (8 << GDMA_RT305X_CTRL0_DST_REQ_SHIFT); } else if (chan->desc->direction == DMA_MEM_TO_MEM) { /* @@ -365,12 +363,12 @@ static int rt3883_gdma_start_transfer(struct gdma_dmaengine_chan *chan) dst_addr = chan->fifo_addr; ctrl0 = GDMA_REG_CTRL0_DST_ADDR_FIXED; ctrl1 = (32 << GDMA_REG_CTRL1_SRC_REQ_SHIFT) | - (chan->slave_id << GDMA_REG_CTRL1_DST_REQ_SHIFT); + (chan->req << GDMA_REG_CTRL1_DST_REQ_SHIFT); } else if (chan->desc->direction == DMA_DEV_TO_MEM) { src_addr = chan->fifo_addr; dst_addr = sg->dst_addr; ctrl0 = GDMA_REG_CTRL0_SRC_ADDR_FIXED; - ctrl1 = (chan->slave_id << GDMA_REG_CTRL1_SRC_REQ_SHIFT) | + ctrl1 = (chan->req << GDMA_REG_CTRL1_SRC_REQ_SHIFT) | (32 << GDMA_REG_CTRL1_DST_REQ_SHIFT) | GDMA_REG_CTRL1_COHERENT; } else if (chan->desc->direction == DMA_MEM_TO_MEM) {