From patchwork Thu Feb 21 05:34:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "(Exiting) Baolin Wang" X-Patchwork-Id: 10823167 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E69221399 for ; Thu, 21 Feb 2019 05:35:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D3CA42EDC1 for ; Thu, 21 Feb 2019 05:35:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C70232F110; Thu, 21 Feb 2019 05:35:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6B3972EDC1 for ; Thu, 21 Feb 2019 05:35:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726409AbfBUFfJ (ORCPT ); Thu, 21 Feb 2019 00:35:09 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:45129 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725385AbfBUFfJ (ORCPT ); Thu, 21 Feb 2019 00:35:09 -0500 Received: by mail-pl1-f196.google.com with SMTP id r14so13563800pls.12 for ; Wed, 20 Feb 2019 21:35:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=T4yr4bk1rvyrNRXUVeZwF9n7nFBtXZOYoRS0bwjzaMY=; b=WhQoTYTo2kw7AXaa0/gWlonxJvoRifCpRYttsri9VopJY/b1WNv/sUaBCghPtgXFV8 +rv594Zknr3rXbC7zWqUsLztidK4rRGR8s+FP19bBKZOwUrrL9RjIiVy3YqYVVNN+rXx S+dj3LAGpbKqUZ9y+XQx6HCLs71DajxlqqmJ4CoTz6yl7DE4Owoqt+LcfKtv9fPKxKTt 3gYFZydSZKeyG3R1UedXEQWvqnXOf2pLj5z/vXdXgdzozIsbw6S3QEyyrNQz/SQr2Vx0 LUmvMQKqyNX9roygA+RQUeGiT8JmFCv4o/NLgkwb4cV5N4842tqkXo1RBjHLFCzv5DGr ArfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=T4yr4bk1rvyrNRXUVeZwF9n7nFBtXZOYoRS0bwjzaMY=; b=hL39fQmvP+m29M2gJpj0Dkbrz4cHj7MyRgGOWX8MhCF1IZayuRc/DCX9fmfVuzoLHw sGtU+jcFlDnU2Zd0pg38KtQIw1HaknnQBXAOX5nmKS3uCrjVwUpj4mhT9+/rMZ+kcCAh TCSkS/aABDDzzQemvZQ3zMQjG0pHk1bE+AETtbOJ/j5haq4VH9K9oS5bBNoJCPPe2sGM HsvXvRVMKXFLP/NyuwGlJe1LwjCijBSmE21iPD2tYKN65p3iGKuQB5pUZibzVxJatse4 9aLu579J6u183/XABBoCJ/B/ehMZ2LpPrFYAQZ1ImTxWYpPMwVi5QkI0wG8Nl8+kYiPH R+9Q== X-Gm-Message-State: AHQUAuZlsWJ7KNvzg3X97bzY3NTkBR1wrTQPmUK6OLbzdf6JIUjGXfw+ aVgSZhA437Kf3V5D3kLd5mQbrw== X-Google-Smtp-Source: AHgI3IbBQFlcuxD5vuIr+qI4QoDjWHaDUlMQHvVrZ+Ydx/YsCDVQztiXzqyXskLK3Hn2fbcfssWHvQ== X-Received: by 2002:a17:902:b70b:: with SMTP id d11mr23557013pls.178.1550727309029; Wed, 20 Feb 2019 21:35:09 -0800 (PST) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id l10sm35001421pfc.90.2019.02.20.21.35.03 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 20 Feb 2019 21:35:07 -0800 (PST) From: Baolin Wang To: vkoul@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com, arnd@arndb.de Cc: orsonzhai@gmail.com, zhang.lyra@gmail.com, dan.j.williams@intel.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, eric.long@unisoc.com, broonie@kernel.org, baolin.wang@linaro.org Subject: [PATCH v2 1/2] dt-bindings: dmaengine: sprd: Change channel id to slave id for DMA cell specifier Date: Thu, 21 Feb 2019 13:34:40 +0800 Message-Id: <652a8ef9554890c254823ec39858b8d7413fd561.1550719757.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP For Spreadtrum DMA engine, all channels are equal, which means slave can request any channels with setting a unique slave id to trigger this channel. Thus we can remove the channel id from device tree to assign the channel dynamically, moreover we should add the slave id in device tree. Signed-off-by: Baolin Wang Reviewed-by: Rob Herring --- Changes from v1: - Remove channel id from DT. --- Documentation/devicetree/bindings/dma/sprd-dma.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/dma/sprd-dma.txt b/Documentation/devicetree/bindings/dma/sprd-dma.txt index 7a10fea..adccea994 100644 --- a/Documentation/devicetree/bindings/dma/sprd-dma.txt +++ b/Documentation/devicetree/bindings/dma/sprd-dma.txt @@ -31,7 +31,7 @@ DMA clients connected to the Spreadtrum DMA controller must use the format described in the dma.txt file, using a two-cell specifier for each channel. The two cells in order are: 1. A phandle pointing to the DMA controller. -2. The channel id. +2. The slave id. spi0: spi@70a00000{ ... From patchwork Thu Feb 21 05:34:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "(Exiting) Baolin Wang" X-Patchwork-Id: 10823169 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7FE3A1399 for ; Thu, 21 Feb 2019 05:35:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6CDDE2EF4F for ; Thu, 21 Feb 2019 05:35:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5DEF92EDC1; Thu, 21 Feb 2019 05:35:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 052192EDC1 for ; Thu, 21 Feb 2019 05:35:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726577AbfBUFfO (ORCPT ); Thu, 21 Feb 2019 00:35:14 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:34602 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726198AbfBUFfO (ORCPT ); Thu, 21 Feb 2019 00:35:14 -0500 Received: by mail-pf1-f194.google.com with SMTP id u9so5919386pfn.1 for ; Wed, 20 Feb 2019 21:35:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=I+lwgjMPx4qaNrrdmqhxKjqvoWmsUeMIRo3rHXe/pVU=; b=yWXXDDAu70UKxZqDRXkfkvj8zkHJjsSWLqih2dV2eqrb9t4B6Nfo6+4SmzO9yqX8gE ejGKc4UoajokSgrctdkTsydBargA/EXcYhOo1d6Cq/qr7neYJ9Ml3rfkgucHkMOSxAqn kcurzbVHgQNmRXY/LkmX+LKyEdWiHR7MqaO3FEPOWlnAUkG6VX4S8Tt853p2Wq8LckEF klDrJapFdcLfP35Ksoyv4N/wvQHSMiwxt1bKllkUe97xZGO/THEf5XlD3+3/sBeADxhx 3UCCdHfXVvuRN4fPBUkTfg8nskfBxPpN7Y7VzWKABHMdPJ9npekq7BBq6QRTDsS/dowy FMJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=I+lwgjMPx4qaNrrdmqhxKjqvoWmsUeMIRo3rHXe/pVU=; b=gxibdNn6Cf25y8a0rY4y5+QPDn/0SA339zzknLruvzo1qvdexYkdOlC7IRCkvrMcdi vByID/fccf55mR29HcLp1tingRmTizVuq403fQCRBA3NjkPIBlOtvHzNWKEAGVzyrDVs S9paw3Mso1sdK8p5IUFKMYUH93ApBDuu31asQBxYWPcQa9qTa19hMwhPllEmIWki1cNY vYYxOTsOOCV2O5g+ujWGjie53hoFf7dK+TC6kPNxy7xzM73RHSe6TCElK4fZfDwjodjL QJRcrMWQQi2EDXWlSPNXzOhl1I4xSK5OBnOSt/3hCfZ5aF7xQKsoUUgGYuyELFuf9GDV V/cQ== X-Gm-Message-State: AHQUAuZaKNk9N/mrvP6bVoXmyrmfJqObYxoBvkS1a2q+xrQMQwn7zpZQ 5vLKGiR12ROHpcBFAD5mUUoc+w== X-Google-Smtp-Source: AHgI3IYxTaTyO21PUP1m+aWr1/zyddwSRtgfr165WFwpvMwxC8pjOvYghKA4jtw4kitRZoG0N4HNaQ== X-Received: by 2002:a65:6553:: with SMTP id a19mr33145199pgw.267.1550727313507; Wed, 20 Feb 2019 21:35:13 -0800 (PST) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.102]) by smtp.gmail.com with ESMTPSA id l10sm35001421pfc.90.2019.02.20.21.35.09 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 20 Feb 2019 21:35:12 -0800 (PST) From: Baolin Wang To: vkoul@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com, arnd@arndb.de Cc: orsonzhai@gmail.com, zhang.lyra@gmail.com, dan.j.williams@intel.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, eric.long@unisoc.com, broonie@kernel.org, baolin.wang@linaro.org Subject: [PATCH v2 2/2] dmaengine: sprd: Change channel id to slave id for DMA cell specifier Date: Thu, 21 Feb 2019 13:34:41 +0800 Message-Id: X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <652a8ef9554890c254823ec39858b8d7413fd561.1550719757.git.baolin.wang@linaro.org> References: <652a8ef9554890c254823ec39858b8d7413fd561.1550719757.git.baolin.wang@linaro.org> In-Reply-To: <652a8ef9554890c254823ec39858b8d7413fd561.1550719757.git.baolin.wang@linaro.org> References: <652a8ef9554890c254823ec39858b8d7413fd561.1550719757.git.baolin.wang@linaro.org> Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We will describe the slave id in DMA cell specifier instead of DMA channel id, thus we should save the slave id from DMA engine translation function, and remove the channel id validation. Meanwhile we do not need set default slave id in sprd_dma_alloc_chan_resources(), remove it. Signed-off-by: Baolin Wang --- Changes from v1: - Remove channel id from DT. --- drivers/dma/sprd-dma.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c index e2f0167..48431e2 100644 --- a/drivers/dma/sprd-dma.c +++ b/drivers/dma/sprd-dma.c @@ -580,15 +580,7 @@ static irqreturn_t dma_irq_handle(int irq, void *dev_id) static int sprd_dma_alloc_chan_resources(struct dma_chan *chan) { - struct sprd_dma_chn *schan = to_sprd_dma_chan(chan); - int ret; - - ret = pm_runtime_get_sync(chan->device->dev); - if (ret < 0) - return ret; - - schan->dev_id = SPRD_DMA_SOFTWARE_UID; - return 0; + return pm_runtime_get_sync(chan->device->dev); } static void sprd_dma_free_chan_resources(struct dma_chan *chan) @@ -1021,13 +1013,10 @@ static void sprd_dma_free_desc(struct virt_dma_desc *vd) static bool sprd_dma_filter_fn(struct dma_chan *chan, void *param) { struct sprd_dma_chn *schan = to_sprd_dma_chan(chan); - struct sprd_dma_dev *sdev = to_sprd_dma_dev(&schan->vc.chan); - u32 req = *(u32 *)param; + u32 slave_id = *(u32 *)param; - if (req < sdev->total_chns) - return req == schan->chn_num + 1; - else - return false; + schan->dev_id = slave_id; + return true; } static int sprd_dma_probe(struct platform_device *pdev)